本文整理汇总了PHP中Mage_Tax_Model_Config::displaySalesShippingBoth方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Tax_Model_Config::displaySalesShippingBoth方法的具体用法?PHP Mage_Tax_Model_Config::displaySalesShippingBoth怎么用?PHP Mage_Tax_Model_Config::displaySalesShippingBoth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Tax_Model_Config
的用法示例。
在下文中一共展示了Mage_Tax_Model_Config::displaySalesShippingBoth方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _initShipping
protected function _initShipping()
{
$store = $this->getStore();
$parent = $this->getParentBlock();
$shipping = $parent->getTotal('shipping');
if (!$shipping) {
return $this;
}
if ($this->_config->displaySalesShippingBoth($store)) {
$shipping = (double) $this->_source->getShippingAmount();
$baseShipping = (double) $this->_source->getBaseShippingAmount();
$shippingIncl = $shipping + (double) $this->_source->getShippingTaxAmount();
$baseShippingIncl = $baseShipping + (double) $this->_source->getBaseShippingTaxAmount();
$totalExcl = new Varien_Object(array('code' => 'shipping', 'value' => $shipping, 'base_value' => $baseShipping, 'label' => $this->__('Shipping & Handling (Excl.Tax)')));
$totalIncl = new Varien_Object(array('code' => 'shipping_incl', 'value' => $shippingIncl, 'base_value' => $baseShippingIncl, 'label' => $this->__('Shipping & Handling (Incl.Tax)')));
$parent->addTotal($totalExcl, 'shipping');
$parent->addTotal($totalIncl, 'shipping');
} elseif ($this->_config->displaySalesShippingInclTax($store)) {
$shippingIncl = $this->_source->getShippingAmount() + $this->_source->getShippingTaxAmount();
$baseShippingIncl = $this->_source->getBaseShippingAmount() + $this->_source->getBaseShippingTaxAmount();
$total = $parent->getTotal('shipping');
if ($total) {
$total->setValue($shippingIncl);
$total->setBaseValue($baseShippingIncl);
}
}
return $this;
}
示例2: displaySalesShippingBoth
/**
* Check if display sales shipping include and exclude tax
*
* @param mixed $store
* @return bool
*/
public function displaySalesShippingBoth($store = null)
{
if ($this->_getDataHelper()->isAvataxEnabled($store)) {
return false;
}
return parent::displaySalesShippingBoth($store);
}