bloggus Posted November 8, 2017 Share Posted November 8, 2017 Is it possible to get voucher code on order confirmation page - actually whih code was used with the purchase? Looked in $params['objOrder'] but can't find the code there, only discount amount. Link to comment Share on other sites More sharing options...
bellini13 Posted November 10, 2017 Share Posted November 10, 2017 The order object has a function named getCartRules() $params['objOrder']->getCartRules() You can search other Prestashop code to see how it is used Link to comment Share on other sites More sharing options...
bloggus Posted November 10, 2017 Author Share Posted November 10, 2017 Great thank you. I missed that, but that give sme the ID or name, but not the code. Anyway I can get code from ID od the cart rule? Link to comment Share on other sites More sharing options...
bloggus Posted November 10, 2017 Author Share Posted November 10, 2017 I got it. Had to call direkt the database. Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('SELECT `code` FROM `'._DB_PREFIX_.'cart_rule` WHERE `id_cart_rule` = \''.$id_cart_rule.'\'') Link to comment Share on other sites More sharing options...
bellini13 Posted November 11, 2017 Share Posted November 11, 2017 is that code getting the coupon code that was originally in the cart, or currently on the order? There is a pretty significant difference, no? Link to comment Share on other sites More sharing options...
Lugi Annese Posted February 7 Share Posted February 7 I am also looking for this solution, have you found it? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now