Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What function and where is $this->getPriceHtml() located?

Tags:

magento

On the default product view page for magento where is "getPriceHtml" function located or what is being called here:

    <?php echo $this->getPriceHtml($_product) ?>

Several words are being displayed by this code such as "Price From:" with the price included afterwards. This is for a configurable product.

like image 858
Ruben Arevalo Avatar asked Mar 21 '12 21:03

Ruben Arevalo


3 Answers

Mage_Catalog_Block_Product::getPriceHtml()

This method renders via app/design/frontend/base/default/template/catalog/product/price.phtml

a.k.a The Worst Template In Magento®

like image 95
benmarks Avatar answered Jan 03 '23 20:01

benmarks


benmark's answer comes down to this:

<?php echo Mage_Catalog_Block_Product::getPriceHtml($_product, true) ?>

Where $_product relates to the product object.

like image 42
Gerard Nijboer Avatar answered Jan 03 '23 20:01

Gerard Nijboer


    $productBlock = new Mage_Catalog_Block_Product();

    $priceBlock = $productBlock->getPriceHtml($_product, true);

    echo $priceBlock;
like image 34
valir Avatar answered Jan 03 '23 19:01

valir