I'm using opencart version 1.5.5.1. We've a website coded using opencart framework. The site uses opencart multi-store feature also. All stores use English language.
Now the question is, is it possible to use different language labels for different stores? For example: One store is related to sports items and another one is related to wrist watches. So we need to use language labels related to sports items in one store and language labels related to watches for the other one.
I'm not sure whether it's possible or not, as in opencart we load the language files via controller file of each module.
Please help me. Thanks in advance!
Not sure if this is the most elegant way, but here's a hack that first came to mind:
English_sports, English_watches, French_sports etc.catalog/comtroller/module/language.php add a conditional statement to catch and filter out not needed languages:Find line 32:
$results = $this->model_localisation_language->getLanguages();
Add:
$store_id = $this->config->get('config_store_id');
Inside data population loop add your conditional and string cleaning code:
foreach ($results as $result) {
if ($store_id == "0" && $result['name'] == 'English_sports'){continue;}
$strings = array("_sports","_watches");
if ($result['status']) {
$this->data['languages'][] = array(
//clean name strings for output
'name' => str_replace($strings,'',$result['name']),
'code' => $result['code'],
'image' => $result['image']
);
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With