PrestaShop has introduced some main updates since its initial release in 2007, with the latest version being PrestaShop 1.7. This new version has many improvements and new features, which include a new architecture, new templates, and a new backoffice user interface.
Development of prestashop 1.7 module is a little different from creating a module in prestashop 1.6. We can create a module to add new functionality to PrestaShop store. Like a new payment gateway, shipping method, or product feature.
In this post, we will discuss some of the key differences between PrestaShop 1.6 modules and PrestaShop 1.7 modules:
Different Framework
First difference in both versions is the framework. PrestaShop 1.7 uses the Symfony framework, while PrestaShop 1.6 uses a custom framework. Symfony is a popular PHP-based web application framework that is widely used in the development of different web applications. It will be easier to create new modules for PrestaShop 1.7 for the developers who are familiar with the Symfony framework.
Code structure
Another difference is the code structure of PrestaShop 1.7 modules is different from PrestaShop 1.6 modules. PrestaShop 1.7 modules are structured in a way that makes it easier to maintain and update them. Because PrestaShop 1.7 uses a modern, object-oriented architecture that is based on the Symfony framework.
Template engine
PrestaShop 1.6 uses Smarty but new version PrestaShop 1.7 uses the Twig template engine. Twig is a modern template engine which is faster and more secure than Smarty. Again, It will be easy to develop prestashop 1.7 modules if you are familiar with Twig templates Developers who are familiar with Twig will find it easier to develop modules for PrestaShop 1.7. Twig is used by many Open-Source projects like Symfony, Drupal8, eZPublish, phpBB, Matomo, OroCRM; and many frameworks have support for it as well like Slim, Yii, Laravel, and Codeigniter — just to name a few.
Twig is fast, secure, and powered by a flexible lexer and parser. This allows us to define our own custom tags and filters, and to create our own DSL.
Different Hooks
We can use hooks in modules to add new functionality to the Prestashop stores. The hook system in PrestaShop 1.7 is different from PrestaShop 1.6. These hooks are more flexible and powerful than the hooks in PrestaShop 1.6, which means that we can create more advanced modules very easily.
As you may know, the folder structure has been changed in PrestaShop 1.7. This means that the modules written on Prestashop 1.6 may not work on its 1.7 version. This happens because Prestashop 1.7 can lack at least some hooks, which you could have used while writing your own module (addProduct, displayCartTotalPriceLabel, deleteProduct, etc. Check out the full list here).
Backward compatibility
PrestaShop 1.7 is not backward compatible with PrestaShop 1.6 modules. That means we will have to modify our existing modules or develop new ones to make them work with PrestaShop 1.7. While this can be a time-consuming process, it also means that we can take advantage of new features and technologies that were not available in PrestaShop 1.6.
Different User interface
PrestaShop 1.7 has a new UI (user interface) that is different from PrestaShop 1.6. This means that modules that interact with the UI need to be updated to work with the new interface. This may include updating the design of module pages, modifying the layout of data fields, and ensuring that module functionality works correctly with the new interface.
Even with these differences, lot of the core concepts and functionalities of PrestaShop modules remain the same in both versions. For example, modules still need to be installed, enabled, and configured in the back-office, and they can still be developed to add new functionality to the store according to our requirements.
PrestaShop 1.7 introduces a lot of changes to the module development process. Which includes the use of a new Symfony framework, twig template engine, and hook system. While these changes may require us to learn new skills and update our existing modules. There are some benefits in PrestaShop 1.7 including better performance, more flexibility, and a more user-friendly interface. By taking advantage of these changes, developers can create modules that offer greater functionality and a better user experience for PrestaShop store owners and potential customers.