本文整理汇总了PHP中Mage_Downloadable_Model_Link::getProduct方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Downloadable_Model_Link::getProduct方法的具体用法?PHP Mage_Downloadable_Model_Link::getProduct怎么用?PHP Mage_Downloadable_Model_Link::getProduct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Downloadable_Model_Link
的用法示例。
在下文中一共展示了Mage_Downloadable_Model_Link::getProduct方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getFormattedLinkPrice
/**
* 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;
}
示例2: getFormattedLinkPrice
/**
* 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;
}