Subcategory listings not using canonical URL's

  • Posts: 250
  • Thank you received: 7
9 years 8 months ago #223349

-- url of the page with the problem -- : www.artistpapers.co.uk/shop
-- HikaShop version -- : 2.6.0
-- Joomla version -- : 3.4.5
-- Error-message(debug-mod must be tuned on) -- : n/a

I have manually set the canonical URL's for my product categories and set the shop to use canonical URL's, this generally works except on category pages where I am displaying subcategories. These are shown as an unordered list but don't use the canonical URL's. This seems to be an issue with the property $this->cat_html which is supplied to the template. Rather than try and figure out where this is being generated I have coded round it in my template over ride, but am reporting this as a possible bug.

Thanks,

Ian

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

  • Posts: 84233
  • Thank you received: 13675
  • MODERATOR
9 years 8 months ago #223366

Hi,

There is no such $this->cat_html variable in HikaShop.
The issue probably comes from a customization of one of the view files done in your template view override folder.

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

  • Posts: 250
  • Thank you received: 7
9 years 8 months ago #223471

Hi Nicola,

I am using a template over ride but I don't think I changed that as it's some html generated before the template is called. It may be because my over ride was of a template from an earlier version of Hikashop? Anyhow I've got around it and if it isn't a problem with the current version all is good.

Ian

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

  • Posts: 7
  • Thank you received: 0
9 years 3 weeks ago #246315

I think I'm having the same problem on my site
I have three levels in my categories, ex:
- main
- main/subcat1
- main/subcat1/subcatA

If I set in 'main' and subcat1 to list all subcategories, in main category I see:
subcat1
subcatA

Now, if I click on subcat1, and then (on the new page) on subcatA, the resulting url is /main/subcat1/subcatA (correct)
But, if I click directly on subcatA, the resulting url is /main/subcatA (wrong)
NB: I'm not using canonical urls

I think it's a bug on the categories list rendering

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

  • Posts: 84233
  • Thank you received: 13675
  • MODERATOR
9 years 3 weeks ago #246338

Hi,

I see only two reasons you would get /main/subcat1/subcatA:
- you have menu items configured for each of your menu item, and the system takes the menu item aliases and so it's normal (the way the Joomla SEF system is done) that you can get different URLs since you can access the same category from several menu items. That's why we have canonical URLs in HikaShop so that you can avoid that issue by defining the main URL you want to use for each category.
- you have a third party SEF system constructing the SEF URLs instead of Joomla/HikaShop. In that case, you need to check with that SEF system support.

Normally the URL of a category ( supposing that you created a menu item of the type categories listing linked to your main product category would be menuItemAlias/categorySEFName/XXX-categoryAlias
XXX is the id of the category and can be removed with the "remove categories and products ids from URLs" setting of the HikaShop configuration.
And the categorySEFName can also be changed/removed in the HikaShop configuration.
But HikaShop doesn't generate URLs with several category aliases by itself like you're describing.

The following user(s) said Thank You: mario.net

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

  • Posts: 7
  • Thank you received: 0
9 years 3 weeks ago #246389

Nicolas, thank you for your quick answer

I was wrongly assuming that, in a complex categories structure, like:
catLevel1
--catLevel2
----catLevel3
having set showID=false and categorySEFName='' in options
the correct url to catLevel3 would be /menuItemCatLevel1/aliasCatLevel2/aliasCatLevel3

Ok, I will now resort to canonicalUrls assigned to the level3 categories to achieve my goal

Thank you very much!
Bye
Mario

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

  • Posts: 250
  • Thank you received: 7
9 years 3 weeks ago #246390

Hi Nicolas and Mario,

I don't actually understand why this has to be a problem with Hikashop.

My old Virtuemart shop (VM1) with SH404SEF generated nested category URL's automatically and as I would expect. To get the same effect in Hikashop I ended up having to manually generate the Canonical URL for all the sub categories which is an absolute pain when you have a lot of subcategories.

Regards,

Ian

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

  • Posts: 7
  • Thank you received: 0
9 years 3 weeks ago #246396

I agree that some kind of aid in filling canonical urls would be a nice addition...

Nicolas, may I suggest to add a button next to the canonical url field, in the category edit window?
Pressing it, hikashop would fill the canonical urls of all subcategories with: <currentCategoryCanonicalUrl>/<subCategoryAlias>
That way it would be easy to fill all the canonical urls recursively

Mario

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

  • Posts: 84233
  • Thank you received: 13675
  • MODERATOR
9 years 3 weeks ago #246393

Hi,

It's not about being "a problem".
It's about what you choose to have as a structure for the URLs.
We decided to have short URLs, which is good for SEO.
So you don't have the whole structure of the categories in the URLs, only one category.
We could have chosen to do like VirtueMart.
It could be changed by changing the way the router.php interprets and and generates the SEF URLs.
So you don't want to have a button to fill in the canonical URLs, HikaShop actually already has an option to auto fill canonical URLs for you. That's not the problem. The problem is that the SEF URL structure you want is not what we choose and it would require changing the way the SEF URLs are generated.

Last edit: 9 years 3 weeks ago by nicolas.

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

  • Posts: 7
  • Thank you received: 0
9 years 3 weeks ago #246450

Thanks for the explanation
Now it's clear that it was a design choice (and that's ok, obviously)
I was worried I had mis-configured something

Bye
Mario

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

  • Posts: 250
  • Thank you received: 7
9 years 3 weeks ago #246458

Hi Nicolas,

All I can say is it was a problem for me.

I had to spend hours creating canonical URL's to reflect the structure of my site, and the site is now more difficult to maintain.

I use keywords in my category names because the product names alone do not fully describe the product, so if someone is searching for Strathmore Illustration Paper they'll see this result ...



As you can see keywords in the product category and subcategory are highlighted, Google is using them so having them there is good for SEO.

Please reconsider this design decision, or at least make including the subcategories in the URL an option.

NOTE: the search results shown are Google page one positions 2, 3, and 4 - position one is the manufacturer's site, so I don't think I've been penalised by having a long URL.

Thanks,

Ian

Attachments:
Last edit: 9 years 3 weeks ago by iedwards. Reason: added note about search position

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

Time to create page: 0.083 seconds
Powered by Kunena Forum