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 -%}
{%- 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
-%}
{{ section.settings.heading | escape }}
{%- if carousel -%}
<carousel-slider class=“carousel block” inactive{% if section.settings.layout == ‘carousel_on_mobile’ %} disable-desktop=“true”{% endif %}>
-
{%- for product in recommendations.products -%}
{% render 'product-card', product: product %}
{%- endfor -%}
{%- if carousel -%}
{% 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 %}