Custom messages in invoice user type / country

  • Posts: 117
  • Thank you received: 3
9 years 5 months ago #176570

-- HikaShop version -- : 2.3.3
-- Joomla version -- : 3.3.6
-- PHP version -- : 5.4.33
-- Browser(s) name and version -- : any

Hi, I need to display in every invoice, at the bottom of the invoice, 3 different kind of custom messages according to combination of 2 conditions: user type (individual or company with and/or without VAT) and country.

I'll try to explain better with a simple table that shows you the combination of messages according to my needs, please watch attached image.

What could be the best way to do that?

Attachments:
Last edit: 9 years 5 months ago by crealiagroup.

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

  • Posts: 13201
  • Thank you received: 2322
9 years 5 months ago #176582

Hi,

You have to edit the views "order / invoice" (backend) and "order / show" (frontend) and add a php if / switch condition on the custom fields values.
Something like:

if(in_array($this->element->billing_address->address_country,array('France','Spain','...'))){
	if(!empty($this->element->billing_address->address_vat))
		echo "CUSTOM MESSAGE 1";
}elseif($this->element->billing_address->address_country != 'Italy'){
	if(empty($this->element->billing_address->address_vat))
		echo "CUSTOM MESSAGE 2";
	else
		echo "CUSTOM MESSAGE 3";
}

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

  • Posts: 117
  • Thank you received: 3
9 years 5 months ago #176801

Hi Xavier, thanks for your suggestion.

Is there a way to use the zone instead of the array with the names of all the countryes?

I just would obtain a solution that is valid even in future when some countryes will have to move in or out from the zone.

Thanks in advice.

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

  • Posts: 81484
  • Thank you received: 13062
  • MODERATOR
9 years 5 months ago #176809

Hi,

With more complex code and a MySQL query yes.
I invite you to contact our partners for a quote on that customization in that case:
www.hikashop.com/home/our-partners.html
or post a request on our commercial jobs forum.

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

Time to create page: 0.066 seconds
Powered by Kunena Forum