06.07.2021・TechStuff
06.07.2021・TechStuff

Renaming Shopware 6 Plugins

Fabian Blechschmidt

You want to rename the name of your plugin you can find when running:

bin/console plugin:refresh

This is easy, change the name of your „base class“ which is defined in your composer.json, e.g. from

{
    "name": "customer/corebugfixes",
    "extra": {
        "shopware-plugin-class": "Customer\\CoreBugFix\\CoreBugFix",
    }
}

to

{
    "name": "customer/corebugfixes",
    "extra": {
        "shopware-plugin-class": "Customer\\CoreBugFix\\CustomerCoreBugFix",
    }
}

But it isn’t applied? That cost me nearly an hour.

What didn’t help

What helped and why

The data is in the composer.json. Shopware is reading the composer.lock file, which contains all the data from the composer.json files AND more meta-data. And to update the composer.lock you need to run composer update.

Protip:

You can run composer update only on the packages you want to update, this way: composer update customer/* or composer update customer/corebugfix