Existing modules should mostly work as-is with version 1.7. In this article, we dive into that “mostly”!
As you certainly know, all well-written 1.6 modules should work with little to no changes in version 1.7, except:
What this means for any upgrade is that in order for a PS 1.6 to migrate to PS 1.7, you (or your agency) will have to:
In any case, we advise you to make sure that your module does work in PrestaShop 1.7.
Now, let’s dive into the details.
Overrides are a nice system to have, but the issue with it is that it is an uncontrolled extension system. We are working on a carefully planned process that will allow developers to extend the PrestaShop code in a much cleaner way. The gist of it would be that the developer team would integrate your needs for overrides in the next version of PrestaShop – kind of what polyfills do for HTML5 features :) In short, you tell us what you need, and while we include it in the next version, you can use an override.
The Product page and the Modules page are the only two pages that have been rewritten using Symfony, and they still work fine with pre-1.7 modules – albeit with a necessary design adaptation, as happened in all major version of PrestaShop before, only this time we provide a UI Kit to help developers easily have a consistent style for their module screens.
The whole PrestaShop 1.7 back office has its design based on the UI Kit. This UI Kit was built so that designers and developers can create interfaces which are consistent in style with the administration interface.
Note that it is still a work in progress, and should not be considered stable until 1.7 is released.
To provide the best user experience possible for customers, and to guarantee that PrestaShop orders respect the law in all countries, we slightly changed the payment API.
For example, the Terms & Conditions checkbox is now displayed with the payment options, and there is only one button to click in order to pay.
That way, theme designers have more control of the layout of payment options.
The Product page has been entirely rewritten for PrestaShop 1.7 in order to make the product creation easier, faster, and more logical. 6 default tabs instead of the previous 12, with the main tab containing much more information; a greatly improved Combination generator/manager; new shortcuts; an in-page catalog browser; and other niceties…
If you created modules which target the Product Page, you may be impacted by these changes. To make them work as expected in the new Product page, you will need to adapt your code.
Here are the main information that you will need to update your modules.
In PrestaShop 1.6, it is allowed to have a dedicated tab per module on the Product page. In version 1.7, we changed this and added a dedicated tab for all the Product page’s modules, via a new hook called hookDisplayAdminProductsExtra
.
If you coded your modules by following the best practices of both PHP and PrestaShop 1.5-1.6, it should not take you too much time to update your code.
Parameters cannot be obtained from a query string anymore. From now on, an array of parameters is directly passed onto the hookDisplayAdminProductsExtra
method.
The URLs of back office assets (CSS, JavaScript, images, etc.) must be absolute, meaning that they must start with http://
or https://
.
The format of the ID for the module’s container has been modified. Here is its new format: module_MODULE_NAME
.
All the 1.6 modules targeting the theme will likely be impacted (to various degrees) by the changes and need to be adapted for 1.7. From the moment your module targets the theme, it will have to be updated.
The Designer Guide is currently being entirely rewritten to focus on the 1.7 Theme system. We expect it to be available online in the coming weeks.
PrestaShop 1.7 introduces widgets, which you can use to place your module’s content directly in your theme.
More information about this will be available in the soon-to-be-available PrestaShop 1.7 Designer Guide.
The front office hooks have seen a bit of evolution. Some have been moved, some have been removed, and some have been created. Here are the lists!
These hooks were only available in 1.6. They are removed from 1.7.
These hooks are only available in 1.7.
These hooks are common to PrestaShop 1.6 and 1.7, but their file location has changed in 1.7.
If you have specific questions about module development that are not answered in this article, let us know in the comments: it will help us build a better Developer Guide!