使用opencart获取多商店设置的商店ID

时间:2012-03-28 22:00:03

标签: php opencart

我们有一个多店铺设置,我想为每个商店稍微更改模板。我仔细查看了现有的代码并找到了这些代码:

$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。即使我们没有订购细节,我也希望这项工作能够实现。

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

1 个答案:

答案 0 :(得分:1)

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

它会在index.php文件

中的此代码中更改为正确的商店ID
if ($store_query->num_rows) {
    $config->set('config_store_id', $store_query->row['store_id']);
} else {
    $config->set('config_store_id', 0);
}
相关问题