Exclude certain pro...
 
Notifications
Clear all

[Solved] Exclude certain products from dymanic product recommendations?

4 Posts
2 Users
0 Reactions
1,737 Views
Aden Mott
(@adenmott)
Eminent Member
Joined: 3 years ago
Posts: 0
Topic starter  

Good morning, 

Is there a way to easily remove certain products from the dynamic product recommendations?  

Thank you


   
Quote
Jasmine Keinsh
(@plakadmin)
Estimable Member Admin
Joined: 4 years ago
Posts: 131
 

Hi Aden, We are checking your query with our Dev team. Apologies for the delay, we'll be back with you asap.

Jasmine | Plak theme support
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as a Solved Solution


   
ReplyQuote
Jasmine Keinsh
(@plakadmin)
Estimable Member Admin
Joined: 4 years ago
Posts: 131
 

Hi Aden, Our dev team looked at your query. We are using Shopify product recommendation API for this feature. It currently doesn't support excluding products. However, there is a hack that may just work for you. Lets say you want to skip a product with ID=1234. Now, you can add this ID in the loop and skip it. This might not work when you have large number of products to skip. Sample code shared by the team is as below:

<ul class="grid grid--uniform grid--view-items">
  {%- for product in recommendations.products limit: 10 -%}
    <li class="grid__item small--one-half medium-up--one-quarter">
      {%- if [1234, 3434, 56565] contains product.id -%}
        {% render 'product-card-grid', product: product %}
      {%endif %}
     </li>
  {%- endfor -%}
</ul>

Jasmine | Plak theme support
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as a Solved Solution


   
ReplyQuote
Aden Mott
(@adenmott)
Eminent Member
Joined: 3 years ago
Posts: 0
Topic starter  

Thank you! I had found another workaround since posting my question.


   
ReplyQuote
Share:

Welcome to the Shopify Forum Community provided by Plak ThemeLLC, a place where you can discuss about eCommerce and Shopify, solve technical issues, get help with Shopify Design, Apps integration, Marketing, Facebooks ad, Google ads and more.

Before posting, we invite you to read and follow the forum rules | We also support any questions related to Free Shopify themes :Dawn, Express, Minimal, Brooklyn, Narrative, Supply, Debut, Venture, Boundless and Simple