使用opencart获取多商店设置的商店ID [英] Get the store ID for multi store setup with opencart

查看:175
本文介绍了使用opencart获取多商店设置的商店ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们建立了一个多商店,我想为每个商店略微更改模板.我对已经存在的代码进行了很好的查找,发现了以下内容:

We have a multi-store set up and I wanted to change the template slightly for each store. I had a good look through the code already in place and found these:

$this->config->get('config_store_id')

$this->load->model('setting/store');
$results = $this->model_setting_store->getStores();

$this->model_setting_setting->getSetting('config', $order_info['store_id']);

第一行仅返回默认商店ID.即使我们没有订购详细信息,我也希望它能正常工作.

The first line only ever returns the default store ID. I would want this to work even if we have not order details.

获取商店ID的最可靠方法是什么?

推荐答案

当前商店ID在$this->config->get('config_store_id')

在此代码中,将其更改为index.php文件中的正确商店ID

It gets changed to the correct store ID in this code in the index.php file

if ($store_query->num_rows) {
    $config->set('config_store_id', $store_query->row['store_id']);
} else {
    $config->set('config_store_id', 0);
}

这篇关于使用opencart获取多商店设置的商店ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆