Add column in invoice product list?

  • Posts: 12
  • Thank you received: 0
12 years 4 months ago #54436

I have a custom field in product that i would like to show on the shipping invoice. How can I show this custom field?

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

  • Posts: 82818
  • Thank you received: 13361
  • MODERATOR
12 years 4 months ago #54484

You will have to edit the file "invoice" of the view "order" for your back end template via the menu Display->Views and add your code there to add the custom field column.

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

  • Posts: 12
  • Thank you received: 0
12 years 4 months ago #54552

I have tried, as described in this thread: www.hikashop.com/en/forum/2-general-talk...g-invoice.html#38726

But i don't know where to insert the code. My PHP-skills are not good, but I made an extra column in the product list, but it will not show the values of my custom field. The column I insert is blank. The heading is ok.

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

  • Posts: 82818
  • Thank you received: 13361
  • MODERATOR
12 years 4 months ago #54576

Please give more information so that we can help you.
What code did you add so far ?
What custom field are you trying to display (could you do a screenshot of its options?) ?

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

  • Posts: 12
  • Thank you received: 0
12 years 1 week ago #75121

I have a custum field called "Lokasjon" in the product table. I want to show this field in the invoice.
I know i should insert the code in the file "invoice" of the view "order".
But I cannot understand where to insert, and what code to add.

In the product list in the invoice I want this field "Lokasjon" to be before or after the excisting field "Product".

This is my settings for the field "Lokasjon":

Attachments:

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

  • Posts: 82818
  • Thank you received: 13361
  • MODERATOR
12 years 6 days ago #75456

The product name is displayed by this line in the invoice:
<?php echo $product->order_product_name.' '.$product->order_product_code;?>

just add after it the code:
<?php $productClass = hikashop_get('class.product');
$productData = $productClass->get($product->product_id);
echo $productData ->lokasjon; ?>

Last edit: 12 years 6 days ago by nicolas.

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

Time to create page: 0.067 seconds
Powered by Kunena Forum