akki-team / sylius-settable-channel-plugin
Package info
github.com/akki-team/sylius-settable-channel-plugin
Type:sylius-plugin
pkg:composer/akki-team/sylius-settable-channel-plugin
1.1.0
2025-05-05 12:52 UTC
Requires
- php: >=8.1
- sylius/sylius: ^1.11 || ^1.12 || ^1.13 || ^1.14
README
Overview
This plugin allows you to set the channel context directly, with a Channel or a ChannelCode thanks to the
SettableChannelContextInterface.
Very useful in your symfony/command and symfony/messenger where channel context cannot be determined because there is
no request.
See the methods available for the SettableChannelContextInterface.
Installation
- Install the plugin to your project with the following command:
$ composer require akki-team/sylius-settable-channel-plugin
- After the installation, check that the plugin is correctly declared in your project in the file
config/bundles.php.
return [ ... Akki\SyliusSettableChannelPlugin\AkkiSyliusSettableChannelPlugin::class => ['all' => true], ];
- You can now inject the SettableChannelContextInterface in your services and set the channel context directly.
$this->settableChannelContext->setChannel($channel);