Skip to main content

Custom messages in invoice user type / country

12 years 1 month ago - 12 years 1 month ago #176570 by crealiagroup
-- 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?
Last edit: 12 years 1 month ago by crealiagroup.

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

12 years 1 month ago #176582 by Xavier
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:
Code:
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.

12 years 1 month ago #176801 by crealiagroup
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.

12 years 1 month ago #176809 by nicolas
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.083 seconds
Powered by Kunena Forum