Download the PHP package leomoshko/sylius-tierprice-plugin without Composer
On this page you can find all versions of the php package leomoshko/sylius-tierprice-plugin. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download leomoshko/sylius-tierprice-plugin
More information about leomoshko/sylius-tierprice-plugin
Files in leomoshko/sylius-tierprice-plugin
Package sylius-tierprice-plugin
Short Description A plugin that allows to add tierprices to Sylius (fork of brille24/sylius-tierprice-plugin)
License MIT
Homepage https://github.com/LeoMoshko/SyliusTierpricePlugin
Informations about the package sylius-tierprice-plugin
Sylius Tier Price Plugin
This plugin adds tier pricing to Sylius: one product variant can have different prices based on the ordered quantity.
This is a fork of
brille24/sylius-tierprice-plugin, published asleomoshko/sylius-tierprice-plugin. The PHP namespace (Brille24\SyliusTierPricePlugin\) and the bundle class name are kept unchanged so it stays a drop-in replacement.
Requirements
| Package | Version |
|---|---|
| PHP | ^8.2 |
| Sylius | 2.0, 2.1, 2.2 |
Installation
-
Install the plugin via composer:
-
Register the bundle in your
config/bundles.php: -
Import the plugin config in your
config/packages/brille24_sylius_tierprice_plugin.yaml: -
For API functionality import the plugin routes in your
config/routes.yaml: -
Go into your
ProductVariantclass, implement the interface and add the trait plus one call in the constructor: - Finally update the database schema (generate and run a migration) and install the assets:
Integration
- This plugin decorates the
sylius.calculator.product_variant_priceservice. If you wish to change that, you could register a compiler pass. - This plugin decorates the
sylius.order_processing.order_prices_recalculatorservice. If you wish to use your own order processor or change its priority, you could register a compiler pass. - The admin product-variant form and the shop product page are extended through Sylius Twig Hooks (
config/app/twig_hooks/), not menu listeners.
Usage
First set up a product with as many variants as you want. Then, for each variant, you can configure tier pricing per channel (and optionally per customer group). The table sorts itself automatically to give a clear overview of the configured tiers.
In the shop the customer sees a table next to the "add to cart" button showing the discount for the different tiers:
Creating data
You can create tier prices with fixtures:
The referenced product and product variant have to exist before the fixture runs.
Upgrading from brille24/sylius-tierprice-plugin
Because the namespace is unchanged, switching is a composer.json change only:
No code, config, template or translation-key changes are required.
Support
Found a bug or need help wiring the plugin into your Sylius project? Please open an issue on the issue tracker.
For paid support, Sylius integration or custom development, get in touch through our partner santv.fr.
Partners
This fork is maintained with the support of:
santv.fr — la tech au service de la santé et du développement des enfants.
License
Released under the MIT License.