Jump to content

Hide Wholesale Price To All Except Superadmin


Recommended Posts

Hello,

 

I found this soulutions on hiding the wholesale price in the backend for all except shop owners:

 

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.

But the problem is I cant find where this price.tpl is located...can annyone shed some light on this please?

 

Link to comment
Share on other sites

In the /themes/your_theme directory.

Hello,

 

There is no price.tpl, only price-drop.tpl in my theme folder, 

 

But I can find it on admin/themes/default/template/controllers/products

 

But after I change the code, it is not working, maybe I am doing it wrong?

 

{if $employee->id_profile == 1}

<div class="form-group">
<div class="col-lg-1"><span class="pull-right">{include file="controllers/products/multishop/checkbox.tpl" field="wholesale_price" type="default"}</span></div>

{/if}

Link to comment
Share on other sites

  • 1 year 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

 

 

In the /themes/your_theme directory.

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

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