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; }
/** * Check if display sales shipping include tax * * @param mixed $store * @return bool */ public function displaySalesShippingInclTax($store = null) { if ($this->_getDataHelper()->isAvataxEnabled($store)) { return false; } return parent::displaySalesShippingInclTax($store); }