Download the PHP package aropixel/sylius-stock-alert-plugin without Composer
On this page you can find all versions of the php package aropixel/sylius-stock-alert-plugin. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download aropixel/sylius-stock-alert-plugin
More information about aropixel/sylius-stock-alert-plugin
Files in aropixel/sylius-stock-alert-plugin
Package sylius-stock-alert-plugin
Short Description Get notifed when your product stock reaches a certain treshold
License MIT
Informations about the package sylius-stock-alert-plugin
Sylius Stock Alert Plugin
Get notifed when your product stock reaches a certain treshold
Table of contents
- Presentation
- Installation
- Usage
- License
Presentation
Once the plugin is installed and configured, you'll be able to define in the admin a stock treshold for each product and / or taxonomy. When inventory levels fall below this threshold (wether with a new order, a stock modification in the admin or a stock treshold modification), notifications will be displayed in the admin dashboard and also sent by emails. Custom notifier can also be implemented easily.
Installation
In a sylius application :
- Install the plugin :
composer require aropixel/sylius-stock-alert-plugin
If the plugin is not registered in the config/bundles.php file, register it by adding:
-
Create a aropixel_sylius_stock_alert.yaml in the config folder and import the plugin configuration:
-
Make sure the sylius mailer plugin is configured (in your config/sylius_mailer.yaml file)
-
If you need the emails stock alert, enable it and configure it in the aropixel_sylius_stock_alert.yaml (you can multiple recipients for the emails alerts):
-
use the ProductVariantTrait in your productVariant Entity
-
Use the TaxonTrait in your Taxon Entity
-
run the migrations
- install the assets:
Usage
You can define stock treshold in the product admin ("stock" tab), but also in the taxonomies of the product. The stock treshold in the product have the highest priority: if it's defined, it will not be overrided by the stock treshold of the taxonomy. If the stock treshold of the product is not defined, the plugin will look in all the taxonomies of the product, compare them all and keep only the lowest (the most restrictive stock treshold of the taxonomies).
Everytime the stock or stock treshold changes, the plugin updates the dashboard notifications.
Everytime an order is completed, the plugin will look for all the notifiers implemented (by default only the email notifier), and send the associated notification. The Email notifier is the only one implemented by default in the plugin. If you want to implements other notifier (like SMS etc), you just need to create a class that extends the Aropixel\SyliusStockAlertPlugin\StockNotifier\StockNotifierInterface and implement the sendNotification() method. Your method will be automatically called.
License
Aropixel Blog Bundle is under the MIT License