model is set but sku isn't.
For that one you need to make 2 edits.
1 to the cart controller
and
1 to the cart library
1. EDIT: system/library/cart.php
2. FIND:
3. AFTER, ADD:
4 EDIT: catalog/controller/checkout/cart.php
5. FIND:
6. AFTER, ADD:
For that one you need to make 2 edits.
1 to the cart controller
and
1 to the cart library
1. EDIT: system/library/cart.php
2. FIND:
Code: Select all
'model' => $product_query->row['model'],
Code: Select all
'sku' => $product_query->row['sku'],
5. FIND:
Code: Select all
'model' => $result['model'],
Code: Select all
'sku' => $result['sku'],
Hey Guys,
I would need such feature as well and as far I can see, it was dropped from the 1.4.8 to do list and I don`t know if this will come in the 1.4.9 release as there are mostly only fixes. Anyway I can not wait so long So I am trying to add this feature by myself.
I managed to alter the order_product table and files so the SKU is pulled on the invoice, so far I have to add the sku to the table manually, but I would like, that it would be added to the table row automatically at the time of purchase.
Does anyone know which file is responsible for the processing of the final order? Meaning -> pulling data from the cart and placing them to the tables? I am reading through the code, but have no luck to find the right functions.
As soon I will finish this, I will post a how to in this topic.
Thank you all!
I would need such feature as well and as far I can see, it was dropped from the 1.4.8 to do list and I don`t know if this will come in the 1.4.9 release as there are mostly only fixes. Anyway I can not wait so long So I am trying to add this feature by myself.
I managed to alter the order_product table and files so the SKU is pulled on the invoice, so far I have to add the sku to the table manually, but I would like, that it would be added to the table row automatically at the time of purchase.
Does anyone know which file is responsible for the processing of the final order? Meaning -> pulling data from the cart and placing them to the tables? I am reading through the code, but have no luck to find the right functions.
As soon I will finish this, I will post a how to in this topic.
Thank you all!
using oc 1.5.6
you know what forget my question, who can read has an advantage
Folks got it working.
1) add the table row for "order_product"
MySQL edit :
go to phpMyAdmin or whatever you are using, go to "your_opencart_db" and open the "order_product" table (may be called otherwise if you are using prefixes) and execute the following SQL query
the new row named "sku" should appear.
Note : existing orders need to be populated with skus manually. Best way is to export a CSV File
of "order_product" table and "product" table and use vlookup function to match Product IDs
with SKUs and reupload. For troubleshooting see -> SQL Alter Table
http://www.tech-recipes.com/rx/378/add- ... sql-table/
2) Now the Opencart alterations :
\admin\controller\sale\order.php
Add :
on line 1199
in
admin\view\template\sale\order_invoice.tpl // so it will be printed out on the invoice
add
on line 59
on line 67
edit line 82
from
to
Change :
\catalog\model\checkout\order.php line 75 // so the SKU is automatically added to the Database
from
to
Add
catalog\controller\checkout\confirm.php // this will pull and show the SKUs to the shopping cart confirmation page and then they can be pulled to DB
on line 171
and on line 387
Add
catalog\controller\checkout\guest_step_3.php // this will pull and show the SKUs to the shopping cart confirmation page and then they can be pulled to DB
on line 164
and on line 384
in catalog\view\theme\your_theme\template\checkout\confirm.tpl // this will display the SKUs at the order confirmation page
add
on line 43
and on line 52
Note : Tested with opencart 1.4.8, tested with paypal sandbox and pre-paid order payments. Let me know if it is working with other payment types as well.
Note : currently not working with manually adding parts through admin. Maybe somebody can play with it
Note : I give no warranty or any support on it, should something break, you are on your own, as I was But I can try..
Note : feel free to copy, alter or redistribute. For god sick just don´t sell it, it is opensource
Have fun with it.
Folks got it working.
1) add the table row for "order_product"
MySQL edit :
go to phpMyAdmin or whatever you are using, go to "your_opencart_db" and open the "order_product" table (may be called otherwise if you are using prefixes) and execute the following SQL query
Code: Select all
ALTER TABLE order_product ADD sku VARCHAR(60);
Note : existing orders need to be populated with skus manually. Best way is to export a CSV File
of "order_product" table and "product" table and use vlookup function to match Product IDs
with SKUs and reupload. For troubleshooting see -> SQL Alter Table
http://www.tech-recipes.com/rx/378/add- ... sql-table/
2) Now the Opencart alterations :
\admin\controller\sale\order.php
Add :
on line 1199
Code: Select all
'sku' => $product['sku'],
in
admin\view\template\sale\order_invoice.tpl // so it will be printed out on the invoice
add
on line 59
Code: Select all
<td><b><?php echo 'SKU'; ?></b></td>
on line 67
Code: Select all
<td><?php echo $product['model']; ?></td>
from
Code: Select all
<td align="right" colspan="4"><b><?php echo $total['title']; ?></b></td>
Code: Select all
<td align="right" colspan="5"><b><?php echo $total['title']; ?></b></td>
Change :
\catalog\model\checkout\order.php line 75 // so the SKU is automatically added to the Database
from
Code: Select all
$this->db->query("INSERT INTO " . DB_PREFIX . "order_product SET
order_id = '" . (int)$order_id . "', product_id = '" . (int)$product['product_id'] . "', name
= '" . $this->db->escape($product['name']) . "', model = '" . $this->db->escape($product
['model']) . "', price = '" . (float)$product['price'] . "', total = '" . (float)$product
['total']. "', tax = '" . (float)$product['tax'] . "', quantity = '" . (int)$product
['quantity'] . "'");
Code: Select all
$this->db->query("INSERT INTO " . DB_PREFIX . "order_product SET
order_id = '" . (int)$order_id . "', product_id = '" . (int)$product['product_id'] . "', name
= '" . $this->db->escape($product['name']) . "', model = '" . $this->db->escape($product
['model']) . "', price = '" . (float)$product['price'] . "', total = '" . (float)$product
['total']. "', sku = '" . (float)$product['sku'] . "', tax = '" . (float)$product['tax'] . "',
quantity = '" . (int)$product['quantity'] . "'");
catalog\controller\checkout\confirm.php // this will pull and show the SKUs to the shopping cart confirmation page and then they can be pulled to DB
on line 171
Code: Select all
'sku' => $product['sku'],
Code: Select all
'sku' => $product['sku'],
catalog\controller\checkout\guest_step_3.php // this will pull and show the SKUs to the shopping cart confirmation page and then they can be pulled to DB
on line 164
Code: Select all
'sku' => $product['sku'],
Code: Select all
'sku' => $product['sku'],
add
on line 43
Code: Select all
<th align="left"><?php echo 'SKU'; ?></th>
Code: Select all
<td align="left" valign="top"><?php echo $product['sku']; ?></td>
Note : currently not working with manually adding parts through admin. Maybe somebody can play with it
Note : I give no warranty or any support on it, should something break, you are on your own, as I was But I can try..
Note : feel free to copy, alter or redistribute. For god sick just don´t sell it, it is opensource
Have fun with it.
using oc 1.5.6
A HOW-TO has been created on how to add SKU numbers to the Invoice. It was done to version 1.5.2.1.
It can be found here:
http://forum.opencart.com/viewtopic.php?f=121&t=57412
It can be found here:
http://forum.opencart.com/viewtopic.php?f=121&t=57412
A good site for e-commerce advice.
Hello, do you think this would work for both cart.php and checkout.php in both folders on OC v2.0.2.0?Qphoria wrote:model is set but sku isn't.
For that one you need to make 2 edits.
1 to the cart controller
and
1 to the cart library
1. EDIT: system/library/cart.php
2. FIND:3. AFTER, ADD:Code: Select all
'model' => $product_query->row['model'],
4 EDIT: catalog/controller/checkout/cart.phpCode: Select all
'sku' => $product_query->row['sku'],
5. FIND:6. AFTER, ADD:Code: Select all
'model' => $result['model'],
Code: Select all
'sku' => $result['sku'],
Total e-commerce newbie bravely testing OC v2.0.3.1 before rolling it live...getting there slowly, somehow. Maybe not. I dunno.
Who is online
Users browsing this forum: No registered users and 126 guests