Why it is high time to consider Sylius as the best eCommerce solution for PHP?

Mikołaj Król, 19 cze 2017

Undoubtedly eCommerce has changed a lot over past years. Those changes also made a great impact on how online trading looks like for developers today. The more customers came into the online market the higher needs they have and the harder it is to come up with those needs. Obviously, it forces the most popular platforms to evolve but sometimes improving the existing software is not enough.

What is eCommerce in 2017?

Ten years ago when someone said "eCommerce", everybody was thinking about an online store with some products, categories, checkout, merchant panel, maybe some layout and a bunch of plugins which successfully either transformed the whole platform to B2B or broke it down in the case of poor code quality.


Today it looks a little bit different. In 2017 you not only buy physical products via the www but you also buy many services, premium account access or files like e-books, audios and movies. There are countless platforms which enable you to pay for something online which are not a standard B2C web store. Before Sylius came into the market, to achieve the goal of selling something online you either had to install another platform with a bunch of things you didn't need or create the trading module from scratch.

It's good to realize that due to the way eCommerce looks like today, the best platform is not that one with the most amount of functionality or available plugins, but the one that is easier to integrate with any other structure.

Technical debt

Developers love to work with newest technologies and great code. Why? Because the good developer is the lazy one which means he doesn't like to reinvent the wheel, write countless workarounds and pray for not to break anything that worked before his changes. Unfortunately, this is something that is hard to understand by many business people. Paying for plugin $100 instead of $2500 to a developer for writing the integration may sound juicy. But do you remember what I mentioned about those plugins before?

Hey, business! Imagine you have to buy a car which you have to do 2000 miles every month. Would you like to buy an after-accident car which was painted beautifully and looks like a new one only because it is cheaper? The point is that this car will probably be more like to break down in the most inaccurate time. It also can be more tricky to fix the car due to its past and what's more - the more you drive, the more it is possible to have a crash. Would you like to have a crash in an after-crash vehicle?

See the point? When you decide to install some plugins rather than writing some suitable, simple SAAS integrations, you will probably end up with a hole in your pocket which you don't even realize you have.

    many legacy plugins == poor code quality == poor performance == poor functionality == poor scalability == less customers == less money.

And yes. When you only depend on plugins in your application, some of them are probably legacy ones.

Your software should depend on your business nor should your business on the software. This means your eCommerce should have the ability to grow with your needs quickly and without regression.

The right tools for the right job

Sylius was created on top of Symfony framework which many developers consider as the best PHP framework. It has a great architecture that allows writing scalable apps. Sylius is no difference. What's more, it uses the framework in the way it should be used. This allows you to use just some components (bundles) you need in existing Symfony or even any other PHP projects just for a specific use-case. For example, you can integrate taxonomy and products to enable your existing app to present some products. That's not something that is easy to achieve with Magento, Presta Shop, WooCommerce or any other eCommerce platform written in PHP available on GitHub. The other advantage is that it is way much easier for a Symfony developer to jump into the Sylius ecosystem than for any other developer to start learning how the specific platform works - most of them have its own workflow which is harder to maintain when time goes by.

I highly recommend watching the great overview of Sylius framework presented by its author - Paweł Jędrzejewski. The only thing I think is worth mentioning before watching it is that this video was uploaded in November 2016, when Sylius was still under hard development. Today it has it's beta-2 release which is probably the one before stable.

Behavioral Driven Development

How many times have you faced the communication problem either if you are a developer or business person?

How many times have you faced a problem that even if you have some unit tests, something not worked as it expected and nobody noticed it until it actually was done?

In most cases, neither a developer is a business person nor is business person a developer. That's why Sylius comes by default with the Behavioral-driven development way of implementing new features which allows business people to write specific features in a way that is understandable both by them and developers. After creating the feature descriptions, developers are writing some specific implementation of how those features should work in the system which you can imagine as a bot which physically opens a page, clicks a button and expects a result (in case of a web page test).

What's more - there's also another great tool called PHPSpec which many call an equivalent to PHPUnit with the difference that it's way much simpler and more focused on how the whole class should work instead of specific code units responsibility. The harder it is to write a PHPSpec specification, the more it is possible that your architecture is bad. Remember the "S" in a SOLID model? This is one of many cases it helps you not to overengineer the implementation and write clean, reliable code.

When talking about both Behat and PHPSpec, you focus on the behavior of the software rather than what specific part of the code does. This is something very important for both developers and business - our work finally needs to meet customers expectations and they don't care whether your nth class method returns true or an array. On the other side, every developer knows that the right implementation is important to get the work done. That's where BDD is compromising those needs perfectly to provide a working application which is easy to maintain and improve.


There's a great community over Sylius. Many opened issues on GitHub with feature requests, PRs with bug fixes and the Slack channel makes learning Sylius a great opportunity to learn new skills, share some experience and have an impact on how the whole project evolves. Open Source is something that's not unique to Sylius and it's proven by many other examples that this is a nice way to become a better developer in short period of time. Learning from others mistakes is always less painful and less time consuming.


Sylius is likely to become the tool of the eCommerce future. Its architecture and flexibility make it a unique dev-tool that in my opinion will be a must know once it hits the stable version which will happen soon. Actually, even if it is still in beta version, there are many great use-cases of successful projects with the usage of this framework which can be found on this page. Many Sylius components solve most of the advanced eCommerce business problems and can be used in various projects which sounds pretty awesome when you are the kind of person who likes somebody else to make your work easier and more enjoyable.

Introducing Sylius BDD, 26 cze 2017