Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Smarty Help For Document Editing Rate Topic   - - - - -

 

Posted 14 April 2017 - 05:35 AM #1

Can anyone help me with syntax for hiding the tax line from my order summary document when no tax is charged?

 

<td style="padding-bottom: 20px; text-transform: uppercase; font-family: Helvetica, Arial, sans-serif;" align="left">{% if o.tax_total %} {{o.tax_name}} {% endif %}</td>
<td style="font-family: Helvetica, Arial, sans-serif;" align="right">{% if o.tax_total %} {{o.tax_total}} {% endif %}</td>

 

in the example above, I tried to use the "if" statements that were used for the discount lines below. I did not expect it to work because there is always a value in that data field. But I've tried using a statement such as "{% if o.tax_total != '$0.00'%}" and it doesn't work. I've never tried programming PHP or Smarty code and don't know anything other that what is quickly referenced on the Web. I assume this is a simple syntax thing. Any help will be appreciated.



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19764 posts

Posted 14 April 2017 - 06:07 AM #2

Please try

{% if o.tax_total != '0.00' %}

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 

Posted 14 April 2017 - 05:05 PM #3

Thanks for the quick reply, eComLabs! Unfortunately, this doesn't work. It seems the only difference in my attempt and yours is the removal of the "$" I don't see anywhere in the order summary doc where that would be inserted, so I assume that is part of the database entry--presumably as part of a text field. If I put the dollar sign into that field, as in, "{% if o.tax_total != '$0.00' %}", I get this error message: "Error Expected name or number at line 81". Is the "$" a special character that needs to be noted a certain way?



 

Posted 14 April 2017 - 05:16 PM #4

Thanks for the quick reply, eComLabs! Unfortunately, this doesn't work. It seems the only difference in my attempt and yours is the removal of the "$" I don't see anywhere in the order summary doc where that would be inserted, so I assume that is part of the database entry--presumably as part of a text field. If I put the dollar sign into that field, as in, "{% if o.tax_total != '$0.00' %}", I get this error message: "Error Expected name or number at line 81". Is the "$" a special character that needs to be noted a certain way?

Disregard the error message that I referenced above. That was a result of experimenting with the tag: "{{ o.taxes.[0..N] }}"