Dirty Butter Posted April 30, 2012 Share Posted April 30, 2012 I need help with this section of code in orders.print.php so an address that DID NOT include a State/Province would not end up with the , on a line by itself. {$order.title_d} {$order.first_name_d} {$order.last_name_d}<br /> {if !empty($order.company_name_d)}{$order.company_name_d}<br />{/if} {$order.line1_d} <br /> {if !empty($order.line2_d)}{$order.line2_d}<br />{/if} {$order.town_d}<br /> {$order.state_d}, {$order.postcode_d}<br /> {$order.country_d} Most recent order with this issue looks like this on the Packing Slip at the end of the delivery address: BESSANS , 73480 France There should be some way to use the {if !empty... coding that is used for business names and 2nd line to street address, but I couldn't figure it out. Any ideas? Quote Link to comment Share on other sites More sharing options...
Toucan Web Design Posted May 1, 2012 Share Posted May 1, 2012 Try: {if !empty($order.state_d)}{$order.state_d}, {/if}{$order.postcode_d}<br /> Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted May 1, 2012 Author Share Posted May 1, 2012 Thanks, Toucan. I thought I had tried that, but evidently not. That worked perfectly!! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.