![]() |
template editing question
I'm creating a custom invoice and was wondering how to do something.
In my customer's billing & shipping address boxes I want to add the customer's phone, fax, email, and website, but ONLY IF they entered them. I have gone through and added this: Code:
{if $_userinfo.default_fields.phone} {$order.phone}<br />{/if} But if the user did not enter in a phone number then the field still adds the <br /> which on my invoice is creating a return space. With a few of these entries: email, web address, phone, fax you can see how it can add up to multiple return spaces if these fields are blank which will make my invoice look odd. Can someone tell me how to do this to where only if the customer adds the info to these fields it will show up and if they omit them then they are omitted from my invoice as well and the return space isn't placed in. Am I putting the <br /> in the wrong place? or am I referencing the wrong thing by using userinfo.default_fields.phone ? |
Re: template editing question
{if $_userinfo.default_fields.phone ne ""}{$order.phone}<br />{/if}
gotta love smarty! |
Re: template editing question
Hrmmm, ok, This is what I have now:
Code:
<table><tr><td> I'm testing this by viewing a previous order through admin area and clicking on "print invoice". If my customer has added just an email address, I'm getting 2 blank spaces between the country and email. I thought with the ne "" it would not add the return spaces? |
All times are GMT -8. The time now is 07:05 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.