Post by CEMinistries » Tue Dec 29, 2015 11:46 pm

I have successfully created a custom product field. However, I am having issues pushing this product field to the oc_order_product table to use on an invoice. I have attempted adding the custom field to the following files with no luck:

admin/constroller/sale/order.php
catalog/controller/checkout/cart.php
catalog/controller/product/product.php
catalog/controller/api/order.php

I still receive the following error, meaning that I haven't defined the index for the api for my custom field. Where do I do this?

<b>Notice</b>: Undefined index: source_code in <b>.../system/modification/catalog/controller/api/order.php</b> on line <b>188</b><b>Notice</b>: Undefined index: source_code in <b>.../system/modification/catalog/controller/api/order.php</b> on line <b>191</b>{"order_id":166,"success":"Success: You have modified orders!"}

Attached is my vqmod file for reference.

Attachments


New member

Posts

Joined
Wed Apr 16, 2014 11:17 pm

Post by daniGo » Wed Dec 30, 2015 12:18 am

You need to also check:

catalog/controller/checkout/confirm.php

catalog/model/checkout/order.php

system/library/cart/cart.php

http://www.gombac.si


Active Member

Posts

Joined
Wed Mar 20, 2013 4:49 pm
Location - Slovenia

Post by CEMinistries » Wed Dec 30, 2015 12:44 am

Thanks for the help! After updating the files you mentioned, I am now receiving the following error:

<b>Notice</b>: Undefined index: source_code in <b>...system/modification/catalog/model/checkout/order.php</b> on line <b>24</b>

Line 24 is the following:

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']) . "', source_code = '" . $this->db->escape($product['source_code']) . "', quantity = '" . (int)$product['quantity'] . "', price = '" . (float)$product['price'] . "', total = '" . (float)$product['total'] . "', tax = '" . (float)$product['tax'] . "', reward = '" . (int)$product['reward'] . "'");

My updated vqmod is attached.

Attachments


New member

Posts

Joined
Wed Apr 16, 2014 11:17 pm

Post by CEMinistries » Thu Dec 31, 2015 10:18 pm

anybody?

New member

Posts

Joined
Wed Apr 16, 2014 11:17 pm
Who is online

Users browsing this forum: grgr and 40 guests