Jump to content

Category with a single product


Recommended Posts

Hello everyone,

 

I wonder if it's possible to go directly to the product page for a category with a single product without going through the intermediate page that normally displays the products of the category?

 

Regards.

Link to comment
Share on other sites

in top menu module file (blocktopmenu.php) you've got code like:

case 'CMS':
$selected = ($this->page_name == 'cms' && (Tools::getValue('id_cms') == $id)) ? ' class="sfHover"' : '';
$cms = CMS::getLinks((int)$id_lang, array($id));
if (count($cms))
$this->_menu .= '<li'.$selected.'><a href="'.Tools::HtmlEntitiesUTF8($cms[0]['link']).'">'.$cms[0]['meta_title'].'</a></li>'.PHP_EOL;
break;

you have to add if condition (with else) where you will check cms page id and then place link to the product (instead of Tools::HtmlEntitiesUTF8($cms[0]['link']) code)

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...