Random Products on JM tabs


Is there any way to have random products selected on the JM Tabs so diferent products show on the tabs every time a customer visits the website? Say I have some tabs each pointing to different category of products, with 10 or more products each category. On current JM Tabs, I always see the same products from the diferent categories on the tabs, while I’d like to see different products on different visits to the web shop. Is it possible?

Thanks, mary

2 answers

Profile photo of Sherlock 0.00 $tone July 26, 2013

Hi maryann,

you can try as following
Open the file of app\code\local\JoomlArt\JmProducts\Block\List.php, at around line number 360 you would see this code

PHP Code:

            Filter list of product showing only the active and 
            visible product
Mage::getSingleton 'catalog/product_visibility' )->addVisibleInCatalogFilterToCollection $products );
Mage::getSingleton 'catalog/product_status' )->addVisibleFilterToCollection $products ); 

you add right below it this line of code

PHP Code:

 $products->getSelect()->order(new Zend_Db_Expr('RAND()')); 

I hope it helps


This question is now closed

Written By