Closed jum4 closed 2 years ago
I don't really get the problem here, as if the gift card has not a configurable amount (so fixed one) then Sylius mechanics takes place and set the OrderItem price itself.
What is your issue exactly ?
My issue is the gift card is actually created with a 0 amount, maybe I misconfigured something ?
The gift card amount should be done on OrderProcess. Can you come up with either some test to reproduce, or a scenario ?
GiftCardPlugin: 0.12.x Sylius: 1.10
Thank you @jum4 , I could reproduce with your scenario, and your PR is indeed fixing the issue. I'm just adding tests and we'll be able to proceed with merge
On 0.12.x branch, when a gift card is automatically created during a purchase, the amount is filled only if the card amount is configurable. For fixed amount, the amount is allways 0.
I think it is because the card is created in the
AddToCartTypeExtension
, and the cartItem prices are not already calculated at this step.I can suggest a working pull request, but I am not sure about the method to use