Quantcast
Channel: Opinion: Shopify Community - Shopify Apps
Viewing all articles
Browse latest Browse all 11091

How to get the URL for any product given that its pattern varies if it belongs to a collection? by Targeting Mantra

$
0
0

For a product which does not belong to any collection we can have url defined as - <shop-url>/products/< product.handle >. In case a product belongs to a collection it changes to - <shop-url>/collections/<collection-name>/products/< product.handle >.

How to handle these cases. Also, I do not get the collection name attached to the product when I make an api call so that I may build upon the url myself. Is there a generic way to get the product url?

I wonder why shopify does not provide with the product url straightways! Is there any reason?

EDIT:

I just realized that even if a product is associated with a collection we can have its url as  <shop-url>/products/< product.handle >; and <shop-url>/collections/<collection-name>/products/< product.handle > are same thing. Two different url but same page?


Viewing all articles
Browse latest Browse all 11091

Trending Articles