Url/Link for each product variant

  • Posts: 125
  • Thank you received: 6
  • Hikashop Business
11 months 5 days ago #351864

-- HikaShop version -- : 4.7.1
-- Joomla version -- : 3.10.8
-- PHP version -- : 8.1.0

Hello,

It would be very helpful if we were able to create different url's for each product variant. There are times where I am offering a paid ad for a specific variant for example red shirts 50% off. It would be great to be able to send customers from that paid ad directly to a specific variant/url instead of sending them to page and then them having to choose the product variant from the paid ad. Thnx

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

  • Posts: 81539
  • Thank you received: 13069
  • MODERATOR
11 months 4 days ago #351865

Hi,

It's actually possible. In the URL of the product page, change the id of the product to the id of the variant you want to target and you'll get that variant preselected when you reach that URL.
For example, on the page www.hikashop.com/download/legal-pack.html you have a characteristic for the selection of the country. There the menu item type is "product page" with that legal pack product selected in the menu item. So there is no product id in the URL. So you can add it as an extra parameter. As you can see it defaults to USA. The id of the variant for "Canada" is 187. If you use the URL www.hikashop.com/download/legal-pack.html?cid=187 you'll see it will default to "Canada" for the country selector.

Note however that this won't work in some cases:
- if you activated the "remove category and product ids in URLs" setting of the HikaShop configuration, then the id of the product doesn't appear in the URL of the products. However, you can still add the id of the variant between the last / and the alias of the product with a dash between the id of the variant and the alias.
- if you have the "dynamic characteristic display" setting activated, then the characteristic selectors default to "please select" superseding the "default" variant and the variant targeted by the id in the URL.
- if you have the "characteristic selection method" setting set to "list", then you have a table of variants on the product details page, with one add to cart per variant row. And thus, since there is no variant selection anymore on the page, the system can't preselect anything.

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

  • Posts: 125
  • Thank you received: 6
  • Hikashop Business
11 months 4 days ago #351874

Thanks for your response. This is GREAT news but i'll need some help. I fall under the case where i have activated the "remove category and product ids in URLs" setting. So my url structure is www.website.com/inspiration/products/the-shark-is-big-tee.html

So if I want to direct folks to a different variant such as size small in this shirt what would be the url? The variant size small ID is 6606 so would it be: www.website.com/inspiration/products/660...hark-is-big-tee.html (this didn't work for me)

Thanks again!

Last edit: 11 months 4 days ago by dklbwf.

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

  • Posts: 81539
  • Thank you received: 13069
  • MODERATOR
11 months 3 days ago #351876

Hi,

Is the-shark-is-big-tee the alias of the main product ?
This new URL should work. That is unless you're using a SEF tool like 4SEF or sh404sef.
They create a database of correspondances between SEFed and non-SEFed URLs. So modified the URL like that means the SEF extension won't be able to find it in the database and thus the modified URL will return a 404 error.
Besides that, I don't see why that wouldn't work. You could try to add the variant id with an extra parameter at the end of the URL like www.website.com/inspiration/products/the...ig-tee.html?cid=6606
That might work better.

The following user(s) said Thank You: dklbwf

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

  • Posts: 125
  • Thank you received: 6
  • Hikashop Business
11 months 2 days ago #351924

That link you included was IT!!!!!! I do have SH404sef configured on all sites and adding that cid=#### takes me directly to the variant I want. Thanks a ton Nicolas. This will be really helpful with paid ads I push forward for specific variants.

The following user(s) said Thank You: Manuel TT

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

Time to create page: 0.064 seconds
Powered by Kunena Forum