-
Notifications
You must be signed in to change notification settings - Fork 77
Save couponAmount and productAmount in newly created Order #352
Conversation
e148abf
to
75862bf
Compare
+1 ASAP we have the @xphere +1, we'll merge. |
@@ -117,6 +117,7 @@ public function createOrderFromCart(CartInterface $cart) | |||
->setCart($cart) | |||
->setQuantity($cart->getQuantity()) | |||
->setProductAmount($cart->getProductAmount()) | |||
->setCouponAmount($cart->getCouponAmount()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder… if those concepts are orthogonal, why setting them in the same place?
After all, this class belongs to Cart
component, and it should not know about the Coupon
component.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xphere that's right, the correct place for this would be some event listener in the CartCoupon
component that listens to the ElcodiCartEvents::ORDER_ONCREATED
event. If there are no other side effects (there shouldn't) this would be a quick change. Trying it 👍
@mmoreram will have to work on |
75862bf
to
67984f9
Compare
Rebasing, test looking good. Waiting for travis and merging. |
How have you solved the binding with Coupon? |
In order for the couponAmount and productAmount to be correctly stored during th CartOrderTransformer::createOrderFromCart() process, we must ensure that a correct amount is initialized in the Cart object when the cart.onload event is triggered.
f8acb49
to
851ba61
Compare
Then I'm definitely 👍 on this |
Save couponAmount and productAmount in newly created Order
GO! 👍 |
Changes Unknown when pulling 851ba61 on fix/coupon-amount-persist into * on master*. |
In order for the couponAmount and productAmount to be correctly stored
during th CartOrderTransformer::createOrderFromCart() process, we must
ensure that a correct amount is initialized in the Cart object when the
cart.onload event is triggered.