【问题标题】:In Opencart How should i edit the "Order By" product_id in mini cart?在 Opencart 中,我应该如何编辑迷你购物车中的“Order By”product_id?
【发布时间】:2016-06-04 03:30:28
【问题描述】:

我仍然没有找到应该在迷你购物车中编辑“ORDER BY product_id”的位置。

我希望列表顺序是按字母顺序排列,应该是 iPhone 第一,MacBook 最后。

我应该如何编辑控制器文件?

【问题讨论】:

    标签: opencart opencart2.x opencart-module


    【解决方案1】:

    默认情况下,opencart 从控制器调用模型/目录/产品和函数 getProducts(),因此您需要使用其他数据编辑控制器:

    /catalog/controller/common/cart.php

    foreach ($this->cart->getProducts() as $product) {
    

    按照想法,它应该是这样的:

    foreach ($this->cart->getProducts($data_f['pd.name']) as $product) {
    

    目前无法测试,但如果您有演示服务器,请尝试一下。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-10-30
      • 2021-06-26
      • 2020-04-05
      相关资源
      最近更新 更多