Skip to content

asdoria/SyliusLocaleSwitcherPlugin

Repository files navigation

Asdoria Lgoo

Asdoria Locale Switcher Plugin

This plugin allows you to change locale in sylius shop while keeping the page you are on.

Features

  • Change the locale of the store and don't redirect to home.

Locale switcher plugin

Installation

  1. run composer require asdoria/sylius-locale-switcher-plugin
  2. Add the bundle in config/bundles.php. You must put the LocaleSwitcher Plugin line ABOVE TwigBundle
Asdoria\SyliusLocaleSwitcherPlugin\AsdoriaSyliusLocaleSwitcherPlugin::class => ['all' => true],
[...]
Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true],
  1. Import config in config/packages/_sylius.yaml
imports:
    - { resource: "@AsdoriaSyliusLocaleSwitcherPlugin/Resources/config/config.yaml"}
  1. Copy the template overrides from the bundle directory
From: [shop_dir] vendor/asdoria/sylius-locale-switcher-plugin/src/Resources/views/bundles/SyliusShopBundle/*
To: [shop_dir] templates/bundles/SyliusShopBundle/*