バージョンによてファイル名が違う
data/class/pages/frontparts/LC_Page_FrontParts_LoginCheck.php
data/class/pages/frontparts/LC_Page_FrontParts_Bloc_Login.php
今回は「$_SESSION[member_id] 」があればログイン状態にする、というサンプルです。
Wordpressなど他のシステムにログインしていて
EC-CUBEにログイン状態を引き継ぐときなどに活用します。
// ログイン判定
if ($objCustomer->isLoginSuccess()) {
$this->tpl_login = true;
$this->tpl_user_point = $objCustomer->getValue('point');
$this->tpl_name1 = $objCustomer->getValue('name01');
$this->tpl_name2 = $objCustomer->getValue('name02');
// ↓ ここから追記
}elseif($_SESSION[member_id] != '') {
$this->tpl_login = true;
$this->tpl_user_point = $objCustomer->getValue('point');
$this->tpl_name1 = $objCustomer->getValue('name01');
$this->tpl_name2 = $objCustomer->getValue('name02');
// ↑ ここまで追記
} else {
// クッキー判定
$this->tpl_login_email = $objCookie->getCookie('login_email');
if ($this->tpl_login_email != '') {
$this->tpl_login_memory = '1';
}
// POSTされてきたIDがある場合は優先する。
if (isset($_POST['login_email']) && $_POST['login_email'] != '') {
$this->tpl_login_email = $_POST['login_email'];
}
}