Announcement

Collapse
No announcement yet.

How can I display a random In Stock product for each base Cat on storefront page?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How can I display a random In Stock product for each base Cat on storefront page?

    How would I display a random In Stock product for each base category (e.g.: "Category Product List Layout" on Category Display page) on storefront page?

    Example:

    Site has 5 base categories, how would I go about displaying one random In Stock product from each base category on the store from page (We had this on our legacy site M4.24c for storefront and category pages that contained subcategories, which is something I would like to do)?

    Ideally, the random product would only change once a day vs on each page refresh.
    Thank you, Bill Davis

    #2
    The easiest way to feature products on any page is going to be to use the ReadyTheme Product listing. However that is not random. It pulls products from a single category or from your all products. You manage the order, and which products display by changing the sort order of that category.

    You can get what you're looking for but you would need to explicitly load the products yourself for each category you need then you could use the transients module to cache the values so it only changes once per day.
    Brennan Heyde
    VP Product
    Miva, Inc.
    [email protected]
    https://www.miva.com

    Comment

    Working...
    X