SEF Weirdness

  • Posts: 250
  • Thank you received: 7
10 years 1 month ago #210120

-- url of the page with the problem -- : www.artistpapers.co.uk/shop/drawing-and-...paper/bristol-boards
-- HikaShop version -- : 2.5.0
-- Joomla version -- : 3.4.3

I've got a SEF related issue which is really odd.

If you go to this page..
https://www.artistpapers.co.uk/shop/drawing-and-illustration-paper/bristol-boards

... and click on the product "Strathmore 200 Series Bristol" you get this SEF URL, which looks correct ...
https://www.artistpapers.co.uk/shop/drawing-and-illustration-paper/bristol-boards/strathmore-200-series-bristol

The trouble is it displays a similar but wrong product "Strathmore 200 Series Sequential Art Bristol" from a different category

Further investigation reveals that if a product on the bristol boards page has a similar product in the sequential art category the wrong product is displayed, so 200 series, 300 series and 500 series Bristol display the wrong, Sequential Art, product even though the link looks correct, but for the other products (400 Series and Windpower Bristol) the correct product is displayed.

With SEF disabled this all works correctly.

I have SH404SEF installed but get the same result with this switched off.

I also have some .httaccess redirects from an old site but I don't think it's a redirect as the URL would change.

Any thoughts on what could be going on?

Thanks,

Ian

Last edit: 10 years 1 month ago by iedwards. Reason: correct typos

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

  • Posts: 2143
  • Thank you received: 747
10 years 1 month ago #210122

Looks like you should set "Remove products and categories id in URLs" in the HikaShop configuration to "No" ( www.hikashop.com/support/support/documen...ig.html#features_sef - outdated image but correct text), or enter truly unique aliases for categories and products.


Need help with customisations of layouts, style or other site development? PM me!
(Don't forget to turn on "E-mail notification of new messages" )

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

  • Posts: 250
  • Thank you received: 7
10 years 1 month ago #210123

Thanks for your input lousyfool.

Yes including the category id's does work, but I don't want those id's in the URL, I didn't have them in the old site I'm replacing and don't want them in this one.

The issue seems to be that hikashop sef can't tell the difference between these two aliases ...

strathmore-300-series-sequential-art-bristol
and
strathmore-300-series-bristol

Ian

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

  • Posts: 250
  • Thank you received: 7
10 years 1 month ago #210183

Would appreciate some input from Nicolas and the team on this. If my SEF works for most products except where the aliases are similar there must be a bug in router.php I would have thought? Trying to get my head around that. At the moment turning on SEF has broken some of my products.

It's so important to have human readable URL's

Another frustration to add to a difficult experience with Hikashop. So many snags.

Ian

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

  • Posts: 84305
  • Thank you received: 13700
  • MODERATOR
10 years 1 month ago #210256

Hi,

Do you have the alias entered for each product ?

As lousyfool said, if you have a unique alias for each product, the system will match the correct product.
However, with the current version, that's only the case if the "alias auto fill" setting is activated.
Next version of HikaShop will have that even when it's off.
So that's probably your issue here.
Here is the router.php which will be in next version of HikaShop and which supports that matching even with the "alias auto fill" setting turned off, so you can replace it in the folder components/com_hikashop/

File Attachment:

File Name: router.zip
File Size:3 KB

Attachments:
The following user(s) said Thank You: iedwards

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

  • Posts: 250
  • Thank you received: 7
10 years 1 month ago #210260

Thank you Nicolas!

That has fixed the problem! Yes I did have aliases set for every product but there seemed no logic as to why most products worked correctly while these few redirected to the wrong product. To add to the frustration these were our best selling products and customer's couldn't access them.

Anyway, once more your support saves the day.

Thanks again.

Ian

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

  • Posts: 250
  • Thank you received: 7
10 years 1 day ago #214151

Hi Nicolas,

I have discovered that this new router.php breaks access to my affiliate control panel.

I have configured access to the hikashop user panel under a menu item called "Account". With the old router.php clicking on the "Access to the affiliate program" button brings up the affiliate settings page wiith a url of account/affiliate .. so far so good.

If I put in the new router.php the weirdness I reported earlier is fixed but I now get a 403 error trying to access the affiliate panel.

Ian

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

  • Posts: 84305
  • Thank you received: 13700
  • MODERATOR
10 years 1 day ago #214168

Hi,

Are the URLs different between one router and the other ?
What are the URLs generated ?
What is the URL of the page from which you're accessing that 403 URL ?

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

  • Posts: 250
  • Thank you received: 7
10 years 21 hours ago #214204

Hi Nicolas,

I am accessing from the "Account" page URL www.artistpapers.co.uk/account



With both routers the URL for the "Access to the Affiliate program" option is www.artistpapers.co.uk/account/affiliate which is what I would expect.

With the original router this link works, with the modified router I get a 403 error.

Thanks,

Attachments:

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

  • Posts: 84305
  • Thank you received: 13700
  • MODERATOR
10 years 11 hours ago #214237

Hi,

Ok, I see the problem.
Change the code:

if($i == 1) $vars['ctrl'] = $name;
elseif($i == 2) $vars['task'] = $name;
to:
if($i == 1){
								$vars['ctrl'] = $name;
								$vars['task'] = '';
							}elseif($i == 2)
								$vars['task'] = $name;
in the components/com_hikashop/router.php and that should fix the problem.

The following user(s) said Thank You: iedwards

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

  • Posts: 250
  • Thank you received: 7
10 years 10 hours ago #214300

Brilliant, thank you Nicolas that seems to have fixed it.

That code occurs in two places and I have replaced both occurrences, I assume that's correct.

Thanks again,

Ian

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

Time to create page: 0.092 seconds
Powered by Kunena Forum