Showing best-selling products section in collection

Highlighted
New Member
1 0 0

Hi

 

I have searched and could not find an answer in the documentation or forum if its possible to fetch collection products (besl-selling) without looking at the looking or modifying the URL.

 

The reason for this is that i would like to have an extra section on my collection page where is show popular products for that collection. This section should not look at filters and all that and have a fixed sorting (best-selling)

 

Is there anyway to do this?

 

This is the extra section i made in the template for this section. But its not giving me the correct sorting and it would filter the collection products if there is filters in the URL

<div class="popular-products-container">
        <ul class="grid-uniform grid-link__container popular-products owl-carousel owl-theme">
          {% paginate collection.products by 10 %}   
            {% assign products = collection.products | sort: 'best-selling' %}
            {% for product in products %}
              {% assign grid_item_width = 'full-width' %}
             {% include 'product-grid-item' %}
            {% endfor %}
          {% endpaginate %} 
        </ul>
        <div class="nav_featured"></div>
      </div>
0 Likes