// 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();
Exemple #2
0
 private function _buildData($orderOnly = false)
 {
     $url = Cible_FunctionsCategories::getPagePerCategoryView(0, 'list_collections', 14);
     $this->view->headLink()->appendStylesheet($this->view->locateFile('cart.css'));
     $account = Cible_FunctionsGeneral::getAuthentication();
     if (!$account) {
         $this->_redirect($url);
     }
     $oMember = new MemberProfile();
     $user = $oMember->findMember($account);
     $orderId = $this->_getParam('qr');
     $oOrder = new OrderCollection();
     if ($orderId) {
         $oOrder->setOrderId($orderId);
     }
     $oOrder->setUserId($user['member_id']);
     $oOrder->setOrderOnly($orderOnly);
     $select = $oOrder->getData();
     return $select;
 }