Jump to content

[SOLVED] Change home category to 'new products' link


Recommended Posts

  On 7/24/2014 at 7:26 AM, vekia said:

remove "home" as category from your menu items, instead of it create own link named "Home" with url to any page you want (in this case with link to new products page)

 

But this won't allow the dropdown menu to pop up upon rollover, will it?

Link to comment
Share on other sites

  On 7/24/2014 at 2:13 PM, vekia said:

that's right, there will be no dropdow with categories

so i assume that you want this dropdown, but only change link associated with first menu item?

 

That's right, at the moment the Home category goes to my front page, but I'm able to change the name of the category, but not the link. I'd like to change the link too and have the dropdown still work.

Link to comment
Share on other sites

hello

sorry for long waiting time, i missed you reply :(

in this case it's necessary to alter blocktopmenu.php file (located in module directory)

 

there is a code like:
 

if ($category['level_depth'] > 1)
			{
				$cat = new Category($category['id_category']);
				$link = Tools::HtmlEntitiesUTF8($cat->getLink());
			}
			else
				$link = $this->context->link->getPageLink('index');

change $link = $this->context->link->getPageLink('index'); to $link = $this->context->link->getPageLink('new-products');

  • Like 2
Link to comment
Share on other sites

  On 7/27/2014 at 8:31 PM, vekia said:

hello

sorry for long waiting time, i missed you reply :(

in this case it's necessary to alter blocktopmenu.php file (located in module directory)

 

there is a code like:

 

if ($category['level_depth'] > 1)
			{
				$cat = new Category($category['id_category']);
				$link = Tools::HtmlEntitiesUTF8($cat->getLink());
			}
			else
				$link = $this->context->link->getPageLink('index');

change $link = $this->context->link->getPageLink('index'); to $link = $this->context->link->getPageLink('new-products');

This makes perfect sense, I've changed it like so:

  Quote

 

private function generateCategoriesMenu($categories)

{
$html = '';
 
foreach ($categories as $key => $category)
{
if ($category['level_depth'] > 1)
{
$cat = new Category($category['id_category']);
$link = Tools::HtmlEntitiesUTF8($cat->getLink());
}
else
$link = $this->context->link->getPageLink('new-products');
 

It isn't changing on the site, unfortunately! Do I need to do something else in addition to uploading the changed .php file?

Link to comment
Share on other sites

  On 7/27/2014 at 9:53 PM, vekia said:

now it's time to re-save settings in your block top menu page

just open top menu configuration page and hit save button (you don't have to change anything, just save settings)

Ahh, I just experimented with the cache settings, and deleting the cache worked, I'll remember to just save settings in the module to trigger a clear cache, thanks so much for your help!!

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...