Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Address Line 2 in Invoice

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 11-19-2005, 05:58 AM
 
craigbrass craigbrass is offline
 

Advanced Member
  
Join Date: May 2005
Location: Cumbria, UK
Posts: 80
 

Default Address Line 2 in Invoice

Hello,

For the shipping and billing address', I get the following shown inside the invoices :-
Billing Address
David Ullswater,
sadfsdfhsdf,
,
yrewyery,
Worcestershire,
cfghsfghf,
United Kingdom (Great Britain)

Shipping Address
David Ullswater,
sadfsdfhsdf,
,
yrewyery,
Worcestershire,
cfghsfghf,
United Kingdom (Great Britain)

Notice the 3rd line of each is ",". This is where the Address Line 2 should go. How do I get it so if the user doesn't enter an address line 2, it isn't shown on the invoice?

My code for each is as follows :-

Billing Address
Code:
{if $_userinfo.default_fields.firstname}{$order.b_firstname}{/if} {if $_userinfo.default_fields.lastname}{$order.b_lastname}{/if}, {if $_userinfo.default_fields.b_address}{$order.b_address}, {/if} {if $_userinfo.default_fields.b_address_2}{$order.b_address_2}, {/if} {if $_userinfo.default_fields.b_city}{$order.b_city}, {/if} {if $_userinfo.default_fields.b_county && $config.General.use_counties eq 'Y'}{$order.b_countyname}, {/if} {if $_userinfo.default_fields.b_state}{$order.b_statename}, {/if} {if $_userinfo.default_fields.b_zipcode}{$order.b_zipcode}, {/if} {if $_userinfo.default_fields.b_country}{$order.b_countryname}{/if}

Shipping Address
Code:
{if $_userinfo.default_fields.firstname}{$order.s_firstname}{/if} {if $_userinfo.default_fields.lastname}{$order.s_lastname}{/if}, {if $_userinfo.default_fields.s_address}{$order.s_address}, {/if} {if $_userinfo.default_fields.s_address_2}{$order.s_address_2}, {/if} {if $_userinfo.default_fields.s_city}{$order.s_city}, {/if} {if $_userinfo.default_fields.s_county && $config.General.use_counties eq 'Y'}{$order.s_countyname}, {/if} {if $_userinfo.default_fields.s_state}{$order.s_statename}, {/if} {if $_userinfo.default_fields.s_zipcode}{$order.s_zipcode}, {/if} {if $_userinfo.default_fields.s_country}{$order.s_countryname}{/if}

Best Regards,
Craig Brass
__________________
Its Elixir - www.itselixir.com
Product: X-Cart Gold
Version: 4.0.17
Status: Live

Its Elixir Wholesale - www.itselixirwholesale.com
Product: X-Cart Gold
Version: 4.0.17
Status: In Development

Real Champagne - www.realchampagne.com
Product: X-Cart Gold
Version: 4.0.17
Status: In Development
Reply With Quote
  #2  
Old 11-19-2005, 10:11 AM
  rubyaryat's Avatar 
rubyaryat rubyaryat is offline
 

eXpert
  
Join Date: Feb 2003
Location: Canada
Posts: 289
 

Default

You want to enclose the statement in another if statement to check if the field is empty.
e.g.
{if $order.b_address_2}{if $_userinfo.default_fields.b_address_2}{$order.b_ad dress_2},
{/if}{/if}

Rubyaryat
__________________
Rubymods.com - Your X-Cart services partner for over 9 years.
Modules offered: FedEx labels, Live currency rates, GeoIP, Order Audit, Multiple e-goods.
X-Cart Store Hosting, project management and affiliates program available.
4.2.3 gold [Unix]
Reply With Quote
  #3  
Old 11-20-2005, 02:42 AM
 
craigbrass craigbrass is offline
 

Advanced Member
  
Join Date: May 2005
Location: Cumbria, UK
Posts: 80
 

Default

Worked perfectly, thanks!
__________________
Its Elixir - www.itselixir.com
Product: X-Cart Gold
Version: 4.0.17
Status: Live

Its Elixir Wholesale - www.itselixirwholesale.com
Product: X-Cart Gold
Version: 4.0.17
Status: In Development

Real Champagne - www.realchampagne.com
Product: X-Cart Gold
Version: 4.0.17
Status: In Development
Reply With Quote
  #4  
Old 12-19-2005, 11:06 PM
 
begeren begeren is offline
 

Member
  
Join Date: Dec 2005
Posts: 23
 

Default

Which template can you find the above code in?
__________________
X-Cart Gold
Version 4.0.17
Reply With Quote
  #5  
Old 12-19-2005, 11:36 PM
  Dongan's Avatar 
Dongan Dongan is offline
 

X-Wizard
  
Join Date: Jul 2005
Location: www.mercuryminds.com
Posts: 1,531
 

Default

Quote:
Originally Posted by begeren
Which template can you find the above code in?

skin1/mail/html/order_invoice.tpl to be edited.
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 04:02 PM.

   

 
X-Cart forums © 2001-2020