简体   繁体   中英

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM