Jump to content

(Solved) How to Hide The Price Tab In a Product Writter?


Recommended Posts

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 by hairmania (see edit history)
Link to comment
Share on other sites

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.

  • Like 1
Link to comment
Share on other sites

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

  • 2 years later...
×
×
  • Create New...