本文整理汇总了PHP中Mage_Sales_Model_Abstract::getOrder方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Sales_Model_Abstract::getOrder方法的具体用法?PHP Mage_Sales_Model_Abstract::getOrder怎么用?PHP Mage_Sales_Model_Abstract::getOrder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Sales_Model_Abstract
的用法示例。
在下文中一共展示了Mage_Sales_Model_Abstract::getOrder方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: insertTotals
/**
* Insert totals to pdf page
*
* @param Zend_Pdf_Page $page
* @param Mage_Sales_Model_Abstract $source
* @return Zend_Pdf_Page
*/
protected function insertTotals($page, $source)
{
$order = $source->getOrder();
$totals = $this->_getTotalsList($source);
$lineBlock = array('lines' => array(), 'height' => 15);
foreach ($totals as $total) {
$total->setOrder($order)->setSource($source);
if ($total->canDisplay()) {
$total->setFontSize(10);
foreach ($total->getTotalsForDisplay() as $totalData) {
$lineBlock['lines'][] = array(array('text' => $totalData['label'], 'feed' => 475, 'align' => 'right', 'font_size' => $totalData['font_size'], 'font' => 'bold'), array('text' => $totalData['amount'], 'feed' => 565, 'align' => 'right', 'font_size' => $totalData['font_size'], 'font' => 'bold'));
}
}
}
$this->y -= 20;
$page = $this->drawLineBlocks($page, array($lineBlock));
return $page;
}
示例2: insertTotals
/**
* Insert totals to pdf page
*
* @param Zend_Pdf_Page $page
* @param Mage_Sales_Model_Abstract $source
* @return Zend_Pdf_Page
*/
protected function insertTotals($page, $source)
{
// remvoeme
$this->y += 40;
if ($this->y - 150 < 15) {
$page = $this->newPage($pageSettings);
}
$order = $source->getOrder();
$totals = $this->_getTotalsList($source);
$lineBlock = array('lines' => array(), 'height' => 20);
$this->y -= 30;
$page->setFillColor(new Zend_Pdf_Color_Html("#58a300"));
$page->setLineColor(new Zend_Pdf_Color_GrayScale(1));
$page->setLineWidth(0.5);
$page->drawRectangle(275, $this->y, 570, $this->y - 30);
$this->_setFontBold($page, 12);
$page->setFillColor(new Zend_Pdf_Color_GrayScale(1));
$page->drawText(Mage::helper('sales')->__('Betrag'), 285, $this->y - 20, 'UTF-8');
$this->sy = $this->y;
$page->setFillColor(new Zend_Pdf_Color_GrayScale(0));
$this->y -= 30;
foreach ($totals as $total) {
$total->setOrder($order)->setSource($source);
if ($total->canDisplay()) {
$total->setFontSize(10);
foreach ($total->getTotalsForDisplay() as $totalData) {
$fontSize = 7;
if ("Gesamt (inkl. Steuern):" === $totalData["label"]) {
$fontSize = 10;
}
if (false !== strpos($totalData["label"], "Produkte zu 19")) {
continue;
}
if ("Steuer:" === $totalData["label"]) {
$totalData["label"] = "19% MwSt.";
}
$totalData["label"] = str_replace("Steuern", "MwSt.", $totalData["label"]);
$lineBlock['lines'][] = array(array('text' => $totalData['label'], 'feed' => 475, 'align' => 'right', "font_size" => 7, 'font' => 'bold'), array('text' => $totalData['amount'], 'feed' => 525, 'align' => 'right', "font_size" => $fontSize, 'font' => 'bold'));
}
}
}
$this->y -= 20;
$page = $this->drawLineBlocks($page, array($lineBlock));
return $page;
}
示例3: salesOrderEntitySaveBefore
/**
* Check whether order entity may be saved
*
* Invoice, shipment, creditmemo (address & item?)
*
* @param Mage_Sales_Model_Abstract $model
*/
public function salesOrderEntitySaveBefore($model)
{
$this->_salesEntitySaveBefore(Mage::app()->getStore($model->getOrder()->getStoreId())->getWebsiteId());
}
示例4: insertTotals
/**
* Insert totals to pdf page
*
* @param Zend_Pdf_Page $page
* @param Mage_Sales_Model_Abstract $source
* @return Zend_Pdf_Page
*/
protected function insertTotals($page, $source)
{
$order = $source->getOrder();
$totals = $this->_getTotalsList($source);
$lineBlock = array('lines' => array(), 'height' => 15);
foreach ($totals as $total) {
$total->setOrder($order)->setSource($source);
if ($total->canDisplay()) {
$total->setFontSize(10);
foreach ($total->getTotalsForDisplay() as $totalData) {
if (isset($totalData['title']) && strpos($totalData['title'], '%') !== false) {
$origLabel = $totalData['label'];
$totalData['label'] = trim(preg_replace('/\\s*\\([^)]*\\)/', '', $origLabel));
#echo "<pre/>";print_r($totalData);die;
}
Mage::log(print_r($totalData, true), NULL, 'developerTotalAfter.log');
$lineBlock['lines'][] = array(array('text' => $totalData['label'], 'feed' => 475, 'align' => 'right', 'font_size' => $totalData['font_size'], 'font' => 'bold'), array('text' => $totalData['amount'], 'feed' => 565, 'align' => 'right', 'font_size' => $totalData['font_size'], 'font' => 'bold'));
}
}
}
$this->y -= 20;
$page = $this->drawLineBlocks($page, array($lineBlock));
return $page;
}