Page 1 of 2
OpenCart problem
Posted: Sun Nov 16, 2014 8:07 am
by skynet88
Hi,
I have no idea what happen to my friend's opencart website.
at the top of site showed this error code"
Warning: sprintf() [function.sprintf]: Too few arguments in /home3/yombee/public_html/steviahub.com/admin/controller/common/header.php on line 127
screenshot :
https://www.dropbox.com/s/0rv5irlgar2vc ... 1.png?dl=0
i open header.php and see at line 127 :
$this->data['logged'] = sprintf($this->language->get('text_logged'), $this->user->getUserName());
anyone can help me what is the problem??
tq
Re: OpenCart problem
Posted: Sun Nov 16, 2014 4:55 pm
by requinix
Did you make a change to the "text_logged" value somewhere? What is it now?
Re: OpenCart problem
Posted: Sun Nov 16, 2014 6:41 pm
by skynet88
requinix wrote:Did you make a change to the "text_logged" value somewhere? What is it now?
no. i didnt make any change. i dont have any idea how to fix this.
search over the net also not have answer
Re: OpenCart problem
Posted: Sun Nov 16, 2014 7:55 pm
by requinix
Weird, because I find all sorts of relevant things when I search around.
There's a configuration or language file thing somewhere. Inside it is the definition of the text_logged value. Find that and post it.
Re: OpenCart problem
Posted: Sun Nov 16, 2014 9:23 pm
by skynet88
requinix wrote:Weird, because I find all sorts of relevant things when I search around.
There's a configuration or language file thing somewhere. Inside it is the definition of the text_logged value. Find that and post it.
i found this in my language pack at header.php
<?php
// Text
$_['text_home'] = 'Laman Utama';
$_['text_wishlist'] = 'Senarai Hajat (%s)';
$_['text_cart'] = 'Troli';
$_['text_items'] = '%s barangan - %s';
$_['text_search'] = 'Carian';
$_['text_welcome'] = 'Selamat Datang, anda boleh <a href="%s">login</a> atau <a href="%s">pendaftaran baru</a>.';
$_['text_logged'] = 'Anda telah login sebagai <a href="%s">%s</a> <b>(</b> <a href="%s">Logout</a> <b>)</b>';
$_['text_account'] = 'Akaun Saya';
$_['text_checkout'] = 'Pembayaran';
$_['text_language'] = 'Bahasa';
$_['text_currency'] = 'Matawang';
?>
what is the problem sir?

Re: OpenCart problem
Posted: Sun Nov 16, 2014 10:04 pm
by requinix
As a shot in the dark, try changing that value to
Code: Select all
$_['text_logged'] = 'Anda telah login sebagai <a href="%s">%%s</a> <b>(</b> <a href="%s">Logout</a> <b>)</b>';
Re: OpenCart problem
Posted: Sun Nov 16, 2014 10:40 pm
by skynet88
requinix wrote:As a shot in the dark, try changing that value to
Code: Select all
$_['text_logged'] = 'Anda telah login sebagai <a href="%s">%%s</a> <b>(</b> <a href="%s">Logout</a> <b>)</b>';
sir, i have changed but same result

Re: OpenCart problem
Posted: Sun Nov 16, 2014 11:04 pm
by skynet88
sir,
i try to follow the code in english language file as this :
$_['text_logged'] = 'Anda telah login sebagai <span>%s</span>';
the error disappeared but my web show this:
https://www.dropbox.com/s/ccb6965tm98ie ... 4.png?dl=0
the normal condition should show horizontal menu button name without the word "text_"
tq
Re: OpenCart problem
Posted: Sun Nov 16, 2014 11:06 pm
by requinix
skynet88 wrote:i found this in my language pack at header.php
Did you find that at admin/language/*/common/header.php? It can only use one %s placeholder in the string. For example,
the English version has
Code: Select all
$_['text_logged'] = 'You are logged in as <span>%s</span>';
Re: OpenCart problem
Posted: Sun Nov 16, 2014 11:37 pm
by skynet88
requinix wrote:skynet88 wrote:i found this in my language pack at header.php
Did you find that at admin/language/*/common/header.php? It can only use one %s placeholder in the string. For example,
the English version has
Code: Select all
$_['text_logged'] = 'You are logged in as <span>%s</span>';
i found it in my language pack (malay language) but different with english language code.
$_['text_logged'] = 'Anda telah login sebagai <a href="%s">%s</a> <b>(</b> <a href="%s">Logout</a> <b>)</b>';
Re: OpenCart problem
Posted: Mon Nov 17, 2014 2:04 am
by requinix
Code: Select all
$_['text_logged'] = 'Anda telah login sebagai <span>%s</span>';
is what you should be using.
Can you post the entire header.php file?
Re: OpenCart problem
Posted: Mon Nov 17, 2014 2:11 am
by skynet88
header full code is i posted just now:
<?php
// Text
$_['text_home'] = 'Laman Utama';
$_['text_wishlist'] = 'Senarai Hajat (%s)';
$_['text_cart'] = 'Troli';
$_['text_items'] = '%s barangan - %s';
$_['text_search'] = 'Carian';
$_['text_welcome'] = 'Selamat Datang, anda boleh <a href="%s">login</a> atau <a href="%s">pendaftaran baru</a>.';
$_['text_logged'] = 'Anda telah login sebagai <a href="%s">%s</a> <b>(</b> <a href="%s">Logout</a> <b>)</b>';
$_['text_account'] = 'Akaun Saya';
$_['text_checkout'] = 'Pembayaran';
$_['text_language'] = 'Bahasa';
$_['text_currency'] = 'Matawang';
?>
Re: OpenCart problem
Posted: Mon Nov 17, 2014 3:18 am
by requinix
That's all? The file should be a LOT larger. That English version I linked to had 79 lines of translations and yours only has 11.
Where did you get it from? It's not complete. You could copy the English one and translate the text yourself, but I'm worried there may be other problems with other files.
Re: OpenCart problem
Posted: Mon Nov 17, 2014 8:19 am
by skynet88
requinix wrote:That's all? The file should be a LOT larger. That English version I linked to had 79 lines of translations and yours only has 11.
Where did you get it from? It's not complete. You could copy the English one and translate the text yourself, but I'm worried there may be other problems with other files.
ya your right sir. english code is very long. i dont know what happen to malay language. so you suggest me to translate my self?
Re: OpenCart problem
Posted: Mon Nov 17, 2014 2:19 pm
by requinix
skynet88 wrote:so you suggest me to translate my self?
You might have to: I looked for a few minutes and couldn't find any free extensions that include translations for the admin site.