link brand name to its category page

  • Posts: 420
  • Thank you received: 10
  • Hikaserial Subscription Hikashop Business
4 years 4 months ago #325165

-- url of the page with the problem -- : again.nu/
-- HikaShop version -- : 4.2.2
-- Joomla version -- : 3.9.13

Hello,

how can we link the brand name in the category veiw to its category page?
On the productpage the brand is already linked... see e.g.: again.nu/nieuw-binnen/product/4356-blouse to brand category again.nu/merken/category/351-brandless

End how to link this in the catergoy view e.g.: again.nu/dames (see attachement)?

Regards,
Michiel

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 4816
  • Thank you received: 654
  • MODERATOR
4 years 4 months ago #325166

Hello,

Can you details what do expect to link to "brand page", I mean we see 2 possibilities :
1. You have in each product div your brand and so the brand link
OR
2. You have by example, on top of your product listing a little module (or carousel ?) with all your brand ?

From your needs, our answer will be very different, and so awaiting news from you to better answer you.
Regards

Last edit: 4 years 4 months ago by Philip.

Please Log in or Create an account to join the conversation.

  • Posts: 420
  • Thank you received: 10
  • Hikaserial Subscription Hikashop Business
4 years 4 months ago #325189

Number 1 :)

Regards

Please Log in or Create an account to join the conversation.

  • Posts: 4816
  • Thank you received: 654
  • MODERATOR
4 years 4 months ago #325196

Hello,

Unfortunatelly, by default
Then you have to proceed via an overide view in order to add the brand link in your div listing.
Follow me step by step :
1. Have a look on this documentation to see how to proceed (html & php knowledge required)
2. Go in Main HikaShop Configuration, then Advanced part, look for "Display view files" and define to "Front-end"
=> As result, on your front end HikaShop view references will be display in order to help you to find the required file.
3. Then go to your view, always from Main HikaShop Configuration, go Display dropdown => Views.
=> I advice you to have a look on product/show_block_dimensions to see the code that manage your brand link.

Hope this will fit your needs.
Regards

Last edit: 4 years 4 months ago by Philip.

Please Log in or Create an account to join the conversation.

  • Posts: 420
  • Thank you received: 10
  • Hikaserial Subscription Hikashop Business
4 years 4 months ago #325257

Hello,
Managed to get the brand-name(manufacter) to be linked to its page with this code:
<td style="text-align:left"><?php echo JText::_('');
$manufacturerClass = hikashop_get('class.category');
$manufacturer = $manufacturerClass->get($this->row->product_manufacturer_id);
if($manufacturer->category_published){
$menuClass = hikashop_get('class.menus');
$Itemid = $menuClass->loadAMenuItemId('manufacturer','listing');
if(empty($Itemid)){
$Itemid = $menuClass->loadAMenuItemId('','');
}
$manufacturerClass->addAlias($manufacturer);

echo '<a href="'.hikashop_contentLink('category&task=listing&cid='.$manufacturer->category_id.'&name='.$manufacturer->alias.'&Itemid='.$Itemid,$manufacturer).'">'.$manufacturer->category_name.'</a>';
echo "<span style='display:none;' itemprop='brand'>". $manufacturer->category_name ."</span>";
}
?>

</td>

But in every page with the category view.. the second item is not showing the correct link.. we checked everything but can not figure this out..
See attachment..
Hope you can help.

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 83404
  • Thank you received: 13498
  • MODERATOR
4 years 4 months ago #325260

Hi,

You code is fine.
HEre is the way the URL is generated :
- if the "force canonical URLs on listing" setting is activated in your HikaShop configuration, then HikaShop will use the URL that you have configured in the "canonical URL" of the brand.
- If it's not activated, then the URL will be generated dynamically, using the first menu item of the type "category listing" configured to display a brands listing, and if not, another randomly selected menu item of one of the types of HikaShop.

So what you describe probably means that you have the "force canonical URLs on listing" setting activated and that you entered a URL you don't want in there for the second brand there.

An alternative could be to use:
hikashop_completeLink('category&task=listing&cid='.$manufacturer->category_id.'&name='.$manufacturer->alias.'&Itemid=XX')
instead of:
hikashop_contentLink('category&task=listing&cid='.$manufacturer->category_id.'&name='.$manufacturer->alias.'&Itemid='.$Itemid,$manufacturer)
where XX is the id of the menu item you want the link to use (supposing that you don't want a different one for each brand).
That way, you will force the system to generate a URL with the menu item of your choosing. However, if you have a wrong canonical URL in your brands, that wrong URL will still be the one indexed by search engines. So I would rather recommend fixing the canonical URL. It will be better for your SEO too.

Please Log in or Create an account to join the conversation.

  • Posts: 420
  • Thank you received: 10
  • Hikaserial Subscription Hikashop Business
4 years 4 months ago #325296

Hi,

We don't use canonical URLs on listing and none was activated, but after a bit of searching through the all fields we noticed that for every second item in a category listing, a canonical URL was generated automaticly while that option is not activated.

So we have used your alternative.. and entered the menu for brands on the XX and now it seems to work fine..

Thanks.

Please Log in or Create an account to join the conversation.

Time to create page: 0.054 seconds
Powered by Kunena Forum