All things Shopify and commerce
Hi,
We have a Frequently Bought Together on the product page, and I want to add a quantity dropdown for each product so that customers can select how much they want. I added a select and try to get value in JS, but it doesn't work. Could someone please give me some suggestions? Really appreciate!!
Solved! Go to the solution
This is an accepted solution.
Hi @Anna_Wang1
We checked your issue and saw that there are 3 ways that you can try to solve the problem:
- Method 1: Catch the "onChange" event of the quantity input: When the quantity changes, it will push the selected variant and quantity value into the items array (in case the items array already has this variant, delete that item and then re-push).
- Method 2: Each variant option will display a quantity input (put the quantity class inside the variant's for loop), then catch the "add to cart button click" event to cycle through the items and put them in the items array.
- Method 3: Try to use the variants order module of the B2B Customer Portal app
I hope that this is useful for you.
If our suggestions are useful, please let us know by giving it a like, marking it as a solution, or donating here ☕.
B2B Solution & Custom Pricing | Product Labels by BSS
Need help from our expert? Kindly share your request with us via community@bsscommerce.com
Hi @Anna_Wang1
Can you kindly share your store link (with the password, if any) with us? We will help you check it and suggest a solution.
If our suggestions are useful, please let us know by giving it a like, marking it as a solution, or donating here ☕.
B2B Solution & Custom Pricing | Product Labels by BSS
Need help from our expert? Kindly share your request with us via community@bsscommerce.com
Hi, thank you for your reply. My store URL is: https://ctomsinc.com/
I used the backup file to test it so I'm not sure if you could see my code.
Please let me know if you have any questions. Thanks.
This is an accepted solution.
Hi @Anna_Wang1
We checked your issue and saw that there are 3 ways that you can try to solve the problem:
- Method 1: Catch the "onChange" event of the quantity input: When the quantity changes, it will push the selected variant and quantity value into the items array (in case the items array already has this variant, delete that item and then re-push).
- Method 2: Each variant option will display a quantity input (put the quantity class inside the variant's for loop), then catch the "add to cart button click" event to cycle through the items and put them in the items array.
- Method 3: Try to use the variants order module of the B2B Customer Portal app
I hope that this is useful for you.
If our suggestions are useful, please let us know by giving it a like, marking it as a solution, or donating here ☕.
B2B Solution & Custom Pricing | Product Labels by BSS
Need help from our expert? Kindly share your request with us via community@bsscommerce.com
Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024