dongxindu8753 2015-12-30 16:10
浏览 49

将自定义字段添加到订购产品表Opencart 2.x.

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.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 python的qt5界面
    • ¥15 无线电能传输系统MATLAB仿真问题
    • ¥50 如何用脚本实现输入法的热键设置
    • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
    • ¥30 深度学习,前后端连接
    • ¥15 孟德尔随机化结果不一致
    • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
    • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
    • ¥15 谁有desed数据集呀
    • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100