我需要从购物车添加一些信息到订购电子邮件。我必须设法显示每个产品的供应商字段,但我无法将其添加到oc_order_product表中,我相信我需要它,以便我可以与订单电子邮件一起发送 在目录/控制器/结帐/购物车.php我已经添加了这个
$data['products'][] = array(
'cart_id' => $product['cart_id'],
'thumb' => $image,
'name' => $product['name'],
'supplier_id' =>htmlspecialchars_decode($product['supplier']),
'supplier_comments' =>htmlspecialchars_decode($product['suppliercomments']),
'model' => $product['model'],
'option' => $option_data,
'recurring' => $recurring,
'quantity' => $product['quantity'],
'stock' => $product['stock'] ? true : !(!$this->config->get('config_stock_checkout') || $this->config->get('config_stock_warning')),
'reward' => ($product['reward'] ? sprintf($this->language->get('text_points'), $product['reward']) : ''),
'price' => $price,
'total' => $total,
'href' => $this->url->link('product/product', 'product_id=' . $product['product_id'])
);
以及目录/型号/结帐/订单.php
if (isset($data['products'])) {
foreach ($data['products'] as $product) {
$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']) . "', Suppliername = '" . (int)$product['supplier_id'] . "', Suppliercomments = '" . (int)$product['cupplier_comments'] . "', model = '" . $this->db->escape($product['model']) . "', quantity = '" . (int)$product['quantity'] . "', price = '" . (float)$product['price'] . "', total = '" . (float)$product['total'] . "', tax = '" . (float)$product['tax'] . "', reward = '" . (int)$product['reward'] . "'");
问题是供应商的数据没有存储在数据库中
最好为您的供应商信息创建新表,将易于管理
也像在 opencart 3.X 中一样,更改默认数据库表是无效
的