Magento - using $this->getPriceHtml on custom page template

后端 未结 4 832
天命终不由人
天命终不由人 2021-02-02 14:02

I have a scroller showing a collection of products currently on sale, which I call using the following:

$todayDate  = Mage::app()->getLocale()->date()->         


        
4条回答
  •  Happy的楠姐
    2021-02-02 14:50

    My colleague recommended using this Magento friendly method to get the price html anywhere:

    load($product->getId());
          $productBlock = $this->getLayout()->createBlock('catalog/product_price');
          echo $productBlock->getPriceHtml($_product); ?>
    

    If you're already working with a loaded product then you won't need the first line, however my product was from a collection so this was necessary.

提交回复
热议问题