Sort Order based on Admin order in CategorySearch

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
User avatar
heinscott
Captain (CAPT)
Captain (CAPT)
Posts: 375
Joined: Thu May 01, 2008 12:37 pm

Sort Order based on Admin order in CategorySearch

Post by heinscott » Wed Nov 12, 2008 11:38 am

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

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Sort Order based on Admin order in CategorySearch

Post by mazhar » Wed Nov 12, 2008 12:31 pm

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

User avatar
heinscott
Captain (CAPT)
Captain (CAPT)
Posts: 375
Joined: Thu May 01, 2008 12:37 pm

Re: Sort Order based on Admin order in CategorySearch

Post by heinscott » Wed Nov 12, 2008 1:42 pm

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

User avatar
heinscott
Captain (CAPT)
Captain (CAPT)
Posts: 375
Joined: Thu May 01, 2008 12:37 pm

Re: Sort Order based on Admin order in CategorySearch

Post by heinscott » Wed Nov 12, 2008 1:57 pm

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.

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Sort Order based on Admin order in CategorySearch

Post by mazhar » Thu Nov 13, 2008 6:09 am

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.

dappy2
Commander (CMDR)
Commander (CMDR)
Posts: 114
Joined: Wed Jan 18, 2006 5:53 pm
Contact:

Re: Sort Order based on Admin order in CategorySearch

Post by dappy2 » Fri Feb 13, 2009 12:41 pm

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


dappy2
Commander (CMDR)
Commander (CMDR)
Posts: 114
Joined: Wed Jan 18, 2006 5:53 pm
Contact:

Re: Sort Order based on Admin order in CategorySearch

Post by dappy2 » Fri Feb 13, 2009 1:17 pm

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

Post Reply