Page 1 of 1

Sort Order based on Admin order in CategorySearch

Posted: Wed Nov 12, 2008 11:38 am
by heinscott
Hello. I am using CategorySearch to do my category pages, and would like to use the order specified in the Admin side. Is there a way to do this? I haven't (so far) been able to find an answer in the forums. I've tried
<asp:ListItem Text="Sort" Value="NORMAL" Selected="True"></asp:ListItem>
but, the page stops working altogether when I add that. If I Leave Value="", some random order shows, but, not what is in the Admin.
Any ideas for me?
Thanks a lot,
Scott

Re: Sort Order based on Admin order in CategorySearch

Posted: Wed Nov 12, 2008 12:31 pm
by mazhar
CategorySearch page makes use of ConLib/CategoryGridPage control. I passed the empty string in the CategoryGridPage.ascx.cs files following line of code and its working fine for me

Code: Select all

ProductList.DataSource = ProductDataSource.NarrowSearch(_Keywords, this.CategoryId, _ManufacturerId, 0, 0, _PageSize, (_HiddenPageIndex * _PageSize), string.Empty);

Re: Sort Order based on Admin order in CategorySearch

Posted: Wed Nov 12, 2008 1:42 pm
by heinscott
What if I don't want to do only the admin type of sorting? I'm assuming if I change that code, that only the default will work...
How do I create an empty string as my parameter? Like I said, I used "" for the default selected option, and the products did not show up in the desired order.
Maybe I'm not understanding correctly...
If you could give me a little bit more of a "walk-through" I would greatly appreciate the help!
Thanks Mazhar.

Scott

Re: Sort Order based on Admin order in CategorySearch

Posted: Wed Nov 12, 2008 1:57 pm
by heinscott
I think I understand what you were talking about now... The problem is, however, that my results are still not sorting. Was the ProductDataSource.NarrowSearch method changed in the last upgrade perhaps?? Other than that, I can't figure out why my results won't display correctly.

Re: Sort Order based on Admin order in CategorySearch

Posted: Thu Nov 13, 2008 6:09 am
by mazhar
You are right the NarrowSearch doesn't seems to care the catalog order. In fact the solution posted by me works for the order in which products were entered. If you manually adjust the product order in catalog and then pass an empty sort expression it brings the product in the order in which they were originally entered in the database. In order to support the catalog order with manual adjustments these methods should support some way to sort the results with OrderBy field of the ac_CatalogNodes table. I have created a bug entry for this.

Re: Sort Order based on Admin order in CategorySearch

Posted: Fri Feb 13, 2009 12:41 pm
by dappy2
Has this been fixed in Able 7.2?

I'm using a custom colib/codebehind based on CategoryGridPage3.aspx / cs with minimal if any changes to the actual codebehind but just front end/display changes.

The sort order doesn't seem to work consistently.

I have Top Level Categories with subcategories. Products are assigned to Top Level & Sub Cats. For most of the subcategories the product sorting is in the order of the admin but not all. For the top level categories it is totally random and I have no idea what is going on.

Edit: Forgot to mention I switch to the default CategoryGridPage3.aspx for category display and it worked the same as the custom page.

So should it be fixed? Do I need to look for code to update?

Thanks,
Dappy

Re: Sort Order based on Admin order in CategorySearch

Posted: Fri Feb 13, 2009 12:53 pm
by mazhar

Re: Sort Order based on Admin order in CategorySearch

Posted: Fri Feb 13, 2009 1:17 pm
by dappy2
Am I missing something? My store is still not executing the expected behavior of mirroring the admin side.

Perhaps I am misunderstanding the fix - am I using the wrong category display (custom - based on Conlib/CategoryGridPage3.aspx)?

If I need to switch to another I'm sure I can customize the display again. As I said the store isn't consistently displaying the admin order for subcategories and it never does on Top Level Categories with subcategories.

Thanks again,
Dappy