• Welcome to KonaKart Community Forum. Please login or sign up.
 

How can I get Total Products Sold/Total Orders?

Started by Simon, August 16, 2011, 08:08:43 am

Previous topic - Next topic

Simon

Hi guys,

Is there any API in konakart i can you use to get Total Products Sold or Total Orders from the following options:
-All Time, Last 30 Days, Year to Date?

Now I just run a custom SQL to do that, is there other better way to solve it?

Thanks.

kate

I assume you have seen the Admin APIs?

The javadoc is installed in the standard installation at http://localhost:8780/javadoc/

You should look at the KKAdminIf for the Admin APIs

getOrders looks like a possible candidate although it might be a bit heavy for just getting the count.   I guess it depends if getting the orders back is useful to you or not.... and also how many orders you're likely to retrieve and how often you call this.


Failing that you could create your own API call (see the custom() call (or customSecure() call))  and define your own parameters to define your search conditions - then your implementation can execute your count functions.   

It really depends what you need to achieve.

In some instances creating a BIRT report might even be the best solution... or indeed a custom query as you are doing already!


julie

QuoteTotal Orders from the following options:
-All Time, Last 30 Days, Year to Date?


You can use

public AdminOrderSearchResult getOrders(String sessionId, AdminOrderSearch search, int offset,
            int size, int languageId) throws KKAdminException;

The return object (AdminOrderSearchResult) contains a totalSetSize attribute which will give you the total number even if you just decide to get the API call to return a single order by setting the size parameter to 1.

As Kate said, it really depends on what you want to achieve. i.e. If it's a report then your best bet could be to use BIRT or some other business intelligence reporting tool. Alternatively you could run a batch job every night that uses the getOrders() API call and updates a custom table containing running counts so that you always have updated "summary" information at hand without needing to run long queries.