Skip to content

Latest commit

 

History

History
113 lines (76 loc) · 3.31 KB

01-installation.md

File metadata and controls

113 lines (76 loc) · 3.31 KB

BitBag SyliusWishlistPlugin

Installation

  1. We work on stable, supported and up-to-date versions of packages. We recommend you to do the same.
$ composer require bitbag/wishlist-plugin
  1. Add plugin dependencies to your config/bundles.php file:
// config/bundles.php

return [
    ...

    BitBag\SyliusWishlistPlugin\BitBagSyliusWishlistPlugin::class => ['all' => true],
];
  1. Import required config in your config/packages/_sylius.yaml file:
# config/packages/_sylius.yaml

imports:
    ...

    - { resource: "@BitBagSyliusWishlistPlugin/Resources/config/config.yml" }
  1. Import routing in your config/routes.yaml file:
# config/routes.yaml

bitbag_sylius_wishlist_plugin:
    resource: "@BitBagSyliusWishlistPlugin/Resources/config/routing.yml"
  1. Clear application cache by using command:
$ bin/console cache:clear
  1. Update your database

First, please run legacy-versioned migrations by using command:

$ bin/console doctrine:migrations:migrate

After migration, please create a new diff migration and run it:

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

Note: If you are running it on production, add the -e prod flag to this command.

Note: If you are updating this plugin from version 1.4.x you need to run:

$ bin/console doctrine:migrations:version BitBag\\SyliusWishlistPlugin\\Migrations\\Version20201029161558 --add --no-interaction
  1. Please add plugin templates into your project:
$ cp -R vendor/bitbag/wishlist-plugin/tests/Application/templates/bundles/SyliusShopBundle/Product templates/bundles/SyliusShopBundle
$ cp vendor/bitbag/wishlist-plugin/tests/Application/templates/bundles/SyliusShopBundle/_header.html.twig templates/bundles/SyliusShopBundle
$ cp vendor/bitbag/wishlist-plugin/tests/Application/templates/bundles/SyliusShopBundle/_logo.html.twig templates/bundles/SyliusShopBundle
  1. Add plugin assets to your project

We recommend you to use Webpack (Encore), for which we have prepared four different instructions on how to add this plugin's assets to your project:

* Default option for plugin development

However, if you are not using Webpack, here are instructions on how to add optimized and compressed assets directly to your project templates:

Asynchronous Messenger case

In case you use asynchronous Messenger transport by default, there is a need to configure all Wishlist commands to sync transport. You can do this by configuring the WishlistSyncCommandInterface interface to sync transport (as presented on code listing below).

# config/packages/messenger.yaml

framework:
    messenger:
        transports:
            sync: 'sync://'
    routing:
        'BitBag\SyliusWishlistPlugin\Command\Wishlist\WishlistSyncCommandInterface': sync

All commands from the plugin implement the WishlistSyncCommandInterface interface, so there is no need for other configuration.