ShopApiPlugin
ShopApiPlugin copied to clipboard
Discount amount calculated in percentage product discount is 1000 times bigger than it should
Sylius version affected: 1.6.4
Description
I'm making a promotion of 50% in product.
Promotions with fixed discount in product works ok but percentage discount in product calculates wrong the amount to discount.
I debug and see that it gets a discount 1000 times bigger than it should and thats why the product price results negative and Sylius returns 0.
Steps to reproduce
Create a promotion with discount in product.
Create a cart with the afected products.
Get the cart with Sylius API using ShopAPI.
Possible Solution
I'll fix it by dividing the amount of the discount with 1000 but I don't know if it could be better solution
I'm right, that your issue is more related to ShopAPI? Can you provide more details about your issue?
Have you already asked for on our #support channel on Slack?
I have debug when I make ShopAPI petition and the 1000 bigger result gets in UnitPercentageDiscountPromotionActionCommand class in line 76.
I haven't ask this in a separated conversation in slack so I think it has not been readed. I'll do it
Sounds like a bug indeed.
I have played around with the percent discount of an item and I couldn't find anything wrong with it.