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

hide customer company line on invoice if none entered v4.1.1

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 06-05-2006, 01:31 PM
 
successco successco is offline
 

Advanced Member
  
Join Date: Apr 2005
Location: Washington USA
Posts: 42
 

Default hide customer company line on invoice if none entered v4.1.1

To not show a line for Company Name: with a blank after it if the customer did not enter a company name in the registration field that was (optional) , not (required)

for the standard customer information

on the invoice page such as /order.php?orderid=##

above where First Name : // Last Name : // etc. is on the invoice

in File: /mail/html/order_invoice.tpl you can replace:

Code:
{if $_userinfo.default_fields.company} <tr> <td>{$lng.lbl_company}:</td> <td>{$order.company}</td> </tr> {/if}

with:

Code:
{if $_userinfo.default_fields.company} {if $order.company ne ''} <tr> <td>{$lng.lbl_company}:</td> <td>{$order.company}</td> </tr> {/if} {/if}

All it really does is check if 'company' has a value in the database table xcart_orders (where it grabs all the other info for the customer that was accurate at the time of the order being placed) before it decides to print Company: (blank) or Company: ACME Gadgets, Inc.

if there is a value it will print: Company: ACME Gadgets, Inc.
if there is not a value it will not print Company: (blank)

So you end up with a nicer-looking invoice i think

Hope this helps someone , took me a while to figure out so I figured I'd share

-Diana
__________________
X-cart Gold 4.1.6
X-affiliate 4.1.6
Reply With Quote
  #2  
Old 06-06-2006, 10:57 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default

One of those things that you'd think would be standard
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



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 01:26 AM.

   

 
X-Cart forums © 2001-2020