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
Business News Technical 3 min read 28.09.2020
Get ready for global sales & operations with the most advanced payment solution from the famous fintech giant, now available in Sylius out of the box. Read More
Business News 3 min read 14.09.2020
We proudly present to you the latest version of the Sylius eCommerce Platform – 1.8, which comes with a brand new, unified API powered by API Platform, Loyalty points system for Sylius Plus, and as you can probably see, a brand new sylius.com website! Numbers This new release is a… Read More
Business Ecosystem News 3 min read 13.08.2020
Read why the French market leader trusted Sylius in a strategic re-platforming process to get a competitive eCommerce advantage. Read More
Comments