CategorySylius

Sylius E-Commerce. Is it any good?

It is not often enough in my view that Developers and Software Engineers take the time to review a framework or content management system in writing, so here is a quick review of our experiences using Sylius.

What is Sylius

Officially Sylius is described as “Modern e-commerce for PHP”.  This for me is the best description of it, when it is in a Release Candidate version.  Currently it is only in Alpha stage and is missing a lot of the functionality when compared to a CMS/framework like Mageno.

 

Sylius is based upon the Symfony 2 framework, and so us developers should love it.  At the time of writing this, Sylius is at version 0.10.0.

The bad parts

The only real draw backs to this framework are that it is incomplete.  There is lots of missing documentation and there is no clear way or example on integrating many of the payment providers (although the main ones are supported out the box).  Another main feature I feel is missing is the creation and management of pages of content.

I can also see problems with the framework going forward which I have not seen solutions for yet (maybe because they are not problems).  One such problem I thought about lately is the problem of overriding Sylius classes via the dependancy injection container.  If we are to ever use a modules approach with Sylius, then there will need to be some kind of way for module overrides (other 3rd party modules) and local overrides to work together.  I know this can be solved via using events, then there is the configuration of the order those event listeners are called.  There is also no such “theme” support either which is a bit of a blow.  Many FE developers don’t want to be trawling through the many Symfony 2 bundles.  Also did I mention it is incomplete 🙂

 

The good parts

Sylius has a very nice admin area, similar in feel to WordPress.  It is easy to use and already has the bulk of functionality you would expect from an e-commerce platform (products, categories, attributes, orders, customers etc).  It is also very easy to add your own items to the admin area for bespoke pieces of functionality.

The front end is not the prettiest at present, but it does have all the basics (shopping cart, currency switcher, totals, basket, product pages etc etc).  It is easy updated to look how you want it to using the joys of Symfony 2.

I purposely places the good parts last as I genuinely like Sylius, and so wanted to finish in the best possible light.  Most developers who have worked on Symfony 2 project know the joy of the freedom it brings.  Controllers that do not have to extend any god controller, the DIC, Twig etc.  It is simply a joy to work with.  We have built many e-commerce websites ourselves using mainly Magento which, as many of us know, is not nice to work with from a back end perspective.  You usually end up an expert in XML not PHP.  Try holding it together when you tell someone you are a Software Engineer after working on Magento for a while.  It’s simply not nice.  Sylius on the other hand is a joy.  It has been built on top of a great framework to produce a great e-commerce platform.

Conclusion

I would say overall, Sylius is definitely my choice for an e-commerce solution.  It obviously depends on the scale of the site you are building and the functionality you require, but if you are building a smallish store and you require lots of customisation, I would consider using Sylius.  We have just completed a store using Sylius and we have enjoyed every minute of it.

Remember to keep in mind however, Sylius is only in Alpha stage at the moment and so you should consider that there could be potential security issues and bugs (like this one I fixed), so it is worth thoroughly testing all your desired functionality by carrying on the frameworks standard testing methodology (BDD) using Behat.

 

PHP5.5.13 and PHP5.4.29 vs Symfony FOSUserBundle

We’ve had some trouble recently firing up a Droplet on Digital Ocean and upgrading PHP to 5.5.13 when using Symfony’s FOSUserBundle with Sylius and Sonata E-Commerce frameworks. The problem arises when you want to log into the administration areas of these E-Commerce systems. The FOSUserBundle allows a user to be authenticated, however the firewall used within the framework attempts to serialise some data which doesn’t quite work.

Using the exact same code base we setup a 3 VMs using Vagrant of the hardworking hashicorp/precise64 Ubuntu box. Each VM had PHP versions, 5.3.10, 5.4.29 and 5.5.13.

We found that PHP5.3.10 worked perfectly and PHP5.4.29 and PHP5.5.13 shows this within the Symfony logs

[2014-06-20 09:27:05] security.INFO: User "admin" has been authenticated successfully [] []
 [2014-06-20 09:27:05] doctrine.DEBUG: "START TRANSACTION" [] []
 [2014-06-20 09:27:05] doctrine.DEBUG: UPDATE fos_user_user SET last_login = ?, updated_at = ? WHERE id = ? ["2014-06-20 09:27:05","2014-06-20 09:27:05",1] []
 [2014-06-20 09:27:05] doctrine.DEBUG: INSERT INTO revisions (timestamp, username) VALUES (?, ?) ["2014-06-20 09:27:05","(binary value)"] []
 [2014-06-20 09:27:05] doctrine.DEBUG: INSERT INTO fos_user_user_audit (rev, revtype, username, username_canonical, email, email_canonical, enabled, salt, password, last_login, locked, expired, expires_at, confirmation_token, password_requested_at, roles, credentials_expired, credentials_expire_at, created_at, updated_at, date_of_birth, firstname, lastname, website, biography, gender, locale, timezone, phone, facebook_uid, facebook_name, facebook_data, twitter_uid, twitter_name, twitter_data, gplus_uid, gplus_name, gplus_data, token, two_step_code, id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) ["1178","UPD","admin","admin","verla.predovic@example.com","verla.predovic@example.com",true,"n2gp2h6w6uookog8kw4k4oww88ogcwg","23a6bd09fd11727cf2f7c7a340 [...]","2014-06-20 09:27:05",false,false,null,null,null,["ROLE_SUPER_ADMIN","ROLE_SONATA_ADMIN"],false,null,"2014-06-19 21:54:29","2014-06-20 09:27:05",null,null,null,null,null,"u",null,null,null,null,null,null,null,null,null,null,null,null,null,null,1] []
 [2014-06-20 09:27:05] doctrine.DEBUG: "COMMIT" [] []
 [2014-06-20 09:27:05] event.DEBUG: Listener "Symfony\Component\Security\Http\Firewall::onKernelRequest" stopped propagation of the event "kernel.request". [] []

We are not fully sure yet, but after reading this http://www.serverphorums.com/read.php?7,946926 we have our doubts on whether the serialisation on PHP is involved causing the firewall in Symfony to break.

If you have a similar experience please get in touch, our quest continues…

UPDATE

We’ve just installed PHP 5.5.9-1ubuntu4 and Symfony, Sonata now work! Will be testing Sylius shortly.