Skip to main content

Posts

Showing posts from December, 2020

Sitecore commerce AddToCart component quantity issue in catalog-productquantity.js

Hello Friends, 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

Sitecore Commerce ProductList getting variant prices for a product

Hello Sitecore Lovers !!!! Today i will talk little about sitecore commerce OOTB component "Product List", if you have used existing storefront site and observe the list, it looks something like below So far so good, now i will talk about the actual issue we run into Problem Most of the storefront OOTB component works on a product level, but in our case we needed prices from a variant and not from a product , Sitecore commerce has a pricing manager but it was always returning NULL for variant prices and was only returning prices for a product and not variant underneath it. Details Now because we knew that this component is using ProductListRepository.cs and if we override it, we could see what pricing logic is written and we can tweak it to get the variant price, but before that we wanted to find why it is not considering variants and only considering a product, Logically it should also fetch its variant prices too So i started digging by looking into Product