Author Topic: Randomize Featured Products Listing  (Read 28 times)

Offline kavlito

  • Newbie
  • *
  • Posts: 14
  • Karma: +2/-0
    • View Profile
Randomize Featured Products Listing
« on: May 13, 2020, 09:50:51 AM »
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.


(one caveat: this does not work with HTML Cache enabled)
« Last Edit: May 14, 2020, 10:40:53 PM by kavlito »


Powered by SMFPacks Social Login Mod