Skip to content

Create catalog promotions in your Sylius store. Allows you to easily setup rules to change prices on all your products

License

Notifications You must be signed in to change notification settings

Setono/SyliusCatalogPromotionPlugin

Repository files navigation

Sylius Catalog Promotion Plugin

Latest Version Latest Unstable Version Software License Build Status

Plugin for Sylius to define permanent or time-limited promotions for products and automatically update prices.

Screenshot showing catalog promotions admin page

Install

Add plugin to composer.json

composer require setono/sylius-catalog-promotion-plugin

Register plugin

<?php
# config/bundles.php

return [
    // ...
    Setono\SyliusCatalogPromotionPlugin\SetonoSyliusCatalogPromotionPlugin::class => ['all' => true],
    Sylius\Bundle\GridBundle\SyliusGridBundle::class => ['all' => true],
    // ...
];

Note, that we MUST define SetonoSyliusCatalogPromotionPlugin BEFORE SyliusGridBundle. Otherwise, you'll see exception like this:

You have requested a non-existent parameter "setono_sylius_catalog_promotion.model.promotion.class".  

Add routing

# config/routes/setono_sylius_catalog_promotion.yaml
setono_sylius_catalog_promotion_admin:
    resource: "@SetonoSyliusCatalogPromotionPlugin/Resources/config/admin_routing.yaml"
    prefix: /admin

Extend core classes

TODO: Extend Product class

Create migration

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

Install assets

bin/console sylius:install:assets

Configure cron (optional)

php bin/console setono:sylius-catalog-promotion:process

About

Create catalog promotions in your Sylius store. Allows you to easily setup rules to change prices on all your products

Topics

Resources

License

Stars

Watchers

Forks