hotice Posted May 26, 2017 Share Posted May 26, 2017 Hello, I want to add a new custom flag to orders. It should be visible only in admin panel. So, until now I did this: - added a new column in ps_orders table: - in AdminOrdersController.php, on line 67 I added is_paid, - in AdminOrdersController.php, starting with line 153 I added: 'is_paid' => array( 'title' => $this->l('Incasata'), 'active' => 'status', 'filter_key' => $alias.'!is_paid', 'align' => 'text-center', 'type' => 'bool', 'class' => 'fixed-width-sm', 'orderby' => false ) With this changes, I have the new column in Orders table in admin panel: The only thing that does not work is changing the flag when clicking on V or X. Like changing the status of products, for example. Can you please help me on this? Cheers, Adrian Link to comment Share on other sites More sharing options...
TiaNex Shopping Posted May 27, 2017 Share Posted May 27, 2017 i think it maybe related with some css style class to trigger ajax to work Link to comment Share on other sites More sharing options...
hotice Posted May 31, 2017 Author Share Posted May 31, 2017 When I modified AdminOrdersController.php I looked into AdminProductsController.php. I copied and modified the part of code that enables and disables the products: $this->fields_list['active'] = array( 'title' => $this->l('Status'), 'active' => 'status', 'filter_key' => $alias.'!active', 'align' => 'text-center', 'type' => 'bool', 'class' => 'fixed-width-sm', 'orderby' => false ); changed to this: 'is_paid' => array( 'title' => $this->l('Incasata'), 'active' => 'status', 'filter_key' => $alias.'!is_paid', 'align' => 'text-center', 'type' => 'bool', 'class' => 'fixed-width-sm', 'orderby' => false ) The ajax is triggered (I can click on X or V and the page refreshes) but the database is not updated and I receive an error message: property "active" is missing in object Order. Probably, I have to change something else too, but I don't know what and where... 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