actindo ->dk__sales_statistics
actindo -> dk__sales_statistics: sales statistics for customer
Signaturstring dk__sales_statistics( string $sid, int $id, string $type, statistics_params $params )
 
Parameter
  • string $sid
    Session identier you got from auth__login or auth__token_login
     
  • int $id
    customer id
     
  • string $type
    type of statistics - 'wg' for product groups related sales statistics,
     
  • statistics_params $params
    Parameter array: (year, timeframe, startdate, enddate)
     
Returnsstring
array( 'ok'=>TRUE/FALSE, 'error'=>string error text, 'data'=>array statistics data as array )
 
Descriptionsales statistics for customer

the parameter array $params has to be used to limit the time period for the statistics:
year:int
has to be a valid year value, for example 2008

timeframe:string
possible values => year | quarter | month | week | free

startdate:string
depends on the timeframe value
timeframe=year => startdate can be set to: ''
timeframe=quarter => startdate can be set to: 1 - 4
timeframe=month => startdate can be set to: 1 - 12
timeframe=week => startdate can be set to: 1 - 52
timeframe=free => startdate can be set to: mysql timestamp format, for example '2008-02-29'

enddate:string
depends on the timeframe value
timeframe=year|quarter|month|week => enddate can be set to: ''
timeframe=free => enddate can be set to: mysql timestamp format, for example '2008-04-15'

keep in mind to specify every single parameter.
for parameters you don't want to use, strings should be given an empty value ('') and integers should be set to
null


the returned array on success contains the statistics data array (accessible by the key 'data') with the
following structure:

type='wg'
array( array( product group id, volume of sales ) )
type=''
array( array( volume of sales ) )