Jump to content

Adding 'supplier_reference' column to the Order List BO on 1.7


alltheshop

Recommended Posts

I would like to add a column to the BO in Prestashop 1.7.2 both in the orders and in the products, there are many valid guides working for previous versions but with 1.7 no longer work, in my case the column needed would be with the supplier_reference code

 

Would you be instructed to create a simple Prestashop 1.7 compatible Override file  like this:

 


<?php

class AdminProductsController extends AdminProductsControllerCore

{

 

public function __construct()

{

 

parent::__construct();

 

// Join the table product supplier in order to get product supplier reference ( Only Work for products without combinations )

$this->_join .= ' LEFT JOIN '._DB_PREFIX_.'product_supplier ps ON ( a.id_product = ps.id_product AND ps.id_product_attribute = 0 )';

 

//Add new field supplier reference in field list

$this->fields_list['product_supplier_reference'] = array(

'title' => $this->l('Supplier Reference'),

'align' => 'left',

'filter_key' => 'ps!product_supplier_reference',

'width' => 80

);

}

}


 

 

 

Someone can kindly help me?

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...