in src/Foundation/CommerceServer/code/Pipelines/CatalogLinkProvider.cs [80:126]
public override string GetDynamicUrl(Item item, LinkUrlOptions options)
{
Assert.ArgumentNotNull(item, "item");
Assert.ArgumentNotNull(options, "options");
var url = string.Empty;
var itemType = item.ItemType();
bool productCatalogLinkRequired = Sitecore.Web.WebUtil.GetRawUrl().IndexOf(ProductItemResolver.NavigationItemName, System.StringComparison.OrdinalIgnoreCase) >= 0;
if (productCatalogLinkRequired)
{
url = CatalogUrlManager.BuildProductCatalogLink(item);
}
else if (this.UseShopLinks)
{
if (itemType == StorefrontConstants.ItemTypes.Product)
{
url = CatalogUrlManager.BuildProductShopLink(item, this.IncludeCatalog, this.IncludeFriendlyName, true);
}
else if (itemType == StorefrontConstants.ItemTypes.Category)
{
url = CatalogUrlManager.BuildCategoryShopLink(item, this.IncludeCatalog, this.IncludeFriendlyName);
}
else if (itemType == StorefrontConstants.ItemTypes.Variant)
{
url = CatalogUrlManager.BuildVariantShopLink(item, this.IncludeCatalog, this.IncludeFriendlyName, true);
}
}
else
{
if (itemType == StorefrontConstants.ItemTypes.Product)
{
url = CatalogUrlManager.BuildProductLink(item, this.IncludeCatalog, this.IncludeFriendlyName);
}
else if (itemType == StorefrontConstants.ItemTypes.Category)
{
url = CatalogUrlManager.BuildCategoryLink(item, this.IncludeCatalog, this.IncludeFriendlyName);
}
}
if (string.IsNullOrEmpty(url))
{
url = base.GetDynamicUrl(item, options);
}
return url;
}