How to make an addon for autoranking of customers based on purchase and display it on the storefront? Any help is very much welcomed. Thank you!
All depends on how you want to calculate “rank”.
Once you have that figured out, then it's not a big deal to add the field to the 'users' table and to display it when viewing in admin…
tbirnset based on amount of items they purchased.
Like I said, you can do your ranking on anything you want… Number of visits * x points, number of items purchased * y points, dollar amount of items purchased * z points gives you some ranking value. Say it's 80. Or you can just sum up the total amount they've purchased (but you'll want to cache this and add to it at each order or your're going to scan the orders table completely for every customer).
You will either need to add a field to the user's table for your ranking or create a new table and reference it.
You will then need to utilize the 'get_user' to add your ranking column to the resulting user_data for all references.
Then, once you have the data available, you can decide what you want to do with it. For instance order the customers list by ranking instead of by name, color code the rows based on the ranking falling within pre-determined ranges, etc. Allow the admin to edit the ranking value on the user's detail page, etc…
You're looking at some custom work. But no matter whom you choose to use to do it for you (or do it yourself), you're going to need a better definition of what you really want to happen. Then you can go to people and ask them to quote it for you.