{"action":"created","issue":{"url":"https://api.github.com/repos/spree/spree/issues/5231","labels_url":"https://api.github.com/repos/spree/spree/issues/5231/labels{/name}","comments_url":"https://api.github.com/repos/spree/spree/issues/5231/comments","events_url":"https://api.github.com/repos/spree/spree/issues/5231/events","html_url":"https://github.com/spree/spree/issues/5231","id":40579898,"number":5231,"title":"Spree 2-3 stable, promotion auto capture?","user":{"login":"dieuit07","id":1289505,"avatar_url":"https://avatars.githubusercontent.com/u/1289505?v=3","gravatar_id":"","url":"https://api.github.com/users/dieuit07","html_url":"https://github.com/dieuit07","followers_url":"https://api.github.com/users/dieuit07/followers","following_url":"https://api.github.com/users/dieuit07/following{/other_user}","gists_url":"https://api.github.com/users/dieuit07/gists{/gist_id}","starred_url":"https://api.github.com/users/dieuit07/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dieuit07/subscriptions","organizations_url":"https://api.github.com/users/dieuit07/orgs","repos_url":"https://api.github.com/users/dieuit07/repos","events_url":"https://api.github.com/users/dieuit07/events{/privacy}","received_events_url":"https://api.github.com/users/dieuit07/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/spree/spree/labels/steps","name":"steps","color":"e11d21"},{"url":"https://api.github.com/repos/spree/spree/labels/unverified","name":"unverified","color":"fbca04"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2014-08-19T11:06:36Z","updated_at":"2015-03-10T04:13:31Z","closed_at":"2015-03-09T16:01:39Z","body":"Hi everyone. I have problem when update from 2.3.0 to 2.3.2\r\nIn cart. I add button for client to remove coupon (I delete Adjustment AND update total, adjustment_total for order). It work great in 2.3.0. BUT the FREESHIP is not work, so I must pum version up to 2.3.2 to fix it. The problem FREESHIP is resolve but now I face with new problem:\r\n\r\nPROMOTION: discount $20 when buy product A\r\nWhen I remove adjustment. I check database see it removed. Then try to increase quantity of product A and Adjustment discount $20 auto created without enter coupon code. I think it value still store somewhere in code. But can not find place to customize it. \r\nTry to clear cach folder and browser too , It not change.\r\nHelp me . Pleaze... \r\n\r\n"},"comment":{"url":"https://api.github.com/repos/spree/spree/issues/comments/77993180","html_url":"https://github.com/spree/spree/issues/5231#issuecomment-77993180","issue_url":"https://api.github.com/repos/spree/spree/issues/5231","id":77993180,"user":{"login":"erwinl","id":330469,"avatar_url":"https://avatars.githubusercontent.com/u/330469?v=3","gravatar_id":"","url":"https://api.github.com/users/erwinl","html_url":"https://github.com/erwinl","followers_url":"https://api.github.com/users/erwinl/followers","following_url":"https://api.github.com/users/erwinl/following{/other_user}","gists_url":"https://api.github.com/users/erwinl/gists{/gist_id}","starred_url":"https://api.github.com/users/erwinl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erwinl/subscriptions","organizations_url":"https://api.github.com/users/erwinl/orgs","repos_url":"https://api.github.com/users/erwinl/repos","events_url":"https://api.github.com/users/erwinl/events{/privacy}","received_events_url":"https://api.github.com/users/erwinl/received_events","type":"User","site_admin":false},"created_at":"2015-03-10T04:13:31Z","updated_at":"2015-03-10T04:13:31Z","body":"@JDutil, we recently encountered this problem too.\r\n\r\nUse case:\r\n\r\n1. We have a promo code field on both cart page and checkout page. \r\n\r\n2. User input promo code on cart page, hit 'Enter', app then transition to the checkout page with promo code populated and calculated properly.\r\n\r\n3. User back to cart page, decided that he doesn't want to use a promo code (yea this is crazy). He empty the promo code field and hit 'Enter' again.\r\n\r\n---\r\n\r\nThe question is how we remove the existing applied promo code? This is what we ended up doing:\r\n\r\n1. Remove the promotion adjustment from order (from all_adjustments so we also pick the ones applied to line items).\r\n\r\n2. Remove the records on `spree_orders_promotions` table.\r\n\r\n    Without removing the records here, the adjustments will be created again.\r\n\r\n    I guess this is what you mean by:\r\n    >I believe the issue is that the promotion is still applied to the order so it recreates the adjustment.\r\n\r\n    If yes then what is the correct way to \"unapply\" a promotion from an order?\r\n\r\nThanks "}}