Hi, I’m using the theme Impulse and would like to remove the quantity selector for a specific product.
I understand that I can use the unless code on certain product tags for this. But I can’t find where to add this code.
Can someone offer any advice? Thank you.
Hi @8corners
On the latest version of the Impulse theme, you will find the quantity selector code in the product-template.liquid file in the snippets folder.
It looks like this:
{%- when 'quantity_selector' -%}
{% assign qty_id = section_id | append: product.id %}
{%- render 'quantity-input', form_id: form_id, id: qty_id, qty: 1, min: 1 -%}
, and it’s on the line 218.
You code would look something like this
{%- when 'quantity_selector' -%}
{% unless product.tags contains "" %}
Make sure to close the unless tag with:
{% endunless %}
just above this line of code:
{%- when ‘variant_picker’ -%}
Hopefully that helps.
Hi @Developden ,
Thank you for your reply. I couldn’t find the quantity selector code on the product template for some reason. Could you advise what to do in this case?
Thank you,
@8corners
Can you please either upload the product-template.liquid file in the reply or let me know which version the theme is on.
Hi,
Here is our product liquid template.
{% unless thumbnail_position %}
{%- assign thumbnail_position = 'beside' -%}
{% endunless %}
{%- assign product_img_structure = product.featured_image | img_url: '1x1' | replace: '_1x1.', '_{width}x.' -%}
{% include 'product-template-variables' %}
{% if image_position == 'left' %}
{% include 'product-images', section_id: section_id, isModal: isModal, thumbnail_position: thumbnail_position %}
{% endif %}
{% if settings.show_breadcrumbs and isModal != true %}
{% include 'breadcrumbs' %}
{% endif %}
{% if settings.vendor_enable %}
{{ product.vendor }}
{% endif %}
{% if isModal %}
{{ product.title }}
{% else %}
# {{ product.title }}
{% endif %}
{% if settings.enable_product_reviews and settings.reviews_layout == 'full' %}
{% if isModal %}
{%- assign review_link = product.url | within: collection | append: '#Reviews-' | append: product.id -%}
{% else %}
{%- assign review_link = '#Reviews-' | append: product.id -%}
{% endif %}
{% endif %}
{% if settings.sku_enable %}
{% if current_variant.sku %}
{{ current_variant.sku }}
{% endif %}
{% endif %}
{%- assign hide_sale_price = true -%}
{% if product.compare_at_price_max > product.price %}
{% if current_variant.compare_at_price > current_variant.price %}
{%- assign hide_sale_price = false -%}
{% endif %}
{{ 'products.general.regular_price' | t }}
{% if current_variant.compare_at_price > current_variant.price %}
{{ current_variant.compare_at_price | money }}
{% endif %}
{{ 'products.general.sale_price' | t }}
{% else %}
{{ 'products.general.regular_price' | t }}
{% endif %}
{{ current_variant.price | money }}
{% if settings.product_save_amount %}
{% if settings.product_save_type == 'dollar' %}
{% capture saved_amount %}{{ current_variant.compare_at_price | minus: current_variant.price | money }}{% endcapture %}
{% else %}
{% capture saved_amount %}{{ current_variant.compare_at_price | minus: current_variant.price | times: 100.0 | divided_by: current_variant.compare_at_price | round }}%{% endcapture %}
{% endif %}
{{ 'products.general.save_html' | t: saved_amount: saved_amount }}
{% endif %}
{% if settings.inventory_enable %}
{%- assign inventory_visible = false -%}
{% if current_variant.inventory_management == 'shopify' %}
{% if current_variant.inventory_quantity < 10 %}
{%- assign inventory_visible = true -%}
{% endif %}
{% endif %}
{% if current_variant.inventory_quantity == 0 %}
{%- assign inventory_visible = false -%}
{% endif %}
{% endif %}
---
{% unless isModal %}
{% comment %}
Shopify's product form attaches a number of tracking
scripts that cause slower load times and false statistics.
Quick view modals request these on-demand.
{% endcomment %}
{% include 'product-form', section_id: section_id %}
{% else %}
{% endunless %}
{% unless section.settings.description_style == 'full' %}
{{ product.description }}
{% include 'product-additional-content', section_id: section_id %}
{% endunless %}
{% if social %}
{% include 'social-sharing', share_title: product.title, share_permalink: product.url, share_image: product %}
{% endif %}
{% unless image_position == 'left' %}
{% include 'product-images', section_id: section_id, isModal: isModal, thumbnail_position: thumbnail_position %}
{% endunless %}
{% if section.settings.description_style == 'full' %}
{{ product.description }}
{% include 'product-additional-content', section_id: section_id %}
{% endif %}