shopp_orders()

get a list of orders

shopp_orders ( $from, $to, $items, $customers, $limit, $order )

@param mixed $from (optional default:false) mktime or SQL datetime, get purchases after this date/time.
@param mixed $to (optional default:false) mktime or SQL datetime, get purchased before this date/time.
@param bool $items (optional default:true) load purchased items into the records
@param array $customers (optional) list of int customer ids to limit the purchases to.  All customers by default.
@param int $limit (optional default:false) maximimum number of results to get, false for no limit
@param string $order (optional default:DESC) DESC or ASC, for sorting in ascending or descending order.
@return array of Purchase objects

Description

get a list of orders

Examples

All orders, with purchased items, sorted in descending order.

$orders = shopp_orders();

All orders from two weeks ago until now using Unix timestamps.

$orders = shopp_orders( strtotime("-2 weeks"), current_time("timestamp") );

All orders for a month period using MySQL datatime

$orders = shopp_orders( '2011-11-01 00:00:00', '2011-11-30 12:59:59' );

All orders from customers 1,2,3, limit 5 orders total

$orders = shopp_orders( false, false, true, array(1, 2, 3), 5 );

All orders, without items, limit 100, in ascending order.

$orders = shopp_orders( false, false, false, array(), 100, 'ASC' );

See Also

You must be logged in to post a comment.

© Ingenesis Limited. Shopp™ is a registered trademark of Ingenesis Limited.

Skip to toolbar