Magento Product Shuffle in collection programatically Mage::getResourceModel('reports/product_collection')

$_pdtsCollection = Mage::getResourceModel('reports/product_collection')
                        ->addAttributeToSelect('*')
                        ->addCategoryFilter($_category)   
                        ->addAttributeToFilter('visibility', $visibility)
                        ->addAttributeToSelect('status')
                        ->addFieldToFilter(array(array('attribute' => 'featured_product', 'eq' => true),));
                                      
               
        $_pdtsCollection->getSelect()->order(new Zend_Db_Expr('RAND()'));

Share this

Related Posts

Previous
Next Post »

Pageviews from the past week