Page 1 of 1
Warning:sprintf() too few arguments
Posted: Tue Apr 12, 2016 7:43 pm
by duende002
Hi there! I get an error message when a customer register a new account:
Warning: sprintf(): too few arguments in xxxx/catalog/controller/account/success.php line 32
I'm using Opencart 2.1.0.2 version
Does anyone know how to fix it?
Thanks in advance
Re: Warning:sprintf() too few arguments
Posted: Wed Apr 13, 2016 6:20 am
by oc-extensions
Hi,
Have you made changes in langauge files?
In catalog/language/english/account/success.php you can find message like this:
Code: Select all
$_['text_message'] = '<p>Congratulations! Your new account has been successfully created!</p> <p>You can now take advantage of member privileges to enhance your online shopping experience with us.</p> <p>If you have ANY questions about the operation of this online shop, please e-mail the store owner.</p> <p>A confirmation has been sent to the provided e-mail address. If you have not received it within the hour, please <a href="%s">contact us</a>.</p>';
In controller you can find:
Code: Select all
$data['text_message'] = sprintf($this->language->get('text_message'), $this->url->link('information/contact'));
This means that in text_message is replaced %s with contact link;
If in catalog/language/english/account/success.php, $_['text_message'] don't have %s then that reason for your error;
If you don't use english then path is catalog/language/your_language/account/success.php
Goog luck !

Re: Warning:sprintf() too few arguments
Posted: Wed Mar 08, 2017 11:47 am
by Nyrk0
Hi.
Same error with OC 2.3.0.2
account/success.php language file has:
Code: Select all
"$_['text_message'] = '<p>Su cuenta ha sido registrada.</p> <p> Se ha enviado confirmación a su email. Si no lo ha recibido, por favor <a href="%s"> contáctenos </a>.</p>';
So, what?

Re: Warning:sprintf() too few arguments
Posted: Tue Mar 28, 2017 11:14 pm
by Thingy Developer
I get exactly the same error when registering as a customer. OC-2.2
Re: Warning:sprintf() too few arguments
Posted: Wed Mar 29, 2017 1:09 pm
by Nyrk0
Don't remember what error was, but was related to foreign language (there was no error when set to en-gb)... something was isolated and solved.