Example #1
0
 /**
  * Get gift wrapping items price with tax processing
  *
  * @param  Varien_Object $item
  * @param  float $price
  * @param  bool $includingTax
  * @param  null|Mage_Customer_Model_Address $shippingAddress
  * @param  null|Mage_Customer_Model_Address $billingAddress
  * @param  null|int $ctc
  * @param  mixed $store
  * @return float
  */
 public function getPrice($item, $price, $includeTax = false, $shippingAddress = null, $billingAddress = null, $ctc = null, $store = null)
 {
     if (!$price) {
         return $price;
     }
     $store = Mage::app()->getStore($store);
     $taxClassId = $item->getTaxClassId();
     if ($taxClassId && $includeTax) {
         $request = Mage::getSingleton('tax/calculation')->getRateRequest($shippingAddress, $billingAddress, $ctc, $store);
         $percent = Mage::getSingleton('tax/calculation')->getRate($request->setProductClassId($taxClassId));
         if ($percent) {
             $price = $price * (1 + $percent / 100);
         }
     }
     return $store->roundPrice($price);
 }