pcljmk Posted May 28, 2013 Share Posted May 28, 2013 Hi. I need information how get in invoice product's main categories. Please help Link to comment Share on other sites More sharing options...
Luís Marques Posted May 28, 2013 Share Posted May 28, 2013 Hi there, I think you need to override the class responsible to send the content to PDF invoice template with the category name of each product. Then you adjust the template to show that data. Hope it helps. Link to comment Share on other sites More sharing options...
pcljmk Posted May 28, 2013 Author Share Posted May 28, 2013 (edited) Ok i did it u must modify OrderInvoice class is located in /classes/order/OrderInvoice.php put this code in function getProducts after $row['id_address_delivery'] = $order->id_address_delivery; $sql = "SELECT `name` FROM `ps_category_lang`, `ps_product` WHERE `ps_product`.`id_product`='".(int)$row['id_product']."' AND `ps_product`.`id_category_default`=`ps_category_lang`.`id_category` AND `ps_category_lang`.`id_lang`=2"; $row['product_category'] = Db::getInstance()->getValue($sql); Ive got only 1 language shop so u could use diff id_lang. and u can happy use {$order_detail.product_category} in invoice.tpl Edited May 28, 2013 by pcljmk (see edit history) 2 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