Is there a direct URL to my variant?

misfitmasks
New Member
13 0 0

So my site is misfitmasks.com and I want a URL that goes straight to a variant. Is that possible?

0 Likes
hannahbeasley
Tourist
9 2 1

It is if you use the Shopify asset file option_selection.js! Part of what that code does is that it appends the variant ID of the current product to the product page URL. (For example: https://myshop.com/products/my-product?variant=123456789)

Here's documentation on how to implement that: https://shopify.dev/tutorials/customize-theme-use-products-with-multiple-options

You can also write your own code (my preferred way to do it), but it requires setting up the system so that you dynamically update the URL with the variant ID when a new variant is selected.

0 Likes