Shopware packages is live + deprecation of packages.friendsofshopware.com

Today is finally the day when Shopware packages is being released. You might ask what is Shopware packages, and what does it have to do with packages.friendsofshopware.com? Good question 🙂 What is Shopware packages? Shopware packages is the long-awaited official Composer package repository for all Shopware store extensions. But why do we want to use that or care about that? What can I expect from Shopware packages? With composer, we can manage all dependencies in our Shopware setups. We usually use a composer project template which requires Shopware and provides some basic tooling. When we want now update the Shopware version, we just pick a newer version of Shopware in composer, and we are ready to go. That’s nice and easy for our Shopware upgrades, but we mostly also use extensions for our shops such as PayPal. Typically, we download the ZIP-file from the Store, unpack and upload it to custom/plugins. Yes, we all are lazy and this really sounds annoying. With the new repository, we can treat the extensions as normal composer dependency like just using composer req store.shopware.com/swagpaypal like cool guys 😎. This will automatically get the most recent version compatible to our Shopware version and other requirements set by the extension manufacturer. Since the dependencies are built directly into Composer, we can use typical commands like composer update store.shopware.com/swagpaypal to update the extension or even update Shopware and all required extensions at once. It’s cool, isn’t it? ...

September 1, 2021 · 3 min · Shyim

Optimization of Thumbnails in PHP

Every shop owner wants a fast online shop with the best pagespeed results. The images have a huge impact on these stats. But can we achieve better results with only PHP? Image generation with PHP In PHP there are two ways how images can be generated: using the gd, or the ImageMagick extension. Both extensions are not optimized to create very small images and they are quite slow. They also lack support for newer image formats like avif (PHP 8.1 will have avif in gd). The PHP community has build packages (like spatie/image-optimizer) to optimize an image after it has been uploaded by executing several optimziers in the CLI. This approach requires to have functions like exec, system or proc_open available, which are disabled by default on some shared hosters. Also, the optimizers need to be installed on the host system. But there are new technologies like ffi or wasm available in PHP. ...

July 14, 2021 · 5 min · Shyim

You don't need a plugin to customize a Shopware 6 project

Every developer who has created a plugin has already created a Symfony bundle. All Shopware plugins are extending from a Shopware bundle class which extends from the Symfony bundle. You might now ask yourself: when plugins are bundles, why did you write this blog post? First, let’s list the differences of a plugin and the two types of bundles: Feature Plugin Shopware Bundle Symfony Bundle modifying Shopware ✔️ ✔️ ✔️ can have migrations ✔️ ✔️ ❌ can be a theme ✔️ ✔️ ❌ can modify admin / storefront with js/css ✔️ ✔️ ❌ can be installed, uninstalled (lifecyle) ✔️ ❌ ❌ can be managed by the shop owner in administration ✔️ ❌ ❌ The benefits of working with a Bundle Having less features is sometimes better. As an agency, you don’t want the shop owner to manage your custom built extensions. The lifecycle of plugins is intended mostly for store distribution and often irrelevant in a custom built environment. When you make changes to a project, you want your code to be active always, regardless of the state of the shop. This makes Shopware updates smoother as well, as the upgrade process runs without plugins your code will still run. This solves theme compile issues during update process, e.g. The loading order of the bundles can be fix configured in the config/bundles.php file to fix bundle dependency issues. Also you could store the entire code in the template of the Shopware 6 project. ...

July 4, 2021 · 3 min · Shyim

Setting up a Shopware Environment with Windows

At work I use Linux, but at home I prefer Windows due to gaming. In this short Tutorial I would like to share my Windows setup with you. My recommended setup includes: WSL 2 Docker Desktop for Windows Ubuntu / Debian GWSL (X-Server for Windows) PhpStorm Development Docker setup or my own Docker setup. (We will use my own in this tutorial) At first we need to install WSL 2 and Docker Desktop. Please follow the tutorials below. ...

October 16, 2020 · 3 min · Shyim

Why I don't like Custom fields?

Normally every project needs custom values saved on products or another entities. Shopware does offer by default Custom fields. It looks nice, but it can produce very fast issues. Before we start: This is my opinion Let’s start with a simple Pro Contra list. Pro Can be easily created in the Administration / Code. Can define field types, labels etc and Shopware does the rendering in Administration for me Loaded by default on the entities Custom Fields are schema less. You can save anything in it Contra Custom Fields are schema less. You can save anything in it They are saved as JSON Hard to modify using SQL Cannot have associations Slow on SQL Filtering, Aggregation Loaded by default on the entities Support between MySQL and MariaDB differs and Performance Cannot have Flags. All fields are public using Sales-Channel / Store-API Cause it does not have a Schema they will be indexed as dynamic in Elasticsearch. This brings lot of other problems You don’t have a control is it translatable or not Fields values cannot be easy deleted on all entities. You need to modify each entry. The most problems are introduced cause of the usage of an JSON field. In SQL the accessed fields needs to be extracted. This takes some time of course. On a bigger shop using many products this could leak to performance issues in the listing when it’s used inside a product filter. ...

August 25, 2020 · 2 min · Shyim

How to deploy plugin updates automatically to the Shopware Store

This blog post describes a small example how to automaticly deploy plugin updates to the Store. I will use the FroshPerformance plugin as example. Preparation You will need a Plugin which based on the 5.2 Pluginsystem or Shopware 6 Plugin a Continuous Integration (i will use Travis as example) Credentials for the Shopware Account FroshPluginUploader Prepare the Plugin itself You will need a plugin.xml with filled title, version, description, compability and changelog for the languages en and de. All these informations will be picked up automaticly and updated in the Account. ...

September 18, 2019 · 2 min · Shyim