logo
Welcome to our new AbleCommerce forums. As a guest, you may view the information here. To post to this forum, you must have a registered account with us, either as a new user evaluating AbleCommerce or an existing user of the application. For all questions related to the older version of Gold and earlier, please go to AbleCommerce Gold forum. Please use your AbleCommerce username and password to Login. New Registrations are disabled.

Notification

Icon
Error

Options
Go to last post Go to first unread
sweeperqb  
#1 Posted : Wednesday, July 27, 2022 9:51:14 AM(UTC)
sweeperqb

Rank: Advanced Member

Groups: Authorized User, Developers
Joined: 5/30/2020(UTC)
Posts: 125

Thanks: 14 times
Was thanked: 3 time(s) in 3 post(s)
When the search page has multiple pages of results, click on one of the page numbers (other than page 1). Click one one of the Product Finder categories or Brands on the left that has fewer results than the current page size. Those links carry forward the page parameter, so now the results page will have something like "Viewing 13 - 19 of 7 results for searchterm".

Wanna join the discussion?! Login to your AbleCommerce Forums forum account. New Registrations are disabled.

sweeperqb  
#2 Posted : Wednesday, July 27, 2022 10:19:14 AM(UTC)
sweeperqb

Rank: Advanced Member

Groups: Authorized User, Developers
Joined: 5/30/2020(UTC)
Posts: 125

Thanks: 14 times
Was thanked: 3 time(s) in 3 post(s)
So, this is how I ended up handling on our end...

Created an extension method to strip querystring parameters from RouteValueDictionary:

Code:
public static class RouteValueDictionaryExtensions
    {
        public static RouteValueDictionary RemoveQueryStringParameter(this RouteValueDictionary dictionary, string key)
        {
            if (dictionary.ContainsKey(key))
            {
                dictionary.Remove(key);
            }
            return dictionary;
        }
    }


Updated the /Website/Views/Category/ProductFinder.cshtml file to use the new extension method to strip out the "page" parameter anywhere a route was being created. Doing so resets everything to Page=1 so the counts are correct.

Example:

Code:
<li>
   <a href="@Url.RouteUrl("AbleRoute", Url.AddUpdateQueryStringParameter("CategoryId", category.CategoryId).RemoveQueryStringParameter("page"))">
       <span>@category.Name</span>
       @if (Model.ShowProductCount)
       {
           <span class="badge">@category.ProductCount</span>
       }
   </a>
</li>
shaharyar  
#3 Posted : Thursday, July 28, 2022 4:11:50 AM(UTC)
shaharyar

Rank: Advanced Member

Groups: Admin, Developers, Registered, HelpDesk, Authorized User
Joined: 10/5/2018(UTC)
Posts: 704

Thanks: 5 times
Was thanked: 113 time(s) in 112 post(s)
I am able to reproduce the issue. I am going to register this as a bug.

Thanks for pointing this out!
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.