address2 and custom field (address3) not on invoic

  • Posts: 20
  • Thank you received: 0
12 years 4 weeks ago #69014

Hi,

I am new to Hikashop and I am trying to change some things for my customer. They want to have the address fields seperated in:

address1 - streetname
address2 - housenumber
address3 - housenumber suffix

I have added address3 as a custom field, which is displayed correctly in the order overview in Hikashop.



I am using PDF invoice, and there both address2 and address3 are not shown



I am not familiar with PHP and I am new to Hikashop. Could somebody help me solving this issue?

I am using Joomla 2.5.7 and Hikashop 1.6.0

Thanxx a lot :-)

Attachments:

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

  • Posts: 82758
  • Thank you received: 13346
  • MODERATOR
12 years 4 weeks ago #69021

Hi,

You will have to edit the file plugins/hikashop/attachinvoice/attachinvoice/invoice.php and change the code displaying the address.

Here is the code you want to change:

<?php
					if(!empty($order->$oneAddress->address_company)) echo $order->$oneAddress->address_company.'<br/>';
					echo $order->$oneAddress->address_title.' '.$order->$oneAddress->address_firstname.' '.$order->$oneAddress->address_lastname.'<br/>';
					echo $order->$oneAddress->address_street.'<br/>';
					echo $order->$oneAddress->address_post_code.' '.$order->$oneAddress->address_city.' '.$order->$oneAddress->address_state.'<br/>';
					echo $order->$oneAddress->address_country.'<br/>';
					if(!empty($order->$oneAddress->address_telephone)) echo JText::sprintf('TELEPHONE_IN_ADDRESS',$order->$oneAddress->address_telephone).'<br/>';
					if(!empty($order->$oneAddress->address_vat)) echo JText::_('VAT_NUMBER').' : '.$order->$oneAddress->address_vat.'<br/>';
					?>

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

  • Posts: 20
  • Thank you received: 0
12 years 4 weeks ago #69043

Super! Thanxx for the help

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

  • Posts: 20
  • Thank you received: 0
12 years 3 weeks ago #69784

Hi Nicolas,

With PDF invoice it is working perfectly. But the standard Hikashop Email are missing those extra fields. As I told you before, I don't know PHP that well. Would you please tell me which files I have to change in order to add those extra fields to the standard Hikashop conformation mails?

Thanxx a lot for the help

Ron

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

  • Posts: 82758
  • Thank you received: 13346
  • MODERATOR
12 years 3 weeks ago #69901

Hi,

For the emails, you need to edit the files address_template via the menu Display->Views. They are even easier to edit than the PDF invoice so it should be easy for you. Just make sure that you edit all of them.

The following user(s) said Thank You: ronsnijder

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

  • Posts: 246
  • Thank you received: 9
  • Hikashop Business Hikashop Essential
11 years 3 months ago #113981

I changed invoice.php, but its not working. Whats wrong?

<?php
					if(!empty($order->$oneAddress->address_company)) echo $order->$oneAddress->address_company.'<br/>';
					echo $order->$oneAddress->address_title.' '.$order->$oneAddress->address_firstname.' '.$order->$oneAddress->address_lastname.'<br/>';
					echo $order->$oneAddress->address_street.' '.$order->$oneAddress->address_nr.' '.$order->$oneAddress->address_ext.'<br/>';
					echo $order->$oneAddress->address_post_code.' '.$order->$oneAddress->address_city.' '.$order->$oneAddress->address_state.'<br/>';
					echo $order->$oneAddress->address_country.'<br/>';
					if(!empty($order->$oneAddress->address_telephone)) echo JText::sprintf('TELEPHONE_IN_ADDRESS',$order->$oneAddress->address_telephone).'<br/>';
					if(!empty($order->$oneAddress->address_vat)) echo JText::_('VAT_NUMBER').' : '.$order->$oneAddress->address_vat.'<br/>';
					?>

This line I changed:
echo $order->$oneAddress->address_street.' '.$order->$oneAddress->address_nr.' '.$order->$oneAddress->address_ext.'<br/>';


I'll keep on trying!

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

  • Posts: 13201
  • Thank you received: 2322
11 years 3 months ago #114056

Hi,

This should work, are you sure that your custom fields have this column name in the menu Display > Custom fields ?
The code seems to be ok.

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

  • Posts: 246
  • Thank you received: 9
  • Hikashop Business Hikashop Essential
11 years 3 months ago #114107

Stupid me, I made typo :blush:
Now its working, Thanks.


I'll keep on trying!

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

Time to create page: 0.097 seconds
Powered by Kunena Forum