/**
  * Enter description here...
  *
  * @param Mage_Downloadable_Model_Link $link
  * @return string
  */
 public function getFormattedLinkPrice($link)
 {
     $price = $link->getPrice();
     if (0 == $price) {
         return '';
     }
     $_priceInclTax = Mage::helper('tax')->getPrice($link->getProduct(), $price, true);
     $_priceExclTax = Mage::helper('tax')->getPrice($link->getProduct(), $price);
     $priceStr = '<span class="price-notice">+';
     if (Mage::helper('tax')->displayPriceIncludingTax()) {
         $priceStr .= $this->helper('core')->currency($_priceInclTax, true, true);
     } elseif (Mage::helper('tax')->displayPriceExcludingTax()) {
         $priceStr .= $this->helper('core')->currency($_priceExclTax, true, true);
     } elseif (Mage::helper('tax')->displayBothPrices()) {
         $priceStr .= $this->helper('core')->currency($_priceExclTax, true, true);
         if ($_priceInclTax != $_priceExclTax) {
             $priceStr .= ' (+' . $this->helper('core')->currency($_priceInclTax, true, true) . ' ' . $this->__('Incl. Tax') . ')';
         }
     }
     $priceStr .= '</span>';
     return $priceStr;
 }
Beispiel #2
0
 /**
  * Enter description here...
  *
  * @param Mage_Downloadable_Model_Link $link
  * @return string
  */
 public function getFormattedLinkPrice($link)
 {
     $price = $link->getPrice();
     $store = $this->getProduct()->getStore();
     if (0 == $price) {
         return '';
     }
     $taxCalculation = Mage::getSingleton('Mage_Tax_Model_Calculation');
     if (!$taxCalculation->getCustomer() && Mage::registry('current_customer')) {
         $taxCalculation->setCustomer(Mage::registry('current_customer'));
     }
     $taxHelper = Mage::helper('Mage_Tax_Helper_Data');
     $coreHelper = $this->helper('Mage_Core_Helper_Data');
     $_priceInclTax = $taxHelper->getPrice($link->getProduct(), $price, true);
     $_priceExclTax = $taxHelper->getPrice($link->getProduct(), $price);
     $priceStr = '<span class="price-notice">+';
     if ($taxHelper->displayPriceIncludingTax()) {
         $priceStr .= $coreHelper->currencyByStore($_priceInclTax, $store);
     } elseif ($taxHelper->displayPriceExcludingTax()) {
         $priceStr .= $coreHelper->currencyByStore($_priceExclTax, $store);
     } elseif ($taxHelper->displayBothPrices()) {
         $priceStr .= $coreHelper->currencyByStore($_priceExclTax, $store);
         if ($_priceInclTax != $_priceExclTax) {
             $priceStr .= ' (+' . $coreHelper->currencyByStore($_priceInclTax, $store) . ' ' . $this->__('Incl. Tax') . ')';
         }
     }
     $priceStr .= '</span>';
     return $priceStr;
 }