Jump to content

Add hidden fields to export process into Product Section


José Ayram

Recommended Posts

Hello!

 

In the admin section i need add some fields to the products grid to export this info in a .csv file.

 

- I created a new file: /override/controllers/admin/AdminProductsController.php. This file extends AdminProductsCore

- My construct method is:

public function __construct()
{
  parent::__construct();
  $this->_getFieldList(); 
}

- My _getFieldList() is:

private function _getFileList()
{
    $this->fields_list['wholesale_price'] = array(
      'title' => 'wholesale_price',
      'filter_key' => 'a!wholesale_price',
      'class' => 'hide', // To hide the field into grid
      'orderby' => false,
      'filter' => false,
      'search' => false,
    );
}

Such as the first time I modify prestashop, I have some doubts about this:

 

- Is this the right way?

- How do I change the alias of a field? For example, the "condition" field gives me error because it is a reserved word in MySQL.

- If I want to change the order of columns, Should I overwrite the entire array of field_list?

 

Thanks in advance

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...