New Shopify Certification now available: Liquid Storefronts for Theme Developers

Creating direct link to product URL from variant/product ID

vapecommerceuk
Excursionist
26 0 5

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?

 

Thank you

Vaping and working
Reply 1 (1)
ranjan-purbey
Visitor
2 0 0

You can use

https://<shopify_domain>/variants/<variant_id> for product detail page

or

https://<shopify_domain>/cart/<variant_id>:<quantity>?storefront=true for adding the product to the cart and showing the cart page