Hello Friends,
Old Code
New Code
After making this change upload this file back to the Sitecore path shown above and publish.
The issue should have been resolved for you now.
NOTE: Sitecore was also able to reproduced this behavior on their end and above is the solution for it.
There is an OOTB component AddToCart for commerce which comes with input box to enter quantity and Add To Cart button
It also has + and - button so you can manually increase and decrease quantity and the textbox will show quantity as per that
Problem
While working on the component i found out that when we enter the quantity manually into the box and if i try to increase and decrease its value using + and -, it was malfunctioning and not updating the quantity which was strange as without touching the textbox, it was working just fine
Solution
Well, Because of some of the code in javascript it was not working and, following is the old code which caused the issue and will also paste the new code which was changed and after that it started working
We will need to edit catalog-productquantity.js full path of this item is /sitecore/media library/Base Themes/Commerce Components Theme/Scripts/Catalog/catalog-productquantity item
, So go to this item in Sitecore, download it and make below changeOld Code
$(quantityInput).attr('value', currentValue);Above is the code which was causing the issue so you just need to find this line in JS and replce it with following
New Code
$(quantityInput).val(currentValue);
After making this change upload this file back to the Sitecore path shown above and publish.
The issue should have been resolved for you now.
NOTE: Sitecore was also able to reproduced this behavior on their end and above is the solution for it.
Comments
Post a Comment