PluginSkeleton provides some default classes and configurations. However, they must have some default values and names that should be changed
to reflect your plugin functionality. Basing on the vendor and plugin names established above, these are the changes that should be made:
Acme example plugin for Sylius.->
Plugin allowing to mark product variants as available on demand in Sylius.(or sth similar)
IronMan\\SyliusProductOnDemandPlugin\\(the same changes should be done in namespaces in
Tests\\IronMan\\SyliusProductOnDemandPlugin\\(the same changes should be done in namespaces in
AcmeSyliusExamplePluginshould be renamed to
AcmeSyliusExampleExtensionshould be renamed to
phpspec.yml.dist(if you want to use PHPSpec in your plugin):
Don’t forget to re-build up the list of files to autoload with
That’s it! All other files are just a boilerplate to show you what can be done in the Sylius plugin. They can be deleted with no harm:
- All files from
- All files from
tests/Behat/Page/Shop/(with corresponding services)
tests/Context/Ui/Shop/WelcomeContext.php(with corresponding service)
You should also delete Behat suite named
You don’t have to remove all these files mentioned above. They can be adapted to suit your plugin functionality. However, as they provide default, dummy features only for the presentation reasons, it’s just easier to delete them and implement new ones on your own.
After you have change name of plugin, please run in your main directory of plugin (cd MyPlugin/ && composer install).
If you don’t rerun this command you may have this error :
$ (cd tests/Application && bin/console assets:install public -e test)
PHP Fatal error: Uncaught Symfony\Component\Debug\Exception\ClassNotFoundException: Attempted to load class "Kernel" from namespace "Tests\FMDD\SyliusEmailOrderAdminPlugin\Application".
Did you forget a "use" statement for e.g. "Symfony\Component\HttpKernel\Kernel" or "Sylius\Bundle\CoreBundle\Application\Kernel"? in C:\Users\FMDD\Plugins\SyliusEmailOrderAdminPlugin\tests\Application\bin\console:36
thrown in C:\Users\FMDD\Plugins\SyliusEmailOrderAdminPlugin\tests\Application\bin\console on line 36