예제 #1
0
파일: Item.php 프로젝트: xiaoguizhidao/beut
 /**
  * Calculate product price based on tax information and account settings
  */
 private function calculateChannelCurrencyPrice()
 {
     if ($this->channelCurrencyPrice > 0) {
         return;
     }
     /** @var $taxCalculator Mage_Tax_Model_Calculation */
     $taxCalculator = Mage::getSingleton('tax/calculation');
     $this->channelCurrencyPrice = $this->proxyItem->getPrice();
     if ($this->needToAddTax()) {
         $this->channelCurrencyPrice += $taxCalculator->calcTaxAmount($this->channelCurrencyPrice, $this->proxyItem->getTaxRate(), false, false);
     } elseif ($this->needToSubtractTax()) {
         $this->channelCurrencyPrice -= $taxCalculator->calcTaxAmount($this->channelCurrencyPrice, $this->proxyItem->getTaxRate(), true, false);
     }
     $this->channelCurrencyPrice = round($this->channelCurrencyPrice, 2);
 }