I have successfully added a custom product field to my Opencart 2.0.3.1 store. I am attempting to push this custom field to my order_product table so that it will appear on invoices, reports, etc. However, I keep receiving the following error: Notice: Undefined index: source_code in ...system/modification/catalog/model/checkout/order.php on line 24
Line 24 reads:
$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'] . "'");
I have successfully done this in 1.5.6.4; however, 2.x's system is stumping me. Please see my vqmod for the 2.x version here: http://forum.opencart.com/download/file.php?id=27195
I cannot seem to find the place to define the index for the INSERT function. Any help would be appreciated. Thanks.