如何使用prestashop 1.6更改产品中的RowHeaders

时间:2016-08-16 18:59:16

标签: php prestashop prestashop-1.6

我正在使用prestashop管理员,我无法更改产品的行标题。请为我提供适当的解决方案。语言和数据库使用是PHP-Mysql

1 个答案:

答案 0 :(得分:1)

更改您找到的产品页面标题所需的一切:     controllers/admin/AdminProductsController.php

在__construct()函数中找到。

内容:

$this->_select .= 'shop.`name` AS `shopname`, a.`id_shop_default`, ';
    $this->_select .= $alias_image.'.`id_image` AS `id_image`, cl.`name` AS `name_category`, '.$alias.'.`price`, 0 AS `price_final`, a.`is_virtual`, pd.`nb_downloadable`, sav.`quantity` AS `sav_quantity`, '.$alias.'.`active`, IF(sav.`quantity`<=0, 1, 0) AS `badge_danger`';
标题为

$this->fields_list = array();
    $this->fields_list['id_product'] = array(
        'title' => $this->l('ID'),
        'align' => 'center',
        'class' => 'fixed-width-xs',
        'type' => 'int'
    );
    $this->fields_list['image'] = array(
        'title' => $this->l('Image'),
        'align' => 'center',
        'image' => 'p',
        'orderby' => false,
        'filter' => false,
        'search' => false
    );
    $this->fields_list['name'] = array(
        'title' => $this->l('Name'),
        'filter_key' => 'b!name'
    );
    $this->fields_list['reference'] = array(
        'title' => $this->l('Reference'),
        'align' => 'left',
    );

    if (Shop::isFeatureActive() && Shop::getContext() != Shop::CONTEXT_SHOP) {
        $this->fields_list['shopname'] = array(
            'title' => $this->l('Default shop'),
            'filter_key' => 'shop!name',
        );
    } else {
        $this->fields_list['name_category'] = array(
            'title' => $this->l('Category'),
            'filter_key' => 'cl!name',
        );
    }
    $this->fields_list['price'] = array(
        'title' => $this->l('Base price'),
        'type' => 'price',
        'align' => 'text-right',
        'filter_key' => 'a!price'
    );
    $this->fields_list['price_final'] = array(
        'title' => $this->l('Final price'),
        'type' => 'price',
        'align' => 'text-right',
        'havingFilter' => true,
        'orderby' => false,
        'search' => false
    );

    if (Configuration::get('PS_STOCK_MANAGEMENT')) {
        $this->fields_list['sav_quantity'] = array(
            'title' => $this->l('Quantity'),
            'type' => 'int',
            'align' => 'text-right',
            'filter_key' => 'sav!quantity',
            'orderby' => true,
            'badge_danger' => true,
            //'hint' => $this->l('This is the quantity available in the current shop/group.'),
        );
    }

    $this->fields_list['active'] = array(
        'title' => $this->l('Status'),
        'active' => 'status',
        'filter_key' => $alias.'!active',
        'align' => 'text-center',
        'type' => 'bool',
        'class' => 'fixed-width-sm',
        'orderby' => false
    );

当然,最佳做法是在以下位置重现覆盖文件:

controllers/admin/AdminProductsController.php