KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have a scroller showing a collection of products currently on sale, which I call using the following: $todayDate = Mage::app()->getLocale()->date()->toString(Varien_Date::DATETIME_INTERNAL_FORMAT); $_productCollection = Mage::getResourceModel('reports/product_collection') ->addAttributeToSelect('*') ->addAttributeToFilter('visibility', $visibility) ->setPageSize(4) // Only return 4 products ->addAttributeToFilter('special_from_date', array('date' => true, 'to' => $todayDate)) ->addAttributeToFilter('special_to_date', array('or'=> array( 0 => array('date' => true, 'from' => $todayDate), 1 => array('is' => new Zend_Db_Expr('null'))) ), 'left') ->addAttributeToSort('special_from_date', 'desc'); $_productCollection->load(); I then run a foreach to get the individual products: foreach ($_productCollection as $_product) Everything works fine, except for the price, which I would usually call using $this->getPriceHtml($_product, true) However this is giving me a blank. If I do a var_dump I can see that both the original price and the special price are both available, so why isn't this working? I use exactly the same code on my homepage template, which I call through the homepage CMS, and the price is shown fine (with the regular price crossed out and special price shown). Using $_product->getFinalPrice() works fine, but only gives me the final "special" price and doesn't show the original price. Am I maybe missing something in my xml layout that's needed to show the prices using getPriceHtml ?
Tags (comma-separated)
Save Edits
Cancel