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)
-   -   Adding Manufacturer's name to Invoice/Receipt (https://forum.x-cart.com/showthread.php?t=64760)

plh 09-03-2012 05:39 PM

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.

cflsystems 09-03-2012 10:17 PM

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}

plh 09-04-2012 01:04 AM

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.

cflsystems 09-04-2012 09:10 AM

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}

plh 09-04-2012 02:13 PM

Re: Adding Manufacturer's name to Invoice/Receipt
 
Thank you very much Steve!

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

Philippe

plh 01-10-2013 10:47 AM

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

gozindagi 08-20-2013 02:18 AM

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.

cflsystems 08-20-2013 08:08 AM

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.


All times are GMT -8. The time now is 06:24 AM.

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