当前位置: 首页>>代码示例>>PHP>>正文


PHP Mage_Core_Block_Template::getWeeeTaxAppliedAmount方法代码示例

本文整理汇总了PHP中Mage_Core_Block_Template::getWeeeTaxAppliedAmount方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Core_Block_Template::getWeeeTaxAppliedAmount方法的具体用法?PHP Mage_Core_Block_Template::getWeeeTaxAppliedAmount怎么用?PHP Mage_Core_Block_Template::getWeeeTaxAppliedAmount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mage_Core_Block_Template的用法示例。


在下文中一共展示了Mage_Core_Block_Template::getWeeeTaxAppliedAmount方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: addPriceAndSubtotalToXml

 /**
  * Add Weee taxes child to the XML
  *
  * @param Mage_Core_Block_Template $renderer Product renderer
  * @param Mage_Sales_Model_Order_Item $item
  * @param Mage_XmlConnect_Model_Simplexml_Element $priceXml
  * @param Mage_XmlConnect_Model_Simplexml_Element $subtotalXml
  * @param bool $isIncludeTax
  * @return null
  */
 public function addPriceAndSubtotalToXml(Mage_Core_Block_Template $renderer, Mage_Sales_Model_Order_Item $item, Mage_XmlConnect_Model_Simplexml_Element $priceXml, Mage_XmlConnect_Model_Simplexml_Element $subtotalXml, $isIncludeTax = false)
 {
     $weeeParams = array();
     $typesOfDisplay = $renderer->getTypesOfDisplay();
     if ($isIncludeTax) {
         $nodeName = 'including_tax';
         $nodeLabel = $renderer->__('Incl. Tax');
         $inclPrice = $renderer->helper('checkout')->getPriceInclTax($item);
         $inclSubtotal = $renderer->helper('checkout')->getSubtotalInclTax($item);
         if ($typesOfDisplay[self::PRICE_DISPLAY_TYPE_14]) {
             $price = $inclPrice + $renderer->getWeeeTaxAppliedAmount();
             $subtotal = $inclSubtotal + $item->getWeeeTaxAppliedRowAmount();
         } else {
             $price = $inclPrice - $renderer->getWeeeTaxDisposition();
             $subtotal = $inclSubtotal - $item->getWeeeTaxRowDisposition();
         }
         $weeeParams['include'] = $inclPrice;
     } else {
         $nodeName = 'excluding_tax';
         $nodeLabel = $renderer->__('Excl. Tax');
         if ($typesOfDisplay[self::PRICE_DISPLAY_TYPE_14]) {
             $price = $item->getPrice() + $renderer->getWeeeTaxAppliedAmount() + $renderer->getWeeeTaxDisposition();
             $subtotal = $item->getRowTotal() + $item->getWeeeTaxAppliedRowAmount() + $item->getWeeeTaxRowDisposition();
         } else {
             $price = $item->getPrice();
             $subtotal = $item->getRowTotal();
         }
     }
     $configNode = array('value' => $this->formatPrice($renderer, $price));
     if ($renderer->helper('tax')->displaySalesBothPrices()) {
         $configNode['label'] = $nodeLabel;
     }
     $this->addWeeeTaxesToPriceXml($renderer, $item, $priceXml->addCustomChild($nodeName, null, $configNode), $weeeParams);
     $configNode['value'] = $this->formatPrice($renderer, $subtotal);
     $weeeParams['include'] = $isIncludeTax ? $inclSubtotal : null;
     $weeeParams['is_subtotal'] = true;
     $this->addWeeeTaxesToPriceXml($renderer, $item, $subtotalXml->addCustomChild($nodeName, null, $configNode), $weeeParams);
 }
开发者ID:Airmal,项目名称:Magento-Em,代码行数:48,代码来源:Order.php

示例2: addPriceAndSubtotalToXmlApi23

 /**
  * Add Weee taxes child to the XML. Api version 23
  *
  * @param Mage_Core_Block_Template $renderer Product renderer
  * @param Mage_Sales_Model_Order_Item $item
  * @param Mage_XmlConnect_Model_Simplexml_Element $priceXml
  * @param Mage_XmlConnect_Model_Simplexml_Element $subtotalXml
  * @param bool $isIncludeTax
  * @return null
  */
 public function addPriceAndSubtotalToXmlApi23(Mage_Core_Block_Template $renderer, Mage_Sales_Model_Order_Item $item, Mage_XmlConnect_Model_Simplexml_Element $priceXml, Mage_XmlConnect_Model_Simplexml_Element $subtotalXml, $isIncludeTax = false)
 {
     $weeeParams = array();
     $typesOfDisplay = $renderer->getTypesOfDisplay();
     if ($isIncludeTax) {
         $nodeId = self::INCLUDING_TAX_ID;
         $nodeLabel = $this->__('Incl. Tax');
         $inclPrice = $renderer->helper('checkout')->getPriceInclTax($item);
         $inclSubtotal = $renderer->helper('checkout')->getSubtotalInclTax($item);
         if ($typesOfDisplay[self::PRICE_DISPLAY_TYPE_14]) {
             $price = $inclPrice + $renderer->getWeeeTaxAppliedAmount();
             $subtotal = $inclSubtotal + $item->getWeeeTaxAppliedRowAmount();
         } else {
             $price = $inclPrice - $renderer->getWeeeTaxDisposition();
             $subtotal = $inclSubtotal - $item->getWeeeTaxRowDisposition();
         }
         $weeeParams['include'] = $inclPrice;
     } else {
         $nodeId = self::EXCLUDING_TAX_ID;
         $nodeLabel = $this->__('Excl. Tax');
         if ($typesOfDisplay[self::PRICE_DISPLAY_TYPE_14]) {
             $price = $item->getPrice() + $renderer->getWeeeTaxAppliedAmount() + $renderer->getWeeeTaxDisposition();
             $subtotal = $item->getRowTotal() + $item->getWeeeTaxAppliedRowAmount() + $item->getWeeeTaxRowDisposition();
         } else {
             $price = $item->getPrice();
             $subtotal = $item->getRowTotal();
         }
     }
     $configNode = array('id' => $nodeId);
     $priceValue = $this->formatPrice($renderer, $price);
     if ($renderer->helper('tax')->displaySalesBothPrices()) {
         $configNode['label'] = $nodeLabel;
     }
     $priceConfig = $configNode;
     $idPrefix = 'price_';
     $priceConfig['id'] = $idPrefix . $priceConfig['id'];
     $priceConfig['formatted_price'] = $priceValue;
     $price = Mage::helper('xmlconnect')->formatPriceForXml($price);
     $priceXml->addCustomChild('price', $price, $priceConfig);
     $this->addWeeeTaxesToPriceXmlApi23($renderer, $item, $priceXml, $weeeParams, $idPrefix, $isIncludeTax);
     $priceValue = $this->formatPrice($renderer, $subtotal);
     $weeeParams['include'] = $isIncludeTax ? $inclSubtotal : null;
     $weeeParams['is_subtotal'] = true;
     $subtotalConfig = $configNode;
     $idPrefix = 'subtotal_';
     $subtotalConfig['id'] = $idPrefix . $subtotalConfig['id'];
     $subtotalConfig['formatted_price'] = $priceValue;
     $subtotal = Mage::helper('xmlconnect')->formatPriceForXml($subtotal);
     $subtotalXml->addCustomChild('price', $subtotal, $subtotalConfig);
     $this->addWeeeTaxesToPriceXmlApi23($renderer, $item, $subtotalXml, $weeeParams, $idPrefix, $isIncludeTax);
 }
开发者ID:barneydesmond,项目名称:propitious-octo-tribble,代码行数:61,代码来源:Order.php


注:本文中的Mage_Core_Block_Template::getWeeeTaxAppliedAmount方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。