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

Fixed bug on inc/dec product quantity in cart with vouchers discounts #10465

Merged
merged 1 commit into from Nov 27, 2018

Conversation

Projects
None yet
5 participants
@sete391
Copy link
Contributor

sete391 commented Sep 17, 2018

Questions Answers
Branch? develop
Description? Bug Fix on increase/decrease qty. Remain invalid vouchers.
Type? Bug fix
Category? CO
BC breaks? no
Deprecations? no
Fixed ticket? -
How to test? Create a voucher (with voucher code empty) with 10% discount and priority 2. Create another voucher (with voucher code empty) with 15% discount and priority 1, with 2 units as minimal quantity. Create a backoffice order and add 1 product. 10% discount is applied (OK). Increase quantity. Voucher changes, 15% discount is applied (OK). Decrease quantity. Voucher remains, 15% discount is applied. It's wrong.

This change is Reviewable

Fixed bug on inc/dec product quantity in cart with vouchers discounts
<!-- Thank you for contributing to the PrestaShop project! 

Please take the time to edit the "Answers" rows with the necessary information: -->

| Questions     | Answers
| ------------- | -------------------------------------------------------
| Branch?       | develop
| Description?  | Bug Fix on increase/decrease qty. Remain invalid vouchers.
| Type?         | Bug fix
| Category?     | CO
| BC breaks?    | no
| Deprecations? | no
| Fixed ticket? | -
| How to test?  | Create a voucher (with voucher code empty) with 10% discount and priority 2. Create another voucher (with voucher code empty) with 15% discount and priority 1, with 2 units as minimal quantity. Create a backoffice order and add 1 product. 10% discount is applied (OK). Increase quantity. Voucher changes, 15% discount is applied (OK). Decrease quantity. Voucher remains, 15% discount is applied. It's wrong.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/prestashop/prestashop/8528)
<!-- Reviewable:end -->
@prestonBot

This comment has been minimized.

Copy link
Collaborator

prestonBot commented Sep 17, 2018

Hello @sete391!

This is your first pull request on the PrestaShop project. Thank you, and welcome to this Open Source community!

@prestonBot

This comment has been minimized.

Copy link
Collaborator

prestonBot commented Sep 17, 2018

Hi!

Your pull request description seems to be incomplete or malformed:

  • The type should be one of: new feature, improvement, bug fix, refacto or critical.

Would you mind completing the contribution table ? This would help us understand how interesting your contribution is.

Thank you!

(note: this is an automated message, but answering it will reach a real human )

@sete391

This comment has been minimized.

Copy link
Contributor

sete391 commented Oct 22, 2018

Any Reviewers?

@PierreRambaud

This comment has been minimized.

Copy link
Contributor

PierreRambaud commented Oct 22, 2018

@sete391 Sorry for the delay :/
@tomlev Any idea about this? You're the best one with Cart :D

@tomlev

tomlev approved these changes Oct 23, 2018

@marionf marionf self-assigned this Oct 23, 2018

@marionf

This comment has been minimized.

Copy link
Contributor

marionf commented Oct 23, 2018

Hello @sete391

I try to reproduce the issue and when I decrease quantity, the 15% voucher is well removed

https://drive.google.com/file/d/1ls0X_36-Zac4RYD4sPLmeOyjGBL7CyFZ/view?usp=sharing

@tomlev

This comment has been minimized.

Copy link
Member

tomlev commented Oct 23, 2018

indeed, without this PR the code in CartRule::autoRemoveFromCart() is well executed when decreasing quantity.
called in CartController@534 : "$removed = CartRule::autoRemoveFromCart();"

@sete391 did you increase/decrease quantities from another place than cart ?

@sete391

This comment has been minimized.

Copy link
Contributor

sete391 commented Nov 26, 2018

Sorry for the delay. Can you try it in a backoffice employeer order? In frontend order it's ok, the error is in backoffice order. @marionf @tomlev

@marionf

This comment has been minimized.

Copy link
Contributor

marionf commented Nov 27, 2018

Thank you for these details @sete391 I can reproduce the issue with a BO order and your solve it 👍

@marionf marionf added QA ✔️ and removed waiting for QA labels Nov 27, 2018

@marionf marionf removed their assignment Nov 27, 2018

@marionf marionf added this to the 1.7.6.0 milestone Nov 27, 2018

@PierreRambaud PierreRambaud merged commit ef254ee into PrestaShop:develop Nov 27, 2018

2 checks passed

Codacy/PR Quality Review Up to standards. A positive pull request.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@PierreRambaud

This comment has been minimized.

Copy link
Contributor

PierreRambaud commented Nov 27, 2018

Thanks @sete391

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment