1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Workaround for error in Product list pager

Workaround for error in Product list pager

3 posts, 1 answered
  1. OC
    OC avatar
    129 posts
    Registered:
    17 Nov 2004
    31 Oct 2012
    Link to this post
    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
  2. OC
    OC avatar
    129 posts
    Registered:
    17 Nov 2004
    31 Oct 2012 in reply to OC
    Link to this post
    /* 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:
    http://www.sitefinity.com/blogs/lubomirvelkov/posts/lubomir-velkovs-blog/2011/12/14/extending_the_default_pager_control
    Updated the OnPreRender function with the code above.
    OC

    Answered
  3. Randy Hodge
    Randy Hodge avatar
    96 posts
    Registered:
    03 Nov 2014
    02 Nov 2012
    Link to this post
    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
3 posts, 1 answered