{"action":"created","issue":{"url":"https://api.github.com/repos/magento/magento2/issues/19168","repository_url":"https://api.github.com/repos/magento/magento2","labels_url":"https://api.github.com/repos/magento/magento2/issues/19168/labels{/name}","comments_url":"https://api.github.com/repos/magento/magento2/issues/19168/comments","events_url":"https://api.github.com/repos/magento/magento2/issues/19168/events","html_url":"https://github.com/magento/magento2/issues/19168","id":379740847,"node_id":"MDU6SXNzdWUzNzk3NDA4NDc=","number":19168,"title":"Cart rule Buy X only applies to single product but can be defined on category basis","user":{"login":"indefinitedevil","id":23464386,"node_id":"MDQ6VXNlcjIzNDY0Mzg2","avatar_url":"https://avatars0.githubusercontent.com/u/23464386?v=4","gravatar_id":"","url":"https://api.github.com/users/indefinitedevil","html_url":"https://github.com/indefinitedevil","followers_url":"https://api.github.com/users/indefinitedevil/followers","following_url":"https://api.github.com/users/indefinitedevil/following{/other_user}","gists_url":"https://api.github.com/users/indefinitedevil/gists{/gist_id}","starred_url":"https://api.github.com/users/indefinitedevil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/indefinitedevil/subscriptions","organizations_url":"https://api.github.com/users/indefinitedevil/orgs","repos_url":"https://api.github.com/users/indefinitedevil/repos","events_url":"https://api.github.com/users/indefinitedevil/events{/privacy}","received_events_url":"https://api.github.com/users/indefinitedevil/received_events","type":"User","site_admin":false},"labels":[{"id":688811200,"node_id":"MDU6TGFiZWw2ODg4MTEyMDA=","url":"https://api.github.com/repos/magento/magento2/labels/Issue:%20Format%20is%20valid","name":"Issue: Format is valid","color":"0e8a16","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-11-12T11:45:58Z","updated_at":"2018-11-12T11:46:02Z","closed_at":null,"author_association":"NONE","body":"We have noticed an issue with applying cart price rules to a category in combination with a Buy X rule. Namely that the Buy X condition only works when there are enough items of a single product, and doesn't consider if there are enough products from the condition which is what we expected.\r\n\r\nIf there is an offer for \"Get a discount for every two things you buy from this category\", we expect it to count items on a category basis, and not on an individual product basis. You should be able to buy one of product X and one of product Y to get the discount, rather than having to buy two of product X to get the discount.\r\n\r\nThis may be related to #9214.\r\n<!---\r\nPlease review our guidelines before adding a new issue: https://github.com/magento/magento2/wiki/Issue-reporting-guidelines\r\nFields marked with (*) are required. Please don't remove the template.\r\n-->\r\n\r\n### Preconditions (*)\r\n<!---\r\nProvide the exact Magento version (example: 2.2.5) and any important information on the environment where bug is reproducible.\r\n-->\r\n1. Magento 2.2.6\r\n\r\n### Steps to reproduce (*)\r\n<!---\r\nImportant: Provide a set of clear steps to reproduce this bug. We can not provide support without clear instructions on how to reproduce.\r\n-->\r\n1. Create a new Cart Price Rule with Rule Information as follows:\r\n\r\n| Attribute | Value |\r\n|------------------------------------|-----------------------|\r\n| Rule Name | Test Rule |\r\n| Active | Yes |\r\n| Websites | All |\r\n| Customer Groups | All |\r\n| Coupon | No Coupon |\r\n\r\n2. Set Conditions to:\r\n\r\n||||||\r\n|---|---|---|---|---|\r\n| if | **ALL** | of these conditions are | **TRUE** |\r\n| if | **Total quantity >= 2** | for subselection of items in cart matching | **ALL** | of these conditions |\r\n| | **Category** | **is** | [category ID with available products] |\r\n\r\n3. Set Actions to:\r\n\r\n| Attribute | Value |\r\n|---|---|\r\n| Apply                              | Fixed amount discount |\r\n| Discount Amount                    | 5                    |\r\n| Maximum Qty Discount is Applied To | 0                     |\r\n| Discount Qty Step (Buy X)          | 2                     |\r\n| Apply to Shipping Amount           | No                    |\r\n| Discard subsequent rules           | Yes                   |\r\n| Free Shipping                      | No                    |\r\n\r\nSet \"Apply the rule only to cart items matching the following conditions (leave blank for all items)\" to\r\n\r\n||||||\r\n|---|---|---|---|---|\r\n| if | **ALL** | of these conditions are | **TRUE** |\r\n| | **Category** | **is** | [category ID with available products] |\r\n\r\n4. Save rule\r\n5. Test 1: Go to frontend and add two different products from selected category to the cart (one of each)\r\n6. Test 2: Go to frontend and add two different products from selected category to the cart (three of each)\r\n\r\n### Expected result (*)\r\n<!--- Tell us what do you expect to happen. -->\r\nTest 1: Discount is applied to both items in the cart as they are both in the targeted category and there are two items in cart\r\nTest 2: Discount is applied to all items in the cart as there is an even number of items and they are all in the targeted category\r\n\r\n### Actual result (*)\r\n<!--- Tell us what happened instead. Include error messages and issues. -->\r\nTest 1: Discount is applied to no products as discounts are only applied if there are enough quantity of a single product, not a combined total of products\r\nTest 2: Discount is applied to four products (two from first product, two from second) and the third product of each is disregarded for discount purposes.\r\n"},"comment":{"url":"https://api.github.com/repos/magento/magento2/issues/comments/437850925","html_url":"https://github.com/magento/magento2/issues/19168#issuecomment-437850925","issue_url":"https://api.github.com/repos/magento/magento2/issues/19168","id":437850925,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNzg1MDkyNQ==","user":{"login":"magento-engcom-team","id":31669971,"node_id":"MDQ6VXNlcjMxNjY5OTcx","avatar_url":"https://avatars1.githubusercontent.com/u/31669971?v=4","gravatar_id":"","url":"https://api.github.com/users/magento-engcom-team","html_url":"https://github.com/magento-engcom-team","followers_url":"https://api.github.com/users/magento-engcom-team/followers","following_url":"https://api.github.com/users/magento-engcom-team/following{/other_user}","gists_url":"https://api.github.com/users/magento-engcom-team/gists{/gist_id}","starred_url":"https://api.github.com/users/magento-engcom-team/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magento-engcom-team/subscriptions","organizations_url":"https://api.github.com/users/magento-engcom-team/orgs","repos_url":"https://api.github.com/users/magento-engcom-team/repos","events_url":"https://api.github.com/users/magento-engcom-team/events{/privacy}","received_events_url":"https://api.github.com/users/magento-engcom-team/received_events","type":"User","site_admin":false},"created_at":"2018-11-12T11:46:02Z","updated_at":"2018-11-12T11:46:02Z","author_association":"CONTRIBUTOR","body":"Hi @indefinitedevil. Thank you for your report. \nTo help us process this issue please make sure that you provided the following information:\n- [ ] Summary of the issue\n- [ ] Information on your environment\n- [ ] Steps to reproduce\n- [ ] Expected and actual results\n\nPlease make sure that the issue is reproducible on the vanilla Magento instance following **Steps to reproduce**. To deploy vanilla Magento instance on our environment, please, add a comment to the issue: \n\n`@magento-engcom-team give me $VERSION instance` \n\nwhere `$VERSION` is [version tags](https://github.com/magento/magento2/tags) (starting from 2.2.0+) or develop branches (for example: 2.3-develop). \nFor more details, please, review the [Magento Contributor Assistant](https://devdocs.magento.com/guides/v2.2/contributor-guide/contributing.html#contributor-assist) documentation.\n\n@indefinitedevil do you confirm that you was able to reproduce the issue on vanilla Magento instance following steps to reproduce?\n- [ ] yes\n- [ ] no"}}
{"actor":{"display_login":"magento-engcom-team"}}