shopp_customer_orders()

retrieve a list of orders for a particular customer

shopp_customer_orders ( $customer, $from, $to, $items )

@param int $customer (required) the customer id to load the orders for
@param mixed $from (optional) mktime or SQL datetime, get purchases after this date/time.
@param mixed $to (optional) mktime or SQL datetime, get purchased before this date/time.
@param bool $items (optional default:true) load purchased items into the records, slightly slower operation
@return array of Purchase objects

Description

retrieve a list of orders for a particular customer

Examples

All orders for customer johndoe@domain.com

$orders = shopp_customer_orders ( shopp_customer('johndoe@domain.com', 'email')->id );

All orders for the last month for customer johndoe@domain.com

$orders = shopp_customer_orders ( 
    shopp_customer('johndoe@domain.com', 'email')->id,
    strtotime('-1 month'),      // from date
    current_time('timestamp')   // to date
);

All orders for a one week period for customer johndoe@domain.com

$orders = shopp_customer_orders ( 
    shopp_customer('johndoe@domain.com', 'email')->id,
    '2011-11-01 00:00:00',  // from date
    '2011-11-08 00:00:00'   // to date
);

All orders associated with WordPress user JohnDoe, with purchased items.

$orders = shopp_customer_orders ( 
    shopp_customer('JohnDoe', 'wpuser')->id,
    false,  // no from date
    false,  // no to date
    true    // include purchased items
);

See Also

You must be logged in to post a comment.

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

Skip to toolbar