Jump to content

Customize add product in backend


the7wind

Recommended Posts

I want to give permission to view/edit the SEO, suppliers and some other tabs only to admins.

I searched within the forum and found only solutions on how to delete these tabs within AdminProductsController.php 

It should be interesting if i could combine to http://www.prestashop.com/forums/topic/280108-check-if-current-user-is-in-a-certain-group/

where i display tabs depending on the group.

The problem with prestashop is that we can only give the whole 'products' permission within the backend while sometimes you need the seo administrator to only stick with seo and the boutique manager to only stick to add the products.

 

Thanks for anyone who can help me with this :)

Link to comment
Share on other sites

Good morning

 

I thought you could do this by:

 

Back office > Administration > Permissions 

 

Paul

 

We certainly can't assign the persmission of a single tab such as seo, infomation, prices ...etc : we only assign their permission as a whole.

In my case i want a certain group to view/edit only infomation, prices and images tabs : no more! 

Thanks for your reply any way :)

Link to comment
Share on other sites

hello

 

there is an option to define permissions for each subitem of "preferences" tab

AOHJP7V.png

you use 1.5.x ?

 

Maybe i wasn't clear : i wanna customize the tabs/links with the Add new product.  

product.jpg

This is what i wanna keep for certain groups.

This is a related topic where he wanted to delete the links/tabs while i want to keep them for certain groups.

 

Thanks again for your fast replies :)

Link to comment
Share on other sites

Well the solution i came up with is creating a back end template then modify the admin.css and add

#link-Suppliers {display:none;} 

...etc

 

This is not an efficient solution for me since i have to change every employee's backend theme.

 

I would have prefered something like this 

if ($employee->id_profile != _PS_ADMIN_PROFILE_){
$content = '<style>#link-Suppliers {display:none;} </style>';
}
 
Didn't manage to know where to place such code :/
If anyone could give me a little hand for this.
Link to comment
Share on other sites

Probably in file:

<your personal admin folder>/themes/default/template/controllers/products/helpers/form/form.tpl

 

Here you see some code like this:

		<div class="productTabs" style="display:none;">
			<ul class="tab">
			{*todo href when nojs*}
			{foreach $product_tabs key=numStep item=tab}
				<li class="tab-row">
					<a class="tab-page {if $tab.selected}selected{/if}" id="link-{$tab.id}" href="{$tab.href}&updateproduct">{$tab.name}</a>
				</li>
			{/foreach}
			</ul>
		</div>

Then, dependent on $tab.name and the admin group you can add the <li> item or not, or make it readonly or so.

 

Hope this helps,

pascal 

Link to comment
Share on other sites

Probably in file:

<your personal admin folder>/themes/default/template/controllers/products/helpers/form/form.tpl

 

Here you see some code like this:

		<div class="productTabs" style="display:none;">
			<ul class="tab">
			{*todo href when nojs*}
			{foreach $product_tabs key=numStep item=tab}
				<li class="tab-row">
					<a class="tab-page {if $tab.selected}selected{/if}" id="link-{$tab.id}" href="{$tab.href}&updateproduct">{$tab.name}</a>
				</li>
			{/foreach}
			</ul>
		</div>

Then, dependent on $tab.name and the admin group you can add the <li> item or not, or make it readonly or so.

 

Hope this helps,

pascal 

 

Thanks for pointing out where the productTabs is handled : It does help, i can make my changes there without having to alter core files. :)

Link to comment
Share on other sites

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