Download the PHP package brille24/tierprice-plugin without Composer
On this page you can find all versions of the php package brille24/tierprice-plugin. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download brille24/tierprice-plugin
More information about brille24/tierprice-plugin
Files in brille24/tierprice-plugin
Package tierprice-plugin
Short Description A plugin that allows to add tierprices to Sylius
License MIT
Informations about the package tierprice-plugin
Sylius Tier Price Plugin
This plugin adds tier pricing to Sylius one product has different prices based on the quantity.
Installation
- Install the bundle via composer
composer require brille24/sylius-tierprice-plugin
-
Register the bundle in your
bundles.php
: -
Add the
config.yml
to your localconfig/config.yml
-
For API functionality add the bundle's
routing.yml
to the localapp/config/routing.yml
-
Go into your ProductVariant class and add the following trait and add one method call to the constructor `
- Finally update the database, install the assets and update the translations:
Integration
- This bundle decorates the
sylius.calculator.product_variant_price
service. If you wish to change that, you could register a compiler pass. - This bundle decorates the
sylius.order_processing.order_prices_recalculator
service. If you wish to use your own order processor or change its priority, you could register a compiler pass.
Usage
First of all you have to set up a product with as many variants as you want. Then in each of these variants you can set the tier pricing based on the channels. The table automatically sorts itself to provide a better overview for all different tiers, you configured.
In the frontend the user will see a nice looking table right next to the "add to cart" button that shows the discount for the different tiers like so:
Creating data
You can easily create the tier prices with fixtures like that.
For this the products need to be created first and the product variant must also exist.
Extending
If you want to extend the tierprices please be aware that this plugin is using XML for configuration. This might collide with projects that use Annotations.