- Web templates
- E-commerce Templates
- Loaded Commerce
- E-Commerce Comparison
- E-commerce Comparison: Payment and Shipping methods
- E-commerce templates compatibility table
- CMS & Blog Templates
- CMS Comparison
- CMS templates versions compatibility
- Facebook Templates
- Website Builders
OpenCart 2 Troubleshooter. How to get rid of the “Warning: sprintf() [function.sprintf]: Too few arguments” message(s)
September 14, 2016
This tutorial shows how to get rid of the following warning: Warning: sprintf() [function.sprintf]: Too few arguments… in OpenCart template.
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.
Check a code above this line. We can see the reference to language files inside common folder.
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).
The following code causes the issue:
You can go ahead and remove it. Updated code will look like on the following screenshot. Save changes and upload modified file.
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.
Refresh a page. We have solved the issue.
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.