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

Adding Manufacturer's name to Invoice/Receipt

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 09-03-2012, 05:39 PM
 
plh plh is offline
 

Senior Member
  
Join Date: May 2004
Posts: 102
 

Default Adding Manufacturer's name to Invoice/Receipt

Hello,

I want to add the "manufacturer" before "product" in the invoice/receipt.

The field available in products is product.manufacturerid but that gives me a number. Not too helpful.

I changed order.php on line 100 and added the following:

$pids = func_query("SELECT $sql_tbl[order_details].itemid, $sql_tbl[order_details].productid, $sql_tbl[manufacturers].manufacturer,$sql_tbl[products].distribution FROM $sql_tbl[order_details], $sql_tbl[products] WHERE $sql_tbl[order_details].orderid = '$orderid' AND $sql_tbl[order_details].productid = $sql_tbl[products].productid AND $sql_tbl[products].distribution != '', $sql_tbl[manufacturers].manufacturer WHERE $sql_tbl[manufacturers].manufacturerid = $sql_tbl[products].manufacturerid");


In order_data.tpl I added: {$manufacturers.manufacturer} in front of {$product.product}.

But this does not seem to do the trick.
I must miss something somehow and hope someone can guide me in the right direction.

Thanks in advance.
__________________
X-Cart 4.4.3
- Happily EWD Hosted -
Reply With Quote
  #2  
Old 09-03-2012, 10:17 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,191
 

Default Re: Adding Manufacturer's name to Invoice/Receipt

Your sql statement is all wrong as well as the smarty code. I am suprised you are not getting an error actually. Don't even try this in order.php. I think manufacturer name is already included in product array but you need to call it properly in the template file

{$product.manufacturer}
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #3  
Old 09-04-2012, 01:04 AM
 
plh plh is offline
 

Senior Member
  
Join Date: May 2004
Posts: 102
 

Default Re: Adding Manufacturer's name to Invoice/Receipt

Unfortunately I have to disagree with your statement about the manufacturer being already in the array, as if it was I would not have posted here.

When printing an invoice/receipt from admin after order has been completed this variable is not available. The only one available is the $product.manufacturerid which returns a number when called.
__________________
X-Cart 4.4.3
- Happily EWD Hosted -
Reply With Quote
  #4  
Old 09-04-2012, 09:10 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,191
 

Default Re: Adding Manufacturer's name to Invoice/Receipt

Ok. In include/func/func.order.php in this function

function func_order_data($orderid)

just before

$products = func_query("SELECT.....

add

// added by CFL Systems
if (!empty($active_modules['Manufacturers'])) {
$join .= " LEFT JOIN $sql_tbl[manufacturers] ON $sql_tbl[manufacturers].manufacturerid = $sql_tbl[products].manufacturerid";
$fields .= ", $sql_tbl[manufacturers].manufacturer";
}

Then you can access it in the template as

{$product.manufacturer}
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote

The following 2 users thank cflsystems for this useful post:
Matt W (02-11-2014), tartaglia (09-05-2012)
  #5  
Old 09-04-2012, 02:13 PM
 
plh plh is offline
 

Senior Member
  
Join Date: May 2004
Posts: 102
 

Default Re: Adding Manufacturer's name to Invoice/Receipt

Thank you very much Steve!

Works perfectly... right out of the box
Hope this will help more people as well.

Philippe
__________________
X-Cart 4.4.3
- Happily EWD Hosted -
Reply With Quote
  #6  
Old 01-10-2013, 10:47 AM
 
plh plh is offline
 

Senior Member
  
Join Date: May 2004
Posts: 102
 

Default Re: Adding Manufacturer's name to Invoice/Receipt

This works well for the html invoice. Unfortunately this information (product.manufacturer) does not export in the QB file using orders_export_qb. What addition would be needed to get this variable through and have it available in the final QB invoice?

I tried with {$orders[oid].product_manufacturer} and does not work.

Thank you.
Philippe
__________________
X-Cart 4.4.3
- Happily EWD Hosted -
Reply With Quote
  #7  
Old 08-20-2013, 02:18 AM
 
gozindagi gozindagi is offline
 

Advanced Member
  
Join Date: Jul 2013
Posts: 61
 

Default Re: Adding Manufacturer's name to Invoice/Receipt

Quote:
Originally Posted by cflsystems
Ok. In include/func/func.order.php in this function

function func_order_data($orderid)

just before

$products = func_query("SELECT.....

add

// added by CFL Systems
if (!empty($active_modules['Manufacturers'])) {
$join .= " LEFT JOIN $sql_tbl[manufacturers] ON $sql_tbl[manufacturers].manufacturerid = $sql_tbl[products].manufacturerid";
$fields .= ", $sql_tbl[manufacturers].manufacturer";
}

Then you can access it in the template as

{$product.manufacturer}
But this code does not work x-cart-4.6.0platinum,after adding this code my site became blank.Please provide me another code which works at x-cart-4.6.0platinum.
__________________
X-cart Platinum 4.6.0
Reply With Quote
  #8  
Old 08-20-2013, 08:08 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,191
 

Default Re: Adding Manufacturer's name to Invoice/Receipt

Make sure the code added doesn't have any broken words, the forum tends to break words with white spaces.
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote

The following user thanks cflsystems for this useful post:
gozindagi (08-20-2013)
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



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 08:34 AM.

   

 
X-Cart forums © 2001-2020