编辑 Prestashop 当前订单视图 [英] Edit Prestashop current orders view

查看:47
本文介绍了编辑 Prestashop 当前订单视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是 Prestashop 1.6.0.9.

I'm using Prestashop 1.6.0.9.

我想编辑这部分的原始 HTML.

I wish to edit the raw HTML for this part.

全尺寸图片链接:http://i.stack.imgur.com/hazQp.png

我想为过滤器添加一个额外的列,但我实际上找不到它的代码...

I wish to add an extra colum to the filters but I can't actually find the code for it...

我已经搜索了 adminXXXX/themes/default/template/ 目录.特别是订单文件,但它们似乎只与您实际单击下面列出的订单之一时获得的视图相关.(下图表示看不到的过滤器下方的订单)

I have searched through the adminXXXX/themes/default/template/ directory. Specifically the orders files but they only seem to be relevant for the view you get when you actually click on one of the orders listed below. (Below meaning the orders below the filters that you can't see)

有谁知道它的实际位置吗?

Does anyone know the actual location for this?

推荐答案

BO 订单的过滤器由 controllers\admin\AdminOrdersController.php 创建.

The filters for BO orders are created by controllers\admin\AdminOrdersController.php.

为了保留 prestashop 核心代码,它表明您为此控制器创建了一个覆盖,您需要在其中加入所需的表(如果尚未加入),指定表中您想要的字段用于过滤器和字段本身.仔细查看 AdminOrdersController 的构造函数以更好地了解如何执行此操作.

In order to preserve prestashop core code it's indicated you create an override for this controller, where you'll need to join the table that you need (if not already joined), specify where in your table is the field you want to use for filter and also the field itself. Have a closer look at the constructor function of AdminOrdersController to better understand how to do this.

例如,如果要添加运营商名称作为过滤器,请创建override\controllers\admin\AdminOrdersController.php 文件并添加以下代码:

For example if you want to add the carrier name as a filter, create override\controllers\admin\AdminOrdersController.php file and add the following code:

<?php

class AdminOrdersController extends AdminOrdersControllerCore {
    public function __construct() {
        parent::__construct();
        $this->_join .= 'LEFT JOIN `'._DB_PREFIX_.'carrier` cr ON (cr.`id_carrier` = a.`id_carrier`)';
        $this->_select .= ', cr.name as carrier';
        $this->fields_list['carrier'] = array(
            'title' => $this->l('Carrier'),
            'align' => 'text-center'
        );
    }
}

这篇关于编辑 Prestashop 当前订单视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆