lightspeedretail / webstore

Web Store eCommerce solution for Lightspeed
http://www.lightspeedpos.com/webstore
Open Software License 3.0
85 stars 63 forks source link

Canonical URL doubles site url #655

Closed iandberg closed 9 years ago

iandberg commented 9 years ago

Webstores in subdirectories appear to have malformed canonical urls on category pages. Visit a category page in a subdirectory-installed store - the canonical url appears with an extra site url like this:

http://www.mystore.com/store/http://www.mystore.com/store/shirts

webstore 3.2.6

euoia commented 9 years ago

Hi @iandberg,

This should have been fixed in 3.2.6 but requires you to go into admin panel and disable "Use Categories In Product Urls", save, then re-enable "Use Categories In Product Urls" and save again. See the release notes here: http://www.lightspeedpos.com/release-notes/webstore/

Please let me know how you get on.

iandberg commented 9 years ago

Thanks for the reply. Many of our clients haven't turned the 'Use Categories In Product Urls' feature on to begin with. I picked a sample client, turned ON 'Use Categories In Product Urls' - canonical url still the same 'doubled' state. So with ''Use Categories In Product Urls'' either off or on, I still see the doubled state.

euoia commented 9 years ago

Hi @iandberg - we just tested this and can't reproduce on Web Store 3.2.6.

Where are you seeing the canonical URL? Can you provide an example URL where I can see the problem?

If you are able to check the database, look in xlsws_category.request_url. If you see full URLs in this column (e.g. http://www.mystore.com/store/shirts) and not just the path (e.g. /shirts) then the you can fix this on Web Store 3.2.6 by toggling the "Use Categories In Product Urls" as mentioned before.

iandberg commented 9 years ago

Hi, The canonical url I'm seeing is in the head where this is given: $this->CanonicalUrl The category urls look fine in the db, there's no extra stuff there, just the path. The doubling up seems to happen on category pages only. It also may be a store-in-subdirectory thing. I checked a client with 3.2.6 with store in the root, and the can. url is fine. canonical Thanks!

gabeguz commented 9 years ago

Very strange, I've tried to replicate your setup on my dev environment, and I can't reproduce the issue. Is there any more data you can provide that will help us reproduce the issue?

Here is what category canonical urls look like for me, with web store installed in a sub folder:

screen shot 2015-05-04 at 10 00 59 am

Have you customized any controllers? Is it possible that a needed change to some of the files hasn't made it over into your code?

iandberg commented 9 years ago

Thanks for looking into it. I found that it's our code (big surprise). Sorry to use up your time.