Jump to content
thirty bees forum

Recommended Posts

Posted

Friends, I am working to override 'part' of adminOrdersController. I try to add onde extra field in orders list, but i dont will copy all _contrunct() from core to add ond extra fields. I try use this, but dont get success. Any can help. public function __construct() { $x = new AdminOrdersControllerCore(); $this->fields_list = array_merge( $x->fields_list, ['tracking_number' => [ 'title' => $this->l('Número Rastreio'), 'havingFilter' => true, 'width' => 100, ], ] ); return AdminOrdersControllerCore::__construct(); }

Posted

Solved! public function __construct() { parent::__construct(); $part1 = array_slice($x->fields_list, 0, 1); $part2 = array_slice($x->fields_list, 2,1); $part3 = array_slice($x->fields_list, 4, 4); $part4 = array_slice($x->fields_list, 8); $this->fields_list = array_merge($part1, $part2, $part3, $extraFields1, $part4); AdminController::__construct(); }

Posted

php AdminController::__construct(); Calling non-static methods statically is deprecated, see: http://php.net/manual/en/language.oop5.static.php

Also not sure whether it actually does something. Probably a no-op.

Posted

Thanks @wakabayashi, I solved using array_split and merge to add fields in middle. If is only at the end array, working the example, but i will add in the middle. Thanks @Traumflug

Mauro

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