Php Opencart Multistore-将其中一个存储重定向到帐户/登录
我使用Opencart版本1.5.4.1,并且我已经安装了商店模块&在下拉列表中有3个商店(例如默认商店、商店1、商店2) 我的要求是将最后一个存储(示例Store2)重定向到Php Opencart Multistore-将其中一个存储重定向到帐户/登录,php,opencart,Php,Opencart,我使用Opencart版本1.5.4.1,并且我已经安装了商店模块&在下拉列表中有3个商店(例如默认商店、商店1、商店2) 我的要求是将最后一个存储(示例Store2)重定向到account/login 我试图将\catalog\controller\module\store.php中的路径从index.php?route=common/home修改为index.php?route=account/login,但Store1和Store2都被重定向到account/login 我还尝试使用以下i
account/login
我试图将\catalog\controller\module\store.php
中的路径从index.php?route=common/home
修改为index.php?route=account/login
,但Store1和Store2都被重定向到account/login
我还尝试使用以下if
条件:如果我选择从默认值到存储1和从存储1到存储2,则它工作,但如果选择任何从默认值到存储2,则它不工作
foreach ($results as $result) {
if((int)$this->config->get('config_store_id')==1)
{
$this->data['stores'][] = array(
'store_id' => $result['store_id'],
'name' => $result['name'],
'url' => $result['url'] . 'index.php?route=account/login'
);
}
else
{
$this->data['stores'][] = array(
'store_id' => $result['store_id'],
'name' => $result['name'],
'url' => $result['url'] . 'index.php?route=common/home'
);
}
}
您可以使用以下
vqmod代码
:
.xml
的文件中vqmod\xml
文件夹
强制客户登录
152.1
2.1.5
精神错乱
请求->获取['route'])){
$skip=数组(
“付款”,
"饲料",,
"遗忘",,
“登录”,
"登记册",;
foreach($s跳过){
if(strpos($this->request->get['route'],$s)!==false){
$match=true;
打破
}
}
}
如果(!$match){
如果(!$this->customer->isloged()){
if($this->config->get('config\u store\u id')==1){
$this->redirect($this->url->link('account/login','SSL');
}
}
}
]]>
<modification>
<id>Force Customer Login</id>
<version>152.1</version>
<vqmver>2.1.5</vqmver>
<author>Qphoria</author>
<file name="catalog/controller/common/header.php">
<operation>
<search position="after"><![CDATA[function index()]]></search>
<add trim="true">
<![CDATA[//Q: Force Customer Login
$match = false;
if (!empty($this - > request - > get['route'])) {
$skip = array(
'payment',
'feed',
'forgotten',
'login',
'register', );
foreach($skip as $s) {
if (strpos($this - > request - > get['route'], $s) !== false) {
$match = true;
break;
}
}
}
if (!$match) {
if (!$this - > customer - > isLogged()) {
if ($this - > config - > get('config_store_id') == 1) {
$this - > redirect($this - > url - > link('account/login', 'SSL'));
}
}
}
]]>
</add>
</operation>
</file>
</modification>