3 min. read
Categories:
Promotion system improvements
Our promotions have just become more powerful thanks to several new rules and actions.
Promotion system improvements

Hey folks!

Here is a very quick update about our promotions system, which received some love in the recent weeks. I hope it will save you some work in your Sylius powered projects.

Overview

Every Sylius promotion consists of a set of rules and actions. It can use coupons, but it is an optional feature.
During the checkout process, we check if users order fulfills all the requirements of every active promotion. If it does, we execute the actions.

If the promotion is coupon based, the Order has to reference a valid coupon AND match all the defined rules.

The promotions can also be restricted to specific time frame and have usage limit. (per promotion, and per coupon)

Reverting mechanism

Thanks to the work of Alexandre Bacco we introduced revert() method to the PromotionActionInterface. (See the PR)

This new method is responsible for “reverting” its effects on the promotion subject.
This is very useful for more complex actions, where you need to perform some specific operations on a subject, which is no longer eligible for given promotion.

Add product action

With the reverting system, Alexandre implemented new add product action, which allows you to add a specific product (or variant) to the users cart.
You can specify the unit price (0 if free) & quantity. There are a lot of use-cases. With a combination of the new rules, you could create very interesting setups…

  • Free product for all orders above X total value.
  • Additional free product to all orders with more than Y items & containing a T-Shirt. (or another taxon)
  • Discounted product for 2nd order of every user.
  • 3 Free products for first 5 orders on a specific day.
  • And 34234 other combinations… (Yes, this number is an estimation)

Additionally, our great Sasa Stamenkovic implemented several other actions and rules.

Shipping discount action

With this action you can apply specific % discount for the shipping of an order.
Just like for the first new action, the possibilities are huge. Simplest use case is free shipping for orders above X amount or for specific group of products.

User nth order rule

This brand new rule checker allows you to apply promotions for a specific user purchase. Need free shipping for the 5th order? You can do this now!

User loyalty

This allows you to check if user has been with you for a specific period of time – more than a month, year or whatever you like. Really useful!

Shipping country

Shipping country rule checker allows you to apply promotion to a specific country for shipments. Most obvious use-case is “free shipping to Germany”.

Taxonomy

Sylius uses a very nice taxonomies engine to classify the products. You can create several taxonomies (like Category, Brand, Manufacturer, Special or You-name-it) and from now on you can apply promotion to specific items.
For example, free shipping & 10% discount for orders containing an item, which is categorized as “Christmas Special”… Again, the combinations are endless.

More is coming

Yes, we want to include more checkers and actions in the future, like customer group rule or currency requirement.
The best part about promotions is that you can very easily create your own custom rules/actions, by implementing one simple service & single configuration form.

You could implement pretty much everything, like a promotion, which schedules an e-mail, two weeks after the purchase with a 10% discount coupon for all users that are in the Retail group and have already purchased a T-Shirt from a specific brand.

If you have an idea or a feature request with a specific scenario, let us know in comments section below!

Stability

While all these features are covered with Behat scenarios, we plan to add even more edge-case stories. Please remember that Sylius is not stable yet and some glitches might occur.

What’s next?

According to the roadmap published few months ago, we should be in the BETA already, but… we’ve made some changes & improvements to these plans. That is the nature of an open source projects roadmap.
We have a lot of amazing stuff coming (new, responsive frontend theme), stay tuned!

Tags:
Share:
Paweł Jędrzejewski
Self-taught developer and entrepreneur, who has built an entire career and business through Open Source technology. Speaker at international conferences. PHPers meetups co-organizer. Keen on helping other young entrepreneurs and companies who may want to follow a similar path.
More from our blog
Cloud 3 min read 17.06.2024
We are thrilled to announce that we just signed a strategic partnership with Platform.sh, and as a result, we are extending our offer with Sylius Cloud powered by Platform.sh. Platform.sh is a modern Platform-as-a-Service (PaaS) solution that allows businesses to leverage the cloud environment without losing access to the code… Read More
Technical 3 min read 11.06.2024
Abstract 1.12 released in Q4 2022 1.13 on Apr 23rd, 2024 (a year later than we anticipated while releasing 1.12) 3859 commits 23 contributors A stabilized Sylius API powered by API Platform It’s been a long and bumpy road. Having it behind our backs was a highway that led Sylius… Read More
Business Ecosystem News 3 min read 06.06.2024
Welcome to the May summary! As an open-source eCommerce framework, Sylius continues to evolve with significant contributions from our vibrant community and valuable product updates. Apart from describing the technical changes, we will also quickly summarize the Sylius Technical Fundamentals & Sylius Polish Community Meetup and eCommerce Day Kaunas, as… Read More
Comments