Symmetry theme: How do I hide the quantity box for one specific collection or for specific products?

Hi Team,

The requirment is to not display the Quantity Box for one entire collection or for specific products.

Link: https://elbyzqrdm5d9604g-27861221460.shopifypreview.com/products_preview?preview_key=1be13dc4e32a6761b1a906aac78fec98

Refer to the screenshot:

Appreciate your help on this.

Looking forward to hearing from you.

Thanks,

VS

Hi There!

How experienced are you in Liquid? The solution is simple to implement but I need to see the Liquid code of the product-template.liquid or equivalent so I can modify it.

Will the collection be always the same? And should this show for some products that are not part of this collection?

Thanks @JHKCreate for responding !

Yes, the collection will be same for my scenario, collection named as “Originals”.

Please provide the updated code logic, I will implement the same.

Here’s the product-template.liquid code as follows:

{%- assign current_variant = product.selected_or_first_available_variant -%}
{%- assign zoom_size = ‘master’ -%}

{%- if template contains ‘lightbox’ -%}
{%- assign in_lightbox = true -%}
{%- else -%}
{%- assign in_lightbox = false -%}
{%- endif -%}

{% if in_lightbox == false %}
{% if section.settings.show_tags and product.tags.size > 0 %} {{ 'products.product.tags' | t }} + {% endif %}

{% if section.settings.show_type %}
{%- assign product_type_handle = product.type | handle -%}
{%- if collections[product_type_handle].handle == product_type_handle -%}
{%- assign type_url = collections[product_type_handle].url -%}
{%- else -%}
{%- assign type_url = product.type | url_for_type -%}
{%- endif -%}
{{ ‘products.product.see_more_of_this_type’ | t }} {{ product.type | link_to: type_url }}
{% endif %}

{% if collection %}

{% if collection.previous_product %} {{ 'products.product.previous' | t }} {% endif %} {% if collection.previous_product and collection.next_product %} / {% endif %} {% if collection.next_product %} {{ 'products.product.next' | t }} {% endif %}
{% endif %}

{% if section.settings.show_tags and product.tags.size > 0 %}

    {% for tag in product.tags %}
  • {{ tag }}
  • {% endfor %}
{% endif %} {%- endif -%}

{%- assign lightbox_size = ‘master’ -%}
{%- assign min_aspect_ratio = 0.6 -%}

{%- assign featured_media = product.selected_or_first_available_variant.featured_media | default: product.featured_media -%} {%- for media in product.media -%} {%- if media.id == featured_media.id -%} {%- assign initial_slide = forloop.index0 -%} {%- break -%} {%- endif -%} {%- endfor -%}
{%- for media in product.media -%} {%- endfor -%}

{%- if in_lightbox == false -%}
{%- assign models = product.media | where: ‘media_type’, ‘model’ -%}
{% if models.size > 0 %}


{%- render ‘icon-3d-badge-full-color’ -%}
{{ ‘products.product.view_in_space’ | t }}

{% endif %}
{%- endif -%}

{% if product.media.size > 1 %}

{% endif %}

{%- if settings.swatch_enabled and settings.swatch_images -%}

{%- for product_option in product.options_with_values -%} {%- if product_option.name == settings.swatch_option_name -%} {%- for value in product_option.values -%} {%- assign swatch_value = value | handle -%} .option--{{ settings.swatch_option_name | handle }} select[data-listed][data-colour-swatch="true"] + .clickyboxes .opt--{{ swatch_value }}::before, .swatch-option__nugget.bg-{{ swatch_value }} { background-image: url({{ swatch_value | append: '.png' | file_img_url: '48x48', crop: 'center' }}); } {%- endfor -%} {%- endif -%} {%- endfor -%}

{%- endif -%}

{{ product.title }}

{% render ‘product-label-detail’, product: product, current_variant: current_variant %}

{{ current_variant.price | money }} {% if current_variant.compare_at_price > current_variant.price %} {{ current_variant.compare_at_price | money }} {% endif %}

{% render ‘unit-price’, variant: current_variant %}

{%- if section.settings.show_tax_and_shipping -%}
{%- if shop.taxes_included or shop.shipping_policy.body != blank -%}

{%- if shop.taxes_included -%} {{ 'products.product.include_taxes' | t }} {%- endif -%} {%- if shop.shipping_policy.body != blank -%} {{ 'products.product.shipping_policy_html' | t: link: shop.shipping_policy.url }} {%- endif -%}
{%- endif -%} {%- endif -%}

{% if section.settings.show_vendor or section.settings.show_sku %}

{%- if section.settings.show_vendor -%} {%- comment -%} Do we have a collection that has the same name as our product vendor name? If we do, let's have the vendor link point to it. If not, we will point to the automatic vendor collection. {%- endcomment -%} {%- assign product_vendor_handle = product.vendor | handle -%} {%- if collections[product_vendor_handle].handle == product_vendor_handle -%} {%- assign vendor_url = collections[product_vendor_handle].url -%} {%- else -%} {%- assign vendor_url = product.vendor | url_for_vendor -%} {%- endif -%}
{{ 'products.product.vendor' | t }} {{ product.vendor | link_to: vendor_url }}
{%- endif -%}

{%- if section.settings.show_sku -%}

{{ 'products.product.sku' | t }} {{ product.selected_or_first_available_variant.sku }}
{%- endif -%}
{% endif %}

{% form ‘product’, product, class: ‘form’, data-ajax-add-to-cart: true, data-product-id: product.id, data-enable-history-state: ‘true’ %}

{% if product.variants.size > 1 %}
{% for option in product.options_with_values %}
{{ option.name }}

{% if settings.show_size_chart and option.name == settings.size_chart_variant %}

{{ 'products.product.size_chart' | t }}
{{ pages[settings.size_chart_page].content }}
{% endif %}

{% endfor %}

{% else %}

{% unless product.has_only_default_variant %}

{% for option in product.options %} {% assign opt_idx = 'option' | append: forloop.index %} {{ option }}: {{ product.variants.first[opt_idx] }}

{% if settings.show_size_chart and option == settings.size_chart_variant %}

{{ 'products.product.size_chart' | t }}
{{ pages[settings.size_chart_page].content }}
{% endif %} {% endfor %}
{% endunless %}

{% endif %}

{% if product.available %}
{% if section.settings.show_inventory_notice %}
{%- capture inventory_notice -%}
{%- if current_variant.inventory_management == ‘shopify’ and current_variant.inventory_quantity > 0 -%}
{%- if section.settings.inventory_notice_threshold == 0 or current_variant.inventory_quantity <= section.settings.inventory_notice_threshold -%}

{{- 'products.labels.only_x_left' | t: quantity: current_variant.inventory_quantity -}}
{%- else -%}
{%- endif -%} {%- else -%}
{%- endif -%} {%- endcapture -%} {% endif %}

{% unless section.settings.show_quantity_selector %}{{ inventory_notice }}{% endunless %}

{% if section.settings.show_quantity_selector %} {{ 'products.product.quantity' | t }} {{ inventory_notice }} {% endif %}
{% if section.settings.enable_payment_button %} {{ form | payment_button }} {% endif %}

{% if section.settings.show_backorder_text == true %}
{% render ‘backorder’, product: product, variant: current_variant %}
{% endif %}

{% else %}

{{ 'products.product.product_unavailable' | t }}
{% endif %} {% endform %}

{%- if template contains ‘lightbox’ -%}

{%- endif -%}

{% if section.settings.description_location == ‘beside’ and in_lightbox == false %}

{{ product.description }}

{% comment %} Add code to show under the description on the line below this one, if beside the image {% endcomment %}

{% endif %}

{% if in_lightbox %}

{% else %} {% if section.settings.show_sharing_links %}
{% render 'social-sharing', share_title: product.title, share_permalink: product.url, share_image: product %}
{% endif %} {% endif %}

{% if section.settings.description_location == ‘below’ and in_lightbox == false %}

{{ product.description }}

{% comment %} Add code to show under the description on the line below this one, if full-width underneath the image {% endcomment %}

{% endif %}

{% if in_lightbox == false %}

{% if section.settings.show_tags and product.tags.size > 0 %}
{{ 'products.product.tags' | t }}
    {% for tag in product.tags %}
  • {{ tag }}
  • {% endfor %}
{% endif %} {% if section.settings.show_sharing_links %}
{% render 'social-sharing', share_title: product.title, share_permalink: product.url, share_image: product %}
{% endif %}
{% if collection.previous_product %} {% render 'svg-chevron-left' %} {% endif %}
{%- if section.settings.show_type and product.type != blank -%} {%- assign product_type_handle = product.type | handle -%} {%- if collections[product_type_handle].handle == product_type_handle -%} {%- assign type_url = collections[product_type_handle].url -%} {%- else -%} {%- assign type_url = product.type | url_for_type -%} {%- endif -%} {{ product.type | link_to: type_url }} {% endif %}
{% if collection.next_product %} {% render 'svg-chevron-right' %} {% endif %}
{{ product.metafields.spr.reviews }}
{% endif %}

{% schema %}
{
“name”: “Product pages”,
“class”: “section-product-template”,
“settings”: [
{
“type”: “checkbox”,
“id”: “show_tax_and_shipping”,
“label”: “Show tax status and shipping policy link”,
“default”: false
},
{
“type”: “checkbox”,
“id”: “show_vendor”,
“label”: “Show vendor”,
“default”: true
},
{
“type”: “checkbox”,
“id”: “show_type”,
“label”: “Show type”,
“default”: false
},
{
“type”: “checkbox”,
“id”: “show_sku”,
“label”: “Show SKU”,
“default”: false
},
{
“type”: “checkbox”,
“id”: “show_quantity_selector”,
“label”: “Show quantity selector”,
“default”: true
},
{
“type”: “checkbox”,
“id”: “enable_payment_button”,
“label”: “Show dynamic checkout button”,
“info”: “Each customer will see their preferred payment method from those available on your store, such as PayPal or Apple Pay. Learn more”,
“default”: true
},
{
“type”: “checkbox”,
“id”: “show_backorder_text”,
“label”: “Show backorder text”,
“default”: true,
“info”: “Only shows for products which use Shopify inventory tracking and are available to purchase when out of stock.”
},
{
“type”: “checkbox”,
“id”: “show_inventory_notice”,
“label”: “Show inventory notice”,
“default”: false
},
{
“type”: “range”,
“id”: “inventory_notice_threshold”,
“min”: 0,
“max”: 100,
“step”: 1,
“label”: “Inventory threshold”,
“info”: “Show inventory quantities below this threshold. Choose 0 to show full amount.”,
“default”: 10
},
{
“type”: “checkbox”,
“id”: “show_sharing_links”,
“label”: “Show social sharing icons”,
“default”: true
},
{
“type”: “checkbox”,
“id”: “show_tags”,
“label”: “Show tags”,
“default”: false
},
{
“type”: “select”,
“id”: “description_location”,
“label”: “Description location”,
“default”: “beside”,
“options”: [
{
“value”: “beside”,
“label”: “Beside main image, under price”
},
{
“value”: “below”,
“label”: “Underneath image and price”
}
]
},
{
“type”: “header”,
“content”: “Media”
},
{
“type”: “paragraph”,
“content”: “Learn more about media types
},
{
“type”: “radio”,
“id”: “prod_gall_thumbs_under”,
“label”: “Thumbnail position”,
“info”: “On desktop screens”,
“options”: [
{
“value”: “beside”,
“label”: “Beside main image”
},
{
“value”: “under”,
“label”: “Underneath main image”
}
],
“default”: “under”
},
{
“type”: “checkbox”,
“id”: “enable_zoom”,
“label”: “Enable image zoom”,
“default”: true
},
{
“type”: “checkbox”,
“id”: “enable_video_looping”,
“label”: “Enable video looping”,
“default”: false
}
]
}
{% endschema %}

OK Clear, can you please share the Collection’s handle please?

Thanks!

What are you referring to? Sorry I didn’t get the “Collection’s handle” thing?

Thanks,

VS

How it’s written in the URL, this is the unique key.

Actually, just open the collection on the backend and give me the Collection’s ID from the URL above, cleaner.

Here’s the URL of my collections “Originals”

https://visheshstudio.com/collections/original-work

Here’s the URL of my collections “Originals” for a specific product:

https://visheshstudio.com/collections/original-work/products/art-makes-you-smart-original-painting

Also, I did googling regarding collections handle, I think you are looking for something like:

collections.original-work.products

Let me know if you need additional information.

Thanks!

Alright Let’s Have A Try, that should do it:

{%- assign current_variant = product.selected_or_first_available_variant -%}
{%- assign zoom_size = 'master' -%}

{%- if template contains 'lightbox' -%}
{%- assign in_lightbox = true -%}
{%- else -%}
{%- assign in_lightbox = false -%}
{%- endif -%}

{% if in_lightbox == false %}

{% if section.settings.show_tags and product.tags.size > 0 %}

{{ 'products.product.tags' | t }} +

{% endif %}

{% if section.settings.show_type %}
{%- assign product_type_handle = product.type | handle -%}
{%- if collections[product_type_handle].handle == product_type_handle -%}
{%- assign type_url = collections[product_type_handle].url -%}
{%- else -%}
{%- assign type_url = product.type | url_for_type -%}
{%- endif -%}
{{ 'products.product.see_more_of_this_type' | t }} {{ product.type | link_to: type_url }}
{% endif %}

{% if collection %}

{% if collection.previous_product %}
{{ 'products.product.previous' | t }}
{% endif %}
{% if collection.previous_product and collection.next_product %} / {% endif %}
{% if collection.next_product %}
{{ 'products.product.next' | t }}
{% endif %}

{% endif %}

{% if section.settings.show_tags and product.tags.size > 0 %}

{% for tag in product.tags %}
- {{ tag }}
{% endfor %}

{% endif %}
{%- endif -%}

{%- assign lightbox_size = 'master' -%}
{%- assign min_aspect_ratio = 0.6 -%}

{%- assign featured_media = product.selected_or_first_available_variant.featured_media | default: product.featured_media -%}
{%- for media in product.media -%}
{%- if media.id == featured_media.id -%}
{%- assign initial_slide = forloop.index0 -%}
{%- break -%}
{%- endif -%}
{%- endfor -%}

{%- for media in product.media -%}

{%- if media.media_type == 'image' and section.settings.enable_zoom -%}{%- endif -%}
{%- render 'media', media: media, min_aspect_ratio: min_aspect_ratio -%}
{%- if media.media_type == 'image' and section.settings.enable_zoom -%}{%- endif -%}

{%- endfor -%}

{%- if in_lightbox == false -%}
{%- assign models = product.media | where: 'media_type', 'model' -%}
{% if models.size > 0 %}

{% endif %}
{%- endif -%}

{% if product.media.size > 1 %}

{% for media in product.media %}

{% render 'responsive-image', image: media.preview_image, min_aspect_ratio: min_aspect_ratio %}

{%- if media.media_type == 'video' or media.media_type =='external_video' -%}

{% render 'icon-video-badge-full-color' %}

{%- endif -%}
{%- if media.media_type == 'model' -%}

{% render 'icon-3d-badge-full-color' %}

{%- endif -%}

{% endfor %}

{% endif %}

{%- if settings.swatch_enabled and settings.swatch_images -%}

{%- endif -%}

# {{ product.title }}

{% render 'product-label-detail', product: product, current_variant: current_variant %}

{{ current_variant.price | money }}
{% if current_variant.compare_at_price > current_variant.price %}
{{ current_variant.compare_at_price | money }}
{% endif %}

{% render 'unit-price', variant: current_variant %}

{%- if section.settings.show_tax_and_shipping -%}
{%- if shop.taxes_included or shop.shipping_policy.body != blank -%}

{%- if shop.taxes_included -%}
{{ 'products.product.include_taxes' | t }}
{%- endif -%}
{%- if shop.shipping_policy.body != blank -%}
{{ 'products.product.shipping_policy_html' | t: link: shop.shipping_policy.url }}
{%- endif -%}

{%- endif -%}
{%- endif -%}

{% if section.settings.show_vendor or section.settings.show_sku %}

{%- if section.settings.show_vendor -%}
{%- comment -%}
Do we have a collection that has the same name as our product vendor name?
If we do, let's have the vendor link point to it.
If not, we will point to the automatic vendor collection.
{%- endcomment -%}
{%- assign product_vendor_handle = product.vendor | handle -%}
{%- if collections[product_vendor_handle].handle == product_vendor_handle -%}
{%- assign vendor_url = collections[product_vendor_handle].url -%}
{%- else -%}
{%- assign vendor_url = product.vendor | url_for_vendor -%}
{%- endif -%}

{{ 'products.product.vendor' | t }} {{ product.vendor | link_to: vendor_url }}

{%- endif -%}

{%- if section.settings.show_sku -%}
{{ 'products.product.sku' | t }} {{ product.selected_or_first_available_variant.sku }}

{%- endif -%}

{% endif %}

{% form 'product', product, class: 'form', data-ajax-add-to-cart: true, data-product-id: product.id, data-enable-history-state: 'true' %}

{% if product.variants.size > 1 %}

{% for option in product.options_with_values %}

{% if settings.show_size_chart and option.name == settings.size_chart_variant %}

{{ 'products.product.size_chart' | t }}

{{ pages[settings.size_chart_page].content }}

{% endif %}

{% endfor %}

{% else %}

{% unless product.has_only_default_variant %}

{% for option in product.options %}
{% assign opt_idx = 'option' | append: forloop.index %}

{% if settings.show_size_chart and option == settings.size_chart_variant %}

{{ 'products.product.size_chart' | t }}

{{ pages[settings.size_chart_page].content }}

{% endif %}
{% endfor %}

{% endunless %}

{% endif %}

{% if product.available %}
{% if section.settings.show_inventory_notice %}
{%- capture inventory_notice -%}
{%- if current_variant.inventory_management == 'shopify' and current_variant.inventory_quantity > 0 -%}
{%- if section.settings.inventory_notice_threshold == 0 or current_variant.inventory_quantity <= section.settings.inventory_notice_threshold -%}

{{- 'products.labels.only_x_left' | t: quantity: current_variant.inventory_quantity -}}

{%- else -%}

{%- endif -%}
{%- else -%}

{%- endif -%}
{%- endcapture -%}
{% endif %}

{% unless section.settings.show_quantity_selector %}{{ inventory_notice }}{% endunless %}

{% assign productCollections = product.collections | map:'handle' %}

{% unless productCollections contains child_list_handle %}

{% if section.settings.show_quantity_selector %}

{% render 'svg-minus' %}

{% render 'svg-plus' %}

{% endif %}

{% if section.settings.enable_payment_button %}
{{ form | payment_button }}
{% endif %}

{% if section.settings.show_backorder_text == true %}
{% render 'backorder', product: product, variant: current_variant %}
{% endif %}

{% else %}
{{ 'products.product.product_unavailable' | t }}

{% endif %}
{% endform %}

{%endunless%}

{% if productCollections contains child_list_handle %}

{% if section.settings.enable_payment_button %}
{{ form | payment_button }}
{% endif %}

{% if section.settings.show_backorder_text == true %}
{% render 'backorder', product: product, variant: current_variant %}
{% endif %}

{% else %}
{{ 'products.product.product_unavailable' | t }}

{% endif %}
{% endform %}

{%endif%}

{%- if template contains 'lightbox' -%}

{%- endif -%}

{% if section.settings.description_location == 'beside' and in_lightbox == false %}
{{ product.description }}

{% comment %} Add code to show under the description on the line below this one, if beside the image {% endcomment %}

{% endif %}

{% if in_lightbox %}

{{ 'products.quick_buy.read_more' | t }}
{% render 'svg-chevron-right' %}

{% else %}
{% if section.settings.show_sharing_links %}

{% render 'social-sharing', share_title: product.title, share_permalink: product.url, share_image: product %}

{% endif %}
{% endif %}

{% if section.settings.description_location == 'below' and in_lightbox == false %}
{{ product.description }}

{% comment %} Add code to show under the description on the line below this one, if full-width underneath the image {% endcomment %}

{% endif %}

{% if in_lightbox == false %}

{% if section.settings.show_tags and product.tags.size > 0 %}

{% for tag in product.tags %}
- {{ tag }}
{% endfor %}

{% endif %}
{% if section.settings.show_sharing_links %}

{% render 'social-sharing', share_title: product.title, share_permalink: product.url, share_image: product %}

{% endif %}

{% if collection.previous_product %}
{% render 'svg-chevron-left' %}
{% endif %}

{%- if section.settings.show_type and product.type != blank -%}
{%- assign product_type_handle = product.type | handle -%}
{%- if collections[product_type_handle].handle == product_type_handle -%}
{%- assign type_url = collections[product_type_handle].url -%}
{%- else -%}
{%- assign type_url = product.type | url_for_type -%}
{%- endif -%}
{{ product.type | link_to: type_url }}
{% endif %}

{% if collection.next_product %}
{% render 'svg-chevron-right' %}
{% endif %}

{{ product.metafields.spr.reviews }}

{% endif %}

{% schema %}
{
"name": "Product pages",
"class": "section-product-template",
"settings": [
{
"type": "checkbox",
"id": "show_tax_and_shipping",
"label": "Show tax status and shipping policy link",
"default": false
},
{
"type": "checkbox",
"id": "show_vendor",
"label": "Show vendor",
"default": true
},
{
"type": "checkbox",
"id": "show_type",
"label": "Show type",
"default": false
},
{
"type": "checkbox",
"id": "show_sku",
"label": "Show SKU",
"default": false
},
{
"type": "checkbox",
"id": "show_quantity_selector",
"label": "Show quantity selector",
"default": true
},
{
"type": "checkbox",
"id": "enable_payment_button",
"label": "Show dynamic checkout button",
"info": "Each customer will see their preferred payment method from those available on your store, such as PayPal or Apple Pay. [Learn more](https://help.shopify.com/manual/using-themes/change-the-layout/dynamic-checkout)",
"default": true
},
{
"type": "checkbox",
"id": "show_backorder_text",
"label": "Show backorder text",
"default": true,
"info": "Only shows for products which use Shopify inventory tracking and are available to purchase when out of stock."
},
{
"type": "checkbox",
"id": "show_inventory_notice",
"label": "Show inventory notice",
"default": false
},
{
"type": "range",
"id": "inventory_notice_threshold",
"min": 0,
"max": 100,
"step": 1,
"label": "Inventory threshold",
"info": "Show inventory quantities below this threshold. Choose 0 to show full amount.",
"default": 10
},
{
"type": "checkbox",
"id": "show_sharing_links",
"label": "Show social sharing icons",
"default": true
},
{
"type": "checkbox",
"id": "show_tags",
"label": "Show tags",
"default": false
},
{
"type": "select",
"id": "description_location",
"label": "Description location",
"default": "beside",
"options": [
{
"value": "beside",
"label": "Beside main image, under price"
},
{
"value": "below",
"label": "Underneath image and price"
}
]
},
{
"type": "header",
"content": "Media"
},
{
"type": "paragraph",
"content": "Learn more about [media types](https://help.shopify.com/en/manual/products/product-media)"
},
{
"type": "radio",
"id": "prod_gall_thumbs_under",
"label": "Thumbnail position",
"info": "On desktop screens",
"options": [
{
"value": "beside",
"label": "Beside main image"
},
{
"value": "under",
"label": "Underneath main image"
}
],
"default": "under"
},
{
"type": "checkbox",
"id": "enable_zoom",
"label": "Enable image zoom",
"default": true
},
{
"type": "checkbox",
"id": "enable_video_looping",
"label": "Enable video looping",
"default": false
}
]
}
{% endschema %}

Hi @JHKCreate , Thanks for sharing the updated code.

I tried using the provided code.

Refer to the below error:

Thanks,

VS

My bad, updated!

{%- assign current_variant = product.selected_or_first_available_variant -%}
{%- assign zoom_size = 'master' -%}

{%- if template contains 'lightbox' -%}
{%- assign in_lightbox = true -%}
{%- else -%}
{%- assign in_lightbox = false -%}
{%- endif -%}

{% if in_lightbox == false %}

{% if section.settings.show_tags and product.tags.size > 0 %}

{{ 'products.product.tags' | t }} +

{% endif %}

{% if section.settings.show_type %}
{%- assign product_type_handle = product.type | handle -%}
{%- if collections[product_type_handle].handle == product_type_handle -%}
{%- assign type_url = collections[product_type_handle].url -%}
{%- else -%}
{%- assign type_url = product.type | url_for_type -%}
{%- endif -%}
{{ 'products.product.see_more_of_this_type' | t }} {{ product.type | link_to: type_url }}
{% endif %}

{% if collection %}

{% if collection.previous_product %}
{{ 'products.product.previous' | t }}
{% endif %}
{% if collection.previous_product and collection.next_product %} / {% endif %}
{% if collection.next_product %}
{{ 'products.product.next' | t }}
{% endif %}

{% endif %}

{% if section.settings.show_tags and product.tags.size > 0 %}

{% for tag in product.tags %}
- {{ tag }}
{% endfor %}

{% endif %}
{%- endif -%}

{%- assign lightbox_size = 'master' -%}
{%- assign min_aspect_ratio = 0.6 -%}

{%- assign featured_media = product.selected_or_first_available_variant.featured_media | default: product.featured_media -%}
{%- for media in product.media -%}
{%- if media.id == featured_media.id -%}
{%- assign initial_slide = forloop.index0 -%}
{%- break -%}
{%- endif -%}
{%- endfor -%}

{%- for media in product.media -%}

{%- if media.media_type == 'image' and section.settings.enable_zoom -%}{%- endif -%}
{%- render 'media', media: media, min_aspect_ratio: min_aspect_ratio -%}
{%- if media.media_type == 'image' and section.settings.enable_zoom -%}{%- endif -%}

{%- endfor -%}

{%- if in_lightbox == false -%}
{%- assign models = product.media | where: 'media_type', 'model' -%}
{% if models.size > 0 %}

{% endif %}
{%- endif -%}

{% if product.media.size > 1 %}

{% for media in product.media %}

{% render 'responsive-image', image: media.preview_image, min_aspect_ratio: min_aspect_ratio %}

{%- if media.media_type == 'video' or media.media_type =='external_video' -%}

{% render 'icon-video-badge-full-color' %}

{%- endif -%}
{%- if media.media_type == 'model' -%}

{% render 'icon-3d-badge-full-color' %}

{%- endif -%}

{% endfor %}

{% endif %}

{%- if settings.swatch_enabled and settings.swatch_images -%}

{%- endif -%}

# {{ product.title }}

{% render 'product-label-detail', product: product, current_variant: current_variant %}

{{ current_variant.price | money }}
{% if current_variant.compare_at_price > current_variant.price %}
{{ current_variant.compare_at_price | money }}
{% endif %}

{% render 'unit-price', variant: current_variant %}

{%- if section.settings.show_tax_and_shipping -%}
{%- if shop.taxes_included or shop.shipping_policy.body != blank -%}

{%- if shop.taxes_included -%}
{{ 'products.product.include_taxes' | t }}
{%- endif -%}
{%- if shop.shipping_policy.body != blank -%}
{{ 'products.product.shipping_policy_html' | t: link: shop.shipping_policy.url }}
{%- endif -%}

{%- endif -%}
{%- endif -%}

{% if section.settings.show_vendor or section.settings.show_sku %}

{%- if section.settings.show_vendor -%}
{%- comment -%}
Do we have a collection that has the same name as our product vendor name?
If we do, let's have the vendor link point to it.
If not, we will point to the automatic vendor collection.
{%- endcomment -%}
{%- assign product_vendor_handle = product.vendor | handle -%}
{%- if collections[product_vendor_handle].handle == product_vendor_handle -%}
{%- assign vendor_url = collections[product_vendor_handle].url -%}
{%- else -%}
{%- assign vendor_url = product.vendor | url_for_vendor -%}
{%- endif -%}

{{ 'products.product.vendor' | t }} {{ product.vendor | link_to: vendor_url }}

{%- endif -%}

{%- if section.settings.show_sku -%}
{{ 'products.product.sku' | t }} {{ product.selected_or_first_available_variant.sku }}

{%- endif -%}

{% endif %}

{% form 'product', product, class: 'form', data-ajax-add-to-cart: true, data-product-id: product.id, data-enable-history-state: 'true' %}

{% if product.variants.size > 1 %}

{% for option in product.options_with_values %}

{% if settings.show_size_chart and option.name == settings.size_chart_variant %}

{{ 'products.product.size_chart' | t }}

{{ pages[settings.size_chart_page].content }}

{% endif %}

{% endfor %}

{% else %}

{% unless product.has_only_default_variant %}

{% for option in product.options %}
{% assign opt_idx = 'option' | append: forloop.index %}

{% if settings.show_size_chart and option == settings.size_chart_variant %}

{{ 'products.product.size_chart' | t }}

{{ pages[settings.size_chart_page].content }}

{% endif %}
{% endfor %}

{% endunless %}

{% endif %}

{% if product.available %}
{% if section.settings.show_inventory_notice %}
{%- capture inventory_notice -%}
{%- if current_variant.inventory_management == 'shopify' and current_variant.inventory_quantity > 0 -%}
{%- if section.settings.inventory_notice_threshold == 0 or current_variant.inventory_quantity <= section.settings.inventory_notice_threshold -%}

{{- 'products.labels.only_x_left' | t: quantity: current_variant.inventory_quantity -}}

{%- else -%}

{%- endif -%}
{%- else -%}

{%- endif -%}
{%- endcapture -%}
{% endif %}

{% unless section.settings.show_quantity_selector %}{{ inventory_notice }}{% endunless %}

{% assign productCollections = product.collections | map:'handle' %}

{% unless productCollections contains child_list_handle %}

{% if section.settings.show_quantity_selector %}

{% render 'svg-minus' %}

{% render 'svg-plus' %}

{% endif %}

{% if section.settings.enable_payment_button %}
{{ form | payment_button }}
{% endif %}

{% if section.settings.show_backorder_text == true %}
{% render 'backorder', product: product, variant: current_variant %}
{% endif %}

{% else %}
{{ 'products.product.product_unavailable' | t }}

{% endform %}

{%endunless%}

{% if productCollections contains child_list_handle %}

{% if section.settings.enable_payment_button %}
{{ form | payment_button }}
{% endif %}

{% if section.settings.show_backorder_text == true %}
{% render 'backorder', product: product, variant: current_variant %}
{% endif %}

{% else %}
{{ 'products.product.product_unavailable' | t }}

{% endif %}
{% endform %}

{%- if template contains 'lightbox' -%}

{%- endif -%}

{% if section.settings.description_location == 'beside' and in_lightbox == false %}
{{ product.description }}

{% comment %} Add code to show under the description on the line below this one, if beside the image {% endcomment %}

{% endif %}

{% if in_lightbox %}

{{ 'products.quick_buy.read_more' | t }}
{% render 'svg-chevron-right' %}

{% else %}
{% if section.settings.show_sharing_links %}

{% render 'social-sharing', share_title: product.title, share_permalink: product.url, share_image: product %}

{% endif %}
{% endif %}

{% if section.settings.description_location == 'below' and in_lightbox == false %}
{{ product.description }}

{% comment %} Add code to show under the description on the line below this one, if full-width underneath the image {% endcomment %}

{% endif %}

{% if in_lightbox == false %}

{% if section.settings.show_tags and product.tags.size > 0 %}

{% for tag in product.tags %}
- {{ tag }}
{% endfor %}

{% endif %}
{% if section.settings.show_sharing_links %}

{% render 'social-sharing', share_title: product.title, share_permalink: product.url, share_image: product %}

{% endif %}

{% if collection.previous_product %}
{% render 'svg-chevron-left' %}
{% endif %}

{%- if section.settings.show_type and product.type != blank -%}
{%- assign product_type_handle = product.type | handle -%}
{%- if collections[product_type_handle].handle == product_type_handle -%}
{%- assign type_url = collections[product_type_handle].url -%}
{%- else -%}
{%- assign type_url = product.type | url_for_type -%}
{%- endif -%}
{{ product.type | link_to: type_url }}
{% endif %}

{% if collection.next_product %}
{% render 'svg-chevron-right' %}
{% endif %}

{{ product.metafields.spr.reviews }}

{% endif %}

{% schema %}
{
"name": "Product pages",
"class": "section-product-template",
"settings": [
{
"type": "checkbox",
"id": "show_tax_and_shipping",
"label": "Show tax status and shipping policy link",
"default": false
},
{
"type": "checkbox",
"id": "show_vendor",
"label": "Show vendor",
"default": true
},
{
"type": "checkbox",
"id": "show_type",
"label": "Show type",
"default": false
},
{
"type": "checkbox",
"id": "show_sku",
"label": "Show SKU",
"default": false
},
{
"type": "checkbox",
"id": "show_quantity_selector",
"label": "Show quantity selector",
"default": true
},
{
"type": "checkbox",
"id": "enable_payment_button",
"label": "Show dynamic checkout button",
"info": "Each customer will see their preferred payment method from those available on your store, such as PayPal or Apple Pay. [Learn more](https://help.shopify.com/manual/using-themes/change-the-layout/dynamic-checkout)",
"default": true
},
{
"type": "checkbox",
"id": "show_backorder_text",
"label": "Show backorder text",
"default": true,
"info": "Only shows for products which use Shopify inventory tracking and are available to purchase when out of stock."
},
{
"type": "checkbox",
"id": "show_inventory_notice",
"label": "Show inventory notice",
"default": false
},
{
"type": "range",
"id": "inventory_notice_threshold",
"min": 0,
"max": 100,
"step": 1,
"label": "Inventory threshold",
"info": "Show inventory quantities below this threshold. Choose 0 to show full amount.",
"default": 10
},
{
"type": "checkbox",
"id": "show_sharing_links",
"label": "Show social sharing icons",
"default": true
},
{
"type": "checkbox",
"id": "show_tags",
"label": "Show tags",
"default": false
},
{
"type": "select",
"id": "description_location",
"label": "Description location",
"default": "beside",
"options": [
{
"value": "beside",
"label": "Beside main image, under price"
},
{
"value": "below",
"label": "Underneath image and price"
}
]
},
{
"type": "header",
"content": "Media"
},
{
"type": "paragraph",
"content": "Learn more about [media types](https://help.shopify.com/en/manual/products/product-media)"
},
{
"type": "radio",
"id": "prod_gall_thumbs_under",
"label": "Thumbnail position",
"info": "On desktop screens",
"options": [
{
"value": "beside",
"label": "Beside main image"
},
{
"value": "under",
"label": "Underneath main image"
}
],
"default": "under"
},
{
"type": "checkbox",
"id": "enable_zoom",
"label": "Enable image zoom",
"default": true
},
{
"type": "checkbox",
"id": "enable_video_looping",
"label": "Enable video looping",
"default": false
}
]
}
{% endschema %}

Hi @JHKCreate , please see the below error:

Thanks,

VS

Third Time’s a charm!

{%- assign current_variant = product.selected_or_first_available_variant -%}
{%- assign zoom_size = 'master' -%}

{%- if template contains 'lightbox' -%}
{%- assign in_lightbox = true -%}
{%- else -%}
{%- assign in_lightbox = false -%}
{%- endif -%}

{% if in_lightbox == false %}

{% if section.settings.show_tags and product.tags.size > 0 %}

{{ 'products.product.tags' | t }} +

{% endif %}

{% if section.settings.show_type %}
{%- assign product_type_handle = product.type | handle -%}
{%- if collections[product_type_handle].handle == product_type_handle -%}
{%- assign type_url = collections[product_type_handle].url -%}
{%- else -%}
{%- assign type_url = product.type | url_for_type -%}
{%- endif -%}
{{ 'products.product.see_more_of_this_type' | t }} {{ product.type | link_to: type_url }}
{% endif %}

{% if collection %}

{% if collection.previous_product %}
{{ 'products.product.previous' | t }}
{% endif %}
{% if collection.previous_product and collection.next_product %} / {% endif %}
{% if collection.next_product %}
{{ 'products.product.next' | t }}
{% endif %}

{% endif %}

{% if section.settings.show_tags and product.tags.size > 0 %}

{% for tag in product.tags %}
- {{ tag }}
{% endfor %}

{% endif %}
{%- endif -%}

{%- assign lightbox_size = 'master' -%}
{%- assign min_aspect_ratio = 0.6 -%}

{%- assign featured_media = product.selected_or_first_available_variant.featured_media | default: product.featured_media -%}
{%- for media in product.media -%}
{%- if media.id == featured_media.id -%}
{%- assign initial_slide = forloop.index0 -%}
{%- break -%}
{%- endif -%}
{%- endfor -%}

{%- for media in product.media -%}

{%- if media.media_type == 'image' and section.settings.enable_zoom -%}{%- endif -%}
{%- render 'media', media: media, min_aspect_ratio: min_aspect_ratio -%}
{%- if media.media_type == 'image' and section.settings.enable_zoom -%}{%- endif -%}

{%- endfor -%}

{%- if in_lightbox == false -%}
{%- assign models = product.media | where: 'media_type', 'model' -%}
{% if models.size > 0 %}

{% endif %}
{%- endif -%}

{% if product.media.size > 1 %}

{% for media in product.media %}

{% render 'responsive-image', image: media.preview_image, min_aspect_ratio: min_aspect_ratio %}

{%- if media.media_type == 'video' or media.media_type =='external_video' -%}

{% render 'icon-video-badge-full-color' %}

{%- endif -%}
{%- if media.media_type == 'model' -%}

{% render 'icon-3d-badge-full-color' %}

{%- endif -%}

{% endfor %}

{% endif %}

{%- if settings.swatch_enabled and settings.swatch_images -%}

{%- endif -%}

# {{ product.title }}

{% render 'product-label-detail', product: product, current_variant: current_variant %}

{{ current_variant.price | money }}
{% if current_variant.compare_at_price > current_variant.price %}
{{ current_variant.compare_at_price | money }}
{% endif %}

{% render 'unit-price', variant: current_variant %}

{%- if section.settings.show_tax_and_shipping -%}
{%- if shop.taxes_included or shop.shipping_policy.body != blank -%}

{%- if shop.taxes_included -%}
{{ 'products.product.include_taxes' | t }}
{%- endif -%}
{%- if shop.shipping_policy.body != blank -%}
{{ 'products.product.shipping_policy_html' | t: link: shop.shipping_policy.url }}
{%- endif -%}

{%- endif -%}
{%- endif -%}

{% if section.settings.show_vendor or section.settings.show_sku %}

{%- if section.settings.show_vendor -%}
{%- comment -%}
Do we have a collection that has the same name as our product vendor name?
If we do, let's have the vendor link point to it.
If not, we will point to the automatic vendor collection.
{%- endcomment -%}
{%- assign product_vendor_handle = product.vendor | handle -%}
{%- if collections[product_vendor_handle].handle == product_vendor_handle -%}
{%- assign vendor_url = collections[product_vendor_handle].url -%}
{%- else -%}
{%- assign vendor_url = product.vendor | url_for_vendor -%}
{%- endif -%}

{{ 'products.product.vendor' | t }} {{ product.vendor | link_to: vendor_url }}

{%- endif -%}

{%- if section.settings.show_sku -%}
{{ 'products.product.sku' | t }} {{ product.selected_or_first_available_variant.sku }}

{%- endif -%}

{% endif %}

{% form 'product', product, class: 'form', data-ajax-add-to-cart: true, data-product-id: product.id, data-enable-history-state: 'true' %}

{% if product.variants.size > 1 %}

{% for option in product.options_with_values %}

{% if settings.show_size_chart and option.name == settings.size_chart_variant %}

{{ 'products.product.size_chart' | t }}

{{ pages[settings.size_chart_page].content }}

{% endif %}

{% endfor %}

{% else %}

{% unless product.has_only_default_variant %}

{% for option in product.options %}
{% assign opt_idx = 'option' | append: forloop.index %}

{% if settings.show_size_chart and option == settings.size_chart_variant %}

{{ 'products.product.size_chart' | t }}

{{ pages[settings.size_chart_page].content }}

{% endif %}
{% endfor %}

{% endunless %}

{% endif %}

{% if product.available %}
{% if section.settings.show_inventory_notice %}
{%- capture inventory_notice -%}
{%- if current_variant.inventory_management == 'shopify' and current_variant.inventory_quantity > 0 -%}
{%- if section.settings.inventory_notice_threshold == 0 or current_variant.inventory_quantity <= section.settings.inventory_notice_threshold -%}

{{- 'products.labels.only_x_left' | t: quantity: current_variant.inventory_quantity -}}

{%- else -%}

{%- endif -%}
{%- else -%}

{%- endif -%}
{%- endcapture -%}
{% endif %}
  
{% assign productCollections = product.collections | map:'handle' %}

{% unless section.settings.show_quantity_selector %}{{ inventory_notice }}{% endunless %}

{% unless productCollections contains child_list_handle %}
 

{% if section.settings.show_quantity_selector %}

{% render 'svg-minus' %}

{% render 'svg-plus' %}

{% endif %}

{% if section.settings.enable_payment_button %}
{{ form | payment_button }}
{% endif %}

{% if section.settings.show_backorder_text == true %}
{% render 'backorder', product: product, variant: current_variant %}
{% endif %}

{% else %}
{{ 'products.product.product_unavailable' | t }}

{%endunless%}
  
  {% if productCollections contains child_list_handle %}
 

{% if section.settings.show_quantity_selector %}

{% endif %}

{% if section.settings.enable_payment_button %}
{{ form | payment_button }}
{% endif %}

{% if section.settings.show_backorder_text == true %}
{% render 'backorder', product: product, variant: current_variant %}
{% endif %}

{% else %}
{{ 'products.product.product_unavailable' | t }}

{%endif%}
  
{% endif %}
{% endform %}

{%- if template contains 'lightbox' -%}

{%- endif -%}

{% if section.settings.description_location == 'beside' and in_lightbox == false %}
{{ product.description }}

{% comment %} Add code to show under the description on the line below this one, if beside the image {% endcomment %}

{% endif %}

{% if in_lightbox %}

{{ 'products.quick_buy.read_more' | t }}
{% render 'svg-chevron-right' %}

{% else %}
{% if section.settings.show_sharing_links %}

{% render 'social-sharing', share_title: product.title, share_permalink: product.url, share_image: product %}

{% endif %}
{% endif %}

{% if section.settings.description_location == 'below' and in_lightbox == false %}
{{ product.description }}

{% comment %} Add code to show under the description on the line below this one, if full-width underneath the image {% endcomment %}

{% endif %}

{% if in_lightbox == false %}

{% if section.settings.show_tags and product.tags.size > 0 %}

{% for tag in product.tags %}
- {{ tag }}
{% endfor %}

{% endif %}
{% if section.settings.show_sharing_links %}

{% render 'social-sharing', share_title: product.title, share_permalink: product.url, share_image: product %}

{% endif %}

{% if collection.previous_product %}
{% render 'svg-chevron-left' %}
{% endif %}

{%- if section.settings.show_type and product.type != blank -%}
{%- assign product_type_handle = product.type | handle -%}
{%- if collections[product_type_handle].handle == product_type_handle -%}
{%- assign type_url = collections[product_type_handle].url -%}
{%- else -%}
{%- assign type_url = product.type | url_for_type -%}
{%- endif -%}
{{ product.type | link_to: type_url }}
{% endif %}

{% if collection.next_product %}
{% render 'svg-chevron-right' %}
{% endif %}

{{ product.metafields.spr.reviews }}

{% endif %}

{% schema %}
{
"name": "Product pages",
"class": "section-product-template",
"settings": [
{
"type": "checkbox",
"id": "show_tax_and_shipping",
"label": "Show tax status and shipping policy link",
"default": false
},
{
"type": "checkbox",
"id": "show_vendor",
"label": "Show vendor",
"default": true
},
{
"type": "checkbox",
"id": "show_type",
"label": "Show type",
"default": false
},
{
"type": "checkbox",
"id": "show_sku",
"label": "Show SKU",
"default": false
},
{
"type": "checkbox",
"id": "show_quantity_selector",
"label": "Show quantity selector",
"default": true
},
{
"type": "checkbox",
"id": "enable_payment_button",
"label": "Show dynamic checkout button",
"info": "Each customer will see their preferred payment method from those available on your store, such as PayPal or Apple Pay. [Learn more](https://help.shopify.com/manual/using-themes/change-the-layout/dynamic-checkout)",
"default": true
},
{
"type": "checkbox",
"id": "show_backorder_text",
"label": "Show backorder text",
"default": true,
"info": "Only shows for products which use Shopify inventory tracking and are available to purchase when out of stock."
},
{
"type": "checkbox",
"id": "show_inventory_notice",
"label": "Show inventory notice",
"default": false
},
{
"type": "range",
"id": "inventory_notice_threshold",
"min": 0,
"max": 100,
"step": 1,
"label": "Inventory threshold",
"info": "Show inventory quantities below this threshold. Choose 0 to show full amount.",
"default": 10
},
{
"type": "checkbox",
"id": "show_sharing_links",
"label": "Show social sharing icons",
"default": true
},
{
"type": "checkbox",
"id": "show_tags",
"label": "Show tags",
"default": false
},
{
"type": "select",
"id": "description_location",
"label": "Description location",
"default": "beside",
"options": [
{
"value": "beside",
"label": "Beside main image, under price"
},
{
"value": "below",
"label": "Underneath image and price"
}
]
},
{
"type": "header",
"content": "Media"
},
{
"type": "paragraph",
"content": "Learn more about [media types](https://help.shopify.com/en/manual/products/product-media)"
},
{
"type": "radio",
"id": "prod_gall_thumbs_under",
"label": "Thumbnail position",
"info": "On desktop screens",
"options": [
{
"value": "beside",
"label": "Beside main image"
},
{
"value": "under",
"label": "Underneath main image"
}
],
"default": "under"
},
{
"type": "checkbox",
"id": "enable_zoom",
"label": "Enable image zoom",
"default": true
},
{
"type": "checkbox",
"id": "enable_video_looping",
"label": "Enable video looping",
"default": false
}
]
}
{% endschema %}

@JHKCreate I tried it implementing the logic. But it is displaying “the product is not available” below the ADD TO CART" button.

The requirement is to hide Quantity Box so that users cant select quantity as for my “Originals” collection, there is always one product. I hope this makes sense.

Let me know if you need additional information.

Looking forward to hearing from you.

Would you mind giving me collaborator access to the Shop so I can fix this quickly? I’m afraid that I need to have a live demo of the changes since the logic seems to be based on different elements as well. Let me know if it’s ok with you and I’ll send an invite

How do i provide the collabrative access?

I have to keep in mind that my online store is live at the moment!

My current online store should not get affected.

Thanks,

VS

Sent you a request for collaborator access. You can check it in “Settings” → “Plans & Permissions”

I will implement the code, confirm and let you know.

Ok Fixed it!

Please preview the “Copy Of Symmetry” theme so I can deploy the code live :slightly_smiling_face:

Cheers!

Thanks @JHKCreate for making the change.

I noticed that we need to make one more change for the “Shopping Cart” page. We need to remove the quantity box from here as well for this “Originals” collection.

Refer to the below image:

Done! Let’s validate please :wink:

Thanks @JHKCreate for fixing this !

It worked.

Can you please provide me details like where exactly you made the changes, am curious because I am aslo software developer.

Looking forward hearing from you.