wakasm Posted September 1, 2010 Share Posted September 1, 2010 Is there a way to display custom text or attributes in product.tpl by using group as a flag?I dislike prestashops "wholesale" system since I can't create a group that just sees the products at their wholesale price, so I instead want to add wholesale as a custom attribute.I've figured everything out that I need except what code would control "If in group X" -> Do this. I think maybe I have to modify product.php to respect groups first? Any help would be appreciated. Link to comment Share on other sites More sharing options...
phrasespot Posted September 2, 2010 Share Posted September 2, 2010 I don't understand exactly what you mean. Could you post a screen shot or address please? Link to comment Share on other sites More sharing options...
rocky Posted September 3, 2010 Share Posted September 3, 2010 It is possible to modify PrestaShop to display the wholesale price for a certain customer group. See my post here for how to create a variable $trade that is available to all the TPL files. You can then use code like the following in product.tpl: {if $trade}{convertPrice price=$product->wholesale_price}{else}{convertPrice price=$product->getPrice(true, $smarty.const.NULL)}{/if} and the following in other TPL files: {if $trade}{convertPrice price=$product.wholesale_price}{else}{convertPrice price=$product.price}{/if} There are many places it needs to be changed though. Link to comment Share on other sites More sharing options...
wakasm Posted September 15, 2010 Author Share Posted September 15, 2010 I am interested in making a change to only one the product.tpl file. I want to display some custom text if the belong to GROUP 2 that I have set up in my backend. I feel this should be a simple solution - just a method to retrieve that they are in that group and an if/then statement that prints out the message. if in group 2 - print this. Link to comment Share on other sites More sharing options...
rocky Posted September 15, 2010 Share Posted September 15, 2010 Just follow my advice above, then use code like the following in product.tpl: {if $trade}{l s='Custom text goes here'}{/if} 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