Shopware: Migration to 6.6

Today we are very happy to have a guest author on our page, most people might know him as kekster and he wanted to share his experiences for the Shopware 6.6 upgrade.

It took me about 2 weeks to migrate all of my 41 Shopware 6 store plugins (about 200k lines of code in PHP, JS, Twig) from 6.5 to 6.6rc1 and I’d like to share my experiences with you guys. First, I’ll have to note that I’m still having nightmares from earlier major migrations and that I was afraid to even look into 6.6. I know I shouldn’t start this early and wait for the final but I really think that Shopware learned from their mistakes and that they don’t want another major release shitstorm from their extension partners. I’ll split the migration into categories.

Core Shopware

Shopware introduced very few breaking changes in 6.6 compared to previous major updates. I think I honestly had to change only three things: a huge rework of a stock plugin due to the new stock handling (introduced in 6.5), replacing the logger factory with the default monolog logger and changing the new product line factory. The new logger was a bit tricky (thanks to Shyim) and the refactoring of the stock plugin was hard – but all in all the changes are manageable. Side note: you can clearly see that the refactoring of the stock management was only done to make sure the swag commercial plugin works with multiple stocks. A lot of code is never used and only acts as a placeholder for decoration.

Core vendor

I really can’t remember anything except the new attribute handling by Symfony 7. You can make use of it or (almost) completely ignore it – but if you haven’t done it yet, then you have to change your controllers (routes etc.) accordingly.

Storefront JS

Shopware changed a lot to async Javascript plugins but this shouldn’t really affect your plugins at all. You have to use the plugin manager and its register method differently but that’s about it.

Storefront templates

The default product-detail templates got dropped since every product has to select a (custom) layout. this makes it even easier. You don’t have to overwrite two templates (CMS elements and product detail) when adding something to the product detail page.

Administration

Okay, this is huge. The vue3 update comes with a lot of mandatory changes. Since I’m more of a backend than a frontend guy, I did have my problems and it took me quite some time to figure out what needed to be changed. The vue3 upgrade guide is good and helpful but far from complete. There are a lot of changes I had to figure out by myself. There are the basics like v-model binding changes, changed emitters and methods – but there are also a lot of things which aren’t explicitly mentioned in the vue3 upgrade guide and which are hard to find out (at least for me). I can think of stuff like props are read only now, data supersedes props, failing deep watchers, changed slot syntax and many more. Plus Shopware removed the default sw-field component, removed filters like |currency or |date (maybe forced because of vue3?!) and added weird NaN values for price fields.

My personal conclusion

Especially the administration changes were a huge mountain to climb. I literally had to change (almost) every single admin file. It took some time to find a solution to every problem but the further I got the problems always repeated themselves. After the third plugin, I had a huge checklist for the vue3 basic changes which I just had to apply and copy/paste for most of the files. Apart from the vue3 update, there wasn’t much work to be done. I really really really hope that Shopware won’t introduce any more breaking changes in the rc2 or the final. Otherwise, I’ll really be mad…

Leave a Reply

Discover more from Winkelwagen

Subscribe now to keep reading and get access to the full archive.

Continue reading