2012-03-28 139 views
2

我们有一个多商店设置,我想稍微更改每个商店的模板。我仔细观察了已经存在的代码,并发现这些代码:使用opencart获取多商店设置的商店ID

$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?

+0

我有同样的问题,改为正确的商店ID在此代码。你知道解决方案还是自动解决? – 2014-02-20 11:19:47

+0

我不确定到底什么是真正的错误我刚刚使用了'$ this-> config-> get('config_store_id')' – 2014-02-20 13:07:10

回答

1

目前的店铺ID是$this->config->get('config_store_id')

它得到的index.php文件

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

不知道我以前测试过这个问题时出现了什么问题。谢谢 – 2012-03-28 22:45:07