Kody Chang
Kody Chang

Reputation: 47

Magento : list.phtml price

I created a Magento web site, but the price disappear from list.phtml here's my line : www.smztw.com/radiator.html why? anyone can tell me how to get it back?

thank you so much

Upvotes: 0

Views: 592

Answers (1)

Ravelposh
Ravelposh

Reputation: 50

Make sure that you have the following line in your template:

echo $this->getPriceHtml($_product, true);

If you have this it should call the method of this file:

/app/code/core/Mage/Catalog/Block/Product/Abstract.php

This is the method (Magento 1.8):

public function getPriceHtml($product, $displayMinimalPrice = false, $idSuffix = '')
    {
        $type_id = $product->getTypeId();
        if (Mage::helper('catalog')->canApplyMsrp($product)) {
            $realPriceHtml = $this->_preparePriceRenderer($type_id)
                ->setProduct($product)
                ->setDisplayMinimalPrice($displayMinimalPrice)
                ->setIdSuffix($idSuffix)
                ->toHtml();
            $product->setAddToCartUrl($this->getAddToCartUrl($product));
            $product->setRealPriceHtml($realPriceHtml);
            $type_id = $this->_mapRenderer;
        }

        return $this->_preparePriceRenderer($type_id)
            ->setProduct($product)
            ->setDisplayMinimalPrice($displayMinimalPrice)
            ->setIdSuffix($idSuffix)
            ->toHtml();
    }

The problem should be here, you can debug it and find where is the problem.

I hope it helps.

Upvotes: 1

Related Questions