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

Cart price rule has failed if use dropdown attribute #10477

Closed
minosss opened this issue Aug 9, 2017 · 13 comments
Closed

Cart price rule has failed if use dropdown attribute #10477

minosss opened this issue Aug 9, 2017 · 13 comments
Assignees
Labels
bug report Fixed in 2.2.x The issue has been fixed in 2.2 release line Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development 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

Comments

@minosss
Copy link

minosss commented Aug 9, 2017

Preconditions

  1. magento ce 2.1.7 with sample data installed
  2. php 7.0.20
  3. MySQL 5.7

Steps to reproduce

  1. Create a new cart price rule
  2. Customer Groups select all
  3. Set Conditions

If total quantity greater than 2 for a subselection of items in cart matching ALL of these conditions:
-- Color is red

  1. set Actions

Apply: Percent of product price discount
Discount Amount: 10

  1. Save and Navigate to storefront as a guest
  2. Add 3 products with red color
  3. View cart and no discount

Test other attribute 8.11

  1. add new product attribute (text field type) eg: vendor
  2. add vendor to the default attribute set
  3. set vendor in product detail page. eg: addas
  4. update rule change color to vendor. eg: vendor is addas
  5. back to shopping cart and update
  6. it works

Expected result

buy a special color (red) and total greater than 2, have 10% discount

Actual result

no discount

screen shot 2017-08-12 at 00 59 59

@vherasymenko
Copy link

@minosss Thank you for your report.
If you want to report an issue please format this report according to the Issue reporting guidelines: with steps to reproduce, actual result and expected result.

@orlangur
Copy link
Contributor

@vherasymenko are steps not clear from the screenshots?

@minosss minosss changed the title Cart price rule are wrong Cart price rule has failed if use dropdown attribute Aug 11, 2017
@minosss
Copy link
Author

minosss commented Aug 11, 2017

@vherasymenko updated, and the cart price rule works if use text field attribute.

screen shot 2017-08-12 at 01 09 59

@magento-engcom-team magento-engcom-team added bug report G1 Passed Progress: needs update Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed and removed G1 Passed Progress: needs update labels Sep 5, 2017
@magento-engcom-team
Copy link
Contributor

@minosss, thank you for your report.
We've created internal ticket(s) MAGETWO-80211 to track progress on the issue.

@magento-engcom-team magento-engcom-team added 2.1.x Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed 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 labels Sep 27, 2017
@marinagociu
Copy link

I'm working on it #SQUASHTOBERFEST

@magento-engcom-team
Copy link
Contributor

magento-engcom-team commented Oct 5, 2017

Hi @marinagociu could you please accept the invitation to magento/magento2 repository ?

@marinagociu
Copy link

Hi @okorshenko can you please assign the task to me? @minosss is the reporter.

@okorshenko
Copy link
Contributor

okorshenko commented Oct 5, 2017

Reassigned

@marinagociu
Copy link

Thanks @okorshenko!

What I found investigating the issue is that for products subselections only the items that are visible in cart are checked against the specified conditions.
In the case described by the reporter, a configurable product was added to cart, and the condition specified on the subselection was based on the color attribute.
The rule was not applied because the configurable product has no value for this attribute since it's the one used to create it. So, I believe, the condition should have been checked against the selected simple product.

I also found that the same happens with bundle products, the conditions specified on subselections will only be checked against the bundle products, and not against it's children.

Is this the correct behaviour, that the conditions should be checked against the children of the visible quote items too?
Also, if this is the case, then for bundle products it would make more sense to use the quantity or the amount on the children items in order to calculate the total on the subselection, is this correct?

@tkacheva
Copy link

tkacheva commented Oct 6, 2017

Hi @marinagociu,
For configurable product option attributes need to be checked on both parent and child products with the priority to the child values.
For Bundle it depends on Bundle type.

I tested the scenario and found that only product sub-selection condition doesn't work properly with colors. Product attribute combination condition works correct.

@marinagociu
Copy link

Hi @tkacheva,
I also encountered this issue only for the sub-selection condition. I will add a PR with a proposed solution.

okorshenko pushed a commit that referenced this issue Nov 13, 2017
…t quote item children too #11274

 - Merge Pull Request #11274 from marinagociu/magento2:fix-cart-rule-subselect
 - Merged commits:
   1. ae9f205
   2. f6121da
okorshenko pushed a commit that referenced this issue Nov 13, 2017
@okorshenko
Copy link
Contributor

The issue has been fixed and delivered to 2.2-develop branch. Will be available with 2.2.2 release

@okorshenko okorshenko added the Fixed in 2.2.x The issue has been fixed in 2.2 release line label Nov 13, 2017
@magento-engcom-team
Copy link
Contributor

Hi @minosss. Thank you for your report.
The issue has been fixed in magento-engcom/magento2ce#1289 by @magento-engcom-team in 2.3-develop branch
Related commit(s):

The fix will be available with the upcoming patch release.

@magento-engcom-team magento-engcom-team added the Fixed in 2.3.x The issue has been fixed in 2.3 release line label Jan 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Fixed in 2.2.x The issue has been fixed in 2.2 release line Fixed in 2.3.x The issue has been fixed in 2.3 release line Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development 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

No branches or pull requests

7 participants