darius
#1
Hello, could someone check if following is correct
{% if u.intracom_vat and not o.tax_total %}
{{ __("A") }}
{% elseif o.tax_total %}
{% else %}
{{ __("B") }}
{% endif %}
Thank you
Basically what I want is,
if customer from EU pay tax this snippet would print empty field
if customer from EU company tax exempt this should print lang B (u.intracom_vat)
if customer is outside EU it should print lang A
Please clarify condition when u.intracom_vat is not empty
darius
#3
If is filled, not empty it should print {{ __("B") }}
Please clarify condition when u.intracom_vat is not empty
Hello, could someone check if following is correct
{% if u.intracom_vat and not o.tax_total %}
{{ __("A") }}
{% elseif o.tax_total %}
{% else %}
{{ __("B") }}
{% endif %}
Thank you
Basically what I want is,
if customer from EU pay tax this snippet would print empty field
if customer from EU company tax exempt this should print lang B (u.intracom_vat)
if customer is outside EU it should print lang A
You can simplify this statement:
{% if (u.intracom_vat) and (o.tax_total is empty) %}
{{ __("A") }}
{% elseif o.tax_total is empty %}
{{ __("B") }}
{% endif %}
Test it, but note that sometimes 0.00 value can be considered as string and cannot pass the empty condition
darius
#6
Yes tax is not empty its 0% = 0.00
Its exactly what I am missing
{% if u.intracom_vat and o.tax_total = 0 %} how to write this in correct way ?
Test it, but note that sometimes 0.00 value can be considered as string and cannot pass the empty condition
Try
{% if u.intracom_vat and o.tax_total == '0.00' %}
darius
#8
Sorted this by myself with your help, thank you both!
Here is my solution for those who use this addon to exempt tax to EU business and with to print lang variable directive acordingly
https://marketplace.cs-cart.com/add-ons/customer-experience/cs-cart-european-vat-number.html
{% if intracom_vat.eu_tax_exempt == 'Y' %}
{{ __("directive49") }}
{% elseif (intracom_vat.eu_tax_exempt == 'N') and (o.tax_total is empty) %}
{{ __("directive41") }}
{% else %}
{% endif %}