Skip to content

Commit

Permalink
Merge pull request #958 from EC-CUBE/seasoft-php-warning
Browse files Browse the repository at this point in the history
PHP Warning 回避
  • Loading branch information
seasoftjapan authored Jul 22, 2024
2 parents a12c9ff + 5fbce34 commit 8d7a99c
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 26 deletions.
35 changes: 18 additions & 17 deletions data/class/helper/SC_Helper_Purchase.php
Original file line number Diff line number Diff line change
Expand Up @@ -1490,24 +1490,25 @@ public function checkDbMyPendignOrder()

public function checkSessionPendingOrder()
{
if (!SC_Utils_Ex::isBlank($_SESSION['order_id'])) {
$order_id = $_SESSION['order_id'];
unset($_SESSION['order_id']);
$objQuery = SC_Query_Ex::getSingletonInstance();
$objQuery->begin();
$arrOrder = SC_Helper_Purchase_Ex::getOrder($order_id);
if ($arrOrder['status'] == ORDER_PENDING) {
$objCartSess = new SC_CartSession_Ex();
$cartKeys = $objCartSess->getKeys();
if (SC_Utils_Ex::isBlank($cartKeys)) {
SC_Helper_Purchase_Ex::rollbackOrder($order_id, ORDER_CANCEL, true);
GC_Utils_Ex::gfPrintLog('order rollback.(session pending) order_id=' . $order_id);
} else {
SC_Helper_Purchase_Ex::cancelOrder($order_id, ORDER_CANCEL, true);
GC_Utils_Ex::gfPrintLog('order rollback.(session pending and set card) order_id=' . $order_id);
}
if (!isset($_SESSION['order_id'])) return;
if (SC_Utils_Ex::isBlank($_SESSION['order_id'])) return;

$order_id = $_SESSION['order_id'];
unset($_SESSION['order_id']);
$objQuery = SC_Query_Ex::getSingletonInstance();
$objQuery->begin();
$arrOrder = SC_Helper_Purchase_Ex::getOrder($order_id);
if ($arrOrder['status'] == ORDER_PENDING) {
$objCartSess = new SC_CartSession_Ex();
$cartKeys = $objCartSess->getKeys();
if (SC_Utils_Ex::isBlank($cartKeys)) {
SC_Helper_Purchase_Ex::rollbackOrder($order_id, ORDER_CANCEL, true);
GC_Utils_Ex::gfPrintLog('order rollback.(session pending) order_id=' . $order_id);
} else {
SC_Helper_Purchase_Ex::cancelOrder($order_id, ORDER_CANCEL, true);
GC_Utils_Ex::gfPrintLog('order rollback.(session pending and set card) order_id=' . $order_id);
}
$objQuery->commit();
}
$objQuery->commit();
}
}
2 changes: 1 addition & 1 deletion data/class/pages/LC_Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ public function init()
// 開始時刻を設定する。
$this->timeStart = microtime(true);

$this->tpl_authority = $_SESSION['authority'];
$this->tpl_authority = $_SESSION['authority'] ?? null;

// ディスプレイクラス生成
$this->objDisplay = new SC_Display_Ex();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function init()
// 開始時刻を設定する。
$this->timeStart = microtime(true);

$this->tpl_authority = $_SESSION['authority'];
$this->tpl_authority = $_SESSION['authority'] ?? null;

// ディスプレイクラス生成
$this->objDisplay = new SC_Display_Ex();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ class LC_Page_FrontParts_Bloc_Category extends LC_Page_FrontParts_Bloc_Ex
public $arrCat;
/** @var array */
public $arrTree;
/** @var int */
public $root_parent_id;

/**
* Page を初期化する.
Expand Down Expand Up @@ -127,7 +125,6 @@ public function lfGetCatTree($arrParentCategoryId, $count_check = false)
foreach ($arrParentCategoryId as $category_id) {
$arrParentID = $objCategory->getTreeTrail($category_id);
$this->arrParentID = array_merge($this->arrParentID, $arrParentID);
$this->root_parent_id[] = $arrParentID[0];
}

return $arrTree;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,6 @@ public function process()
*/
public function action()
{
// 基本情報を渡す
$objSiteInfo = SC_Helper_DB_Ex::sfGetBasisData();
$this->arrInfo = $objSiteInfo->data;

//おすすめ商品表示
$this->arrBestProducts = $this->lfGetRanking();
}
Expand Down

0 comments on commit 8d7a99c

Please sign in to comment.