【发布时间】:2014-04-29 10:59:49
【问题描述】:
如何在右侧栏中查看产品的产品价格,
在 Magento 产品详细信息页面中?
(我的详细信息页面是 2column-right)
如果有人知道,请帮助我,是否可能
谢谢
【问题讨论】:
标签: magento
如何在右侧栏中查看产品的产品价格,
在 Magento 产品详细信息页面中?
(我的详细信息页面是 2column-right)
如果有人知道,请帮助我,是否可能
谢谢
【问题讨论】:
标签: magento
先在catalog.xml(app/design/)下添加如下代码
<catalog_product_view>
.......
<reference name="right">
<block type="catalog/product_view" name="catalog.product.rightprice" before="-" template="catalog/product/view/rightprice.phtml"/>
</reference>
</catalog_product_view>
在catalog/product/view下创建一个phtml(rightprice.phtml)
rightprice.phtml 的代码是
echo Mage::registry('current_product')->getFinalPrice();
还有更多详情,你可以试试这个
if(Mage::registry('current_product')){
$product=Mage::registry('current_product');
$displayMinimalPrice = false;
$idSuffix = '-right';
$type_id = $product->getTypeId();
if (Mage::helper('catalog')->canApplyMsrp($product)) {
$realPriceHtml = $this->_preparePriceRenderer($type_id)
->setProduct($product)
->setDisplayMinimalPrice($displayMinimalPrice)
->setIdSuffix($idSuffix)
->setIsEmulateMode(true)
->toHtml();
$product->setAddToCartUrl($this->getAddToCartUrl($product));
$product->setRealPriceHtml($realPriceHtml);
$type_id = $this->_mapRenderer;
echo $this->_preparePriceRenderer($type_id)
->setProduct($product)
->setDisplayMinimalPrice($displayMinimalPrice)
->setIdSuffix($idSuffix)
->toHtml();
}
如果有任何问题,请告诉我
【讨论】: