Download the PHP package adriana/sylius-impersonator-plugin without Composer
On this page you can find all versions of the php package adriana/sylius-impersonator-plugin. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download adriana/sylius-impersonator-plugin
More information about adriana/sylius-impersonator-plugin
Files in adriana/sylius-impersonator-plugin
Package sylius-impersonator-plugin
Short Description User Impersonator Plugin
License proprietary
Informations about the package sylius-impersonator-plugin
User Impersonator Plugin
Documentation
This is a simple Sylius Plugin designed to help administrators to know when they impersonated a customer within the shop.
This hint consists in showing the string: Impersonated by {impersonator_username}
in the shop banner, near the customer's name and on the checkout page.
Quickstart Installation
-
Run
composer require adriana/sylius-impersonator-plugin
. -
Enable the plugin in
config/bundles.php
: -
Ensure you have modified resource configured in
config/packages/_sylius.yaml
: -
Execute migrations in order to have the new field
show_user_impersonate_hint
inside thechannel
table: -
Add
EvoUserImpersonatorChannelTrait
in your Channel entity and implement interfaceEvoUserImpersonatorChannelInterface
: -
Ensure you have modified resource configured in
config/packages/_sylius.yaml
: -
Add translations path in order to use translations in
config/translation.yaml
: - In order to run Behat tests ensure you have modified your
behat.yml
and configured:
Usage
Check Admin panel, channels options - edit one channel and the Show user impersonate hint
option should appear and should be enabled by default.
After that you can impersonate a customer and the Impersonated by {impersonator_username}
hint should appear in the shop.
This plugin has a Twig Extension that you can use in any template you need in order to show the "impersonated by" hint. You can use this extension by calling:
{{ "sylius.user_impersonator.hint"|trans({"{{impersonator_username}}": userImpersonatorHint()}) }}
And you can also make use of the Service created in Evo\SyliusUserImpersonatorPlugin\Service\CheckUserImpersonator
which you can inject into your application and call its public methods.
Run Behat Tests
Configure Services path in config/services_test.yaml
:
Run tests with: APP_ENV=test vendor/bin/behat --suite=adriana_user_impersonator