Setono / SyliusGiftCardPlugin

Sell gift cards on your Sylius store and let users use them in the checkout process
MIT License
45 stars 39 forks source link

Set cartItem unit price before giftcard creation #194

Closed jum4 closed 2 years ago

jum4 commented 2 years ago

Related to #193

codecov[bot] commented 2 years ago

Codecov Report

Merging #194 (13401d9) into 0.12.x (a70f927) will increase coverage by 1.51%. The diff coverage is 100.00%.

@@             Coverage Diff              @@
##             0.12.x     #194      +/-   ##
============================================
+ Coverage     45.75%   47.27%   +1.51%     
  Complexity      501      501              
============================================
  Files            94       94              
  Lines          1567     1576       +9     
============================================
+ Hits            717      745      +28     
+ Misses          850      831      -19     
Impacted Files Coverage Δ
src/Form/Extension/AddToCartTypeExtension.php 60.86% <100.00%> (+60.86%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update a70f927...13401d9. Read the comment docs.

loevgaard commented 2 years ago

@Roshyo: How did this work in 0.11? Why has it changed? Do you know that?

Roshyo commented 2 years ago

It stopped working when we started to allow GC with custom amounts. Previously, we were creating the GC from the OrderItemUnit when placing the order. Now we do it when creating the Order (cart) and the Order Item Unit has no price yet, since it is assigned by Sylius later. Perhaps an other fix would be to change the GC creation just after this price assignment (from order processor) but not sure if it would raise more problems or not.

loevgaard commented 2 years ago

Thank you @jum4 and @Roshyo 🎉