Example #1
0
 /**
  * Calculate including tax price
  *
  * @param Varien_Object $item
  * @param mixed $basePrice
  * @param Mage_Sales_Model_Quote_Address $shippingAddress
  * @param bool $includeTax
  * @return string
  */
 public function calculatePrice($item, $basePrice, $shippingAddress, $includeTax = false)
 {
     $billingAddress = $this->_getQuote()->getBillingAddress();
     $taxClass = Mage::helper('enterprise_giftwrapping')->getWrappingTaxClass();
     $item->setTaxClassId($taxClass);
     $price = Mage::helper('enterprise_giftwrapping')->getPrice($item, $basePrice, $includeTax, $shippingAddress, $billingAddress);
     return Mage::helper('core')->currency($price, true, false);
 }
Example #2
0
 public function getCodPrice($price, $includingTax = null, $shippingAddress = null, $ctc = null, $store = null)
 {
     $pseudoProduct = new Varien_Object();
     $pseudoProduct->setTaxClassId($this->getCodTaxClass($store));
     $billingAddress = false;
     if ($shippingAddress && $shippingAddress->getQuote() && $shippingAddress->getQuote()->getBillingAddress()) {
         $billingAddress = $shippingAddress->getQuote()->getBillingAddress();
     }
     return Mage::helper('tax')->getPrice($pseudoProduct, $price, $includingTax, $shippingAddress, $billingAddress, $ctc, $store, $this->codPriceIncludesTax($store));
 }
Example #3
0
 public function getCapayableFeePrice($price, $incTax = true, $shippingAddress = NULL, $customerTaxClass = NULL, $store = NULL)
 {
     $taxPriceRequest = new Varien_Object();
     $taxPriceRequest->setTaxClassId($this->getPaymentsFeeTaxClass($store));
     $billingAddress = false;
     if ($shippingAddress && $shippingAddress->getQuote() && $shippingAddress->getQuote()->getBillingAddress()) {
         $billingAddress = $shippingAddress->getQuote()->getBillingAddress();
     }
     return Mage::helper('tax')->getPrice($taxPriceRequest, $price, $incTax, $shippingAddress, $billingAddress, $customerTaxClass, $store, $this->capayableFeePriceIncludesTax($store));
 }
Example #4
0
 /**
  * @param  float $amount
  * @param  bool  $amountContainsTax
  * @return float
  */
 protected function _getNetForGrossShipping($amount, $amountContainsTax = true)
 {
     $storeViewId = Mage::helper("shopgate/config")->getConfig()->getStoreViewId();
     $taxClassId = Mage::helper("tax")->getShippingTaxClass($storeViewId);
     $pseudoProduct = new Varien_Object();
     $pseudoProduct->setTaxClassId($taxClassId);
     $returnIncludesTax = Mage::helper("tax")->shippingPriceIncludesTax($storeViewId);
     $customerTaxClass = null;
     $amount = Mage::helper("tax")->getPrice($pseudoProduct, $amount, $returnIncludesTax, null, null, null, $storeViewId, $amountContainsTax);
     return $amount;
 }