X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   hide customer company line on invoice if none entered v4.1.1 (https://forum.x-cart.com/showthread.php?t=22292)

successco 06-05-2006 01:31 PM

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

balinor 06-06-2006 10:57 AM

One of those things that you'd think would be standard :)


All times are GMT -8. The time now is 10:57 PM.

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