Custom messages in invoice user type / country
- crealiagroup
-
Topic Author
- Offline
Less
More
11 years 11 months ago - 11 years 11 months ago #176570
by crealiagroup
Custom messages in invoice user type / country was created 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?
-- 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: 11 years 11 months ago by crealiagroup.
Please Log in or Create an account to join the conversation.
11 years 11 months ago #176582
by Xavier
Replied by Xavier on topic Custom messages in invoice user type / country
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:
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.
- crealiagroup
-
Topic Author
- Offline
11 years 11 months ago #176801
by crealiagroup
Replied by crealiagroup on topic Custom messages in invoice user type / country
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.
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.
11 years 11 months ago #176809
by nicolas
Replied by nicolas on topic Custom messages in invoice user type / country
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.
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.204 seconds