【问题标题】:How to Show Product image in Opencart (order Invoice)?如何在 Opencart 中显示产品图片(订单发票)?
【发布时间】:2017-10-01 15:44:05
【问题描述】:

我想在 Opencart 的发票中显示产品图片,当用户购买某些东西时,发票只生成产品名称,我希望发票也有产品图片,请告诉我怎么做做这个 ? 提前致谢。

【问题讨论】:

标签: php html opencart opencart2.x opencart2.3


【解决方案1】:

首先像这样加载这个模型的图像 $this->load->model('tool/upload'); 前512线附近 $data['products'] = array(); foreach ($order_product_query->rows as $product) {

只需在您的 catlog/model/checkout/order 中创建一个函数来获取图像。将产品 ID 作为参数传递并返回该单个变量。

在 $data 中调用该函数,例如 'image' => $this->model_tool_image->resize($this->myfunc($product['product_id']), $thumb_width, $thumb_height),

最后,

通过图像变量在视图文件中调用您的产品图像。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-09-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多