OpenCart problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

User avatar
skynet88
Forum Commoner
Posts: 42
Joined: Tue Apr 20, 2010 5:23 pm
Contact:

OpenCart problem

Post 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
Mencari Ubat Resdung? .
Make money with simcard , only for malaysian!
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: OpenCart problem

Post by requinix »

Did you make a change to the "text_logged" value somewhere? What is it now?
User avatar
skynet88
Forum Commoner
Posts: 42
Joined: Tue Apr 20, 2010 5:23 pm
Contact:

Re: OpenCart problem

Post 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
Mencari Ubat Resdung? .
Make money with simcard , only for malaysian!
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: OpenCart problem

Post 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.
User avatar
skynet88
Forum Commoner
Posts: 42
Joined: Tue Apr 20, 2010 5:23 pm
Contact:

Re: OpenCart problem

Post 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? :D
Mencari Ubat Resdung? .
Make money with simcard , only for malaysian!
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: OpenCart problem

Post 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>';
User avatar
skynet88
Forum Commoner
Posts: 42
Joined: Tue Apr 20, 2010 5:23 pm
Contact:

Re: OpenCart problem

Post 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 :(
Mencari Ubat Resdung? .
Make money with simcard , only for malaysian!
User avatar
skynet88
Forum Commoner
Posts: 42
Joined: Tue Apr 20, 2010 5:23 pm
Contact:

Re: OpenCart problem

Post 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
Mencari Ubat Resdung? .
Make money with simcard , only for malaysian!
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: OpenCart problem

Post 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>';
User avatar
skynet88
Forum Commoner
Posts: 42
Joined: Tue Apr 20, 2010 5:23 pm
Contact:

Re: OpenCart problem

Post 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>';
Mencari Ubat Resdung? .
Make money with simcard , only for malaysian!
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: OpenCart problem

Post 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?
User avatar
skynet88
Forum Commoner
Posts: 42
Joined: Tue Apr 20, 2010 5:23 pm
Contact:

Re: OpenCart problem

Post 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';
?>
Mencari Ubat Resdung? .
Make money with simcard , only for malaysian!
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: OpenCart problem

Post 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.
User avatar
skynet88
Forum Commoner
Posts: 42
Joined: Tue Apr 20, 2010 5:23 pm
Contact:

Re: OpenCart problem

Post 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?
Mencari Ubat Resdung? .
Make money with simcard , only for malaysian!
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: OpenCart problem

Post 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.
Post Reply