Jump to content

Display Shipping and Billing Address on Invoice Print


bigpedro
 Share

Recommended Posts

We do not need to have the site logo on our printed invoice as it is used for internal purposes only.  However we would like both the delivery and billing address to be shown.

 

On admin/skins/default/templates/orders.print.php I have deleted the store logo and it is my intention to display the billing address in it's place.  

 

However this is where my problem is!!  I guess I have to call this info on admin/sources/orders.in.php ?

 

I'm sure it's an easy answer.  I just can't find it!

 

Any Ideas?

Link to comment
Share on other sites

CubeCart gets all the data relevant to an order. However, some of that data is not in a human-readable form.

 

In /admin/sources/orders.index.inc.php, near line 417, starts the gathering/processing of data to be printed.

 

Near line 458 is a pair of statements that fetches the state name from the supplied state code number for the delivery address (state_d and country_d). We need to add two more statements that will do the same for the billing address (state and country):

            $summary['state'] = (is_numeric($summary['state'])) ? getStateFormat($summary['state']) : $summary['state'];
            $summary['country'] = getCountryFormat($summary['country']);

Fixing the above, we now have a full workable array to be used in the template:

$order.company_name

$order.title

$order.first_name

$order.line1

$order.line2

$order.town

$order.state

$order.postcode

$order.country

Link to comment
Share on other sites

  • 4 weeks later...

In the file /admin/skins/default/templates/orders.print.php, near line 65, starts a fieldset of shipping information. If you want to add another fieldset below it, try adding the following after the </fieldset> on line 70:

<fieldset class="other"><legend>Order placed by:</legend>
  <div>
    {if !empty($order.name) && empty($order.last_name)}{$order.name}{else}{$order.title} {$order.first_name} {$order.last_name}{/if}<br />
    {if !empty($order.company_name)}{$order.company_name}<br />{/if}
  </div>
</fieldset>

This gives us the First and Last Name (and the Company Name if it exists) of the Billing Address info.

 

Finally, in admin, Maintenance, Rebuild tab, clear the cache so that CubeCart will fetch and use this new copy of the template.
 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...