Post by gergovprint » Thu Mar 10, 2016 9:26 pm

how can I do the manufacturer's name be written differently for different languages
my Opencart ver. 1.5.6

sory for bad English

I need this module (for version 1.5.6) http://www.opencart.com/index.php?route ... e%20brands

метални табели отпечатване на флаери отпечатване на винил отпечатване на плакати


New member

Posts

Joined
Wed Apr 28, 2010 10:03 pm


Post by gergovprint » Sat Mar 12, 2016 2:48 pm

I found a solution - but does not operate normally, the code must be edited (can you help me)



Why don't you just use the tags you mentioned:

Code: Select all

{en}Daikin{/en}
{bg}Дайкин{/bg}
Then add preg_match on output before rendering.

In system/engine/controller.php find this line:

Code: Select all

$this->output = ob_get_contents();
replace with (in my example language IDs are 1 and 2 for English and Russian respectively):

Code: Select all

//check for current language and do preg_replace on output

/* get current language ID */
$cur_lang_id = $this->config->get('config_language_id');

/* store buffer output in variable */
$html = ob_get_contents();
$tags = array('/\{en\}/','/\{\/en\}/','/\{bg\}/','/\{\/bg\}/');

/* do replacements */
if ($cur_lang_id == '2') {$html = preg_replace('/\{en\}.+\{\/en\}/','',$html);}
if ($cur_lang_id == '1') {$html = preg_replace('/\{bg\}.+\{\/bg\}/','',$html);}

/* remove tags */
$html = preg_replace($tags,'',$html);

//$this->output = ob_get_contents();
$this->output = $html;

I found a solution to the problem ... but something does not see the attachment

Attachments

Untitled-1.jpg

Untitled-1.jpg (281.09 KiB) Viewed 420 times


метални табели отпечатване на флаери отпечатване на винил отпечатване на плакати


New member

Posts

Joined
Wed Apr 28, 2010 10:03 pm

Who is online

Users browsing this forum: No registered users and 12 guests