View Single Post
  #3  
Old 04-19-2006, 03:20 PM
 
sundance sundance is offline
 

Member
  
Join Date: Oct 2004
Posts: 27
 

Default

Here is a TOTALLY DIRTY way to show the Manufacturer Names on Invoices.

Apply this fix to:
/mail/html/order_data.tpl

You can place it where you want, but in this instance I have placed it just after
Code:
{foreach from=$products item=product} <TR> <TD align="center">{$product.productcode}</TD> <TD><FONT style="FONT-SIZE: 11px">

so that the manufacturer name appears on the invoice with a comma, followed by the product name.

Code:
{* RG Add Manufacturer to Invoice Start *} {php} $manid=$this->_tpl_vars['product']['manufacturerid'] ; $productman= func_query_first_cell("select manufacturer from xcart_manufacturers where manufacturerid=$manid"); if ($productman!="") { echo " $productman, "; } {/php} {* RG Add Manufacturer to Invoice End *}

These are the reasons this fix is BAD:

1. It is hardcoded PHP in a template
2. I have hardcoded the xcart table name (xcart_manufacturers) into the template - this may need to change depending on your table names.
3. There MUST be a more elegant way to do the database call than hardcoded here in the template like this, but necessity has forced me to produce this dirty fix instead.

This is the reason this fix is GOOD:

1. It works.

Hope this helps somebody.

Rob
__________________
Xcart 4.0.17
Reply With Quote