Workaround for error in Product list pager

Posted by Community Admin on 04-Aug-2018 10:11

Workaround for error in Product list pager

All Replies

Posted by Community Admin on 31-Oct-2012 00:00

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

Posted by Community Admin on 31-Oct-2012 00:00

/* 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);
            
 
        
      
    

Managed to find a workaround if anyone encounters the same problem.
Implemented the Custom Pager found here:
www.sitefinity.com/.../extending_the_default_pager_control
Updated the OnPreRender function with the code above.
OC

Posted by Community Admin on 02-Nov-2012 00:00

Hello Ole,

This has been fixed and will be in the service pack to be released this month.

Regards,
Randy Hodge
the Telerik team

Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

This thread is closed