2012-03-28 128 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