Workaround for error in Product list pager
Telerik has confirmed that there is an error on the Product list pager when selected department is not on the first level of hierarchical departments. The url rendered for the next page button or buttons for numbered pages does not include the full path to the selected department.
Does anyone have a suggestion for a workaround? I'm not even sure where the error originates, it is probably in the Telerik.Sitefinity.Modules.Ecommerce.Catalog.Web.UrlEvaluators DepartmentFilterUrlEvaluator.
Any ideas anyone? Solution needed yesterday, off course...
OC
/* BUG FIX */
string cUrl = HttpContext.Current.Request.Url.AbsoluteUri;
string urlName = cUrl.Split('/').Last();
int start = cUrl.IndexOf("Departments/") + 12;
int length = cUrl.Length - start;
string fullUrl = cUrl.Substring(start, length);
var cmdNext = this.Container.GetControl<
SitefinityHyperLink
>("cmdNext", true);
var cmdPrev = this.Container.GetControl<
SitefinityHyperLink
>("cmdPrev", true);
cmdNext.NavigateUrl = cmdNext.NavigateUrl.Replace("Departments/" + urlName, "Departments/" + fullUrl);
cmdPrev.NavigateUrl = cmdPrev.NavigateUrl.Replace("Departments/" + urlName, "Departments/" + fullUrl);
Control control1 = this.Container.GetControl<
Control
>("numeric", !this.HideNumeric);
if (control1 != null)
if (!this.HideNumeric)
foreach (Control c in control1.Controls)
if (c.GetType().ToString() == "System.Web.UI.WebControls.HyperLink")
((HyperLink)c).NavigateUrl = ((HyperLink)c).NavigateUrl.Replace("Departments/" + urlName, "Departments/" + fullUrl);
Hello Ole,
This has been fixed and will be in the service pack to be released this month.
Regards,
Randy Hodge
the Telerik team