Display custom fields (textarea) on invoices

  • Posts: 10
  • Thank you received: 0
8 years 11 months ago #223151

-- HikaShop version -- : 2.7
-- Joomla version -- : 2.5

Hi,
I have added a custom field (textarea) for a customer to add Shipping notes during checkout. I want the data from this textarea to show up on the invoices. I have tried adding the code to the invoice template:

<?php echo "Shipping Notes: ".$this->order->shippingnotes; ?>

where 'shippingnotes' is the column name. When I add this to the invoice template it only shows the string 'Shipping Notes:' but does not show the info that the customer filled out.

Any ideas?

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

  • Posts: 82868
  • Thank you received: 13375
  • MODERATOR
8 years 11 months ago #223198

Hi,

In which file exactly are you adding that code ?
Do you use the PDF invoice plugin ?
Could you provide a screenshot of the settings of your custom field ?

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

  • Posts: 10
  • Thank you received: 0
8 years 11 months ago #223233

Hi Nicolas,
I am editing the invoice file under Display>Views. I am not using the PDF invoice plugin

Attached (screenshot.jpg) is an image of how my custom field is set up. And screenshot1.jpg is how it is showing up on the invoice

Attachments:

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
8 years 11 months ago #223235

Hi,

Your custom field is an "address" custom field ; so you won't be able to access to the data through " $this->order->shippingnotes " because it is not an order custom field.
You should read the content in the shipping address data of the order.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: huwhuw

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

  • Posts: 10
  • Thank you received: 0
8 years 11 months ago #223420

And how would I go about doing that?
I've tried: <?php echo "Shipping Notes: ".$this->shipping_address->shippingnotes; ?>
and : <?php echo "Shipping Notes: ".$this->address->shippingnotes; ?>

Am I missing something?

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

  • Posts: 10
  • Thank you received: 0
8 years 11 months ago #223421

Actually I got it to display by adding {shippingnotes} to the address_template file, but what I really want to do is have it displayed at the bottom of the invoice under Shipping method, Payment method (see attachment)

Attachments:

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

  • Posts: 82868
  • Thank you received: 13375
  • MODERATOR
8 years 11 months ago #223455

Hi,

Custom address fields are there to complete the addresses.
If you want fields related to the whole order, then you should instead create custom fields of the table "order" via the menu Display>Custom fields.
The customer will also be able to fill them during the checkout and they will appear where you want on your invoices.

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

Time to create page: 0.058 seconds
Powered by Kunena Forum