X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Show Field Only If Data Entered (https://forum.x-cart.com/showthread.php?t=52018)

photo 01-28-2010 12:29 PM

Show Field Only If Data Entered
 
We have Tax Number enabled in the User Profiles options section but would like it to only display on the invoice if a customer does indeed have a tax number. Is there a way to use an {if} statement to accomplish this?

Example for customer with a tax number,

First Name: John
Last Name: Doe
Company: Cakes Are Us
Tax Number: 1234567
Phone: 555 1212
E-Mail: john@cakesrus.com
URL: cakesville.com

Example for customer without a tax number,

First Name: John
Last Name: Doe
Company: Cakes Are Us
Phone: 555 1212
E-Mail: john@cakesrus.com
URL: cakesville.com

Below is the current {if} statement for that field.

Code:

{if $_userinfo.default_fields.tax_number}{$lng.lbl_tax_number|truncate:$max_truncate:"...":true|cat:":"|string_format:$max_space}{$order.tax_number}
{/if}



Thanks

ARW VISIONS 01-28-2010 01:43 PM

Re: Show Field Only If Data Entered
 
try this

{if $order.tax_number ne ""}
{if $_userinfo.default_fields.tax_number}{$lng.lbl_tax _number|truncate:$max_truncate:"...":true|cat:":"| string_format:$max_space}{$order.tax_number}
{/if}
{/if}

photo 01-29-2010 05:57 AM

Re: Show Field Only If Data Entered
 
Quote:

Originally Posted by Ashley
try this

{if $order.tax_number ne ""}
{if $_userinfo.default_fields.tax_number}{$lng.lbl_tax _number|truncate:$max_truncate:"...":true|cat:":"| string_format:$max_space}{$order.tax_number}
{/if}
{/if}


Thanks Ashley, I'll give this a try.


All times are GMT -8. The time now is 01:15 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.