How To Set Up Minimum Order Quantities For Each Product in Empire Theme per tag

Hey guys. Can anyone save me? I’m trying to solve this problem myself. I tried with some apps, but despite solving this problem, they created another one. So I need to configure it in code. Has anyone made this change in Empire Theme? I need to apply it on the product page, collection page, and cart.

I need to set up minimum order quantities (with multiples) for each product per tag.
(example tag: minqty:10 for products that are sold with a minimum order of 10 pieces… in this case, a minimum of 10 pieces and in multiples of 10 (10-20-30-40).

Thanks for your attention!

Here’s how I would approach this:

  1. Tag the products according to their minimums

  2. Add code to the product page to tell the customer the minimum

  3. Add a script that prevents adding to cart and triggers a warning message when the user tries to add to the cart under the minimum.

Example code snippet for #2

{% if product.tags contains "minimum 10" %}

This product requires a minimum quantity of 10 units

{% endif %}

Example code snippet for #3

{% if product.tags contains "minimum 10" %}

This product requires a minimum of 10 units

{% endif %}

I would add those either above or below the add to cart button. If you share this with your developer they should know what to do.

If you don’t have a developer, you can take a crack at it but make sure you do this on a backup theme and test first (this guide will help you with theme editing plus inspecting elements to get their ID: https://speedboostr.com/how-to-safely-edit-your-shopify-theme/), or if you want feel free to reach out to my team at speedboostr.com/contact if you want a Shopify developer to handle it for you.

1 Like

@ana_vasbr Have you got your solution? If not then your requirements can be fulfilled with the MultiVariants - Bulk order app. But this app will only work on the product page and cart page, not on the collection page. If it suits your business then you can go ahead with the solution. For the collection page, the app will either block the add to cart button where you have applied the restriction or restrict your customer on the cart page unless the condition is fulfilled.

Through the MultiVariants - Bulk order app, you can set a minimum quantity per order for any product. If you set the minimum quantity as 10 then the customer can’t go to the cart page without choosing 10 quantities. Also, if you want to set a multiple quantity increase for the product then that can be also achieved by the app. If you set the quantity interval as 10 then it will increase like 10,20,30 and so on. After choosing any quantity the stock will be updated immediately. You set different restrictions for different products or groups of products in your store.

Also, with this app, you can apply restrictions for minimum-maximum quantities, predefined bundle, interval quantities, limits on variants and orders can be achieved. You’ll get 3 days of trial for going through all the available features.

Here is the Demo product where the customer must choose 12 items before going to the cart page and here is the Demo store with more available features.

1 Like

I am using the Simple theme and trying to set a minimum order quantity on specific items, I am not a developer so am unsure where to add the code to the product-template.liquid
Hoping you can advise where to place it, below is the current code.

"

{% comment %}
Get first variant in stock, or deep linked one
{% endcomment %}
{% assign current_variant = product.selected_or_first_available_variant %}
{%- assign featured_image = current_variant.featured_image | default: product.featured_image -%}

{% for image in product.images %} {% capture img_id %}ProductImage-{{ image.id }}{% endcapture %} {% capture wrapper_id %}ProductImageWrapper-{{ image.id }}{% endcapture %} {%- assign img_url = image | img_url: '1x1' | replace: '_1x1.', '_{width}x.' -%}

{% include ‘image-style’ with image: image, width: 720, height: 600, small_style: true, wrapper_id: wrapper_id, img_id: img_id %}

{{ image.alt | escape }}
{{ product.metafields.spr.reviews }}
{% if product.compare_at_price_max > product.price %} {{ 'products.product.on_sale' | t }} {% endif %}
{% endfor %} {{ featured_image.alt | escape }}

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

    {% case product.images.size %} {% when 2 %} {% assign thumbnail_width = 'small--one-half medium-up--push-one-sixth medium-up--one-third' %} {% when 4 %} {% assign thumbnail_width = 'small--one-half medium-up--one-quarter' %} {% else %} {% assign thumbnail_width = 'small--one-third medium-up--one-third' %} {% endcase %}

    {% for image in product.images %}

  • {{ image.alt | escape }}
  • {% endfor %}
{% endif %}

{% if section.settings.product_image_zoom_type == ‘lightbox’ %}

    {% for image in product.images %}
  • {% endfor %}
{% endif %}

{{ product.title }}

SKU:
{% assign current_variant = product.selected_or_first_available_variant %}
{{ current_variant.sku }}

{% if section.settings.vendor_show %}

{{ product.vendor }}

{% endif %}

{% if product.compare_at_price_max > product.price %} {{ 'products.product.sale_price' | t }} {% else %} {{ 'products.product.regular_price' | t }} {% endif %} {{ current_variant.price | money }}

{% if product.compare_at_price_max > product.price %}
{{ ‘products.product.regular_price’ | t }}

{{ current_variant.compare_at_price | money }}

{% endif %}

{% comment %} Inventory tracking on product page {% endcomment %}
{% if current_variant.inventory_management == 'shopify' and current_variant.inventory_policy != 'continue' %} We have {{ current_variant.inventory_quantity }} in stock. {% else %} This product is available. {% endif %}
Weight each: {{ product.variants.first.weight | weight_with_unit }} approx.
{%- 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 -%}

{% form ‘product’, product, class: ‘product-form’ %}

{% if section.settings.product_quantity_enable %}

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

{% if section.settings.product_description_position == ‘right’ %}
{%- assign position = ‘right’ -%}
{% include ‘product-description’ %}
{% endif %}

{% if section.settings.social_sharing_products %}
{% include ‘social-sharing’, share_title: product.title, share_permalink: product.url, share_image: product %}
{% endif %}

{%- if collection.previous_product %} {{ '← PREVIOUS' | link_to: collection.previous_product }} {% endif -%} {%- if collection.next_product %} {{ 'NEXT →' | link_to: collection.next_product }} {% endif -%}

{% if section.settings.product_description_position == ‘below’ %}
{%- assign position = ‘below’ -%}
{% include ‘product-description’ %}
{% endif %}

{% include ‘related-products’ %}

{% unless product == empty %}

{% endunless %}

"

Thanks in advance!

I am using the Simple theme and want to set a minimum order quantity on certain products but cannot work out where to place the code. Could you advise where to place the code, in the below current product-template.liquid

"

{% comment %}
Get first variant in stock, or deep linked one
{% endcomment %}
{% assign current_variant = product.selected_or_first_available_variant %}
{%- assign featured_image = current_variant.featured_image | default: product.featured_image -%}

{% for image in product.images %} {% capture img_id %}ProductImage-{{ image.id }}{% endcapture %} {% capture wrapper_id %}ProductImageWrapper-{{ image.id }}{% endcapture %} {%- assign img_url = image | img_url: '1x1' | replace: '_1x1.', '_{width}x.' -%}

{% include ‘image-style’ with image: image, width: 720, height: 600, small_style: true, wrapper_id: wrapper_id, img_id: img_id %}

{{ image.alt | escape }}
{{ product.metafields.spr.reviews }}
{% if product.compare_at_price_max > product.price %} {{ 'products.product.on_sale' | t }} {% endif %}
{% endfor %} {{ featured_image.alt | escape }}

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

    {% case product.images.size %} {% when 2 %} {% assign thumbnail_width = 'small--one-half medium-up--push-one-sixth medium-up--one-third' %} {% when 4 %} {% assign thumbnail_width = 'small--one-half medium-up--one-quarter' %} {% else %} {% assign thumbnail_width = 'small--one-third medium-up--one-third' %} {% endcase %}

    {% for image in product.images %}

  • {{ image.alt | escape }}
  • {% endfor %}
{% endif %}

{% if section.settings.product_image_zoom_type == ‘lightbox’ %}

    {% for image in product.images %}
  • {% endfor %}
{% endif %}

{{ product.title }}

SKU:
{% assign current_variant = product.selected_or_first_available_variant %}
{{ current_variant.sku }}

{% if section.settings.vendor_show %}

{{ product.vendor }}

{% endif %}

{% if product.compare_at_price_max > product.price %} {{ 'products.product.sale_price' | t }} {% else %} {{ 'products.product.regular_price' | t }} {% endif %} {{ current_variant.price | money }}

{% if product.compare_at_price_max > product.price %}
{{ ‘products.product.regular_price’ | t }}

{{ current_variant.compare_at_price | money }}

{% endif %}

{% comment %} Inventory tracking on product page {% endcomment %}
{% if current_variant.inventory_management == 'shopify' and current_variant.inventory_policy != 'continue' %} We have {{ current_variant.inventory_quantity }} in stock. {% else %} This product is available. {% endif %}
Weight each: {{ product.variants.first.weight | weight_with_unit }} approx.
{%- 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 -%}

{% form ‘product’, product, class: ‘product-form’ %}

{% if section.settings.product_quantity_enable %}

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

{% if section.settings.product_description_position == ‘right’ %}
{%- assign position = ‘right’ -%}
{% include ‘product-description’ %}
{% endif %}

{% if section.settings.social_sharing_products %}
{% include ‘social-sharing’, share_title: product.title, share_permalink: product.url, share_image: product %}
{% endif %}

{%- if collection.previous_product %} {{ '← PREVIOUS' | link_to: collection.previous_product }} {% endif -%} {%- if collection.next_product %} {{ 'NEXT →' | link_to: collection.next_product }} {% endif -%}

{% if section.settings.product_description_position == ‘below’ %}
{%- assign position = ‘below’ -%}
{% include ‘product-description’ %}
{% endif %}

{% include ‘related-products’ %}

{% unless product == empty %}

{% endunless %}

"

Thanks in advance!