Jump to content

Add added date and updated date columns in products list backoffice


Gilbert Daniel
 Share

Recommended Posts

Hi There!

  

   i need help to add custom columns in product list in backoffice, what i'd like is get added date and updated date beside Status column in prestashop 1.6.1.3. So I add some code in AdminProductsController.php.

$this->fields_list['date_add'] = array(
            'title' => $this->l('Created Date'),    
            'align' => 'text-center',            
            'class' => 'fixed-width-sm',
            'orderby' => true
        );
$this->fields_list['date_upd'] = array(
            'title' => $this->l('Modified Date'),    
            'align' => 'text-center',            
            'class' => 'fixed-width-sm',
            'orderby' => true
        );

 With this code i get the error. So please kindly help me to solve this problem.

 

Thanks.

 

 

 

Share this post


Link to post
Share on other sites

  • 6 months later...
  • 1 year later...
  • 2 years later...

Create an alias and a filter.

        $this->_select .= $alias_image.'.`id_image` AS `id_image`, cl.`name` AS `name_category`, '.$alias.'.`wholesale_price`, '.$alias.'.`date_add`, '.$alias.'.`date_upd`, 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['date_add'] = array(
                    'title' => $this->l('Date Added'),    
                    'align' => 'text-center',            
                    'width' => 80,
                    'type' => 'datetime',
                    'filter_key' => 'a!date_add'                    
        );
        $this->fields_list['date_upd'] = array(
                    'title' => $this->l('Last Updated'),    
                    'align' => 'text-center',            
                    'width' => 80,
                    'type' => 'datetime',
                    'filter_key' => 'a!date_upd'
        );            

 

Share this post


Link to post
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
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More