- We work on stable, supported and up-to-date versions of packages. We recommend you to do the same.
$ composer require bitbag/wishlist-plugin
- Add plugin dependencies to your
config/bundles.php
file:
// config/bundles.php
return [
...
BitBag\SyliusWishlistPlugin\BitBagSyliusWishlistPlugin::class => ['all' => true],
];
- Import required config in your
config/packages/_sylius.yaml
file:
# config/packages/_sylius.yaml
imports:
...
- { resource: "@BitBagSyliusWishlistPlugin/Resources/config/config.yml" }
- Import routing in your
config/routes.yaml
file:
# config/routes.yaml
bitbag_sylius_wishlist_plugin:
resource: "@BitBagSyliusWishlistPlugin/Resources/config/routing.yml"
- Clear application cache by using command:
$ bin/console cache:clear
- 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
- 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
- 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:
- Import webpack config*
- Add entry to existing config
- Import entries in your entry.js files
- Your own custom config
* 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:
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.