本文整理汇总了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();
}
示例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']);
// регистрируем нового пользователя
示例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;
}