Canonical urls

  • Posts: 147
  • Thank you received: 9
  • Hikashop Business
4 years 7 months ago #311412

Hello,

I did something wrong on canonical urls.

Some products have "wrong" canonical urls: they dont have the right path, instead of that they are pointing to a wrong path category like "/index.php/hikashop-menu-for-brands-listing/product/product_name" or "/index.php/books/product/product_name" (the product isnt a book). Some other products have the right canonical urls, pointing to the right URL.

I searched in forum and I noticed that I should have disabled the joomla's sef plugin. Also, I had the option "No, generate the URLs" on "Force canonical URLs on listings"

I would like to set the canonical urls in every product, especially in the wrong ones.

Thank you in advance.

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

  • Posts: 81597
  • Thank you received: 13081
  • MODERATOR
4 years 7 months ago #311437

Hi,

If you want to have HikaShop fill in the canonical URLs for you you need to:
- clear all the canonical URLs of your products with a mass action: www.hikashop.com/forum/install-update/89...ith-mass-action.html
- set the "force canonical URLs on listings" setting to "Use canonical URL and generate it if missing" in the HikaShop configuration
- browse the listings of the products on the frontend so that the system can generate the new canonical URLs of the products.

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

  • Posts: 147
  • Thank you received: 9
  • Hikashop Business
4 years 7 months ago #311457

Hello,

Everything is fine now.

Thank you very much nicolas.

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

  • Posts: 147
  • Thank you received: 9
  • Hikashop Business
4 years 7 months ago #311491

Hello,

I have the same problem on categories.
They are really messed up.

Can I fix them with Mass actions?

Thank you in advance.

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

  • Posts: 81597
  • Thank you received: 13081
  • MODERATOR
4 years 7 months ago #311492

Hi,

Yes. It's the same process:
- clear all the canonical URLs of your categories with a mass action
- set the "force canonical URLs on listings" setting to "Use canonical URL and generate it if missing" in the HikaShop configuration
- browse the listings of the categories on the frontend so that the system can generate the new canonical URLs of the categories.

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

  • Posts: 147
  • Thank you received: 9
  • Hikashop Business
4 years 7 months ago #311507

Hello,

And how can I reset the category canonical url? I cant find the right field.

Thank you in avance..

Edit: it was early and didnt see the field in the category option. Sorry for bothering you.
Thank you for helping me.

Last edit: 4 years 7 months ago by Giscard.

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

  • Posts: 147
  • Thank you received: 9
  • Hikashop Business
4 years 7 months ago #311525

Hello,

I navigate on the categories in the front end, after I deleted the canonical URL, but they didnt update in back-end.

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

  • Posts: 81597
  • Thank you received: 13081
  • MODERATOR
4 years 7 months ago #311528

Hi,

You need to browse them from your main menu item which lists the categories.
If you browse them from the menu module itself, then it just displays the listing of the products of the category selected in the menu item, and thus there is no canonical URL to calculate.
It needs to display a listing of category. to calculate the canonical URL of each category in the listing.

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

  • Posts: 147
  • Thank you received: 9
  • Hikashop Business
4 years 7 months ago #311559

Hello,

I navigate via the hyper menu, clicked on the first item in the main menu, redirect on the categories listings.
What I did wrong ?

Thank you in advance.

Attachments:

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

  • Posts: 81597
  • Thank you received: 13081
  • MODERATOR
4 years 7 months ago #311563

Hi,

I'm not sure what you did.
Here is the explanation with a screenshot:
monosnap.com/file/TYfDW7UHJIayDswe5ofepawESFZoqL

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

  • Posts: 147
  • Thank you received: 9
  • Hikashop Business
4 years 7 months ago #311591

Hello,

That is what I did and tried to do it again, but I dont get update on the canonical URL in categories.

Thank you in advance.

Edit 1: On mobile is working and is setting the mobile-menu on each category, but on desktop doesnt update the values.
Edit 2: I am thinking that maybe there is something wrong with my menu. You said above nicolas that I shouldnt navigate through modules, so I chaecked if there is a module in my menu. There wasnt. Then I change the mobile menu with my main menu and tried to navigate via mobile in order to see the results on canonical URL. They didnt update.

Last edit: 4 years 7 months ago by Giscard.

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

  • Posts: 81597
  • Thank you received: 13081
  • MODERATOR
4 years 7 months ago #311594

Hi,

Once the canonical URL is filled in the categories, it won't be updated. It will only be set if the field is empty in the categories.
Also, then main category from your main menu items won't be filled since they are only displayed in a listing by via a menu module.
So you'll have to fill them manually.

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

  • Posts: 147
  • Thank you received: 9
  • Hikashop Business
4 years 7 months ago #311636

Hello,

Updated I mean from empty string to the right path. I have cleared the canonical urls via mass actios, before navigate. Also, when I see that a category has a mobile url I delete that as well.

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

  • Posts: 81597
  • Thank you received: 13081
  • MODERATOR
4 years 7 months ago #311666

Hi,

I think I know why this doesn't work for you.
You have sub menu items with the categories and in that case, the system directly use the URL of the sub menu item corresponding to the category, which skips the generation of the URL process where the canonical URL is generated if missing.
Change the code:

return JRoute::_('index.php?option=com_hikashop&Itemid='.$submenu->itemid);
to:
						$url = JRoute::_('index.php?option=com_hikashop&Itemid='.$submenu->itemid);

						// save the URL as canonical URL if the "force canonical URLs on listings" setting is activated and the canonical URL is not filled in
						$config = hikashop_config();
						$force_canonical = $config->get('force_canonical_urls',1);
						if(isset($cid->category_canonical) && empty($cid->category_canonical) && $force_canonical == 2) {
							$newObj = new stdClass();
							$newObj->category_id = $cid->category_id;
							$newObj->category_canonical = $url;
							$categoryClass = hikashop_get('class.category');
							$categoryClass->save($newObj);
						}
						return $url;
in the file components/com_hikashop/views/category/view.html.php and that should help.
Let us know how it goes so that we can add that patch on our end too.

The following user(s) said Thank You: Giscard

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

  • Posts: 147
  • Thank you received: 9
  • Hikashop Business
4 years 7 months ago #311667

Hello,

Now it generates the path.
But in my case it is not the right one.
I go that: /index.php/hikashop-menu-for-module-131/category/analosima-grafeiou
When I want the path from the menu.

Thank you in advance.

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

  • Posts: 81597
  • Thank you received: 13081
  • MODERATOR
4 years 6 months ago #311671

Hi,

I don't see how that could be the case since this code saves the URL from the sub menu item.
Could you please double check ?

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

  • Posts: 147
  • Thank you received: 9
  • Hikashop Business
4 years 6 months ago #311700

Hello,

I am sorry, I double check and everythig is fine now.
The path is the right one.

Thank you very much nicolas!

The following user(s) said Thank You: nicolas

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

  • Posts: 147
  • Thank you received: 9
  • Hikashop Business
4 years 6 months ago #311743

Hello,

How can I manage a product's Canonical URL, which product will be set in two different categories? I added one product in a different category and it points in the path that is set in the product, of course.

Thank you in advance.

Last edit: 4 years 6 months ago by Giscard.

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

  • Posts: 81597
  • Thank you received: 13081
  • MODERATOR
4 years 6 months ago #311763

Hi,

Canonical URLs do not change anything regarding that.
It's only if you activate the "force canonical URLs on listings" setting of the HikaShop configuration that the canonical URL of the product will be used everywhere.
If you don't want that, you should turn off that setting. That way, the URLs to access the product page will be different, but the indexed URL for search engines will still be the canonical URL (and you won't have issues with SEO).

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

  • Posts: 147
  • Thank you received: 9
  • Hikashop Business
4 years 6 months ago #311781

Hello,

I tried to turn off the option about canonical URLs, but the current products display error in the fron-end so I turn it up again.

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

Time to create page: 0.089 seconds
Powered by Kunena Forum