News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

category in invoice

Started by Eddzor, December 19, 2012, 11:41:29 AM

Previous topic - Next topic

Eddzor

Hi

Can i echo the category name of the product in the invoice?

theret

Need the same thing...

The category name to show on the Invoice and Confirmation Email.

Anyone??

Thanks

luken

#2
I tried some options like $item->virtuemart_category_name; or $product->category_name;  but dosen't work.
This is my solution to put category name in Confirmation Email
In the file: invoice/invoice_items.php
after this lines

foreach($this->orderDetails['items'] as $item) {
$qtt = $item->product_quantity ;
$product_link = JURI::root().'index.php?option=com_virtuemart&view=productdetails&virtuemart_category_id=' . $item->virtuemart_category_id . '&virtuemart_product_id=' . $item->virtuemart_product_id;


add the following code

$db = JFactory::getDBO();
$query = 'SELECT `category_name` ' . ' FROM `#__virtuemart_categories_es_es` ' . ' WHERE `virtuemart_category_id` =' .$item->virtuemart_category_id ;
$db->setQuery($query);
$catname = $db->loadResult();



to print the category name, put this line  where you want
<?php echo $catname?>

The table virtuemart_categories_es_es will be diferent depending your language site.