Hi All,
I am currently using the dynamic source for the display of the “featured collection” on the product page, however, the list of the product under the featured collection is fixed, is it possible to have it display randomly? your help is much appreciated, thanks.
Jac
I prepared the below code not sure it is correct or not, and which liquid should i save it as i am using Dawn theme
{% assign featured_products = collection.products | where: “featured”, true %}
{% assign total_featured_products = featured_products.size %}
{% assign start_index = “now” | date: “%L” | modulo: total_featured_products %}
{% assign paginate_index = 5 %}
{% assign products_shown = 0 %}
{% for product in featured_products %}
{% if forloop.index0 >= start_index %}
{% assign products_shown = products_shown | plus: 1 %}
{% if products_shown >= paginate_index %}{% break %}{% endif %}
{% endif %}
{% endfor %}