I would like to create a direct link to the live product on my Shopify store which will be created from the variant or product ID. This can be done through the API or URL redirect?
The variant/product ID is the only variable I have to work with, is this possible?
I have exactly the same question, but for the products without variants. Is it possible to access products without variants via URL containing just product id number?
I am not aware of such an option. But shopify creates a default variant for products where you have not explicitly created a variant. You can use that variant’s ID for generating the link.
You can append the product page URL with “.json” in your browser to see the Variant ID and lots of other information for your product.
Use [SHOPIFY-PRODUCT-PAGE-URL].json and you will see “variants” in the json data listing.
Variant “0:” is the “base product” when there are no displayed variants, etc.:
product:
{...}
variants:
0:
id XXXXXXXXXXXXXX <~~ This is the default "Variant ID"
product_id YYYYYYYYYYYYY <~~ This is the Main "Product ID"
title "Default Title"
{...}