Get product from Url

Is there any way to get a product-object from the public website Url?
If so, how do you do it?

Litium version: 4.8.2

1 Like

Do you mean an URL like:
https://www.example.com/products/pants/special-pants-1234 ?

You can use the last part – special-pants-1234 – to get the Article.

// Get the article by urlName (last segment of the articles url) and language. 
Article article = Article.GetArticle(languageID, urlName, FoundationContext.Token);

https://docs.litium.com/documentation/previous-versions/litium-studio-4-5/litium-studio-4-5-1/litium_studio_productcatalog/articles

Seem to be working fine, thank you!