X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Putting the Username on Invoices? Anyone? (https://forum.x-cart.com/showthread.php?t=59425)

spence88mph 05-19-2011 01:55 PM

Putting the Username on Invoices? Anyone?
 
Hi,

Anyone know how to put the username on the invoice, I'm stumped.

It's for a 4.4.3 cart,

thanks heaps

Spence

vasilis 05-20-2011 01:59 AM

Re: Putting the Username on Invoices? Anyone?
 
You must edit the /mail/html/order_invoice.tpl file (which will be either in skin/common_files dir or skin/<skin_used> dir if you have done any modifications already to that template).
Find the following code (around line 77 in 4.4.2 version):
Code:

<table cellspacing="0"{if $is_nomail eq 'Y'} class="invoice-personal-info"{else} cellpadding="0" style="width:45%; border: 0px none; margin-bottom: 15px;"{/if} summary="{$lng.lbl_address|escape}">
       
        <tr>
          <td><strong>{$lng.lbl_email}:</strong></td>
          <td>{$order.email}</td>
        </tr>
                       
        {if $_userinfo.default_fields.title}
          <tr>
            <td><strong>{$lng.lbl_title}:</strong></td>
            <td>{$order.title}</td>
          </tr>
        {/if}

        {if $_userinfo.default_fields.firstname}
          <tr>
            <td{if $is_nomail ne 'Y'} nowrap="nowrap"{/if}><strong>{$lng.lbl_first_name}:</strong></td>
            <td>{$order.firstname}</td>
          </tr>
        {/if}
......................
......................
......................


and wherever you want to display the username field, among the <tr> tags, insert an additional table row:
Code:

<tr>
          <td><strong>username:</strong></td>
          <td>{$userinfo.username}</td>
 </tr>

You might have to use different smarty variable names (although I don't think so), I've checked those in 4.4.2 version - check smarty variables in Webmaster mode.

spence88mph 05-20-2011 02:32 AM

Re: Putting the Username on Invoices? Anyone?
 
thanks a lot mate, I'll give it a ago.

spence88mph 05-20-2011 02:46 AM

Re: Putting the Username on Invoices? Anyone?
 
Eventhough my site is login via username not password, {$userinfo.username} returns the email address not the username.

vasilis 05-20-2011 02:54 AM

Re: Putting the Username on Invoices? Anyone?
 
could it be that the email address has been used for a username ?

spence88mph 05-20-2011 03:09 AM

Re: Putting the Username on Invoices? Anyone?
 
That's what I thought but no it's not I have it set for login via username not email. the call I have found through webmaster mode in admin is 'uname'. So I tried {$userinfo.uname} but it displays nothing. Thanks for looking though.

vasilis 05-20-2011 05:19 AM

Re: Putting the Username on Invoices? Anyone?
 
order_invoice.tpl is called by main/order_message.tpl so you might want to take a look in the calling line - some smarty variables are assigned there which pass on to order_invoice.tpl

spence88mph 05-20-2011 05:40 AM

Re: Putting the Username on Invoices? Anyone?
 
thanks buddy will do

spence88mph 05-20-2011 09:46 PM

Re: Putting the Username on Invoices? Anyone?
 
ended up being {$userinfo.login}, works a charm, thanks for you help!

SGS 11-24-2011 02:35 AM

Re: Putting the Username on Invoices? Anyone?
 
I found that to get a username to show up on an Invoice I had to use this:{$_userinfo.login}

Worked using Pro 4.4.4.

Hope that helps anyone else looking to put a user name on an invoice. I would think that would be a given. Maybe QT can build that one in next build???

SGS


All times are GMT -8. The time now is 11:09 AM.

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