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

Fix conflict between two cart rules and a single product cart #8180

Merged
merged 0 commits into from Sep 21, 2017

Conversation

Projects
None yet
4 participants
@Xaconi
Contributor

Xaconi commented Jul 26, 2017

Fixing this case: two cart rules, one with a free product and other with a percentage discount. The problem is when there is no stock of the free product, the code to load the second cart rule didn't checked if the product was in the cart. If detected that the gift rule was loaded, it substracted one unit from the total quantity cart products. And if the cart had only one product, it generated a "Cart empty" error. Now it checks if the cart contains the cart rule free product.

Questions Answers
Branch? "develop"
Description? The proposed solution resolves the specific case that combines two cart rules. One, to add a free product automatically. And the second one, to make a percentage discount. I've found a problem when the free product has no stock, and the cart has only one product. The FO gets the "Cart is empty" error. Now, the system checks if the free product is in the cart.
Type? bug fix
Category? CO
BC breaks? no
Deprecations? no
How to test? Generate two cart rules. one with a free product, and other with a percentage discount with code. The free product has to be a zero stock product. Then, add a product to customer's cart (it loads the free product cart rule, but it no adds to the cart beacuse don't have stock). Finally, try to add the second rule with the code on the order page. It generates the "Cart is empty error". The fix resolves this case

Important guidelines

@prestonBot

This comment has been minimized.

Show comment
Hide comment
@prestonBot

prestonBot Jul 26, 2017

Collaborator

Hello Xaconi!

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

Collaborator

prestonBot commented Jul 26, 2017

Hello Xaconi!

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

@Xaconi Xaconi changed the title from Update CartRule.php to CO: Conflict between two cart rules and a single product cart Jul 26, 2017

@aleeks aleeks changed the title from CO: Conflict between two cart rules and a single product cart to Fix conflict between two cart rules and a single product cart Jul 26, 2017

@vincentbz vincentbz added this to the 1.7.2.2 milestone Jul 28, 2017

@eternoendless eternoendless modified the milestones: 1.7.2.3, 1.7.2.2 Aug 25, 2017

@eternoendless eternoendless requested a review from tomlev Sep 21, 2017

@eternoendless eternoendless merged commit 25fa975 into PrestaShop:develop Sep 21, 2017

1 check passed

continuous-integration/travis-ci/push The Travis CI build passed
Details
@eternoendless

This comment has been minimized.

Show comment
Hide comment
@eternoendless

eternoendless Sep 21, 2017

Member

Sorry, I messed up when trying to rebase this PR into 1.7.2.x. I have re-created it here: #8361

Member

eternoendless commented Sep 21, 2017

Sorry, I messed up when trying to rebase this PR into 1.7.2.x. I have re-created it here: #8361

@eternoendless eternoendless removed this from the 1.7.2.3 milestone Sep 21, 2017

@vincentbz vincentbz added this to the 1.7.3.0 milestone Sep 22, 2017

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