Hi everyone, I think I have found a bug in the getProductOptionsAvailability( ) api.
If a product has a normal price of 500€, and I set 10% discount in the product settings, the API shows a wrong value under
selectedVariant.discountedPrice
and
selectedVariant.formattedDiscountedPrice
Sales price 500€
Sale price 500€ - 10% = 450€
The selected product variant has a surcharge of 55€
Therefore selectedVariant.formattedDiscountedPrice (500€+55€) -10% = 499,5€.
but selectedVariant.formattedDiscountedPrice calculates (500€-10%) + 55€ = 505€
However, if you change the discount from % to €, (500€+55€) - 50€ = 505€ is calculated, which is correct.
If you then add the product to the shopping cart, the percentage discount is correctly displayed as 499.5€ and 505€ for the € discount in the shopping cart.
This is absolutely confusing and is due to incorrect programming of the percentage discount in the getProductOptionsAvailability() API.
Also in the product setting of the corresponding variant the correct price is displayed at the percentage discount of 499,5€.
What is also unfortunate is that the API does not display the number of available variants.
Does anyone have any other idea how I can determine the price, the discounted price and the number of available product variants using velo code?