// Create and load administrator
$user = UserFactory::registerUser('*****@*****.**', 'johnsmith', 'John Smith', 'Administrator');
// Load user by email
$user = new User('*****@*****.**');
// Load user by login
$user = new User('johndoe', 'login');
// Check if subscription is valid
$user->isSubscribed();
// Buy subscription via PayPal for 4 days
Subscription::buy($user, 4, new PayPal(), $paymentDetails);
// Buy subscription via PayPal for 10 days
Subscription::buy($user, 10, new WebMoney(), $paymentDetails);
// Load a product by title
$product = new Product('TV');
// Load a product by ID
$product = new Product(736);
// Get product info
$product->getProductInfo();
// Buy the product
$order = $product->buy($user, new PayPal(), $paymentDetails);
// Get order by ID
$order = new Order();
$order->load(123);
// Set different statuses of order
$order->changeStatus(Order::ORDER_STATUS_CANCELLED);
$order->changeStatus(Order::ORDER_STATUS_IN_PROGRESS);
$order->changeStatus(Order::ORDER_STATUS_CLOSED);
$adminUser = new User('*****@*****.**');
$report = new OrderCollection($adminUser);
// Get sum of sold special product in a date rang for specific user
$sum = $report->addDateRangeFilter('2015-02-05', '2015-02-09')->addUserFilter($user)->addSpecialProductsFilter();