SonnyBoyII Posted June 24, 2011 Posted June 24, 2011 Hi,How can I pull out categories group variable to my template code?I need to do if/else statement in categories.tpl filesomething like:If current category is in a group id=4 do this else do thatthanks!regards,SonnyBoy Share this post Link to post Share on other sites More sharing options...
PrestaShopDeveloper Posted June 24, 2011 Posted June 24, 2011 {if in_array(1, $category->getGroups())} yes {/if} Where 1 is your id_group 1 Share this post Link to post Share on other sites More sharing options...
SonnyBoyII Posted June 24, 2011 Posted June 24, 2011 It works !!!! Thank you so much!!! You saved me!!!How can I find myself how to get the access to a variable or set a new one? Share this post Link to post Share on other sites More sharing options...
PrestaShopDeveloper Posted June 24, 2011 Posted June 24, 2011 New one:1) You can override ObjectModel / Controller from the "override" folder.2) You can develop a module that hooks and adds the necessary variable (usually a good decision when you need some other changes as well and pack them up in a custom module)3) You can hardcode it at ObjectModel / ControllerExisting:Just check the ObjectModel / Controller files for the available variables. Share this post Link to post 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