Jump to content

Limit employee price view permission


Yaguznal

Recommended Posts

Hello everyone!

 

I have one employee that will do the product descriptions for me but I not want him to see or change prices. Since this all is in the catalog/product category, he can do everything. There is no option to limit an employees permissions further then "product".

 

Is there something I am overlooking? Is that finer grain permission hidden somewhere?

 

I can also change the website files. I know html and css. I can manipulate php and java but not write it myself.

 

Thanks in advance!

 

Yagu

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 year later...
  • 8 months later...
  • 4 months later...

Looking for an answer too. Anyone? 

 

Found a somewhat incomplete solution:

 

inside price.tpl you have access to $employee object, so find the HTML code that contains wholesale price (there is <div class="form-group"> ... </div>) and wrap it in next condition:

{if $employee->id_profile == 1}
<div class="form-group">
...html code...
</div>
{/if}

where 1 it is Id for SuperAdmin profile by default.

 

Anyone can help with a complete coding?

Edited by newcomer (see edit history)
Link to comment
Share on other sites

  • 5 months later...

 

Found a somewhat incomplete solution:

 

inside price.tpl you have access to $employee object, so find the HTML code that contains wholesale price (there is <div class="form-group"> ... </div>) and wrap it in next condition:

{if $employee->id_profile == 1}

<div class="form-group">

...html code...

</div>

{/if}

where 1 it is Id for SuperAdmin profile by default.

 

This is a good approach indeed. Keep going!

Link to comment
Share on other sites

  • 9 months later...

How is it with the latest 1.7 version? Where is the price.tpl file located? Within "admin\themes\default\template" i can't find it at all.

 

Can somebody please help me, i'm lost here.

 

Thank you and best regards,

Housy

 

Looking for an answer too. Anyone? 

 

Found a somewhat incomplete solution:

 

inside price.tpl you have access to $employee object, so find the HTML code that contains wholesale price (there is <div class="form-group"> ... </div>) and wrap it in next condition:

{if $employee->id_profile == 1}
<div class="form-group">
...html code...
</div>
{/if}

where 1 it is Id for SuperAdmin profile by default.

 

Anyone can help with a complete coding?

Link to comment
Share on other sites

With Windows command line i was able to find the right file - src/PrestaShopBundle/Resources/views/Admin/Product/form.html.twig

 

But now i don't know how to work with TWIG files. I did try to modify it by adding some random heading html tag but nothing happens actually, when i refresh product editing page and click on the Pricing Tab.

 

What am i doing wrong?

 

 

 

How is it with the latest 1.7 version? Where is the price.tpl file located? Within "admin\themes\default\template" i can't find it at all.

 

Can somebody please help me, i'm lost here.

 

Thank you and best regards,

Housy

 

Edited by Housy (see edit history)
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...