Search code examples
symfonysymfony4fixturessylius

Sylius: How not to execute some fixtures, but leave vanilla files untouched?


I want to execute all standard Sylius fixtures, except for the products (and if necessary also leave out the corresponding options, ect).

As we know php bin/console sylius:fixtures:load will execute everything without a configurable exception. What's the most uncomplicated/easy way to accomplish it, without actually touching the vanilla sylius files?


Solution

  • I found it myself. As described here https://docs.sylius.com/en/1.6/customization/fixtures.html the default fixtures are loaded in by this file src/Sylius/Bundle/CoreBundle/Resources/config/app/fixtures.yml and if you copy it and paste it's contents into config\packages\sylius_fixtures.yaml you can adjust product and order values as well as others.