I would like to display pagination twice in category pages, once on top of the page and once at the bottom.
I tried to make some changes in the templates/categories/productsingrind.ascx file:
productsingrind.ascx
//first pager
<div class="product-pager" id="productpager" runat="server">
<nopCommerce:Pager runat="server" ID="productsPager" FirstButtonText="<% $NopResources:Pager.First %>"
LastButtonText="<% $NopResources:Pager.Last %>" NextButtonText="<% $NopResources:Pager.Next %>"
PreviousButtonText="<% $NopResources:Pager.Previous %>" CurrentPageText="Pager.CurrentPage" />
</div>
....
//second pager
<div class="product-pager" id="productpager1" runat="server">
<nopCommerce:Pager runat="server" ID="productsPager1" FirstButtonText="<% $NopResources:Pager.First %>"
LastButtonText="<% $NopResources:Pager.Last %>" NextButtonText="<% $NopResources:Pager.Next %>"
PreviousButtonText="<% $NopResources:Pager.Previous %>" CurrentPageText="Pager.CurrentPage" />
</div>
productsingrind.ascx.cs
;
if (productCollection.Count > 0)
{
this.productsPager.PageSize = pageSize;
this.productsPager.TotalRecords = totalRecords;
this.productsPager.PageIndex = this.CurrentPageIndex;
this.productsPager1.PageSize = pageSize;
this.productsPager1.TotalRecords = totalRecords;
this.productsPager1.PageIndex = this.CurrentPageIndex;
this.dlProducts.DataSource = productCollection;
this.dlProducts.DataBind();
}
...
if ((productCollection.Count < pageSize) && (this.CurrentPageIndex == 0))
{
productpager.Attributes.Add("style", "display:none");
productpager1.Attributes.Add("style", "display:none");
}
...
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
ctrlPriceRangeFilter.ExcludedQueryStringParams = productsPager.QueryStringProperty;
ctrlPriceRangeFilter.ExcludedQueryStringParams = productsPager1.QueryStringProperty;
ctrlProductSpecificationFilter.ExcludedQueryStringParams = productsPager.QueryStringProperty;
ctrlProductSpecificationFilter.ExcludedQueryStringParams = productsPager1.QueryStringProperty;
ctrlProductSpecificationFilter.CategoryId = this.CategoryId;
ctrlProductSpecificationFilter.ReservedQueryStringParams = "CategoryId,";
ctrlProductSpecificationFilter.ReservedQueryStringParams += "orderby,";
ctrlProductSpecificationFilter.ReservedQueryStringParams += ctrlPriceRangeFilter.QueryStringProperty;
ctrlProductSpecificationFilter.ReservedQueryStringParams += ",";
ctrlProductSpecificationFilter.ReservedQueryStringParams += productsPager.QueryStringProperty;
ctrlProductSpecificationFilter.ReservedQueryStringParams += productsPager1.QueryStringProperty;
}
After aaplying the previous code, pagination is not working anymore. Did I miss something here? Could you help me fix it please?