Skip to main content

Custom field display in the PDF plugin invoic

1 year 1 month ago #368778 by Gonzalez Villoria
-- HikaShop version -- : 6.1.0
-- Joomla version -- : 4.4.13
-- PHP version -- : 8

Hello, I have the invoice PDF plugin installed and I need to include a custom text field in the product table (it’s a batch for traceability). How can I do this? Thank you.

Please Log in or Create an account to join the conversation.

1 year 1 month ago #368780 by nicolas
Hi,

Go in the menu Display>Views and search for the pdf_layout view.
You'll find the 4 different layout files corresponding to the "layout" setting in the PDF invoice plugin.
So edit the one corresponding to the layout you're using.
There, the product name is displayed with the code:
Code:
echo implode('<br/>',$this->str_split_unicode(strip_tags($product->order_product_name),50));
In $product , you don't directly have the custom product fields data, however you have the product_id.
So, you can use such code, below the product name display code:
Code:
$productClass = hikashop_get('class.product'); $productData = $productClass->get($product->product_id); echo '<br/>'. $productData->xxx;
where xxx is the column name of your custom product field.

Please Log in or Create an account to join the conversation.

Time to create page: 0.057 seconds
Powered by Kunena Forum