Jump to content

Products main category in invoice


pcljmk

Recommended Posts

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 by pcljmk (see edit history)
  • Like 2
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...