People like to have things that make life easier. And why shouldn’t they? In this modern era where software & technologies are developed to reduce human efforts & making things easier for people by running a thousand lines of code in the background. With the advent of online shopping, Ecommerce store owner are trying to make the shopping experience more convenient & quicker than ever. That’s why Ecommerce store owner is always experimenting with different pieces of stuff inside their Magento store to serve great shopping experience to their store customers and if you dont then you are losing your customers.

Recently one of customer came up with the requirement with the concept of adding incremental quantity button to his Magento store. So, his wholesale customers can easily increment or decrement product quantity while his regular customers can continue shopping without any disruption. Using this tiny concept he has delivered a hassle-free shopping experience to both the types of customers. We thought it will be helpful to our other customers too. So, we have decided to feature in our “How to” Blog Series. So here the three-step tutorial for adding Quantity Increment & Decrement Button to Magento Product page.
First, we need to create “catalog_product_view.xml” layout file at the following path using below code.
app\code\Vendor\Extension\view\frontend\layout\catalog_product_view.xml

Secondly, we need to create one more file “addtocart.phtml” using below code for displaying increment & decrement button in store frontend.
app\code\Vendor\Extension\view\frontend\templates\catalog\product\addtocart.phtml

Lastly, we have to create “qty_change.js” that will change quantity accordingly on frontend button action.
app\code\Vendor\Extension\view\frontend\web\js\qty_change.js

That’s it. You have successfully added Quantity Increment & Decrement Button to Magento Product page. Also, you are free to use this code anywhere inside your Magento form as per need. You are also free to modify this according to your need.

Quantity Dropdown CTA

Lastly, hit that stars if this code worked for you & comment down below if you faced any issue.

Happy Coding!

Click to rate this post!
[Total: 18 Average: 3.9]