Is it possible to have different URLs for variants

  • Posts: 200
  • Thank you received: 75
7 years 11 months ago #239685

-- HikaShop version -- : 2.6.3
-- Joomla version -- : 3.5.1

Hi,

we would like to ask if there's any way of creating different URLs for variants. Right now a product with all its variants has one URL, but we were wondering if customers could directly go to the product page with a specific variant pre-selected (any variant, not just the default one).

So let's say the product page URL is www.mysite.com/product , can we have something like:

www.mysite.com/product-10-cm to go to product page and have variant 10 cm automatically selected, or
www.mysite.com/product-20-cm to go to product page and have variant 20 cm automatically selected, etc.

To have separate URLs for each variant may be beneficial for search engine results as well, because we know many of our customers are searching specifically for a size like 10 or 20 cm.

Thanks!

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

  • Posts: 81540
  • Thank you received: 13071
  • MODERATOR
7 years 11 months ago #239697

Hi,

Yes, you can use that URL:
www.mysite.com/XXX-product-20-cm
where XXX is the id of the variant.
As long as the id of the variant is added at the beginning of the URL, you can put whatever you want after it and it will display the product page with the variant preselected.

The following user(s) said Thank You: GW

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

  • Posts: 1
  • Thank you received: 0
  • Hikashop Business
7 years 10 months ago #243427

Hello,

I'm struggling with getting this to work. I too am looking to accessing product variants directly via URL. I've tried the syntax for constructing the URL by adding the variant ID associated with the product, but am always getting 404 pages.

Does your example assume certain SEO global settings to be configured? I've attached a screen shot of how I have the SEO settings.

Thank you.
Rich

Attachments:

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

  • Posts: 81540
  • Thank you received: 13071
  • MODERATOR
7 years 10 months ago #243984

Hi,

Sorry for the delay, your post wasn't showing to us for some reason.

The construction of SEF URLs is more complex than that.
A SEF URL of a product page will look like this:

http://www.mywebsite.com/[parent menu item alias]/[menu item alias]/[product SEF name]/[product id]-[product alias][.html]
The [parent menu item alias] and [menu item alias] parts of the URL are added based on the menu item you're on.
If your menu item is directly under the root menu item, then you won't have a parent menu item alias in the URL.
And if your menu item is the default menu item of your website (the homepage), then you won't have the menu item alias in the URL.
The [product SEF name] comes from the HikaShop SEF configuration. This can be emptied, modified, etc.
The [product id] is usually the product ID but the variant DI can be used too. And if you have the "remove category and product ids from URLs" setting activated, that parameter can be removed (but it can still be there).
The [product alias] is the alias of the product. If not specified, the system will try to use the product name, but it can sometimes create problems, when the product name has special characters in it (not english letters).
The [.html] comes from Joomla and depends on how you configured the Joomla SEF settings in the Joomla configuration.

But it's actually quite easy to get a variant URL without trying to construct it. Go on the product page, add the variant you want to the cart, and in the checkout cart view, the link to the product page will actually use the variant ID, so you can use that link.

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

Time to create page: 0.072 seconds
Powered by Kunena Forum