ShopApiPlugin icon indicating copy to clipboard operation
ShopApiPlugin copied to clipboard

Discount amount calculated in percentage product discount is 1000 times bigger than it should

Open Bizkaitarra opened this issue 5 years ago • 4 comments

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

Bizkaitarra avatar Jan 20 '20 07:01 Bizkaitarra

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?

lchrusciel avatar Jan 20 '20 08:01 lchrusciel

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

Bizkaitarra avatar Jan 20 '20 09:01 Bizkaitarra

Sounds like a bug indeed.

mamazu avatar Apr 22 '20 17:04 mamazu

I have played around with the percent discount of an item and I couldn't find anything wrong with it.

mamazu avatar Apr 28 '20 22:04 mamazu