{"action":"closed","issue":{"url":"https://api.github.com/repos/cubecart/v6/issues/898","labels_url":"https://api.github.com/repos/cubecart/v6/issues/898/labels{/name}","comments_url":"https://api.github.com/repos/cubecart/v6/issues/898/comments","events_url":"https://api.github.com/repos/cubecart/v6/issues/898/events","html_url":"https://github.com/cubecart/v6/issues/898","id":114813038,"number":898,"title":"Slight Coupon Code Tweaks","user":{"login":"SemperFiWS","id":6945093,"avatar_url":"https://avatars.githubusercontent.com/u/6945093?v=3","gravatar_id":"","url":"https://api.github.com/users/SemperFiWS","html_url":"https://github.com/SemperFiWS","followers_url":"https://api.github.com/users/SemperFiWS/followers","following_url":"https://api.github.com/users/SemperFiWS/following{/other_user}","gists_url":"https://api.github.com/users/SemperFiWS/gists{/gist_id}","starred_url":"https://api.github.com/users/SemperFiWS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SemperFiWS/subscriptions","organizations_url":"https://api.github.com/users/SemperFiWS/orgs","repos_url":"https://api.github.com/users/SemperFiWS/repos","events_url":"https://api.github.com/users/SemperFiWS/events{/privacy}","received_events_url":"https://api.github.com/users/SemperFiWS/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/cubecart/v6/labels/misc","name":"misc","color":"5319e7"}],"state":"closed","locked":false,"assignee":{"login":"abrookbanks","id":4520803,"avatar_url":"https://avatars.githubusercontent.com/u/4520803?v=3","gravatar_id":"","url":"https://api.github.com/users/abrookbanks","html_url":"https://github.com/abrookbanks","followers_url":"https://api.github.com/users/abrookbanks/followers","following_url":"https://api.github.com/users/abrookbanks/following{/other_user}","gists_url":"https://api.github.com/users/abrookbanks/gists{/gist_id}","starred_url":"https://api.github.com/users/abrookbanks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abrookbanks/subscriptions","organizations_url":"https://api.github.com/users/abrookbanks/orgs","repos_url":"https://api.github.com/users/abrookbanks/repos","events_url":"https://api.github.com/users/abrookbanks/events{/privacy}","received_events_url":"https://api.github.com/users/abrookbanks/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/cubecart/v6/milestones/18","html_url":"https://github.com/cubecart/v6/milestones/6.0.9","labels_url":"https://api.github.com/repos/cubecart/v6/milestones/18/labels","id":1353021,"number":18,"title":"6.0.9","description":"","creator":{"login":"abrookbanks","id":4520803,"avatar_url":"https://avatars.githubusercontent.com/u/4520803?v=3","gravatar_id":"","url":"https://api.github.com/users/abrookbanks","html_url":"https://github.com/abrookbanks","followers_url":"https://api.github.com/users/abrookbanks/followers","following_url":"https://api.github.com/users/abrookbanks/following{/other_user}","gists_url":"https://api.github.com/users/abrookbanks/gists{/gist_id}","starred_url":"https://api.github.com/users/abrookbanks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abrookbanks/subscriptions","organizations_url":"https://api.github.com/users/abrookbanks/orgs","repos_url":"https://api.github.com/users/abrookbanks/repos","events_url":"https://api.github.com/users/abrookbanks/events{/privacy}","received_events_url":"https://api.github.com/users/abrookbanks/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":18,"state":"open","created_at":"2015-10-13T11:30:24Z","updated_at":"2015-11-10T16:54:26Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2015-11-03T13:15:31Z","updated_at":"2015-11-10T16:54:26Z","closed_at":"2015-11-10T16:54:26Z","body":"I have been working on a coupons enhancement modification / plugin for a client of mine.\r\n\r\nAs part of that, in the '/classes/cubecart.class.php' file I needed to move this:\r\n```php\r\n            if (isset($this->_basket['coupons']) && is_array($this->_basket['coupons']) || !empty($this->_basket['discount'])) {\r\n                if (!empty($this->_basket['discount']) && $this->_basket['discount']>0) {\r\n                    $GLOBALS['smarty']->assign('DISCOUNT', $GLOBALS['tax']->priceFormat($this->_basket['discount']));\r\n                }\r\n\r\n                if (is_array($this->_basket['coupons'])) {\r\n                    foreach ($this->_basket['coupons'] as $coupon) {\r\n                        $coupon['remove_code'] = $coupon['voucher'];\r\n                        if ($coupon['type'] == 'fixed') {\r\n                            $this->_basket['discount_type'] = 'f';\r\n                            $coupon['value'] = $GLOBALS['tax']->priceFormat($coupon['value_display'], true);\r\n                            $coupons[] = $coupon;\r\n                        } else if ($coupon['type'] == 'percent') {\r\n                            $this->_basket['discount_type'] = $coupon['products'] ? 'pp' : 'p';\r\n                            $coupon['voucher'] .= ' ('.$coupon['value'].'%)';\r\n                            $coupon['value'] = $GLOBALS['tax']->priceFormat($coupon['value_display'], true);\r\n                            $coupons[] = $coupon;\r\n                        }\r\n                    }\r\n                    $GLOBALS['smarty']->assign('COUPONS', $coupons);\r\n                }\r\n            }\r\n```\r\nabove the shipping code so shipping would calculate after the coupon is set.\r\n\r\nIs there any chance that code change could be implemented in the next CC6 release?\r\nIf so, could a hook be added immediately after it?"}}