Prestashop 1.7 new architecture
Prestashop 1.7 is under development, this new version will have lots of changes in the architecture, in other words, it will be new architecture for prestashop. In this blog post, we would like to give you updates about the plans of the new architecture.
Brief description about Prestashop 1.7 new architecture and the transition phase.
- PrestaShop 1.7 new architecture will be based on the Symfony Framework and the Twig templating engine.
- The new architecture is planned to be used in the back office for two pages: Product page and Modules page (it can be applied for other parts later).
- Other parts in the Presashop 1.7 back office will still use the legacy architecture from Prestashop 1.5 & 1.6. New architecture will be applied later Prestashop 1.7 versions.
- The old architecture will coexist during the process of moving to new architecture and this phase will take some versions of PrestaShop.
- Only modules targetting Products and Modules pages will need to see their templating code adapted.
Prestashop 1.7 Architecture more details
1. Reasons PrestaShop 1.7 needs new architecture?
Just 1 reason, since the current Prestashop architecture is getting old and it is out dated, if no architecture changes, Prestashop would loose their market share for other Ecommerce platforms: Magento, Woocommcerce, Opencart, etc.
Look back the history, PrestaShop 1.5 was released in 2012 and that was a huge overhaul of the codebase, multistore feature, the advanced stock management feature, a revised module API, and in general a Core rewritten in order to better follow MVC patterns.
PrestaShop 1.6 was released in 2014 with the maintaince of most of the 1.5 architecture. The main changes in Prestashop 1.6 is the re-design of back-end and front-office with the integration of Bootstrap that make responsiveness for both front-end and back-end. Other great feature is the Dashboard with its KPIs, but the codebase was all remained. Prestashop 1.6 worked as expected, but it was getting show weaknesses since web development changed a lot and other eCommerce platform had lots of improvement.
The initial requirement is indicated that PrestaShop’s codebase needs to be more robust, more modular, and fully testable. Actually, new architecture was first applied in v1.6.1.0, but Prestashop 1.7 needs more than that to make Prestashop as one of the best eCommerce platforms. Decision is made, PrestaShop 1.7 will introduce Symfony2 in its Core codebase. As montioned, this change will be negotiated smoothly and over the long term.
2. Why Prestashop team decided to use Symfony Framework instead of upgrading current Prestashop core?
The very first reason of using Symfony Framework is that the framework is proven, popular open-source framework with stability of a globally recognized framework and it is resumed to help improve Prestashop core. Secondly, by using pre-made framework, we can reduce the maintenance workload, which consumes too much time and is not our core business features as Prestashop core includes so many things: managing a cart, handling orders, calculating prices and taxes, generating invoices, ect.
3. Why Symfony2 is chosen and how it improves Prestashop 1.7?
Simply, it’s Symfony2, the new standard of PHP! It’s really leading the way in terms of code quality and project popularity. Lots of other options are considered but each of the option has weakness. Let’s have a quick overview of the frameworks considered to use for Prestashop 1.7 core.
Lumen/Laravel:
- It uses Symfony components, so it’s one more layer over Symfony
- It brings a lot of services that are not really useful
Silex:
- This is a minimalist framework
- No efficient route descriptor.
- Based on an old version of Symfony components, so one more layer over Symfony.
Slim framework:
- This is a small framework that is a better fit for small software.
- It’s maintained by a very small team, and has seen little contribution in the past year so it is not good for long terms.
- The retro-compatibility seems to be broken each time a new version is published.
Zend framework:
- This framework is a big competitor to Symfony, but its popularity is really waning.
- Moreover, the Zend framework comes as a huge monolith. It could be a choice for a full rewrite of the code, but that’s bit an option right now.
Yii framework:
- It’s also a monolith.
- The community is quite small. Finding qualified developers to maintain the code will be very hard.
From the overview and comparision, Symfony2 is the final choice for the Prestashop 1.7 new architecture.
Which parts of PrestaShop 1.7 will be rewritten with Symfony Framework?
PrestaShop 1.7 will not be 100% written in Symfony. In other words, only a fraction of the codebase will use Symfony for this version. Fully use Symfony is not a safe strategy, a smoother transition patch will be better. In details, only the back-office will be affected and the first version of Prestashop 1.7, you can see the changes from 2 main pages: Product page and the Modules page. The following versions, each page will be switching to the new Symfony-based architecture.
Other improvements of Prestashop 1.7
Along with the new architecture in codebase, the design of the Prestashop back-office will be revamped to be more friendly and easy for users. The navigation will be re-designed for ease of managing your store. A quick guide will be included in the Prestashop 1.7 back-office to help new users setup a store. Check out list of Prestashop 1.7 new features.
Will the 1.6 modules still work?
Symfony will be used for back office-specific features only. It will be limited to an adaptation of hooks on the Products and Modules page. Modules targeting the other pages should not need to be adapted.
Module developers won’t need to develop in Symfony as the module API will be mostly the same, and Smarty is still used in non-rewritten pages. It will be necessary to use Symfony’s Twig templating engine for modules, but the core code of the module should remain the same.
For the Product page, the idea is using a switch button to switch between the Legacy/Smarty version and the Symfony/Twig version. It would allow the Prestashop 1.6 modules to work in Prestashop 1.7, that would give more time to developers to adapt their Prestashop 1.6 modules.
What happen with Prestashop 1.6?
PrestaShop 1.7 introduces new way themes work with new Starter Theme and the best practices it follows. So Prestashop 1.6 themes will not work in Prestashop 1.7: logic code is taken out of templates, controllers are now passing arrays instead of objects, the theme is secure by default, CSS classes are only for styling, no use of Bootstrap anymore, etc. The new way to build themes in 1.7, with a sturdy Starter Theme from which all theme developers will be able to build solid themes from the get-go, will allow the Community to create modern and durable themes.
The post Prestashop 1.7 architecture appeared first on Premium Prestashop Themes.