Issue
I'm trying to display all top 1 product on the collection on one page. but I know how to do that.
I share upload three screenshots I want them to display on one page. Any tips?
Solution
There are a lot of ways to do this.
1 way. Start by creating a new collection with a condition, select product type
is equal to top 1
. In the product you want to appear in that collection, add top 1
to the type.
-
{% for collection in collections %} {% for product in collection.products %} {% if forloop.index == 1%} {% comment %}display product{% endcomment %} {% endif %} {% endfor %} {% endfor %}
The above code will select first product on every collections in the shop. To control which to appear as first, go to the collection and select the sort orders.
Answered By - Charles C. Answer Checked By - Gilberto Lyons (PHPFixing Admin)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.