Jump to content

How to add a custom Prestashop Module only on a single category page.


Recommended Posts

Dear sir,

 

  I want to activate a custom module only on a single category page (Which is also displayed  on menu item on frontend).This module must be activated only on that category page not on other pages..

 

But I can't able to do that..

 

Please advice..

Link to comment
Share on other sites

prestashop hasn't got feature to display contents only on selected category pages. it means that it's necessary to create code to support it.

 

in this case, the simplest solution will be condition in php file, in hook:

public displayYourHook($params){

if (isset($_GET['id_cat']){
  if ($_GET['id_cat']==5){
     //   contents here
  }
}

}
Link to comment
Share on other sites

Ok i got it for category page.

 

Now I have a Custom CMS page on my Prestashop store and I want to activate the module only on that custom page.

 

Please provide the condition code for php file to achieve above.

Link to comment
Share on other sites

×
×
  • Create New...