How can I remove a specific product from auto-populated recommendation lists?

We’re a charity. We have an app that allows us to collect donations in the cart/basket.

This quickly became our most popular product. As a result it is first result in every auto-populated product recomendation list.

I would like to hide this from the product recommendation section. I have applied a tag of ‘HIDE’ to that product but don’t know where to add it in product-recomendation.liquid

Presumably there needs to be a for loop and an if statement to check for the tag but I don’t really understand how this section is working.

Any help would be greatly appreciated.


{%- style -%}
  .section-{{ section.id }}-padding {
    padding-top: {{ section.settings.padding_top | times: 0.75 | round: 0 }}px;
    padding-bottom: {{ section.settings.padding_bottom | times: 0.75 | round: 0 }}px;
  }

  @media screen and (min-width: 750px) {
    .section-{{ section.id }}-padding {
      padding-top: {{ section.settings.padding_top }}px;
      padding-bottom: {{ section.settings.padding_bottom }}px;
    }
  }
{%- endstyle -%}

  

p.s. I know this has been asked before but in all those threads nobodies code looked like this so couldn’t take learnings from it.

thanks

Solved. Ended up doing it like this:

  • Add a tag to the product(s) you want to hide from product recomendations

  • In the code for product-recommendations add {% unless %} with a condition to look for that tag amongst products within recommedations (see below)


  

Hey @jake_mitchell ,

Do you just have products on your store that count as donations or are you also using cart donations?

Westen

We do have other products that are technically donation products, yes, but we don’t mind those being in product recs. It’s only the donation that is provided as a widget in the cart/basket that we wanted to hide.

because 28% of people do donate that way the product that it is linked to was regularly given pride of place in the recomended product selection. Since I’ve added that unless statement in it no longer is.