acuarelweb Posted September 12, 2015 Share Posted September 12, 2015 Hi there. Im trying to make a custom orders list module controller, and would like to know if is possible to hide the id column while keeping the edit & view buttons (the addRowAction ones...) My helperList fields are as follows: $this->fields_list = array( 'id_order' => array( 'title' => $this->l('ID'), 'align' => 'text-center', 'class' => 'fixed-width-xs', 'search' => false, 'filter_key' => 'a!id_order', // clave da consulta mysql que queremo amosar.. 'orderby' => true, // necesario para indicar que si se pode ordenar 'visible'=>false ), 'reference' => array( 'title' => $this->l('Ticket'), 'align' => 'text-center', 'class' => 'fixed-width-xs', 'search' => true, 'filter_key' => 'a!reference', // clave da consulta mysql wue queremo amosar.. 'orderby' => true // necesario para indicar que si se pode ordenar ), 'date_add' => array( 'title' => $this->l('Fecha'), 'align' => 'text-right', 'type' => 'datetime', 'filter_key' => 'a!date_add', 'search' => false, 'orderby'=>true ) ); If i remove the part from the ID, it is not shown in the list, but the edit or view links dont work as it seems the id_order parameter is needed. I don't know how... Is there any parameter in the field list or any other workaround to accomplish this via php (css is not a solution here :-) Thanks in advance. Regards, Acuarel Link to comment Share on other sites More sharing options...
acuarelweb Posted September 13, 2015 Author Share Posted September 13, 2015 Thank you kik-off Gracias!! Link to comment Share on other sites More sharing options...
piribipipi Posted May 12, 2017 Share Posted May 12, 2017 Hola acuarelweb!! te acuerdas de como arreglaste esto??? Gracias! Link to comment Share on other sites More sharing options...
piribipipi Posted May 17, 2017 Share Posted May 17, 2017 someone knows why is not available the best answer in this post?????? i need to solve the same problem :S:S:S help!!!! Link to comment Share on other sites More sharing options...
josh barak Posted September 26, 2017 Share Posted September 26, 2017 (edited) I found a simple solution for this using css. 1. Create a file in this path: httpdocs/override/controllers/admin/AdminOrdersController.php 2. Paste in the following code: <?php class AdminOrdersController extends AdminOrdersControllerCore { public function __construct() { parent::__construct(); // Adding a class in order to apply css to the id column (display: none;) $this->fields_list['id_order']['class'] = 'fixed-width-xs id_order '; } // Adding a css file public function setMedia() { parent::setMedia(); // CSS files $this->addCSS(__PS_BASE_URI__.$this->admin_webpath.'/themes/'.$this->bo_theme.'/css/mystyle.css'); } } 3. create a css file in the following path: httpdocs/[admin]/themes/[current theme]/css/mystyle.css 4. paste in the following code: body.adminorders table.order .id_order { display: none; } // Hiding the filter of the ID column, assuming the ID column is the second column in the table, otherwise adjust // the number for the ":nth-child" to match the column number. body.adminorders table.order tr.filter th:nth-child(2) { display: none; } THATS IT! The ID column should no longer be displayed. (This works in prestashop 1.6.0.9 and wasn't tested in other versions) Edited September 26, 2017 by josh barak (see edit history) Link to comment Share on other sites More sharing options...
pelleringa Posted August 30, 2021 Share Posted August 30, 2021 (edited) In the case someone end up here, there is an easy solution for this. Just add hidden: 'class' => 'hidden' in the field array class, e.g: 'id_order' => array( 'title' => $this->l('ID'), 'align' => 'text-center', 'class' => 'hidden', 'search' => false, 'filter_key' => 'a!id_order', // clave da consulta mysql que queremo amosar.. 'orderby' => true, // necesario para indicar que si se pode ordenar 'visible'=>false ), Edited August 31, 2021 by pelleringa (see edit history) Link to comment Share on other sites More sharing options...
ps8modules Posted August 31, 2021 Share Posted August 31, 2021 (edited) 'type' => 'hidden' other: ['type'] => {'select', 'bool', 'date', 'datetime', 'decimal', 'float', 'percent', 'editable', 'price', 'text', 'textarea', 'hidden'}, Edited August 31, 2021 by WebSoft (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