![]() |
Magento2 - How to create the buttons increase and decrease quantity on the product detail page in Magento 2 |
Magento2 - How to create the buttons increase and decrease quantity on the product detail page in Magento 2
Hi Friends Today i'm share with you Guys.How to create the buttons increase and decrease quantity on the product detail page in Magento 2
in this blog post i'm share with you guys , How to create the buttons increase and decrease quantity in Magento 2.
Github Link: https://github.com/php-cuong/magento2-qty
Google Drive Link : https://drive.google.com/file/d/1RFLN9YiPEUK_cUslbr3AemDn7lxeLgzB/view?usp=share_link
This will be the results after we complete this practice.
Before doing this practice, we need to determine the layout of the product detail page and the template phtml we will override.
For now, we will determine correctly the path of the product detail page.
So the layout for the product detail page is catalog_product_view.xml
this file will be put in the folder named frontend/layout of the module named Magento_Catalog.
And now, we will determine correctly the template phtml file need to override.
➤ Find this file product/view/addtocart.phtml in the layout catalog_product_view.xml
This is the block name product.info.addtocart.additional we will override.
Okay, let's go :
Let's do this practice, you need to follow steps by step:
Step 1: Download above given Module and Put it in the app/code/
After then you will Run the commands line following:
- php bin/magento setup:upgrade (Install the new modules)
- php bin/magento setup:static-content:deploy (Deploy the static contents)
- php bin/magento cache:flush (Flush caches)