本文整理汇总了PHP中order::update方法的典型用法代码示例。如果您正苦于以下问题:PHP order::update方法的具体用法?PHP order::update怎么用?PHP order::update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类order
的用法示例。
在下文中一共展示了order::update方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getUserCart
static function getUserCart()
{
global $db, $user, $router;
$sessAr = expSession::get('verify_shopper');
// initialize this users cart if they have ecomm installed.
$active = $db->selectValue('modstate', 'active', 'module="storeController"');
if (!expModules::controllerExists('cart') || empty($active)) {
// if ecomm is turned off, no cart.
return null;
} else {
if (isset($router->params['controller']) && $router->params['controller'] == 'order' && ($router->params['action'] == 'verifyReturnShopper' || $router->params['action'] == 'verifyAndRestoreCart' || $router->params['action'] == 'clearCart') && (!isset($sessAr['validated']) || $sessAr['validated'] != true)) {
return new order();
} else {
// if ecomm is turned off, no cart.
//$active = ;
if (empty($active)) {
return null;
}
$order = new order();
//initialize a new order object to use the find function from.
$ticket = expSession::getTicketString();
//get this users session ticket. this is how we track anonymous users.
// grab the origional referrer from the session table so that we can transfer it into the cart where it will be used for reporting purposes
// sessions are temporary so we can't report on the referrer in the session table itsef because it may not be there
// and we can't just get the referrer ar this point becaues the user likely navigated the site a bit and we want the origional referring site
$orig_referrer = $db->selectValue('sessionticket', 'referrer', "`ticket`='" . $ticket . "'");
//see if we have a LIVE and ACTIVE session w/ cart and grab it if so
$sessioncart = $order->find('first', "invoice_id='' AND sessionticket_ticket='" . $ticket . "'");
//check to see if the user is logged in, and if so grab their existing cart
if (!empty($user) && $user->isLoggedIn()) {
$usercart = $order->find('first', "invoice_id='' AND user_id=" . $user->id);
}
//eDebug($sessioncart);
//eDebug($usercart);
//enter here if we have NO ACTIVE SESSION CART -OR- We're awaiting a potential cart retore
if (empty($sessioncart->id) || $sessAr['awaiting_choice'] == true) {
if (empty($usercart->id)) {
// no SESSION cart was found and user is not logged in...
//let's see if they have a cart_id cookie set and we'll snag that if so
//they won't have any user data, since they are "logged in" once they get to
//checkout, so all we're really doing here is populating a cart for return
//shoppers
$cookie_cart_id = isset($_COOKIE['cid']) ? $_COOKIE['cid'] : 0;
//eDebug($cookie_cart_id,true);
if ($cookie_cart_id) {
$tmpCart = new order($cookie_cart_id);
if ($tmpCart->id != $cookie_cart_id) {
//cookie set, but we gots no cart in the DB so act as if we had no cookie
$cart = new order();
$cart->update(array("sessionticket_ticket" => $ticket, 'user_id' => $user->id, 'orig_referrer' => $orig_referrer, 'return_count' => $cart->setReturnCount($orig_referrer)));
order::setCartCookie($cart);
} else {
$u = new user($tmpCart->user_id);
//1) Was Not logged in
if (empty($tmpCart->user_id)) {
$cart = new order($cookie_cart_id);
//update the session ticket and return count
$cart->update(array('sessionticket_ticket' => $ticket, 'return_count' => $cart->setReturnCount($orig_referrer)));
order::setCartCookie($cart);
flash('message', gt('Welcome back'));
} else {
if (!empty($tmpCart->user_id)) {
//check for is admin first
if ($u->isActingAdmin() || $u->isAdmin()) {
//no need to restore anything.
$cart = new order();
$cart->update(array("sessionticket_ticket" => $ticket, 'user_id' => $user->id, 'orig_referrer' => $orig_referrer));
order::setCartCookie($cart);
} else {
if (!empty($tmpCart->user_id) && count($tmpCart->orderitem) == 0) {
//silently copy tracking data from old order and continue on
$cart = new order();
$cart->update(array("sessionticket_ticket" => $ticket, 'user_id' => $user->id, 'orig_referrer' => $orig_referrer, 'return_count' => $tmpCart->setReturnCount($orig_referrer)));
order::setCartCookie($cart);
flash('message', gt('Welcome back'));
} else {
if (!empty($tmpCart->user_id) && count($tmpCart->orderitem) > 0) {
//3) Was Logged in w/ NON-?real user? account
//eDebug(expUtil::right($u->username,10),true);
if ($u->isTempUser()) {
if (isset($sessAr['validated']) && $sessAr['validated']) {
//already went through validation and we're good to go
$cart = new order($sessAr['cid']);
//update the session ticket and return count
$cart->update(array('sessionticket_ticket' => $ticket, 'return_count' => $cart->mergeReturnCount($sessioncart->return_count), 'orig_referrer' => $sessioncart->orig_referrer));
order::setCartCookie($cart);
expSession::un_set('verify_shopper');
$user = new user($cart->user_id);
expSession::login($user);
//Update the last login timestamp for this user.
$user->updateLastLogin();
flash('message', gt('Welcome back') . ' ' . $sessAr['firstname'] . '! ' . gt('Your shopping cart has been restored - you may continue shopping or') . ' <a href="' . makelink(array("controller" => "cart", "action" => "checkout")) . '">checkout</a> ' . gt('at your convenience.'));
} else {
//send to verification? If user has elected to restore their cart
//eDebug($_SESSION);
if (isset($sessAr['awaiting_choice']) && $sessAr['awaiting_choice'] == true) {
/*expSession::set('verify_shopper',array('au'=>1,'orig_path'=>$router->current_url, 'firstname'=>$u->firstname, 'cid'=>$cookie_cart_id));
redirect_to(array("controller"=>"order",'action'=>'verifyReturnShopper'));
orderController::verifyReturnShopper();*/
//just give em the sessioncart
//.........这里部分代码省略.........
示例2: iconv
A03 超商取貨新訂單,使用 輕鬆袋或迷你袋 (不回覆sn_id,不需在ezShip上確認訂單
,需登錄編號)
A04 超商取貨新訂單,使用 輕鬆袋或迷你袋 (不回覆sn_id,需在ezShip上確認訂單,
需登錄編號)
A05 宅配新訂單,不需在ezShip上確認訂單,可直接印單 (回覆sn_id,10碼數字)
*/
$temp_str .= '<input type="hidden" name="order_status" value="A05">';
//1 取貨付款 3 取貨不付款
$temp_str .= '<input type="hidden" name="order_type" value="1">';
//1 取貨付款 3 取貨不付款
$temp_str .= '<input type="hidden" name="su_id" value="' . $this->account . '">';
$temp_str = '<form id="form1" method="get" action="' . $this->sale_url . '">' . $temp_str . '</form><script>document.forms.form1.submit();</script>';
echo iconv("UTF-8", "Big5", $temp_str);
}
}
$sale = new ezship(account);
$sale->isshop();
//$sale->istake();
if ($_REQUEST["stCode"]) {
//--紀錄商店資訊
$shopping_car = new order($conn, PREFIX . "shopping_car", PREFIX . "shopping_car_list", PREFIX . "products");
$order = $shopping_car->getorder(" where order_no='" . $_REQUEST['processID'] . "'");
$indata['memo'] = '店面資訊:' . $_REQUEST['stCate'] . ' ' . $_REQUEST['stCode'] . ' ' . $_REQUEST['stName'] . ' ' . $_REQUEST['stTel'] . ' ' . $_REQUEST['stAddr'] . ' ';
$shopping_car->update($indata, $order['id']);
$sale->data_send($_REQUEST);
exit;
}
if ($_POST) {
$sale->data_send($_POST);
exit;
}
示例3: alert
//--紅利設定 (多少換1)
//$shopping_car->set_point(1);
//-結帳資料
if ($_POST && $_REQUEST['submit']) {
//--自訂訂單編號
$shopping_car->order_auto_set('JSP');
$pay_bill = $shopping_car->paybill($_POST);
if (!$pay_bill) {
alert('付款結帳失敗!!' . $shopping_car->erromsg, '?list=1');
exit;
} else {
$temp = $shopping_car->esun_pay_send($pay_bill, '回傳路徑');
}
linkto('index.jsx');
} else {
$pay_bill = $shopping_car->update($_POST);
}
//--新增商品
if ($_GET["addpro"]) {
$temp_addpro = explode(',', $_GET["addpro"]);
$temp_size = explode(',', $_GET["size"]);
$temp_price = explode(',', $_GET["price"]);
if (!$_GET["count"]) {
$_GET["count"] = 1;
}
//---會員分類折扣
$member_dp = $conn->GetRow("select * from " . PREFIX . "data_list where type='memberdesh' and new_type='" . $member->getinfo('type') . "' and status=1");
$shopping_car->deshprice($member_dp['detail'], false);
foreach ($temp_addpro as $k => $v) {
//--取得分類折扣
$pro_data = $conn->GetRow("select * from " . PREFIX . "products where id='" . $v . "'");
示例4: elseif
if ($w->check() == '0') {
$w->msg('还没有登录呢!错误代码:107', '/admin.php');
}
$config['name'] = $_SESSION['name'];
$config['user'] = $_SESSION['user'];
if ($g) {
if ($g['ac'] == 'logout') {
//登出
$w->logout();
} elseif ($g['ac'] == 'edit') {
//编辑
$config['aid'] = $g['aid'];
$odate = $o->show($g['aid']);
$o->edit($odate);
} elseif ($g['ac'] == 'add') {
//添加数据
$w->show('add');
exit;
} elseif ($g['ac'] == 'del') {
$o->del($g['aid']);
}
}
if ($p) {
if ($p['ac'] == 'update') {
$o->update($p);
} elseif ($p['ac'] == 'add') {
$o->adds($p);
}
}
$config['oli'] = $o->li('0', '10');
$w->show('list');
示例5: order
function update_shipping()
{
$order = new order($this->params['id']);
$this->params['shipped'] = datetimecontrol::parseData('shipped', $this->params);
$order->update($this->params);
flash('message', gt('Shipping information updated.'));
expHistory::back();
}