Latest Blog Posts

Editing the OpenCart Homepage
29.09.2025 2665 3 44 min

Editing the OpenCart homepage, customizing H1 and Title text, displaying products and modu..

How to Uninstall Powered by OpenCart
03.09.2025 4134 3 20 min

Remove Powered by OpenCart and customize footer: edit template, use theme editor or OCMOD ..

How to remove modules in OpenCart
28.08.2025 2114 3 12 min

Step-by-step instructions for deleting modules in OpenCart 3 via the admin panel, manually..

Which hosting to choose for OpenCart
25.08.2025 1435 3 19 min

Find out which hosting to choose for an OpenCart online store. Requirements, selection cri..

Error "SyntaxError: Unexpected token < in JSON at position 0"

7351 0 3 min
Error "SyntaxError: Unexpected token < in JSON at position 0"

If you have only recently become acquainted with OpenCart, then you have probably already encountered an error during the installation of modules, which has something like the following content:

 SyntaxError: Unexpected token < in JSON at position 0 

SyntaxError: Unexpected token < in JSON at position 0

This SyntaxError: Unexpected token < in JSON at position 0 error can have various causes. Such as incorrectly filled in FTP data in the store settings or its complete absence, lack of user rights to the corresponding site directories, etc.

But now we will not go into detail about the reasons, but will immediately move on to solving the problem

You need to fill out the fields in the FTP tab correctly and pay special attention to the FTP Directory field. For some reason, even experienced developers do not fill it out, probably thinking that Login and Password will be enough. But we would not recommend storing FTP data in the database and, on the contrary, clearing these 3 fields and installing the LocalCopy.ocmod.xml add-on (an alternative name for QuickFix), which makes filling in these fields optional.

After installation, the error should disappear, but if this does not happen, install the module manually using an alternative method:

  1. We take an archive with a module, which, for example, has the name export-import.ocmod.zip
  2. We unpack it and see the files: the install.xml file and the upload folder. The archive may also contain install.php and install.sql files. You will need to run the code from the install.php file and run queries through phpMyAdmin from the install.sql file
  3. Move the contents of the upload folder to the root of the site (where the admin and catalog folders are located)
  4. Go to the section Modules - Installing extensions and download the install.xml file, after renaming it install.ocmod.xml
  5. In the Modules - Modifiers section, check whether the modifier has appeared. Click the plus sign to activate and then update the modifier cache. Let's look at the modifier log to see if everything is in order.
  6. There is also another way to install the xml modifier without having to download it through the Installing add-ons section. We rename the install.xml file, for example, to export-import.ocmod.xml and copy it to the www.site.com\system\ directory, after which we update the cache in the admin panel (in the list of Modifiers with this installation you will not see it, only the log, but the modifier itself is always at hand in the system, and not in the database).

Products related to this post

Adding LocalCopy.ocmod.xml
Free
LocalCopy.ocmod.xml module - fixes FTP должен быть включен в настройках when installing modifications in the OpenCart 2 admin pane..
ChatGPT Consultant

Comments

Leave your comment or question

Write Comment

Popular