Estian Posted May 19, 2020 Share Posted May 19, 2020 (edited) PrestaShop Version: 1.7.6.5Coding Knowledge: Intermediate (Learning PrestaShop) I have developed a module that I intend to use to modify the "AdminSuppliers" controller list view in the back office. In fact I've been able to hook into the "actionAdminSuppliersListingFieldsModifier" hook in order to do just that (see attached screenshot). On the supplier list view this custom button's value is determined by a newly added custom setting that can also be toggled on the supplier edit page. On the supplier edit page when a supplier is saved the "hookActionAdminSaveAfter" is used to capture the newly added custom setting value. The problem I'm facing is that the button on the list view is simply not toggling this value in the same way, and I'm sure that I am missing a piece of information that would allow this value to be toggled on the list view. Note that I want this button to toggle the newly added custom value in the exact way the "Status" button toggles the supplier's enabled/disabled status. The only code I have for adding this button so far is the below: public function hookActionAdminSuppliersListingFieldsModifier( $params ) { // This adds the value to the list, but is not saving since there is no AdminController "processHide_products" function. $params['fields']['hide_products'] = [ 'title' => $this->trans( 'Hide assoc. products' ), 'align' => 'center', 'type' => 'bool', 'orderby' => false, 'class' => '', 'active' => 'hide_products' ]; } When the newly created custom button on the list view is clicked it tries opening the following link: "index.php?controller=AdminSuppliers&id_supplier=<id_supplier>&hide_productssupplier&token=<token>" To make this button acccess and save its custom value, should this URL be changed? What is the best way to implement this button? Thank you in advance for any assistance. Edited May 19, 2020 by Estian (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