I am trying to show subcategory name of a product on invoice.
I was successful in showing category name by adding following code in getProducts() in classes/order/orderinvoice.php file:-
$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`=1";
$row['product_category'] = Db::getInstance()->getValue($sql);
and then adding following code in pdf/invoice.tpl file :-
{$order_detail.product_category}
Can anyone please tell how to get subcategory name of product on invoice ?