Getting started with Sylius, an open source e-commerce platform built on Symfony2. Sylius provides standalone bundles and a full-featured application. It offers modern and testable code through proper object-oriented PHP and dependency injection. Key features include products, carts, orders, taxation, shipping and inventory management. Sylius uses Behavior Driven Development with Behat and Phpspec to ensure code quality. Documentation is available at docs.sylius.org to help developers get started with individual components or installing the full Sylius application.
14. What is sylius
• E-Commerce framework for PHP
• Set of bundles for Symfony2
• Platform based on Symfony2
15. e-commerce framework for php
• Collection of decoupled components
• Usable with any PHP project
• Common E-Commerce patterns and domain
models implemented in „raw” PHP code
• Loosely integrated with other libraries
16. Set of bundles for symfony2
• Standalone Symfony2 bundles
• Every E-Commerce feature lives in a separate
package available through Composer
• Can be integrated into existing application
• Bundles as integration layers for Symfony
17. e-commerce symfony2 app
• Online-selling platform
• Can be used as a base for project or „as is”
• Integration with other Symfony2 app is possible and
easy
• Consists of two main bundles containing Core and
Web interface
26. PROPER OBJECT ORIENTED PHP
• No singletons and static access all over the place
• Testable code
• Lack of magic
• DependencyInjection and many other design
patterns
27. vendors managed using composer
• All Sylius components, bundles and distributions
are available through Composer
• Sylius uses Composer to manage its dependencies
• No NIH allowed
• A lot of community libraries
28. Symfony as framework
• Sylius, just like eZ Publish, is built on top of full-
stack Symfony2
• Based on Standard Edition, should be familiar for
any Symfony developer
• Does not reinvent the wheel and shares part of
community
29. Doctrine as orm
• No ActiveRecord
• Fully featured ORM as the foundation for data
storage
• Whole data persistence hidden behind elegant
interfaces
• Potentially supports MongoDB and other platforms
30. Behavior DRIVEN DEVELOPMENT
• StoryBDD with Behat maintains high level of
communication quality among the community
• We communicate using examples
• Behat scenarios are executed as acceptance tests
automatically on every change
• SpecBDD using phpspec punishes us for any bad design
decision
• CodeQuality
36. Require a single component
$ composer require sylius/product:v0.10.0
<?php
!
$product = new Product();
!
$product
->setName(’T-Shirt’)
->setDescription(’Really cool t-shirt’)
;
37. Install symfony2 bundle
$ composer require sylius/cart-bundle:v0.10.0
<?php
!
class FooController extends Controller
{
public function barAction()
{
$cart = $this->get(’sylius.cart_provider’)->getCart();
}
}
And follow the installation instructions from the documentation
41. Resource Layer
• Lives on top of Doctrine
• Extends and uses Doctrine Common Persistence
interfaces
• Contains basic interfaces, like
TimestampableInterface,
SoftDeleteableInterface etc.
• Integrated through SyliusResourceBundle
42. Products Attributes and variations
Options and Variants
• Component and bundle for common entity
Attributes handling
• Processing of object variations using options
• Product integrates both Attributes and Variants
43. Orders and Carts
Sales and Shopping Cart
• Cart is an Order with appropriate state „checkout”
• Support of Adjustments for discounts and fees
• Order items can contain any type of object or plain
text, quantity and price
44. Other components and bundles
We have few of them
• Taxation with categorization and different calculators support
• Complex shipping management with different shipping methods
and cost calculators
• Inventory tracking with backorders support
• Promotions system with coupons, actions and custom rules
support
• Addresses management with geographical zones for precise
shipping and taxation rates
• Payum integration for payments
45. Okay, a bit more than „few”
More fun
• Workflows, checkouts, installation wizards and multistep
actions
• Pricing component with customizable price calculators
(volume, regional, per custom group etc.)
• Settings system for easy configuration via GUI
• Taxonomies for categorization of products
• Theming, Plugins, Reviews, Subscriptions, Multi-Channel
(coming soon)
46. What about content management?
Symfony CMF Integration
• Very basic integration with the CMF
• Simple content types and blocks
• Big plans to take this integration even further