Question

Learning Symfony2 and Sylius at the same time here. Thanks for your patience.

What brought me to this question is the desire to override some of Sylius's default functionally. The first of which I am focusing on is tax behavior. I want to accommodate specific tax rates for several different on the ground stores. As I understand it, if I want to be able to update future changes in Sylius, I don't want to modify code in sylius/src/Sylus/* correct? I think I understand how to make the overrides, but I cannot seem to generate my own bundle with Sylius.

ubuntu@ubuntu-VirtualBox:/var/www/sylius$ php app/console generate:bundle

[InvalidArgumentException]
Command "generate:bundle" is not defined.

I can run the same command in a generic Symfony2 install I have, and it works.

Am I doing something wrong / something is broken, or has bundle generation been removed from Sylius and it is expected that bundles be written all manually?

Thanks, and any links to further reading on this are appreciated.

Was it helpful?

Solution

You need to install SensioGeneratorBundle if you want this feature. This bundle is not included in standard Sylius distribution. Installation and their usage is pretty straightforward ;)
Yup, I think you shouldn't edit core bundles but instead override whatever you want - see here how to achieve that. Sylius is built with good design so overriding could be easily achieved by simply having your own DI class parameter instead of core class.
Cheers!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top