Jump to content

Add CMS page to product catalogue drop-down


Recommended Posts

Hi!

 

I know how to create a new category for the top navigation menu that is made of of CMS pages.

 

However, I would like to add a CMS page to the drop-down for a specific product category. For example, I have a category of products with a number of sub-categories, so when I hover of the parent category in the top menu, I get a drop-down listing all sub-categories. I would like for a CMS page to also appear in this drop-down. Is this possible?

 

Thanks!

Link to comment
Share on other sites

  • 1 month later...

Hi!

 

I know how to create a new category for the top navigation menu that is made of of CMS pages.

 

However, I would like to add a CMS page to the drop-down for a specific product category. For example, I have a category of products with a number of sub-categories, so when I hover of the parent category in the top menu, I get a drop-down listing all sub-categories. I would like for a CMS page to also appear in this drop-down. Is this possible?

 

Thanks!

 

I have the same question 
 
Thanks, 
 
regards, 
Michiel
Link to comment
Share on other sites

  • 1 month later...

I know of a way to do this; it's probably not the best way but if you're desperate give it a try!

 

1) Create a new sub-category in the usual way. Name this category whatever you want your CMS page to be called and place it within your drop-down menu wherever it needs to go.

 

You'll now have an empty category page. The goal is to automatically redirect this empty page to your CMS page.

 

2) Open up CategoryController.php (in controllers/front). Look for something like this:

public function init(){
    // Get category ID
    $id_category = (int)Tools::getValue('id_category');
    if (!$id_category || !Validate::isUnsignedId($id_category))
    $this->errors[] = Tools::displayError('Missing category ID');

    // Instantiate category
    $this->category = new Category($id_category, $this->context->language->id);

Beneath that last line add this:

 

if ($id_category==XXX) //Change the XXX to the category ID number that you just created
    {
         header('Location: /content/1-delivery-and-order-info'); //Change to your actual CMS page address
         exit();
    }

Please note that my Prestashop (version 1.6) has been heavily customized by another programmer, so it may be too different from yours to work.

Edited by Beans (see edit history)
Link to comment
Share on other sites

×
×
  • Create New...