當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Customers::SetSessionCustomerBonusCart方法代碼示例

本文整理匯總了PHP中Customers::SetSessionCustomerBonusCart方法的典型用法代碼示例。如果您正苦於以下問題:PHP Customers::SetSessionCustomerBonusCart方法的具體用法?PHP Customers::SetSessionCustomerBonusCart怎麽用?PHP Customers::SetSessionCustomerBonusCart使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Customers的用法示例。


在下文中一共展示了Customers::SetSessionCustomerBonusCart方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: FillByOrderId

 public function FillByOrderId($id_order, $add = null)
 {
     $Order = new Orders();
     $Customer = new Customers();
     $Order->SetFieldsById($id_order);
     $order = $Order->fields;
     if ($_SESSION['member']['gid'] == _ACL_CONTRAGENT_) {
         if ($order['discount'] > 0 && $_SESSION['member']['id_user'] == $order['id_customer']) {
             $this->SetPersonalDiscount($order['discount']);
             $Customer->UpdateCustomer(array('id_user' => $_SESSION['member']['id_user'], 'email' => $_SESSION['member']['email'], 'discount' => $order['discount']));
         }
     }
     $products = $Order->GetOrderForCart(array('o.id_order' => $id_order));
     if ($add == null && isset($_SESSION['cart']['id'])) {
         $this->ClearCart($_SESSION['cart']['id']);
     } elseif ($_SESSION['member']['gid'] == _ACL_CONTRAGENT_ && $add == null && !isset($_SESSION['cart']['id'])) {
         $_SESSION['cart'] = null;
     }
     $_SESSION['cart']['note'] = $order['note'];
     if ($_SESSION['member']['gid'] == _ACL_CONTRAGENT_) {
         $_SESSION['cart']['base_order'] = $id_order;
         $_SESSION['cart']['id_customer'] = $order['id_customer'];
         $Customer->SetSessionCustomerBonusCart($order['id_customer']);
     }
     foreach ($products as $p) {
         $p['quantity'] = $p['opt_qty'] + $p['mopt_qty'];
         if ($this->IsAvailableProduct($p['id_product'])) {
             $this->UpdateCartQty($p);
             // $this->IsActualPrice($p);
         } else {
             $_SESSION['cart']['unavailable_products'][] = $p;
         }
     }
     // print_r($_SESSION['cart']);
     // die();
 }
開發者ID:Arikito,項目名稱:webking.xt,代碼行數:36,代碼來源:cart_c.php

示例2: array

     $data = array('last_name' => isset($_POST['last_name']) ? $_POST['last_name'] : null, 'first_name' => isset($_POST['first_name']) ? $_POST['first_name'] : null, 'middle_name' => isset($_POST['middle_name']) ? $_POST['middle_name'] : null, 'name' => !empty($_POST['last_name']) ? $_POST['last_name'] . ' ' . $_POST['first_name'] . ' ' . $_POST['middle_name'] : 'user_' . rand(), 'passwd' => $pass = G::GenerateVerificationCode(6), 'descr' => 'Пользователь создан менеджером при оформлении корзины', 'phone' => $_POST['phone'], 'id_contragent' => $_SESSION['member']['id_user']);
     // регистрируем нового пользователя
     if ($id_customer = $Customers->RegisterCustomer($data)) {
         $Users->SendPassword($data['passwd'], $data['phone']);
         $_SESSION['cart']['id_customer'] = $id_customer;
         $res['message'] = 'успех';
         $res['status'] = 1;
     } else {
         $res['message'] = 'Произошла ошибка, повторите попытку.';
         $res['status'] = 2;
     }
     echo json_encode($res);
     break;
 case 'bindingCustomerOrder':
     $_SESSION['cart']['id_customer'] = $_POST['id_customer'];
     if ($Customers->SetSessionCustomerBonusCart($_POST['id_customer'])) {
         $res['message'] = 'успех';
         $res['status'] = 1;
     } else {
         $res['message'] = 'Произошла ошибка, повторите попытку.';
         $res['status'] = 2;
     }
     echo json_encode($res);
     break;
 case 'settCustomerForOrder':
     if (isset($_POST['step']) && isset($_POST['date'])) {
         switch ($_POST['step']) {
             case 'add_and_set':
                 // создаем нового пользователя
                 $data = array('name' => 'user_' . rand(), 'passwd' => $pass = G::GenerateVerificationCode(6), 'descr' => 'Пользователь создан автоматически при оформлении корзины', 'phone' => $_POST['date']);
                 // регистрируем нового пользователя
開發者ID:Arikito,項目名稱:webking.xt,代碼行數:31,代碼來源:cart.php

示例3: Customers

                     _acl::load($Users->fields['gid']);
                     $echo['err'] = 0;
                 } else {
                     $echo['msg'] = 'Неверный email или пароль.';
                     $echo['err'] = 1;
                 }
             } else {
                 if ($Users->CheckUser($_POST)) {
                     $Users->LastLoginRemember($Users->fields['id_user']);
                     G::Login($Users->fields);
                     _acl::load($Users->fields['gid']);
                     $echo['member'] = $_SESSION['member'];
                     $echo['err'] = 0;
                     if ($_SESSION['member']['gid'] == _ACL_CUSTOMER_) {
                         $customer = new Customers();
                         $customer->SetSessionCustomerBonusCart($Users->fields['id_user']);
                     }
                 } else {
                     $echo['msg'] = 'Неверный email или пароль.';
                     $echo['err'] = 1;
                 }
             }
         } else {
             $echo['msg'] = 'Неверный email или пароль.';
             $echo['err'] = 1;
         }
     }
 } else {
     $echo['msg'] = "В Вашем браузере отключены cookie или их прием заблокирован антивирусом. Без настройки этой функции авторизация на сайте невозможна.";
     $echo['err'] = 1;
 }
開發者ID:Arikito,項目名稱:webking.xt,代碼行數:31,代碼來源:auth.php


注:本文中的Customers::SetSessionCustomerBonusCart方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。