Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.
For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email email@example.com.
// get all products that are marked as featured $collection = Mage::getModel('catalog/product')->getCollection(); $collection->addAttributeToSelect('featured'); $collection->addFieldToFilter(array( array('attribute' => 'featured', 'eq' => true), ));
// if no products are currently featured, display some text if (!$collection->count()) : ?>
<p class="note-msg"><?php echo $this->__('There are no featured products at the moment .') ?></p>
I’ve managed to get the products to show correctly in my middle column ‘content’ by using the method on the wiki and assigning the products to an inactive category but now I need to move it to the right hand column.
and placed this in the design section rather than the content section and this did show the products but it wasnt limited to the inactive category and seemed to show all the products. It was as if it wasnt getting the information about the category number.
Is there a simple way to move the block to the right? or failing that could I hard code the category number into the file catalog/product/list.phtml somehow?
@ Amol Kharat,
i am new to Magento.....
i am using your code for add feature product at homepage.... but using your code my Featured Product Block is make empty....
Can you explain how to create featured.phtml file??