Make the default quantity to be 3 of my products

Make the default quantity to be 3 of my products

JesusGomicare
Excursionist
40 0 5

Hi guys,

 

I want to make the default quantity in the selector to be 3 when people enter a product page.

 

How can I do so?

 

Thanks

Replies 9 (9)

namphan
Shopify Partner
2572 335 380

Hi @JesusGomicare,

Please go to Actions > Edit code > Sections > main-product.liquid file, find 'quantity__input' and change code here:

Screenshot.png

Code:

{{ product.selected_or_first_available_variant.quantity_rule.min }} => 3
Coffee tips fuels my dedication.
Shopify Development Service
PageFly Page Builder Optimize your Shopify store (Free plan available)
Need help with your store? namphan992@gmail.com
namphan
Shopify Partner
2572 335 380

Hi @JesusGomicare,

Have you tried testing it?

Coffee tips fuels my dedication.
Shopify Development Service
PageFly Page Builder Optimize your Shopify store (Free plan available)
Need help with your store? namphan992@gmail.com

DitalTek
Shopify Partner
877 103 121

@JesusGomicare 

Your means here is when user click to plus button quantity a product so instead of increase 1 you need increase 3 for each change quantity, right?

To do this you need change increment step for input field.

- You can please Like and Accepted Solution if my suggestion helpful.
- And you want to hire developer Theme or App Shopify => Feel free to send me a DM or contact to us via Email | WhatsApp
- Website: ditaltek.com

Dan-From-Ryviu
Shopify Partner
11537 2258 2440

Hi @JesusGomicare 

You can do that by modifying min value in the quantity input on your product page template liquid code. Example like in this image below (Dawn theme)Screenshot 2024-07-30 at 09.43.41.png

- Helpful? Like & Accept solution! - Support me? Buy me a coffee
- Ryviu - Product Reviews & QA app: Collect customer reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Dhgate and CSV.
- Reton: Loyalty & Rewards - Earn points through tasks, redeem for discounts, and enjoy exclusive VIP rewards!
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- En...
Sign up now.

JesusGomicare
Excursionist
40 0 5

Hi Dan,

 

Thanks for the the help!

 

This works, but doesn't allow to go below 3. I want the default to be 3, but to also be able to go 1.

 

Any ideas on how to do so?

Dan-From-Ryviu
Shopify Partner
11537 2258 2440

Hi @JesusGomicare 

Please change the code to original and add this code at the bottom of your main-product.liquid file 

                    <script>
                      document.addEventListener('DOMContentLoaded', function() {
                        var quantityInput = document.getElementById('Quantity-{{ section.id }}');
                        if (quantityInput) {
                          quantityInput.value = 3;
                        }
                      });
                    </script>

 

- Helpful? Like & Accept solution! - Support me? Buy me a coffee
- Ryviu - Product Reviews & QA app: Collect customer reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Dhgate and CSV.
- Reton: Loyalty & Rewards - Earn points through tasks, redeem for discounts, and enjoy exclusive VIP rewards!
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- En...
Sign up now.

BSSCommerce-B2B
Shopify Partner
1972 564 568

Hi @JesusGomicare,

 

Follow these Steps:

1) Go to Online Store
2) Edit Code
3) Find product-info.js file

4) Add the following code in the function setQuantityBoundries 

Code: (Some conditions to guarantee satisfy quantity rules if exist)

 

// This customize can be removed anytime
if (min < 3 && (max == null || max >= 3)) this.quantityInput.value = 3;
// end

 

Changes:

BSSCommerceB2B_0-1722308305534.png

 

B2B Wholesale Solution: Streamline your B2B operation with advanced features like wholesale registration forms, custom pricing.


B2B Portal, Quote, Net 30: Speed up purchasing and streamline your quotation process with advanced features like quick order, request for quote.


B2B Lock Password Protect: Easily control access to pages, products, and pricing with robust features.


BSS Commerce - Full-service eCommerce Agency I Use Shopify for 1$ in the first month now

JesusGomicare
Excursionist
40 0 5

Hi @BSSCommerce-B2B,

 

Thanks for your help! Sadly enough, this doesn't work. 

 

Any ideas on how to fix it?

BSSCommerce-B2B
Shopify Partner
1972 564 568

HI @JesusGomicare,

Your Dawn is using a different variable name for mine. You can try this code instead

// This customize can be removed anytime
if (min < 3 && (max == null || max >= 3)) this.input.value = 3;
// end

 

 

B2B Wholesale Solution: Streamline your B2B operation with advanced features like wholesale registration forms, custom pricing.


B2B Portal, Quote, Net 30: Speed up purchasing and streamline your quotation process with advanced features like quick order, request for quote.


B2B Lock Password Protect: Easily control access to pages, products, and pricing with robust features.


BSS Commerce - Full-service eCommerce Agency I Use Shopify for 1$ in the first month now