{"action":"created","issue":{"url":"https://api.github.com/repos/magento/magento2/issues/19956","repository_url":"https://api.github.com/repos/magento/magento2","labels_url":"https://api.github.com/repos/magento/magento2/issues/19956/labels{/name}","comments_url":"https://api.github.com/repos/magento/magento2/issues/19956/comments","events_url":"https://api.github.com/repos/magento/magento2/issues/19956/events","html_url":"https://github.com/magento/magento2/issues/19956","id":393859824,"node_id":"MDU6SXNzdWUzOTM4NTk4MjQ=","number":19956,"title":"Magento 2 : Remove Specific Product From All Active Carts","user":{"login":"anonspkdk","id":29209568,"node_id":"MDQ6VXNlcjI5MjA5NTY4","avatar_url":"https://avatars3.githubusercontent.com/u/29209568?v=4","gravatar_id":"","url":"https://api.github.com/users/anonspkdk","html_url":"https://github.com/anonspkdk","followers_url":"https://api.github.com/users/anonspkdk/followers","following_url":"https://api.github.com/users/anonspkdk/following{/other_user}","gists_url":"https://api.github.com/users/anonspkdk/gists{/gist_id}","starred_url":"https://api.github.com/users/anonspkdk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anonspkdk/subscriptions","organizations_url":"https://api.github.com/users/anonspkdk/orgs","repos_url":"https://api.github.com/users/anonspkdk/repos","events_url":"https://api.github.com/users/anonspkdk/events{/privacy}","received_events_url":"https://api.github.com/users/anonspkdk/received_events","type":"User","site_admin":false},"labels":[{"id":689434599,"node_id":"MDU6TGFiZWw2ODk0MzQ1OTk=","url":"https://api.github.com/repos/magento/magento2/labels/Issue:%20Format%20is%20not%20valid","name":"Issue: Format is not valid","color":"d93f0b","default":false}],"state":"open","locked":false,"assignee":{"login":"engcom-backlog-nazar","id":40756439,"node_id":"MDQ6VXNlcjQwNzU2NDM5","avatar_url":"https://avatars2.githubusercontent.com/u/40756439?v=4","gravatar_id":"","url":"https://api.github.com/users/engcom-backlog-nazar","html_url":"https://github.com/engcom-backlog-nazar","followers_url":"https://api.github.com/users/engcom-backlog-nazar/followers","following_url":"https://api.github.com/users/engcom-backlog-nazar/following{/other_user}","gists_url":"https://api.github.com/users/engcom-backlog-nazar/gists{/gist_id}","starred_url":"https://api.github.com/users/engcom-backlog-nazar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/engcom-backlog-nazar/subscriptions","organizations_url":"https://api.github.com/users/engcom-backlog-nazar/orgs","repos_url":"https://api.github.com/users/engcom-backlog-nazar/repos","events_url":"https://api.github.com/users/engcom-backlog-nazar/events{/privacy}","received_events_url":"https://api.github.com/users/engcom-backlog-nazar/received_events","type":"User","site_admin":false},"assignees":[{"login":"engcom-backlog-nazar","id":40756439,"node_id":"MDQ6VXNlcjQwNzU2NDM5","avatar_url":"https://avatars2.githubusercontent.com/u/40756439?v=4","gravatar_id":"","url":"https://api.github.com/users/engcom-backlog-nazar","html_url":"https://github.com/engcom-backlog-nazar","followers_url":"https://api.github.com/users/engcom-backlog-nazar/followers","following_url":"https://api.github.com/users/engcom-backlog-nazar/following{/other_user}","gists_url":"https://api.github.com/users/engcom-backlog-nazar/gists{/gist_id}","starred_url":"https://api.github.com/users/engcom-backlog-nazar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/engcom-backlog-nazar/subscriptions","organizations_url":"https://api.github.com/users/engcom-backlog-nazar/orgs","repos_url":"https://api.github.com/users/engcom-backlog-nazar/repos","events_url":"https://api.github.com/users/engcom-backlog-nazar/events{/privacy}","received_events_url":"https://api.github.com/users/engcom-backlog-nazar/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2018-12-24T11:01:27Z","updated_at":"2018-12-24T11:01:55Z","closed_at":null,"author_association":"NONE","body":"i am trying to remove specific product from all active carts.\r\n\r\n```\r\n    $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance(); \r\n\t$resource = $objectManager->get('Magento\\Framework\\App\\ResourceConnection');\r\n\t$connection = $resource->getConnection();\r\n\t$tableName = $resource->getTableName('quote_item'); //gives table name with prefix\r\n\t\t\t \r\n\t//Select Data from table\r\n\t$sql = \"Select * FROM \" . $tableName.\" WHERE product_id=\".$product_id;\r\n\t$result = $connection->fetchAll($sql); // gives associated array, table fields as key in array.\r\n\tforeach ($result as $r) {\r\n\t// echo $r['quote_id'];\r\n\t$quote = $objectManager->get('\\Magento\\Quote\\Model\\Quote')->load($r['quote_id']);\r\n\r\n \tif ($r['product_id'] == $product_id ) {\r\n \t$quote_item = $resource->getTableName('quote_item'); //gives table name with prefix\r\n \r\n\t//Delete Data from table\r\n\t$sql_del = \"Delete FROM \" . $tableName.\" Where product_id = \".$product_id;\r\n\t$connection->query($sql_del);\r\n\t$quote->collectTotals()->save();\r\n \t\t\t\t}\r\n\t\t\t}\r\n\r\n```\r\nThrough this code when i disable any product from admin pannel, it automatically removes that product from all of the active carts \r\nbut i have one problem, it doesn't update minicart. \r\n\r\nhttps://i.stack.imgur.com/BYzDo.png\r\n\r\n\r\nAs you can see in picture the inner portion of minicart is updating correctly like now i have one product in minicart and its showing 1 Item. but at minicart icon its showing 2 items in minicart. \r\ni used This code to update minicart :\r\n\r\n```\r\n    require([\r\n\t\t\t           'Magento_Customer/js/customer-data'\r\n\t\t\t        ], function (customerData) {\r\n\t\t\t            var sections = ['cart'];\r\n\t\t\t            customerData.invalidate(sections);\r\n\t\t\t            customerData.reload(sections, true);\r\n\t\t\t        });\r\n```\r\n\r\nBut this code doesn't works on my website. \r\n"},"comment":{"url":"https://api.github.com/repos/magento/magento2/issues/comments/449719551","html_url":"https://github.com/magento/magento2/issues/19956#issuecomment-449719551","issue_url":"https://api.github.com/repos/magento/magento2/issues/19956","id":449719551,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0OTcxOTU1MQ==","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-12-24T11:01:55Z","updated_at":"2018-12-24T11:01:55Z","author_association":"CONTRIBUTOR","body":"Hi @engcom-backlog-nazar. Thank you for working on this issue. \nIn order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:\n- [ ] 1. Verify that issue has all the required information. (**Preconditions**, **Steps to reproduce**, **Expected result**, **Actual result**).<details><summary>Details</summary>If the issue has a valid description, the label `Issue: Format is valid` will be added to the issue automatically. Please, edit issue description if needed, until label `Issue: Format is valid` appears.</details>\n\n- [ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add `Issue: Clear Description` label to the issue by yourself.\n\n- [ ] 3. Add `Component: XXXXX` label(s) to the ticket, indicating the components it may be related to.\n- [ ] 4. Verify that the issue is reproducible on `2.3-develop` branch<details><summary>Details</summary>- Add the comment `@magento-engcom-team give me 2.3-develop instance` to deploy test instance on Magento infrastructure. <br/> - If the issue is reproducible on `2.3-develop` branch, please, add the label `Reproduced on 2.3.x`.<br/>- If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and **_stop verification process here_**!\n</details>\n\n- [ ] 5. Verify that the issue is reproducible on `2.2-develop` branch. <details><summary>Details</summary>- Add the comment `@magento-engcom-team give me 2.2-develop instance` to deploy test instance on Magento infrastructure. <br/>- If the issue is reproducible on `2.2-develop` branch, please add the label `Reproduced on 2.2.x`</details>\n\n- [ ] 6. Add label `Issue: Confirmed` once verification is complete. \n\n- [ ] 7. Make sure that automatic system confirms that report has been added to the backlog."}}
{"actor":{"display_login":"magento-engcom-team"}}