rank the categories?

A place to discuss and receive support for the Web Auction application.

rank the categories?

Postby chadifa » Thu Jan 03, 2008 12:51 am

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?
chadifa
 
Posts: 7
Joined: Thu Jan 03, 2008 12:41 am

Postby shannah » Thu Jan 03, 2008 6:08 pm

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
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

dynamic order

Postby chadifa » Fri Jan 04, 2008 12:27 am

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
chadifa
 
Posts: 7
Joined: Thu Jan 03, 2008 12:41 am

Postby shannah » Fri Jan 04, 2008 12:40 am

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]
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm


Return to Web Auction Discussion

Who is online

Users browsing this forum: No registered users and 17 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved