Exemplo n.º 1
1
 public function confirmed()
 {
     $hash = $this->getQueryString('order');
     $orbit = new Orbit();
     $purchaseData = UID::get('purchase_data', $hash);
     $purchase = $orbit->post('request/purchase', $purchaseData);
     $this->view()->loadTemplate('confirmed');
     $this->commitReplace($this->view()->render(), '#content');
 }
Exemplo n.º 2
0
 private function getHeader()
 {
     $products = Services::get('products');
     $favs = '0';
     $carts = '0';
     if (UID::isLoggedIn()) {
         $orbit = new Orbit();
         $favRequest = $orbit->get('client/countfav', 1, 1, array('id' => UID::get('id')));
         $favs = $favRequest['fav'];
     }
     $cart = Services::get('cart');
     $carts = $cart->updateCounter(true);
     $this->newView('header');
     $this->view('header')->loadTemplate('header');
     $this->view('header')->setVariable('favs', $favs);
     $this->view('header')->setVariable('carts', $carts);
     $categories = $products->getCategories();
     $this->view('header')->setVariable('categories', $categories['items']);
     return $this->view('header')->render();
 }
Exemplo n.º 3
0
 public function orders()
 {
     if (!UID::isLoggedIn()) {
         $this->loginPage();
         return;
     }
     $orbit = new Orbit();
     $result = $orbit->get('client/orders/' . UID::get('id'));
     $orders = $result['orders'];
     $this->view()->loadTemplate('orders');
     $this->view()->setVariable('orders', $orders);
     $this->commitReplace($this->view()->render(), '#content');
 }
Exemplo n.º 4
0
 public function addFavourite()
 {
     if (!UID::isLoggedIn()) {
         $client = Services::get('client');
         $client->register();
         return;
     }
     $orbit = new Orbit();
     $favs = $orbit->post('client/favourites/' . UID::get('id'), array('product_id' => $this->getQueryString('id')));
     #debug($favs);
     $favRequest = $orbit->get('client/countfav', 1, 1, array('id' => UID::get('id')));
     $countfavs = $favRequest['fav'];
     $this->commitReplace(intval($countfavs), '#favitems');
     $this->view()->loadTemplate('favlink');
     $this->commitReplace($this->view()->render(), '#addfav');
 }