8000 Save couponAmount and productAmount in newly created Order by alch · Pull Request #352 · elcodi/elcodi · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on May 30, 2019. It is now read-only.

Save couponAmount and productAmount in newly created Order #352

Merged
merged 3 commits into from
Nov 6, 2014

Conversation

alch
Copy link
Member
@alch alch commented Nov 3, 2014

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.

@alch alch force-pushed the fix/coupon-amount-persist branch from e148abf to 75862bf Compare November 3, 2014 18:44
@alch
Copy link
Member Author
alch commented Nov 3, 2014

Ping @mmoreram @xphere 🔔

@mmoreram
Copy link
Contributor
mmoreram commented Nov 3, 2014

+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())
Copy link
Contributor

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.

Copy link
Member Author

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
Copy link
Contributor
mmoreram commented Nov 4, 2014

@alch @xphere ping me when this PR is ready to be merged

@alch
Copy link
Member Author
alch commented Nov 5, 2014

@mmoreram will have to work on CartCoupon event listeners. Won't take too long hopefully.

@alch alch force-pushed the fix/coupon-amount-persist branch from 75862bf to 67984f9 Compare November 5, 2014 09:55
@alch
Copy link
Member Author
alch commented Nov 5, 2014

Rebasing, test looking good. Waiting for travis and merging.

@alch
Copy link
Member Author
alch commented Nov 5, 2014

@mmoreram the fix was much easier than I thought, it basically got fixed by #353. What was missing is the ORM association with Currency in Order.orm.yml.

Once travis is done with the tests, feel free to merge

@xphere
Copy link
Contributor
xphere commented 8000 Nov 5, 2014

How have you solved the binding with Coupon?
I'm 👍 if that's addressed.

@alch
Copy link
Member Author
alch commented Nov 5, 2014

@xphere it was already working, the problem was that due to bug #353 some listeners were not kicking in. Once that got fixed, it was only a matter of updating the ORM definition for Order, since associations with couponCurrency and productCurrency were not being mapped.

alch added 3 commits November 6, 2014 10:07
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.
@alch alch force-pushed the fix/coupon-amount-persist branch from f8acb49 to 851ba61 Compare November 6, 2014 09:07
@xphere
Copy link
Con 8000 tributor
xphere commented Nov 6, 2014

Then I'm definitely 👍 on this

mmoreram added a commit that referenced this pull request Nov 6, 2014
Save couponAmount and productAmount in newly created Order
@mmoreram mmoreram merged commit 05c550d into master Nov 6, 2014
@mmoreram
Copy link
Contributor
mmoreram commented Nov 6, 2014

GO! 👍

@xphere xphere deleted the fix/coupon-amount-persist branch December 18, 2014 11:41
@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 851ba61 on fix/coupon-amount-persist into * on master*.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0