Esempio n. 1
0
 public function OrderAction()
 {
     if ($_SERVER['REQUEST_METHOD'] == 'POST') {
         $data['user_id'] = $_SESSION['user']['id'];
         foreach ($_SESSION['cart']['products_id'] as $id => $count) {
             $data['product_id'] = $id;
             $data['count'] = $count;
             Orders_Model::InsertToOrders($data);
         }
         $res['Content'] = Cart_View::GetOkPage();
         unset($_SESSION['cart']);
         return $res;
     }
     header("Location: " . $_SERVER['HTTP_REFERER']);
     die;
 }