Page 1 of 1

[SOLVED] how to localize new button in VQMOD

Posted: Thu Jan 10, 2013 5:26 am
by lenamtl
Hi,

I'm using a VQMOD Customer Order Print and want to localized the Print button.

In the vqmod the line that added the button is:

Code: Select all

<![CDATA[<div class="right"><a href="javascript:printDiv('print');" class="button" />Print</a></div>]]>
I have added a new string in my main languages files :
\www\opencart\catalog\language\english\english.php
\www\opencart\catalog\language\french\french.php

Code: Select all

$_['button_print]          = 'Print';
So what should be the new line of code that will replace Print by the language string.


A quick solution for now is to use an icon instead of button but I like to know how to use the language variables correctly.

Thanks

Re: how to localize new button in VQMOD

Posted: Thu Jan 10, 2013 6:26 am
by OSWorX
In the corresponding controller assign the new language var to a variable e.g.:

Code: Select all

$this->data['button_print'] = $this->language->get('text_button_print');
And then in the template do it like (here inside the vqmod):

Code: Select all

<![CDATA[<div class="right"><a href="javascript:printDiv('print');" class="button" /><?php echo $button_print; ?></a></div>]]>

Re: [SOLVED] how to localize new button in VQMOD

Posted: Fri Jan 11, 2013 12:36 am
by lenamtl
It's working ok thanks :)

I have edited the the order.php file located in www\opencart\catalog\controller\account
Around line 226

Re: [SOLVED] how to localize new button in VQMOD

Posted: Fri Jan 11, 2013 12:54 am
by OSWorX
lenamtl wrote:It's working ok thanks :)

I have edited the the order.php file located in www\opencart\catalog\controller\account
Around line 226
Forgot to mention: both lines of code can be done through vqmod (not only the second for the template).
But I am sure you did it that way ;D

Re: [SOLVED] how to localize new button in VQMOD

Posted: Fri Jan 11, 2013 8:51 am
by lenamtl
Yes, I have already put all code modifications in VQMOD to keep original code untouched.
VQMOD is fantastic!
Thanks