Hide Route Insurance from "you may also like"

Topic summary

A user is attempting to exclude Route insurance/protection products from the “you may also like” (product recommendations) section on their Shopify store. They need to modify the product-recommendations.liquid file but are finding that solutions from other forum threads don’t match their current code structure.

Desired solution:

  • Use product tags (e.g., “insurance”) to filter out specific items from recommendations
  • Previously documented tag-based exclusion methods aren’t compatible with their theme’s code

Technical context:

  • The provided liquid code appears corrupted or improperly formatted (contains reversed/garbled text)
  • This formatting issue may complicate troubleshooting

Status: The question remains unanswered with no responses yet. The user is seeking guidance on implementing tag-based product filtering within their specific theme structure.

Summarized with AI on November 8. AI used: claude-sonnet-4-5-20250929.

Hello,

I’m trying to exclude route protection from “you may also like” and it seems i need to edit on product-recomenndations.liquid but the responses in other topics dont match my code.

Can anyone help? I saw a solution that used tags to exclude. such that anything tagged with “insurance” was excluded from “you may also like”. Thanks in advance.

Here is my product-recommendations liquid code:

{%- comment -%}theme-check-disable NestedSnippet{%- endcomment -%}
{%- if section.index > 2 -%}

{%- else -%} {{ 'product.css' | asset_url | stylesheet_tag }} {%- endif -%}

{%- if settings.enable_quick_add -%}

{%- endif -%}

{%- liquid
assign carousel_desktop_small = ’ md:auto-cols-3 lg:auto-cols-4 xl:auto-cols-5 small-cards-desktop’
assign carousel_desktop_medium = ’ sm:auto-cols-3 xl:auto-cols-4’
assign carousel_desktop_large = ’ sm:auto-cols-2 lg:auto-cols-3’

assign grid_desktop_small = ’ md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 small-cards-desktop’
assign grid_desktop_medium = ’ sm:grid-cols-3 xl:grid-cols-4’
assign grid_desktop_large = ’ sm:grid-cols-2 lg:grid-cols-3’

if section.settings.card_size_mobile == ‘small’
assign carousel_mobile_cols = ‘grid-flow-col auto-cols-2 small-cards-mobile’
assign grid_mobile_cols = ‘grid-cols-2 small-cards-mobile’
if section.settings.layout == ‘carousel_on_mobile’
assign carousel_mobile_cols = carousel_mobile_cols | append: ’ sm:grid-cols-2’
endif
else
assign carousel_mobile_cols = ‘grid-flow-col auto-cols-1’
assign grid_mobile_cols = ‘grid-cols-1’
endif

if section.settings.layout == ‘carousel’
assign carousel = true

if section.settings.card_size == ‘small’
assign grid_classes = carousel_mobile_cols | append: carousel_desktop_small
elsif section.settings.card_size == ‘medium’
assign grid_classes = carousel_mobile_cols | append: carousel_desktop_medium
else
assign grid_classes = carousel_mobile_cols | append: carousel_desktop_large
endif
elsif section.settings.layout == ‘carousel_on_mobile’
assign carousel = true

if section.settings.card_size == ‘small’
assign grid_classes = carousel_mobile_cols | append: grid_desktop_small
elsif section.settings.card_size == ‘medium’
assign grid_classes = carousel_mobile_cols | append: grid_desktop_medium
else
assign grid_classes = carousel_mobile_cols | append: grid_desktop_large
endif
else
assign carousel = false

if section.settings.card_size == ‘small’
assign grid_classes = grid_mobile_cols | append: grid_desktop_small
elsif section.settings.card_size == ‘medium’
assign grid_classes = grid_mobile_cols | append: grid_desktop_medium
else
assign grid_classes = grid_mobile_cols | append: grid_desktop_large
endif
endif

assign product_id = product.id
assign limit = section.settings.products_to_show
-%}

{%- if recommendations.performed and recommendations.products_count > 0 -%} {%- if section.settings.heading != blank -%}

{{ section.settings.heading | escape }}

{%- endif -%}

{%- if carousel -%}
<carousel-slider class=“carousel block” inactive{% if section.settings.layout == ‘carousel_on_mobile’ %} disable-desktop=“true”{% endif %}>

{%- endif -%}
    {%- for product in recommendations.products -%} {% render 'product-card', product: product %} {%- endfor -%}

{%- if carousel -%}

{%- if settings.slider_show_arrows != 'never' -%}
{{ 'general.slider.next' | t }} {% render 'icon-chevron-right' %} {{ 'general.slider.previous' | t }} {% render 'icon-chevron-left' %}
{%- endif -%}
{%- endif -%} {%- endif -%}

{% schema %}
{
“name”: “Related products”,
“tag”: “section”,
“class”: “cc-product-recommendations”,
“settings”: [
{
“type”: “paragraph”,
“content”: “Dynamic recommendations use order and product information to change and improve over time. Learn more
},
{
“type”: “header”,
“content”: “Section header”
},
{
“type”: “text”,
“id”: “heading”,
“label”: “Heading”,
“default”: “You may also like”
},
{
“type”: “select”,
“id”: “heading_align”,
“label”: “Heading alignment”,
“options”: [
{
“value”: “text-start”,
“label”: “Left”
},
{
“value”: “text-center”,
“label”: “Center”
},
{
“value”: “text-end”,
“label”: “Right”
}
],
“default”: “text-start”
},
{
“type”: “header”,
“content”: “Layout”
},
{
“type”: “select”,
“id”: “layout”,
“label”: “Layout”,
“options”: [
{
“value”: “carousel”,
“label”: “Carousel”
},
{
“value”: “carousel_on_mobile”,
“label”: “Carousel on mobile”
},
{
“value”: “grid”,
“label”: “Grid”
}
],
“default”: “carousel”
},
{
“type”: “select”,
“id”: “card_size_mobile”,
“label”: “Product card size on mobile”,
“options”: [
{
“value”: “small”,
“label”: “Small”
},
{
“value”: “large”,
“label”: “Large”
}
],
“default”: “small”
},
{
“type”: “select”,
“id”: “card_size”,
“label”: “Product card size on large screens”,
“options”: [
{
“value”: “small”,
“label”: “Small”
},
{
“value”: “medium”,
“label”: “Medium”
},
{
“value”: “large”,
“label”: “Large”
}
],
“default”: “small”
},
{
“type”: “range”,
“id”: “products_to_show”,
“label”: “Maximum products to show”,
“min”: 2,
“max”: 8,
“step”: 1,
“default”: 8
}
]
}
{% endschema %}