-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Integrate the promotion coupons #429
[WIP] Integrate the promotion coupons #429
Conversation
go, go, go :) |
@jjanvier Nice work, quick tip = https://github.com/Sylius/Sylius/blob/master/features/frontend/checkout_inventory.feature#L38, I added this step definition to simplify adding a product with specified quantity. Should help you making the scenarios a bit shorter. :) |
Thanks ! It will be much better indeed. |
What's done so far :
Two Behat tests fails because I can not know, with the actual code, if a coupon is eligible to the user's cart. Should I delete those tests or should we find a way to change the method ping @pjedrzejewski @stloyd for opinion and review |
@jjanvier Dang, I forgot to tell you that there is a |
Wrong button, sorry. :) |
*/ | ||
public function handle(OrderInterface $order) | ||
{ | ||
if (null != $code = $order->getCouponCode()) { |
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.
Please use strict comparison. Same line below.
Fixing CS and glitches
…Events. Fixing CS
@stloyd @pjedrzejewski OK for review Everything's green and I used the sylius_promotion_coupon_to_code as described by @pjedrzejewski |
And "Promotion total: (€20.00)" should appear on the page | ||
And "Grand total: €180.00" should appear on the page | ||
|
||
|
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.
2 extra lines here.
*/ | ||
public function __construct(ObjectRepository $couponRepository) | ||
public function __construct(ObjectRepository $couponRepository, EventDispatcher $dispatcher) |
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.
Same as above, you should typehint the interface. :)
Awesome work Julien. 👍 |
When I add product "Lenny" to cart, with quantity "2" | ||
Then I should be on the cart summary page | ||
And "Promotion total: (€27.75)" should appear on the page | ||
# 5*25 + 2*15 = 155 - 155*5% - 20 = 127.25 |
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 do this too, but let's remove it as well. 💃
thanks for reviews @stloyd @pjedrzejewski |
[WIP] Integrate the promotion coupons
@jjanvier Awesome work man! Thanks! 👍 |
Great work guys 👍 👍 |
To fix #377