ravspw1 Posted November 13, 2022 Share Posted November 13, 2022 Hello, how to hide the button: view - for the list of orders in the administration panel? The point is that employees cannot view order details, and only have a list of current orders Link to comment Share on other sites More sharing options...
ComGrafPL Posted November 14, 2022 Share Posted November 14, 2022 Did you check the employee's permissions? So they can't view the orders details? 1 Link to comment Share on other sites More sharing options...
ravspw1 Posted November 14, 2022 Author Share Posted November 14, 2022 In the employee permissions settings, when I turn off the order preview - employees cannot see the entire list of orders. And I'd like them to see the list without being able to check the details. Link to comment Share on other sites More sharing options...
ps8modules Posted November 16, 2022 Share Posted November 16, 2022 Hi. Please, what programming skills do you have for Prestashop? Are you able to program a module that would hide the "View" button via JavaScript? 1 Link to comment Share on other sites More sharing options...
ps8modules Posted November 16, 2022 Share Posted November 16, 2022 (edited) For example, this code is sufficient in the module: public function hookActionAdminControllerSetMedia($params) { if($this->context->controller->controller_name == 'AdminOrders' && !Tools::getValue('id_order')) { /* array disable employee by id */ $disabledViewEmployee = array('2', '3', '4'); /* get current employee logged */ $currentEmployee = $this->context->employee->id; /* default value */ $disable = false; if (in_array($currentEmployee, $disabledViewEmployee)){ $disable = true; } /* custom javascript */ $this->context->controller->addJs('modules/'.$this->name.'/js/adminOrders.js'); /* variable for javascript */ $jsDef = array('employe_disable_view' => $disable); Media::addJsDef($jsDef); } } And custom JavaScript ....adminOrders.js: $(document).ready(function(){ /* params from module */ if (employe_disable_view == true){ document.querySelectorAll('.grid-view-row-link').forEach(function(el) { el.style.display = 'none'; }); } }); Edited November 16, 2022 by 4you.software (see edit history) 1 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