Extensions for OpenCart 4
It's no secret that OpenCart modules have virtually no backward compatibility between versions. Therefore, in order to make a universal module for different versions of OpenCart, developers have to resort to checking the assembly version in the code and apply different techniques depending on the current version.
Things will get even more complicated with the new release of OpenCart 4. Now it is practically impossible to make a module simultaneously compatible with previous versions 1, 2 and 3 and a new assembly. This means that for OpenCart 4.x you need to make separate releases of modules. For the authors of modules, this, of course, is very unpleasant news, because it is inconvenient to maintain and refine several releases of one module at once. But we were not left with a choice and we will have to "adapt" to the new conditions.
What has changed in the new major version compared to previous builds of OpenCart?
- Ocmod is not supported. Now the integration of the modules needs to be done through Events. This is good news for developers, because now it will be possible to reduce the number of compatibility problems between modules with different templates. Let's just hope that the event system in OpenCart will be improved and developed.
- The structure of the folders for storing modules. All add-on files have been moved to the new root directory /extension/, inside this directory, each author of the module will have his own directory, for example /extension/opencartbot/, and there are already familiar admin and catalog folders. At the same time, the intermediate extension folder was removed. As a result, the path to the front-end controller of the module will be as follows:
And the path to the module template will be as follows:
As you can see, now you don't need to load the module template into the site template folder.
- The product block in the lists has been moved to a separate template product/thumb.twig. Now you don't need to edit all templates to change the button or add stickers on the product.
- Pagination has been moved to a separate template common/pagination.twig
- The minimum used PHP version is 8+.
- The used version of Bootstrap framework has been updated to v5.0.0, which means that the layout has changed.
- New version of font library Font Awesome Free 5.15.1
- Added new version of library jQuery 3.6.0
- There are many other changes and improvements that you can see after installing the new release.