{"action":"opened","issue":{"url":"https://api.github.com/repos/opencart/opencart/issues/4429","repository_url":"https://api.github.com/repos/opencart/opencart","labels_url":"https://api.github.com/repos/opencart/opencart/issues/4429/labels{/name}","comments_url":"https://api.github.com/repos/opencart/opencart/issues/4429/comments","events_url":"https://api.github.com/repos/opencart/opencart/issues/4429/events","html_url":"https://github.com/opencart/opencart/issues/4429","id":158312883,"number":4429,"title":"Coupon is not working as expected when coupon offers free shipping","user":{"login":"samirkumardas","id":4821199,"avatar_url":"https://avatars.githubusercontent.com/u/4821199?v=3","gravatar_id":"","url":"https://api.github.com/users/samirkumardas","html_url":"https://github.com/samirkumardas","followers_url":"https://api.github.com/users/samirkumardas/followers","following_url":"https://api.github.com/users/samirkumardas/following{/other_user}","gists_url":"https://api.github.com/users/samirkumardas/gists{/gist_id}","starred_url":"https://api.github.com/users/samirkumardas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samirkumardas/subscriptions","organizations_url":"https://api.github.com/users/samirkumardas/orgs","repos_url":"https://api.github.com/users/samirkumardas/repos","events_url":"https://api.github.com/users/samirkumardas/events{/privacy}","received_events_url":"https://api.github.com/users/samirkumardas/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-06-03T08:06:38Z","updated_at":"2016-06-03T08:06:38Z","closed_at":null,"body":"In OC 2.x, a coupon with free shipping enabled, can not be applied before selecting shipping method. If I did not choose shipping method during checkout, the applied coupon got lost whenever I refresh the page.\r\n\r\nIn OC 1.5.x, it would work as expected. I could apply coupon (with free shipping - yes) anytime whatever I chosen shipping method or not.\r\n\r\nActually following line is reseting applied coupon every time if discount amount is zero. But it should not because discount amount will not available in  the cart page unless I choose a shipping method during checkout page.\r\n\r\n> File:  catalog/model/total/coupon.php \r\n> Line: 182\r\n> Code: unset($this->session->data['coupon']);\r\n\r\nI think it should not reset when coupon type is free shipping. Something like:\r\n\r\n```\r\nif(!$coupon_info['shipping'])  {\r\n    unset($this->session->data['coupon']);\r\n }\r\n```\r\n\r\n\r\n\r\n\r\n\r\n\r\n "}}
{"actor":{"display_login":"samirkumardas"}}