本文整理汇总了PHP中Mage_Tax_Model_Config::setNeedUsePriceExcludeTax方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Tax_Model_Config::setNeedUsePriceExcludeTax方法的具体用法?PHP Mage_Tax_Model_Config::setNeedUsePriceExcludeTax怎么用?PHP Mage_Tax_Model_Config::setNeedUsePriceExcludeTax使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Tax_Model_Config
的用法示例。
在下文中一共展示了Mage_Tax_Model_Config::setNeedUsePriceExcludeTax方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: collect
/**
* Prepare subtotals calculations result before apply tax
*
* @param Mage_Sales_Model_Quote_Address $address
* @return Mage_Tax_Model_Sales_Total_Quote_Subtotal
*/
public function collect(Mage_Sales_Model_Quote_Address $address)
{
$this->_areTaxRequestsSimilar = $this->_calculator->compareRequests($this->_getStoreTaxRequest($address), $this->_getAddressTaxRequest($address));
$address->setSubtotalInclTax(0);
$address->setBaseSubtotalInclTax(0);
$this->_subtotalInclTax = 0;
$this->_baseSubtotalInclTax = 0;
if (!$address->getTaxSubtotalIsProcessed() && $this->_needSubtractTax($address)) {
$address->setTotalAmount('subtotal', 0);
$address->setBaseTotalAmount('subtotal', 0);
$items = $address->getAllItems();
foreach ($items as $item) {
/**
* Child item's tax we calculate for parent - that why we skip them
*/
if ($item->getParentItemId()) {
continue;
}
if ($item->getHasChildren() && $item->isChildrenCalculated()) {
foreach ($item->getChildren() as $child) {
$this->_resetItemPriceInclTax($child);
$this->_recollectItem($address, $child);
}
$this->_recalculateParent($item);
} else {
$this->_resetItemPriceInclTax($item);
$this->_recollectItem($address, $item);
}
$this->_addSubtotalAmount($address, $item);
}
if ($this->_areTaxRequestsSimilar) {
$address->setSubtotalInclTax($this->_subtotalInclTax);
$address->setBaseSubtotalInclTax($this->_baseSubtotalInclTax);
}
$this->_config->setNeedUsePriceExcludeTax(true);
} elseif (!$address->getTaxSubtotalIsProcessed() && !$this->_needSubtractTax($address)) {
foreach ($address->getAllItems() as $item) {
$this->_resetItemPriceInclTax($item);
}
}
if (!$address->getTaxSubtotalIsProcessed() && $this->_needSubtractShippingTax($address)) {
$this->_processShippingAmount($address);
$this->_config->setNeedUseShippingExcludeTax(true);
}
$address->setTaxSubtotalIsProcessed(true);
return $this;
}