user3040570
user3040570

Reputation: 392

how to view product price in right bar in magento product details page

How to view product price of a product in right side bar,

in Magento product details page?

(my details page is 2column-right)

Any one please help me if know about it and is it possible or not

thank you

Upvotes: 1

Views: 440

Answers (1)

Amit Bera
Amit Bera

Reputation: 7611

First add below code under 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>

Create a phtml(rightprice.phtml) under catalog/product/view

code of rightprice.phtml is

echo Mage::registry('current_product')->getFinalPrice();

Also get More details ,you can try this

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();
        }

If any issue let me know

Upvotes: 2

Related Questions