Bonus points plugin for Sylius.


Approved by Sylius

About us

At BitBag we do believe in open source. However, we are able to do it just because of our awesome clients, who are kind enough to share some parts of our work with the community. Therefore, if you feel like there is a possibility for us working together, feel free to reach us out. You will find out more about our professional services, technologies and contact details at


Screenshot showing menu where bonus points rules are managed

Screenshot showing example of bonus points rule

Screenshot showing customer view after discounting an order

Screenshot showing order shipped for free


This plugin allows you to create rules for assigning bonus points to users.
Users can exchange them for discounts(1 bonus point = 1 currency discount) when creating an order.


  1. Require plugin with composer:

    composer require bitbag/bonus-points-plugin
  2. Add plugin dependencies to your config/bundles.php file:

        return [
            BitBag\SyliusBonusPointsPlugin\BitBagSyliusBonusPointsPlugin::class => ['all' => true],
  3. Import required config by adding config/packages/bitbag_sylius_bonus_points_plugin.yaml file:

    # config/packages/bitbag_sylius_bonus_points_plugin.yaml
       - { resource: "@BitBagSyliusBonusPointsPlugin/Resources/config/config.yml" }
  4. Import routing in your config/routes.yaml file:

    # config/routes.yaml
        resource: "@BitBagSyliusBonusPointsPlugin/Resources/config/routing.yml"
  5. Extend Order(including Doctrine mapping):

    namespace App\Entity\Order;
    use BitBag\SyliusBonusPointsPlugin\Entity\BonusPointsAwareInterface;
    use BitBag\SyliusBonusPointsPlugin\Entity\BonusPointsAwareTrait;
    use Sylius\Component\Core\Model\Order as BaseOrder;
    class Order extends BaseOrder implements BonusPointsAwareInterface
        use BonusPointsAwareTrait;

    Mapping (XML):

    <?xml version="1.0" encoding="UTF-8"?>
    <doctrine-mapping xmlns=""
          <entity repository-class="App\Doctrine\ORM\OrderRepository" name="App\Entity\Order\Order" table="sylius_order">
                <field name="bonusPoints" type="integer" nullable="true" />
  6. Customize shop templates to include bonus points. For starter You may want copy to templates directory everything from plugin's tests/Application/templates

  7. Finish the installation by updating the database schema and installing assets:

    $ bin/console doctrine:migrations:diff
    $ bin/console doctrine:migrations:migrate


$ composer install
$ cd tests/Application
$ yarn install
$ yarn build
$ bin/console assets:install public -e test
$ bin/console doctrine:schema:create -e test
$ bin/console server:run -d public -e test
$ open http://localhost:8080
$ vendor/bin/behat


Learn more about our contribution workflow on