【问题标题】:opencart order email extra product fieldopencart 订单电子邮件额外产品字段
【发布时间】:2018-05-18 13:44:46
【问题描述】:

我需要从购物车中添加一些信息以订购电子邮件。我必须设法显示每个产品的供应商字段,但我不能将它添加到 oc_order_product 表中我相信我需要它,所以我可以通过订单电子邮件发送它 在 catalog/controller/checkout/cart.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'])
            );

在目录/模型/checkout/order.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'] . "'");

问题是供应商的数据没有存储在数据库中

【问题讨论】:

    标签: php email field opencart extra


    【解决方案1】:

    更好地为您的供应商信息创建新表,将易于管理

    同样在 opencart 3.X 中改变默认数据库表是无效的

    【讨论】:

    • 你的时间。
    猜你喜欢
    • 1970-01-01
    • 2017-05-02
    • 1970-01-01
    • 1970-01-01
    • 2012-09-01
    • 1970-01-01
    • 1970-01-01
    • 2021-01-29
    • 2018-08-29
    相关资源
    最近更新 更多