Housy Posted June 7, 2017 Share Posted June 7, 2017 Hello Within Back Office of Prestashop version 1.7 I would like to prevent viewing the "Cost price" for employees without "SuperAdmin" status. In some other thread i have seen how this can be done but the solution was for previous 1.6 versions and below. I have succesfully found the right file and the reason why i have opened this thread is that i have no idea how to work with TWIG file exstension. I would like to modify this file - "src/PrestaShopBundle/Resources/views/Admin/Product/form.html.twig" I can open TWIG file with Notepad++ but if i make any changes by adding just some random heading tag and then refresh product editing page in the Back Office and click on the "Pricing" tab, i don't see an extra heading tag. Page remains the same as it is by default. Everything works but changes aren't visible. What am i doing wrong? What would be the right approach to edit TWIG files? Thank you and best regards, Housy 1 Link to comment Share on other sites More sharing options...
Housy Posted June 7, 2017 Author Share Posted June 7, 2017 I had to clear Cache and now i can see changes. But still I have some questions. Is it wrong to directly modify TWIG files? Can i do any harm to my store or is it fine? Regards, Housy 1 Link to comment Share on other sites More sharing options...
Rhobur Posted June 11, 2017 Share Posted June 11, 2017 Modifying twig files for template modification is the recommended way, you're doing it OK. 1 Link to comment Share on other sites More sharing options...
psy_ch Posted February 16, 2023 Share Posted February 16, 2023 Perfect!! I can confirm, even though I didn't have the cache active, using the "Clear Cache" button under Advanced Parameters > Performance makes the changes visible. Thanks a lot, haven't learned about symfony yet and that helped Link to comment Share on other sites More sharing options...
JBW Posted February 16, 2023 Share Posted February 16, 2023 On 6/7/2017 at 3:17 AM, Housy said: Is it wrong to directly modify TWIG files? Can i do any harm to my store or is it fine? I do not recommend to do change core admin twig directly, you will loose your changes with PS upgrades. Rather do this inside a module extending the original twig: https://devdocs.prestashop-project.org/8/modules/concepts/templating/admin-views/ Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now