Skip to content

Latest commit

 

History

History
118 lines (84 loc) · 2.76 KB

01.1-configuration.md

File metadata and controls

118 lines (84 loc) · 2.76 KB

Sylius B2B Kit

Configuration

Plugin configuration

  1. If you don't use Symfony Flex add Sylius B2B Kit to your config/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],
];
  1. 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 ###
  1. Copy Elasticsearch index files:
cp -R ./vendor/sylius/b2b-kit/tests/Application/config/indexes ./config
  1. 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)%' }
  1. Import required config in your config/packages/_sylius.yaml file:
# config/packages/_sylius.yaml

imports:
    ...

  - { resource: '@SyliusB2BKitPlugin/config/plugins/config.yaml' }
  1. Import routing in your config/routes.yaml file:
# config/routes.yaml

sylius_b2b_kit:
  resource: "@SyliusB2BKitPlugin/config/routes/routes.yaml"
  1. 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
  1. Install assets
bin/console assets:install

Note: If you are running it on production, prepend the command with APP_ENV=prod

  1. Update your database
bin/console doctrine:migrations:migrate

Note: If you are running it on production, prepend the command with APP_ENV=prod

  1. Clear cache

bin/console cache:clear
  1. Add plugin assets to your project: