News:

AbanteCart v1.4.2 is released.

Main Menu

Do you like AbanteCart? Please rate AbanteCart or share your experience with other eCommerce entrepreneurs. Go to Softaculous rating page to add your rating or write a review

Randomize Featured Products Listing

Started by kavlito, May 13, 2020, 09:50:51 AM

Previous topic - Next topic

kavlito

I use the Featured Products listing on my homepage. However, the display order is static and I prefer it to be random.

This can be easily accomplished by adding one line to this file: /storefront/view/*mytemplate*/template/blocks/product_list.tpl

Insert: shuffle($products);
between: $icount = 0;
and: foreach ($products as $product) {

See attachment.

Enjoy!

(one caveat: this does not work with HTML Cache enabled - Update 5/26/20 - this statement is moot as of v1.2.16 as HTML Cache has been deprecated)

Forum Rules Code of conduct
AbanteCart.com 2010 -