gravita/notify-when-available

A Sylius plugin that enables the option of setting a future date when the product will be available. Users can add an email to notify then when the product can be purchased


README

687474703a2f2f64656d6f2e73796c6975732e6f72672f6173736574732f73686f702f696d672f6c6f676f2e706e67

Plugin Skeleton

68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f73796c6975732f706c7567696e2d736b656c65746f6e2e737667 68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73796c6975732f706c7567696e2d736b656c65746f6e2e737667 68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f53796c6975732f506c7567696e536b656c65746f6e2f6d61737465722e737667 68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f53796c6975732f506c7567696e536b656c65746f6e2e737667

Installation

  1. Run composer require gravita/notify-when-available.

  2. Add the plugin to AppKernel.php:

    public function registerBundles(): array
    {
        return array_merge(parent::registerBundles(), [
            
            // ...
    
            new \Gravita\SyliusNotifyWhenAvailablePlugin\GravitaSyliusNotifyWhenAvailablePlugin(),
        ]);
    }
  3. Add the required resource files to your config.yml:

    imports:
       # ...
       - { resource: "@GravitaSyliusNotifyWhenAvailablePlugin/Resources/config/config.yml" }
       - { resource: "@GravitaSyliusNotifyWhenAvailablePlugin/Resources/config/resources.yml" }
  4. Add the bundle routing file to your routing.yml

    gravita_notify_when_available_shop:
        resource: "@GravitaSyliusNotifyWhenAvailablePlugin/Resources/config/app/shop_routing.yml"
  5. Update your database:

    php bin\console doctrine:schema:update --force

Usage

Running plugin tests

Once installed, the plugin adds two fields to the product variant form "Details" tab:

  • Available from: this fields holds the message showed to the user if this product variant is not checked as "Available"
  • Available for purchase: if this fields is not checked the message that is set on "Available from" will bee shown to the user. With this message will be a form to register an email on the notification list of the product variant.