本文整理汇总了PHP中SC_Helper_Purchase::clearShipmentItemTemp方法的典型用法代码示例。如果您正苦于以下问题:PHP SC_Helper_Purchase::clearShipmentItemTemp方法的具体用法?PHP SC_Helper_Purchase::clearShipmentItemTemp怎么用?PHP SC_Helper_Purchase::clearShipmentItemTemp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SC_Helper_Purchase
的用法示例。
在下文中一共展示了SC_Helper_Purchase::clearShipmentItemTemp方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
public function testClearShipmentItem_商品情報が配列でない場合_何も変更されない()
{
$this->setUpShipping($this->getMultipleShipping());
// 内容を配列でないように変更
$_SESSION['shipping']['00001'] = 'temp';
$helper = new SC_Helper_Purchase();
$helper->clearShipmentItemTemp('00001');
// '00001'は配列でないので全体を取得
$this->expected = array('00001' => 'temp', '00002' => array('商品2'), '00003' => array());
$this->actual['00001'] = $_SESSION['shipping']['00001'];
$this->actual['00002'] = $_SESSION['shipping']['00002']['shipment_item'];
$this->actual['00003'] = $_SESSION['shipping']['00003']['shipment_item'];
$this->verify('配送商品');
}
示例2: saveMultipleShippings
/**
* 複数配送情報を一時保存する.
*
* 会員ログインしている場合は, その他のお届け先から住所情報を取得する.
*
* @param integer $uniqid 一時受注テーブルのユニークID
* @param SC_FormParam $objFormParam SC_FormParam インスタンス
* @param SC_Customer $objCustomer SC_Customer インスタンス
* @param SC_Helper_Purchase $objPurchase SC_Helper_Purchase インスタンス
* @return void
*/
public function saveMultipleShippings($uniqid, &$objFormParam, &$objCustomer, &$objPurchase, &$objAddress)
{
$arrParams = $objFormParam->getSwapArray();
foreach ($arrParams as $arrParam) {
$other_deliv_id = $arrParam['shipping'];
if ($objCustomer->isLoginSuccess(true)) {
if ($other_deliv_id != 0) {
$otherDeliv = $objAddress->getAddress($other_deliv_id, $objCustomer->getValue('customer_id'));
if (!$otherDeliv) {
SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, '', false, "入力値が不正です。<br />正しい値を入力してください。");
SC_Response_Ex::actionExit();
}
foreach ($otherDeliv as $key => $val) {
$arrValues[$other_deliv_id]['shipping_' . $key] = $val;
}
} else {
$objPurchase->copyFromCustomer($arrValues[0], $objCustomer, 'shipping');
}
} else {
$arrValues = $objPurchase->getShippingTemp();
}
$arrItemTemp[$other_deliv_id][$arrParam['product_class_id']] += $arrParam['quantity'];
}
$objPurchase->clearShipmentItemTemp();
foreach ($arrValues as $shipping_id => $arrVal) {
$objPurchase->saveShippingTemp($arrVal, $shipping_id);
}
foreach ($arrItemTemp as $other_deliv_id => $arrProductClassIds) {
foreach ($arrProductClassIds as $product_class_id => $quantity) {
if ($quantity == 0) {
continue;
}
$objPurchase->setShipmentItemTemp($other_deliv_id, $product_class_id, $quantity);
}
}
//不必要な配送先を削除
foreach ($_SESSION['shipping'] as $id => $arrShipping) {
if (!isset($arrShipping['shipment_item'])) {
$objPurchase->unsetOneShippingTemp($id);
}
}
// $arrValues[0] には, 購入者の情報が格納されている
$objPurchase->saveOrderTemp($uniqid, $arrValues[0], $objCustomer);
}
示例3: saveMultipleShippings
/**
* 複数配送情報を一時保存する.
*
* 会員ログインしている場合は, その他のお届け先から住所情報を取得する.
*
* @param integer $uniqid 一時受注テーブルのユニークID
* @param SC_FormParam $objFormParam SC_FormParam インスタンス
* @param SC_Customer $objCustomer SC_Customer インスタンス
* @param SC_Helper_Purchase $objPurchase SC_Helper_Purchase インスタンス
* @param SC_CartSession $objCartSess SC_CartSession インスタンス
* @return void
*/
function saveMultipleShippings($uniqid, &$objFormParam, &$objCustomer, &$objPurchase, &$objCartSess, &$objAddress)
{
$arrParams = $objFormParam->getSwapArray();
foreach ($arrParams as $arrParam) {
$other_deliv_id = $arrParam['shipping'];
if ($objCustomer->isLoginSuccess(true)) {
if ($other_deliv_id != 0) {
$otherDeliv = $objAddress->getAddress($other_deliv_id);
foreach ($otherDeliv as $key => $val) {
$arrValues[$other_deliv_id]['shipping_' . $key] = $val;
}
} else {
$objPurchase->copyFromCustomer($arrValues[0], $objCustomer, 'shipping');
}
} else {
$arrValues = $objPurchase->getShippingTemp();
}
$arrItemTemp[$other_deliv_id][$arrParam['product_class_id']] += $arrParam['quantity'];
}
$objPurchase->clearShipmentItemTemp();
foreach ($arrValues as $shipping_id => $arrVal) {
$objPurchase->saveShippingTemp($arrVal, $shipping_id);
}
foreach ($arrItemTemp as $other_deliv_id => $arrProductClassIds) {
foreach ($arrProductClassIds as $product_class_id => $quantity) {
if ($quantity == 0) {
continue;
}
$objPurchase->setShipmentItemTemp($other_deliv_id, $product_class_id, $quantity);
}
}
//不必要な配送先を削除
foreach ($_SESSION['shipping'] as $id => $arrShipping) {
if (!isset($arrShipping['shipment_item'])) {
$objPurchase->unsetOneShippingTemp($id);
}
}
// $arrValues[0] には, 購入者の情報が格納されている
$objPurchase->saveOrderTemp($uniqid, $arrValues[0], $objCustomer);
}
示例4: saveMultipleShippings
/**
* 複数配送情報を一時保存する.
*
* 会員ログインしている場合は, その他のお届け先から住所情報を取得する.
*
* @param integer $uniqid 一時受注テーブルのユニークID
* @param SC_FormParam $objFormParam SC_FormParam インスタンス
* @param SC_Customer $objCustomer SC_Customer インスタンス
* @param SC_Helper_Purchase $objPurchase SC_Helper_Purchase インスタンス
* @param SC_CartSession $objCartSess SC_CartSession インスタンス
* @return void
*/
function saveMultipleShippings($uniqid, &$objFormParam, &$objCustomer, &$objPurchase, &$objCartSess)
{
$objQuery =& SC_Query_Ex::getSingletonInstance();
$arrParams = $objFormParam->getSwapArray();
foreach ($arrParams as $arrParam) {
$other_deliv_id = $arrParam['shipping'];
if ($objCustomer->isLoginSuccess(true)) {
if ($other_deliv_id != 0) {
$otherDeliv = $objQuery->select('*', 'dtb_other_deliv', 'other_deliv_id = ?', array($other_deliv_id));
foreach ($otherDeliv[0] as $key => $val) {
$arrValues[$other_deliv_id]['shipping_' . $key] = $val;
}
} else {
$objPurchase->copyFromCustomer($arrValues[0], $objCustomer, 'shipping');
}
} else {
$arrValues = $objPurchase->getShippingTemp();
}
$arrItemTemp[$other_deliv_id][$arrParam['product_class_id']] += $arrParam['quantity'];
}
$objPurchase->clearShipmentItemTemp();
foreach ($arrValues as $shipping_id => $arrVal) {
$objPurchase->saveShippingTemp($arrVal, $shipping_id);
}
foreach ($arrItemTemp as $other_deliv_id => $arrProductClassIds) {
foreach ($arrProductClassIds as $product_class_id => $quantity) {
if ($quantity == 0) {
continue;
}
$objPurchase->setShipmentItemTemp($other_deliv_id, $product_class_id, $quantity);
}
}
// $arrValues[0] には, 購入者の情報が格納されている
$objPurchase->saveOrderTemp($uniqid, $arrValues[0], $objCustomer);
}