- If you don't use Symfony Flex add
Sylius B2B Kit
to yourconfig/bundles.php
file:
// config/bundles.php
return [
...
Sylius\B2BKit\SyliusB2BKitPlugin::class => ['all' => true],
OldSound\RabbitMqBundle\OldSoundRabbitMqBundle::class => ['all' => true],
BitBag\SyliusWishlistPlugin\BitBagSyliusWishlistPlugin::class => ['all' => true],
FOS\ElasticaBundle\FOSElasticaBundle::class => ['all' => true],
BitBag\SyliusElasticsearchPlugin\BitBagSyliusElasticsearchPlugin::class => ['all' => true],
FOS\JsRoutingBundle\FOSJsRoutingBundle::class => ['all' => true],
];
- Set environment variables in your
.env
file, change the values according to your needs:
...
###> fos/elastica ###
ELASTICSEARCH_URL=http://localhost:9200/
###< fos/elastica ###
###> sylius/b2b-kit ###
CUSTOMER_GROUP_PRICING_PRIORITY=10
ORGANIZATION_PRICING_PRIORITY=20
###< sylius/b2b-kit ###
- Copy Elasticsearch index files:
cp -R ./vendor/sylius/b2b-kit/tests/Application/config/indexes ./config
- Override
config/packages/fos_elastica.yaml
file settings:
imports:
- { resource: "../indexes/bitbag_shop_products.yml" }
- { resource: "../indexes/bitbag_option_taxons.yml" }
- { resource: "../indexes/bitbag_attribute_taxons.yml" }
- { resource: "../indexes/bitbag_shop_facets.yml" }
parameters:
bitbag_es_pagination_available_page_limits: [9, 18, 36]
bitbag_es_pagination_default_limit: 9
bitbag_es_fuzziness: AUTO
twig:
globals:
bitbag_es_pagination_available_page_limits: "%bitbag_es_pagination_available_page_limits%"
fos_elastica:
clients:
default: { url: '%env(ELASTICSEARCH_URL)%' }
- Import required config in your
config/packages/_sylius.yaml
file:
# config/packages/_sylius.yaml
imports:
...
- { resource: '@SyliusB2BKitPlugin/config/plugins/config.yaml' }
- Import routing in your
config/routes.yaml
file:
# config/routes.yaml
sylius_b2b_kit:
resource: "@SyliusB2BKitPlugin/config/routes/routes.yaml"
- Copy Sylius templates overridden in plugin to your templates' directory (e.g. templates/bundles/):
mkdir -p templates
cp -R vendor/sylius/b2b-kit/tests/Application/templates/* ./templates
- Install assets
bin/console assets:install
Note: If you are running it on production, prepend the command with APP_ENV=prod
- Update your database
bin/console doctrine:migrations:migrate
Note: If you are running it on production, prepend the command with APP_ENV=prod
bin/console cache:clear
- Add plugin assets to your project: