Skip to content
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 #10477 Check cart rule subselect conditions against quote item children too #11274

Merged
merged 2 commits into from
Nov 13, 2017

Conversation

marinagociu
Copy link

@marinagociu marinagociu commented Oct 6, 2017

Description

The cart price rule subselect condition only checked the visible quote items and this proved to be a problem in the case of configurable and bundle products.
The quote item children are now checked against the validation too, and an item will be considered valid and added to the subselect total if either it, or at least one of it's children is validated.

In the case of bundle products, the children items data will be used and added to the subselect total, when the match is on a child item.

In the case of configurable products, the parent item data will be used in the subselect total, just like for all the other product types.

Fixed Issues (if relevant)

  1. Cart price rule has failed if use dropdown attribute #10477: Cart price rule has failed if use dropdown attribute

Manual testing scenarios

  1. Create a cart price rule with a products subselection condition.
  2. The subselection conditions should include checking attribute values that are only set on simple products associated to configurable or bundle products.
  3. Add to cart the configurable and bundle products and make sure the associated simple products meet the conditions of the subselection.
  4. The cart rule should be applied.

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

The subselect condition only checked the visible quote items and this
proved to be a problem in the case of configurable and bundle products.
The quote item children are now checked against the validation too,
and an item will be considered valid and added to the subselect total
if either it, or at least one of it's children is validated.

In the case of bundle products, the children items data will be used
and added to the subselect total, when the match is on a child item.

In the case of configurable products, the parent item data will be used
in the subselect total, just like for all the other product types.

Resolves: magento#10477
@okorshenko okorshenko modified the milestones: October 2017, November 2017 Nov 1, 2017
@ishakhsuvarov ishakhsuvarov removed their assignment Nov 7, 2017
@magento-engcom-team magento-engcom-team added 2.2.x bugfix Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release labels Nov 7, 2017
@fooman fooman self-assigned this Nov 9, 2017
@okorshenko okorshenko merged commit f6121da into magento:2.2-develop Nov 13, 2017
okorshenko pushed a commit that referenced this pull request Nov 13, 2017
@magento-engcom-team magento-engcom-team added the Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release label Nov 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Progress: accept Release Line: 2.2 Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants