[email protected] Posted March 2, 2017 Share Posted March 2, 2017 Hello,how and where I need to convert the file AdminProductsController.php (I assume it's there)I want add new column to the list of products (gross price before discount) in the Back Office. Link to comment Share on other sites More sharing options...
rocky Posted March 4, 2017 Share Posted March 4, 2017 What's the difference between the base price and gross price? You can create override/controllers/admin/AdminProductControllers.php with code like the following to add a column: <?php class AdminProductsController extends AdminProductsControllerCore { public function __construct() { parent::__construct(); $this->fields_list['ean13'] = array( 'title' => $this->l('EAN13'), ); } } This will add an EAN13 column. If I understand what the gross price is, I can be more specific. 1 Link to comment Share on other sites More sharing options...
[email protected] Posted March 9, 2017 Author Share Posted March 9, 2017 Hello,ther is one column with the net price, and one column with the gross price. That second one is with reduction of current promotions. I want to get Gross price without any reduction original price (set on product page) + tax. Link to comment Share on other sites More sharing options...
rocky Posted March 10, 2017 Share Posted March 10, 2017 Try creating override/controllers/admin/AdminProductsController.php with the following: <?php class AdminProductsController extends AdminProductsControllerCore { public function __construct() { parent::__construct(); $this->_select .= ', a.`id_product` AS `price_gross`'; $this->fields_list['price_gross'] = array( 'title' => $this->l('Gross price'), 'type' => 'price', 'align' => 'text-right', 'callback' => 'calculateGrossPrice' ); } public static function calculateGrossPrice($id_product) { return Product::getPriceStatic($id_product, true, null, 6, null, false, false); } } Link to comment Share on other sites More sharing options...
[email protected] Posted March 10, 2017 Author Share Posted March 10, 2017 Hello, the solution works perfectly, code I added directly to a file /cotrollers/admin/AdminProductController.phpThanks for your help and your time Link to comment Share on other sites More sharing options...
lucasdee Posted May 9, 2017 Share Posted May 9, 2017 (edited) "Try creating override/controllers/admin/AdminProductsController.php with the following:..." Hi there. rockys code seems to work on 1.6. Could someone point me to proper solution for 1.7? It would be great. I'm pulling my hair out after 20 h of investigating. Google search returns nothing helpful. Best regards. Edited May 9, 2017 by lucasdee (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now