예제 #1
0
파일: Tax.php 프로젝트: kewaunited/xcart
 /**
  * Get shipping tax cost
  *
  * @param \XLite\Module\CDev\SalesTax\Model\Tax\Rate $rate Rate
  *
  * @return float
  */
 protected function getShippingTaxCost(\XLite\Module\CDev\SalesTax\Model\Tax\Rate $rate)
 {
     $result = 0;
     $modifier = $this->order->getModifier(\XLite\Model\Base\Surcharge::TYPE_SHIPPING, 'SHIPPING');
     if ($modifier && $modifier->getSelectedRate() && $modifier->getSelectedRate()->getMethod()) {
         $shippingRate = $modifier->getSelectedRate();
         if ($rate->isAppliedToObject($shippingRate->getMethod())) {
             $result = $rate->calculateShippingTax($shippingRate->getTaxableBasis());
         }
     }
     return $result;
 }
 /**
  * {@inheritDoc}
  */
 public function calculateShippingTax($shippingCost)
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'calculateShippingTax', array($shippingCost));
     return parent::calculateShippingTax($shippingCost);
 }