chrisnov Posted June 23, 2012 Share Posted June 23, 2012 In the backend of Prestashop you can make an exception for modules in : Modules> posistion > edit. It would be great if you can also assign an module to a specific page. So you don't have to fill in all the execeptions if you want a module to show up in just one page... 1 Link to comment Share on other sites More sharing options...
tomerg3 Posted June 23, 2012 Share Posted June 23, 2012 This a a good DIY change, which is not very hard. Look in the main module file module_name.php and find the hook you want to restrict. Based on your PS version, get the variable $page_name (you can search for it in other files and see how it is invoked / used). Then simply add the following at the top of the hook function if ($page_name != 'category') // replace category with any page name return; 2 Link to comment Share on other sites More sharing options...
chrisnov Posted June 23, 2012 Author Share Posted June 23, 2012 Thnx! I will do that! Link to comment Share on other sites More sharing options...
jpryce Posted July 26, 2012 Share Posted July 26, 2012 homecategories_v0.2.zipHi there Maybe i'm being thick but i can't find that php file, or do you mean the main php file for that module i.e. homecategories.php? I'm trying to restrict that module to a custom page called categories.php that i've created. Please see attached Link to comment Share on other sites More sharing options...
Mike Kranzler Posted July 26, 2012 Share Posted July 26, 2012 Hi Chris, Thanks for the suggestion! You're welcome to post it to the Forge so that it will be passed on directly to our development team. -Mike Link to comment Share on other sites More sharing options...
jpryce Posted August 1, 2012 Share Posted August 1, 2012 Hey I'm still having real trouble with this. I've tried the solution given by tomerg3 but can't find the exact piece of code he's changing in my homecategories.php file. I've looked for reference at the other page restricted modules i.e. my slider carousel and homefeatured.php and neither reference $page_name. In fact i can't work out how they're being restricted at all. Def just me being thick but i'd really appreciate some help... Ta James Link to comment Share on other sites More sharing options...
maryswave Posted November 1, 2012 Share Posted November 1, 2012 I can only get this to work in index... anything else returns a white screen so I have a custom html module I want to show on the left that is specific based on primary category, is that possible? how would that link work? " {if $page_name == index} " works for index but if my category id is 9 how would that look? Link to comment Share on other sites More sharing options...
Recommended Posts