Created
July 4, 2013 02:09
-
-
Save nanasess/5924381 to your computer and use it in GitHub Desktop.
カートセッションを入れ替える for EC-CUBE 2.12.x
購入確認ページのアップセル/クロスセルなどで使える。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* dtb_order_temp を更新する. | |
* | |
* @params SC_CartSession_Ex $objCartSess カートセッションインスタンス | |
* @params SC_SiteSession_Ex $objSiteSess サイトセッションインスタンス | |
* @params string $pre_uniqid 現在の order_temp_id | |
* @params integer $cartKey 現在のカートキー | |
* @return boolean 更新が成功した場合 true | |
*/ | |
function updateOrderTemp($objCartSess, $objSiteSess, $pre_uniqid, $cartKey) { | |
$objSiteSess->setRegistFlag(); | |
$objSiteSess->setUniqId(); | |
$uniqid = $objSiteSess->getUniqId(); | |
$sqlval['order_temp_id'] = $uniqid; | |
$where = 'order_temp_id = ?'; | |
$objQuery =& SC_Query_Ex::getSingletonInstance(); | |
$res = $objQuery->update('dtb_order_temp', $sqlval, $where, array($pre_uniqid)); | |
$objCartSess->registerKey($cartKey); | |
$objCartSess->saveCurrentCart($uniqid, $cartKey); | |
if ($res != 1) { | |
return false; | |
} | |
return true; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment