Although Magento2 is still a year away from being released, there is a lot of excitement being built around it. Magento2 not only includes new features like the Visual Layout Editor, but it is also drastically changing some of the core methods and functionality.
The first major change that we see with Magento 2 ecommerce platform, is that since the development version was released it has been available on github. This allows the community to be more proactive on the Magento development and improvement. Right now, anyone can fork the main github repo, add new features or a bug fix and create a pull request; effectively contributing to Magento2 Core development.
Don’t Look Back
Magento2 is not backwards compatible – this means they are removing all deprecated code from its source, so if you have any modules that still using deprecated code (which you shouldn’t) be sure to update your code for this release!
New File Structure
In the current release of Magento we have the app/design/frontend/base/ theme, this is our last point of fallback if Magento cannot find the request template inside our custom theme. On Magento2 this structure is changing considerably. There will no longer be a base theme, instead all of our base views will be moved inside the module structure. For example the Catalog product view will now be located in app/code/core/Mage/Catalog/view/frontend/product/view.phtml and instead of having a catalog.xml inside the base/layout folder we now have a single layout.xml inside each module view folder.
The reason behind this changes is to provide a better and more clear structure for views and to encourage developers to only actually override the views that they need for their custom themes.
New Layout elements
Magento2 introduces the new concept of containers:
– Containers can contain blocks.
– Containers can contain other containers.
– Containers render all childrens.
The idea behind containers is to have a new logic structure to clearly organize blocks and define sections of the layout. Containers are used heavily by the Visual Design editor to move blocks around.
No more Prototypes
Say Goodbye to the Factory Names
You might have heard the rumor about the factory methods being removed from Magento2 and sadly it’s 100% true, calling: Mage::getModel(‘catalog/product’); It’s not going to work in Magento2, instead factory names have been replaced by full class namespaces that means now you will have to call: Mage::getModel(‘Mage_Catalog_Model_Product’);
This also means the class names in the eav_* tables are changing to the real class names instead of the factory names. Fortunately, Magento is not leaving the developers empty handed, the Magento2 team has actually put a lot of effort into building a set of migration tools that can be located under dev/tools/migration:
Both files will look for occurrences and calls using the factory names, and it will try to replace the factory names with the actual class names; saving developers a lot of time trying to find and replace all this calls.
There are more changes coming and we will be covering all of them in more detail in future posts! Stay tuned!