If this tutorial is not what you were looking for, you still have any questions, suggestions or concerns - feel free to let us know. Please help us to serve you better!

Your Name

Your Email

Your Message (required)

captcha

Featured templates

OpenCart 2 Troubleshooter. How to get rid of the “Warning: sprintf() [function.sprintf]: Too few arguments” message(s)

This tutorial shows how to get rid of the following warning: Warning: sprintf() [function.sprintf]: Too few arguments… in OpenCart template.

OpenCart 2 Troubleshooter. How to get rid of the Warning sprintf() [function.sprintf] Too few arguments message(s)-1

  1. First of all we should open a file, specified in the warning message. Please, check the screenshot above. You will see path to file there. Download the file and open it with text editor. In our case issue is related to the code, specified on line 64 (please, refer to the screenshot above). Open the appropriate line of code. In our case the issue is related to text_wishlist constant.

    OpenCart 2 Troubleshooter. How to get rid of the Warning sprintf() [function.sprintf] Too few arguments message(s)-2

  2. Check a code above this line. We can see the reference to language files inside common folder.

    OpenCart 2 Troubleshooter. How to get rid of the Warning sprintf() [function.sprintf] Too few arguments message(s)-3

  3. Go to a catalog/language folder and open the folder with the appropriate language pack. In our case the issue appears when we select Dutch. Path to file is catalog/language/dutch/common/header.php in our case (as common/header path was specified in the header.php file we have checked initially).
    Open file with the editor. We can see text_wishlist variable. In our case this variable was specified in system\modification\catalog\controller\common\header.php on line 64 (the file we have checked initially).

    OpenCart 2 Troubleshooter. How to get rid of the Warning sprintf() [function.sprintf] Too few arguments message(s)-4

  4. The following code causes the issue: (%s)

    You can go ahead and remove it. Updated code will look like on the following screenshot. Save changes and upload modified file.

    OpenCart 2 Troubleshooter. How to get rid of the Warning sprintf() [function.sprintf] Too few arguments message(s)-5

  5. You can always check how the language constant should be defined in the language packs that come with the template. For example, you can open catalog/language/english/common/header.php file, compare code and perform adjustments in your language file.

  6. Refresh a page. We have solved the issue.

    OpenCart 2 Troubleshooter. How to get rid of the Warning sprintf() [function.sprintf] Too few arguments message(s)-6

Feel free to check the detailed video tutorial below:

OpenCart 2 Troubleshooter. How to get rid of the “Warning: sprintf() [function.sprintf]: Too few arguments” message(s)

If you’re searching for more professional solutions to build a website, have a look at Best OpenCart Themes 2017.