示例#1
0
 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
0
文件: Config.php 项目: shabirm/avatax
 /**
  * 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);
 }