HairMaker.Gr Posted August 23, 2014 Share Posted August 23, 2014 (edited) Hello I want to ask this questions. I want to give premission to someone to be product writter. Prestashop dont give me the flexible to check exactly what tabs to give premission. It is auto in the mode Product Writter. How can i Hide The Price Tab, so do not can change anything in the prices of my products.??? Thanks for your answer. Edited August 23, 2014 by hairmania (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted August 23, 2014 Share Posted August 23, 2014 by default it's not possible cases like that need a modification of controller controllers/admin/adminproductscontroller.php there is a code like: if ($this->context->shop->getContext() != Shop::CONTEXT_GROUP) $this->available_tabs = array_merge($this->available_tabs, array( 'Informations' => 0, 'Pack' => 7, 'VirtualProduct' => 8, 'Prices' => 1, 'Seo' => 2, 'Associations' => 3, 'Images' => 9, 'Shipping' => 4, 'Combinations' => 5, 'Features' => 10, 'Customization' => 11, 'Attachments' => 12, 'Suppliers' => 13, )); you have to change it, depending on what EMPLOYEE is logged, you can define what kind of tabs you want to display for example: if ($this->context->employee->id==15){ if ($this->context->shop->getContext() != Shop::CONTEXT_GROUP) $this->available_tabs = array_merge($this->available_tabs, array( 'Informations' => 0, )); } elseif { if ($this->context->shop->getContext() != Shop::CONTEXT_GROUP) $this->available_tabs = array_merge($this->available_tabs, array( 'Informations' => 0, 'Pack' => 7, 'VirtualProduct' => 8, 'Prices' => 1, 'Seo' => 2, 'Associations' => 3, 'Images' => 9, 'Shipping' => 4, 'Combinations' => 5, 'Features' => 10, 'Customization' => 11, 'Attachments' => 12, 'Suppliers' => 13, )); } employee with id 15 will have possibility to see /edit only "informations" section. 1 Link to comment Share on other sites More sharing options...
HairMaker.Gr Posted August 23, 2014 Author Share Posted August 23, 2014 Vekia at first thanks for your answer and for your time to think and wrote the code. If you someday make a module with this function to choose what premission and in which tabs to give the free to work my employes i am the first to buy it!!!! Thanks!!!!!!!!!!!!! Link to comment Share on other sites More sharing options...
MaXi32 Posted August 27, 2016 Share Posted August 27, 2016 I put the above code at the correct place. then it crashed the site when clicking on the product tab. Link to comment Share on other sites More sharing options...
Recommended Posts