Variant Product Link Redirecting To The Default URL

Shoemaker
New Member
4 0 0
Hi Guys,

Hoping you can help me with this

When I go to the variant's URL, it always redirects to the default URL.
Example:
products/aidi-mocc-slip-on?variant=37936626008254 (Aidi Mocc Dark Wine)
 
this always redirect/goes back to the default color

products/aidi-mocc-slip-on?variant=37936625942718 (Aidi Mocc Black / default color)
0 Likes
Mircea_Piturca
Shopify Partner
1459 39 284

Hey there.

Would the Aidi Mocc Dark Wine variant be unavailable?

Do you have a link to that product page?

Thanks

Finally—Add variant descriptions to your products
0 Likes
Shoemaker
New Member
4 0 0

Yes, the product (Aidi Mocc Dark Wine) is available.
Even the variant size, always redirects to the first/default size.

Sorry, but the website is not yet live.

0 Likes
Mircea_Piturca
Shopify Partner
1459 39 284

It may be, but I am just guessing here, that your product page is using the product.first_available_variant rather than product.selected_or_first_available_variant

https://shopify.dev/docs/themes/liquid/reference/objects/product#product-selected_or_first_available...

Finally—Add variant descriptions to your products
Shoemaker
New Member
4 0 0

Thank you for the suggestion, but this is what I found out on the product liquid of the theme I'm using

{%- assign current_variant = product.selected_or_first_available_variant -%}


0 Likes