Posted on 13/08/2015 15:18:39
The URL is either generated automatically on render or is coming from the canonical input in the product meta data.
It is not possible to get that information. For what do you need it? There might be a better option.
Attached the code that generates the canonical:
If Not String.IsNullOrEmpty(Product.Meta.Canonical) Then
AddCanonical(Product.Meta.Canonical)
ElseIf Product.Groups IsNot Nothing AndAlso Product.Groups.Count > 0 Then
'First, find right group
Dim canonical As String = String.Empty
If Not String.IsNullOrEmpty(Product.PrimaryGroupID) Then
If Product.PrimaryGroupID <> Base.Request("GroupID") Then
canonical = EnsureGroupCanonical(FixedPathAndQuery(), Product.PrimaryGroupID)
End If
End If
'Then Check if group is on right page
If Not primaryGroup Is Nothing AndAlso primaryGroup.Meta.PrimaryPageID > 0 AndAlso primaryGroup.Meta.PrimaryPageID <> Me.PageView.ID Then
If String.IsNullOrEmpty(canonical) Then
canonical = FixedPathAndQuery()
End If
canonical = EnsureGroupPageCanonical(canonical, primaryGroup)
End If
'Remove variant from canonical url
If Not String.IsNullOrEmpty(Base.Request("VariantID")) Then
If String.IsNullOrEmpty(canonical) Then
canonical = FixedPathAndQuery()
End If
canonical = RemoveVariantCanonical(canonical, Product.DefaultVariantComboID)
End If
If Not String.IsNullOrEmpty(canonical) Then
canonical = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(canonical.Trim("/"c))
'Base.w(canonical)
AddCanonical(canonical)
End If
End If