SOLVED: How to set up minimum order quantities for each product

Highlighted
Totally understand.

Do you have a lot of apps on the site?  What is the URL?  I can check it
out.
James Byrne, Owner, Information Architect (USMC VET)
After Dark Grafx - Since 1992
"We Work After Dark, So You Don't Have To!"
https://www.afterdarkgrafx.com

Services: Website Design, Mobile App Development (iOS, Android, Windows), Ecommerce, Magento, Shopify, Miva, BigCommerce, Search Engine Optimization, Wordpress, Hosting, Graphic Design, Merchant Accounts, Consulting and all things web related!

Certified Partner/Developer/Affiliates: Shopify, Google Integrator, Wordpress, Zoho, AuthorizeNet, Geotrust and a Member of the San Diego Regional Chamber of Commerce, Veteran Owned Businesses, Veteran's In Business Network.

I also build custom apps for Shopify!
0 Likes
Highlighted
New Member
3 0 0

No apps yet, just building it out. Trying to figure out how to do minimum order and discounts for multiple purchases. I'll look at an app that can maybe do both. Thanks!

0 Likes
Highlighted
Correct.
It is best to use apps instead of tweaking the code unless you already
know which direction you are going.

A) build out your site
B) add the necessary apps to get the site working the way you want
C) THEN... go back and implement custom code to do whatever you need
done (meaning, get rid of the app(s) if you don't need them because of a
custom solution via code works better.

This is a better approach so that you can launch the site, test it and
see if it is something that you need.  If so, you can then reach out to
an expert (like me) or any others to get a custom solution implemented
that will work and be a one time cost and not a subscription.

Make  CENTS?  <--  yes on purpose...
James Byrne, Owner, Information Architect (USMC VET)
After Dark Grafx - Since 1992
"We Work After Dark, So You Don't Have To!"
https://www.afterdarkgrafx.com

Services: Website Design, Mobile App Development (iOS, Android, Windows), Ecommerce, Magento, Shopify, Miva, BigCommerce, Search Engine Optimization, Wordpress, Hosting, Graphic Design, Merchant Accounts, Consulting and all things web related!

Certified Partner/Developer/Affiliates: Shopify, Google Integrator, Wordpress, Zoho, AuthorizeNet, Geotrust and a Member of the San Diego Regional Chamber of Commerce, Veteran Owned Businesses, Veteran's In Business Network.

I also build custom apps for Shopify!
0 Likes
Highlighted
Tourist
7 0 0

Thank you for this solution! What I noticed however is that there is an additional piece of code between the end of your add-on and the rest of the default code:

<input type="number" id="Quantity-{{ section.id }}"
                    name="quantity" value="1" min="1" pattern="[0-9]*"
                    class="product-form__input product-form__input--quantity" data-quantity-input
                  >

How should this be treated? I've commented it out and that seems to work fine.

 

Would also greatly appreciate your help in implementing this on the cart, if you're willing.

0 Likes
Highlighted

Excellent! If it is working for you - then you are good to go. I may have added it accidentally.  As per the cart implementation, let me know the url and I will check out the store. Is it using Debut or other free theme?  

 

The other issue is, that this would be on on a product by product basis so it may not function correctly.

 

Lastly, if you are trying this yourself, see Jason's Code from 11-06-2016 08:41 AM on this page

 

https://community.shopify.com/c/Shopify-Design/DO-NOT-include-snippet-on-cart-page-based-on-item-s-i...

 

He is using it differently with different tags, but it gives you an idea of how it should work. You would then wrap the quantity and tags within the loop.

 

James

James Byrne, Owner, Information Architect (USMC VET)
After Dark Grafx - Since 1992
"We Work After Dark, So You Don't Have To!"
https://www.afterdarkgrafx.com

Services: Website Design, Mobile App Development (iOS, Android, Windows), Ecommerce, Magento, Shopify, Miva, BigCommerce, Search Engine Optimization, Wordpress, Hosting, Graphic Design, Merchant Accounts, Consulting and all things web related!

Certified Partner/Developer/Affiliates: Shopify, Google Integrator, Wordpress, Zoho, AuthorizeNet, Geotrust and a Member of the San Diego Regional Chamber of Commerce, Veteran Owned Businesses, Veteran's In Business Network.

I also build custom apps for Shopify!
0 Likes
Highlighted
Tourist
7 0 0

Thanks James! The site is www.p3gear.com but not launched yet. How can I get you a password if you want to check it out?

 

As for Jason's solution, I need to look at that closely to see how I can incorporate it. Basically I want to either disallow the ability to change the quantity in the cart or better yet, throw an error and block moving forward with Checkout.

0 Likes
Highlighted

@utopiastudios sent dm

James Byrne, Owner, Information Architect (USMC VET)
After Dark Grafx - Since 1992
"We Work After Dark, So You Don't Have To!"
https://www.afterdarkgrafx.com

Services: Website Design, Mobile App Development (iOS, Android, Windows), Ecommerce, Magento, Shopify, Miva, BigCommerce, Search Engine Optimization, Wordpress, Hosting, Graphic Design, Merchant Accounts, Consulting and all things web related!

Certified Partner/Developer/Affiliates: Shopify, Google Integrator, Wordpress, Zoho, AuthorizeNet, Geotrust and a Member of the San Diego Regional Chamber of Commerce, Veteran Owned Businesses, Veteran's In Business Network.

I also build custom apps for Shopify!
0 Likes
Highlighted
New Member
1 0 0

@After_Dark_Graf 

Thanks for the code. When I add this to my products page for a tag it creates two quantities. The previous quantity and the new min quantity box?

0 Likes
Highlighted
New Member
2 0 0

Thank you James after fiddling a little, your code works, there was a glitch at first (2 quantity forms on the product page like the person above got (@simplystuck ) , I had to comment out the next line after your code to make it disappear. 

 

so I ended up with this : 

 

{% include 'product-template-min-qty' %}
<!-- <input type="number" min="1" size="2" class="quantity" name="quantity" id="quantity" value="1" {% if settings.limit_quantity and variant.inventory_management != blank and variant.inventory_policy == "deny" %}max="{{ variant.inventory_quantity }}"{% endif %} /> --!>

 

Thanks a lot for that elegant piece of code !!

 

0 Likes
Highlighted
You are most welcome.
James Byrne, Owner, Information Architect (USMC VET)
After Dark Grafx - Since 1992
"We Work After Dark, So You Don't Have To!"
https://www.afterdarkgrafx.com

Services: Website Design, Mobile App Development (iOS, Android, Windows), Ecommerce, Magento, Shopify, Miva, BigCommerce, Search Engine Optimization, Wordpress, Hosting, Graphic Design, Merchant Accounts, Consulting and all things web related!

Certified Partner/Developer/Affiliates: Shopify, Google Integrator, Wordpress, Zoho, AuthorizeNet, Geotrust and a Member of the San Diego Regional Chamber of Commerce, Veteran Owned Businesses, Veteran's In Business Network.

I also build custom apps for Shopify!
0 Likes