Categories

Featured templates

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

Ryan DeWitt September 14, 2016
Rating: 5.0/5. From 2 votes.
Please wait...

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.

Templates for OpenCart
This entry was posted in OpenCart Tutorials and tagged error message, message, Opencart2, sprintf, warning. Bookmark the permalink.

Submit a ticket

If you are still unable to find a sufficient tutorial regarding your issue please use the following link to submit a request to our technical support team. We'll provide you with our help and assistance within next 24 hours: Submit a ticket