MOQ

MandyRenee56
Excursionist
38 0 3

I'm trying to figure out how to set up an MOQ for my products. They are seriously discounted and I'd like to set an MOQ of $25 in order for them to place and order. Is there an app, or a way to make this happen? Someone once told me that I'd have to make a box on the checkout page that stated "I have at least $25 in my cart" and customers would have to click that box in order to proceed with their order. Any help, suggestions are greatly appreciated, thank you! 

Replies 2 (2)
PaulNewton
Shopify Partner
5516 500 1132

Hi @MandyRenee56 Here is starting code you can use in a themes cart template

Always backup themes and files before making changes

Merchants that want this customization can contact me at paull.newton+shopifyforums@gmail.com with store url, storefront-pass,theme name, and this topic url and any other details.

Find your relevant cart template files and configure the deal_minimum_price in cents , and deal_product_handle to the product handle.

Then wrap the cart checkout buttons code in an if statement checking deal_minimum_price_eligible to show buttons when a cart is eligible, there's example logic at the end.

Note this is a basic example and will not work with variants that have custom line item properties, nor may work with some themes ajax carts or other complexities.

 

{%- comment -%}Author Paul Newton paull.newton+shopifyforums@gmail.com {%- endcomment -%}
{%- assign deal_minimum_type = "price"-%}
{% comment %}{%- assign deal_minimum_type = "quantity"-%}{% endcomment %}

{%- comment -%}shopify is in cents no dollars{%- endcomment -%}
{%- assign deal_minimum_price = 1000 -%}
{% comment %}{%- assign deal_minimum_quantity = 3 -%}{% endcomment %}
{%- assign deal_product_handle = "handle-of-discountable-product" -%}

{%- for item in cart.items -%}
    {%- if item.product.handle == deal_product_handle -%}
        {%- assign deal_product_is_in_cart = true -%}

        {%- case deal_minimum_type -%}
            {%- when 'price' -%}
                {%- assign deal_line_item_total = item.price | times: item.quantity -%}
                {%- assign deal_minimum_price_eligible = false -%}
                {%- if deal_line_item_total < deal_minimum_quantity -%}
                    {%- comment -%}logic for when deal product is not in the cart{%- endcomment -%}
                    <h1>Buy at least {{ deal_minimum_price | money }} , to get the deal </h1>
                    {%- elsif deal_line_item_total >= deal_minimum_quantity -%}
                    {%- assign deal_minimum_price_eligible = true -%}

                {%- endif -%}
            {%- when 'quantity' -%}
                {%- if item.quantity < deal_minimum_quantity -%}
                    <h1>Buy {{ deal_minimum_quantity }} more, to get 1 Free </h1>
                {%- endif -%}
            
        {%- endcase -%}
    {%- endif -%}
{%- endfor -%}

{%- if deal_product_is_in_cart -%}
    {%- comment -%}logic for when deal product is in the cart{%- endcomment -%}
{%- endif -%}
{%- if deal_product_is_in_cart == false -%}
    {%- comment -%}logic for when deal product is NOT in the cart{%- endcomment -%}
{%- endif -%}

{%- if deal_minimum_price_eligible -%}
    {%- comment -%}logic for when deal price minimum is met {%- endcomment -%}
{%- endif -%}
{%- if deal_minimum_price_eligible == false -%}
    {%- comment -%}logic for when deal price minimum is NOT met {%- endcomment -%}
{%- endif -%}

 

 

New Feature: Automatic free shipping discounts


Confused? Busy? Get the solution you need paull.newton+shopifyforum@gmail.com


Problem Solved? ✔Accept and Like solutions to help future merchants

Answers powered by coffee Buy Paul a Coffee for more answers or donate to eff.org


Defeat problems ,Learn To Ask Questions The Smart Way

Touhiid
Shopify Partner
50 8 9

Hello @MandyRenee56

Have you found any solution for the issue that you are experiencing now? If not, You can check out MultiVariants - Bulk order. It does the same thing that you are trying to do.

If I am not wrong, you want to set MOV(Minimum Order Value) not MOQ(Minimum Order Quantity). Using MultiVariants you can set both, minimum order value and minimum order quantity.  After completing some simple setup at the app backend, it will display all the product variants on the product page and set a minimum/maximum order value. 

Also, if you’re looking for a minimum order quantity, it is also possible with the app.

 

In addition, This app also offers to add a custom text field for every variant, its UI can be changeable upon your theme, variants option display styles (Grid/box, Swatch, List, and Select layout), etc.

 

Have a look at this Sample Product that has a minimum order value of $25, so customers can’t place an order unless the total price is at least $25. 

Minimum order value with MultiVariants - Bulk OrderMinimum order value with MultiVariants - Bulk Order

 

Touhid | eFoli
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- Checkout our apps:Inkybay || MultiVariants