Page 1 of 1

rank the categories?

PostPosted: Thu Jan 03, 2008 12:51 am
by chadifa
how we can rank the categories and the products?
and switch between the orders?
i know the there a variable named cursor can we benefit from it?

PostPosted: Thu Jan 03, 2008 6:08 pm
by shannah
To rank the products, there is a decent solution presented here.
http://xataface.com/forum/viewtopic.php?t=4194#21073
This solution orders them by product_name by making a change inside the getPreferences() method of the conf/ApplicationDelegate.php class. You could also add a column to the products table and sort on that column.

To order the categories, check out the getCategoriesMenuOptions method int he ApplicationDelegate class, and change the SQL query provided there to order the categories how you like. If you need to add a column to the categories table to serve as a sort order, you can do that too, then sort on that column in the SQL query.

Hope this helps.

-Steve

dynamic order

PostPosted: Fri Jan 04, 2008 12:27 am
by chadifa
i have red a tutoriel that help to sort fields based on metafields:order=field name can we used on a single table i have try it but no success

PostPosted: Fri Jan 04, 2008 12:40 am
by shannah
sort fields based on metafields:order=field name can we used on a single table


metafields:order is only applicable for relationships. Web auction doesn't have any relationships to the products table that would help here.


Best to just add the sort field in the code as I have shown in the examples above.[/b]