|
3 | 3 | ```bash |
4 | 4 | composer require bitbag/user-com-plugin |
5 | 5 | ``` |
6 | | - 2. Add required environment variables to your `.env` file: |
7 | | - ```dotenv |
8 | | - USER_COM_FRONTEND_API_KEY="" |
9 | | - TAG_MANAGER_ID="" |
10 | | - USER_COM_ENCRYPTION_KEY=your-32-character-long-key |
11 | | - USER_COM_ENCRYPTION_IV=your-16-character-long-iv |
12 | | - ``` |
13 | | - 3. Add plugin dependencies to config/bundles.php file: |
14 | | - ```php |
15 | | - return [ |
16 | | - ... |
17 | | - BitBag\SyliusUserComPlugin\BitBagSyliusUserComPlugin::class => ['all' => true], |
18 | | - Spinbits\SyliusGoogleAnalytics4Plugin\SpinbitsSyliusGoogleAnalytics4Plugin::class => ['all' => true], |
19 | | - League\FlysystemBundle\FlysystemBundle::class => ['all' => true], |
20 | | - Setono\SyliusFeedPlugin\SetonoSyliusFeedPlugin::class => ['all' => true], |
21 | | - Setono\DoctrineORMBatcherBundle\SetonoDoctrineORMBatcherBundle::class => ['all' => true], |
22 | | - //Sylius grid bundle should be under Setono\SyliusFeedPlugin\SetonoSyliusFeedPlugin |
23 | | - Sylius\Bundle\GridBundle\SyliusGridBundle::class => ['all' => true], |
24 | | - ... |
25 | | - ]; |
26 | | - ``` |
| 6 | +2. Add required environment variables to your `.env` file: |
| 7 | + ```dotenv |
| 8 | + USER_COM_FRONTEND_API_KEY="" |
| 9 | + TAG_MANAGER_ID="" |
| 10 | + USER_COM_ENCRYPTION_KEY=your-32-character-long-key |
| 11 | + USER_COM_ENCRYPTION_IV=your-16-character-long-iv |
| 12 | + ``` |
| 13 | +3. Add plugin dependencies to `config/bundles.php` file. Make sure that none of the bundles are duplicated. |
| 14 | + ```php |
| 15 | + return [ |
| 16 | + ... |
| 17 | + BitBag\SyliusUserComPlugin\BitBagSyliusUserComPlugin::class => ['all' => true], |
| 18 | + Spinbits\SyliusGoogleAnalytics4Plugin\SpinbitsSyliusGoogleAnalytics4Plugin::class => ['all' => true], |
| 19 | + League\FlysystemBundle\FlysystemBundle::class => ['all' => true], |
| 20 | + Setono\SyliusFeedPlugin\SetonoSyliusFeedPlugin::class => ['all' => true], |
| 21 | + Setono\DoctrineORMBatcherBundle\SetonoDoctrineORMBatcherBundle::class => ['all' => true], |
| 22 | + //Sylius grid bundle should be under Setono\SyliusFeedPlugin\SetonoSyliusFeedPlugin |
| 23 | + Sylius\Bundle\GridBundle\SyliusGridBundle::class => ['all' => true], |
| 24 | + ... |
| 25 | + ]; |
| 26 | + ``` |
27 | 27 | 4. Import required config in your `config/packages/_sylius.yaml` file: |
28 | 28 | ```yaml |
29 | 29 | imports: |
|
32 | 32 | ... |
33 | 33 | ``` |
34 | 34 |
|
35 | | - 4. Import routes in your `config/routes.yaml` file: |
36 | | - ```yaml |
37 | | - bitbag_sylius_user_com_plugin: |
38 | | - resource: "@BitBagSyliusUserComPlugin/config/routes.yaml" |
39 | | - ``` |
| 35 | +4. Import routes in your `config/routes.yaml` file: |
| 36 | + ```yaml |
| 37 | + bitbag_sylius_user_com_plugin: |
| 38 | + resource: "@BitBagSyliusUserComPlugin/config/routes.yaml" |
| 39 | + ``` |
40 | 40 |
|
41 | 41 | 5. Extend `Channel` entity `UserComApiAwareTrait` and implement `UserComApiAwareInterface` |
42 | | - ```php |
43 | | - class Channel extends BaseChannel implements ChannelInterface |
| 42 | + ```php |
| 43 | + use BitBag\SyliusUserComPlugin\Trait\UserComApiAwareTrait; |
| 44 | + use BitBag\SyliusUserComPlugin\Trait\UserComApiAwareInterface; |
| 45 | + ... |
| 46 | + class Channel extends BaseChannel implements UserComApiAwareInterface |
44 | 47 | { |
45 | 48 | use UserComApiAwareTrait; |
46 | 49 | } |
47 | 50 | ``` |
48 | 51 | |
49 | | - ```php |
50 | | - interface ChannelInterface extends BaseChannelInterface, UserComApiAwareInterface |
51 | | - { |
52 | | - } |
53 | | - ``` |
54 | 52 | >`UserComApiAwareTrait` contains mapping for annotations and for attributes which are required by UserCom integration. |
55 | 53 | > If you're using xml mapping, you should add mapping for those properties in your `Channel.orm.xml` file. |
56 | 54 |
|
57 | 55 | 6. Take advantage of channel based configuration of GoogleAnalyticsPlugin by adding : |
58 | 56 | ```yaml |
59 | 57 | spinbits_sylius_google_analytics4: |
60 | 58 | id: "%env(TAG_MANAGER_ID)%" |
61 | | - channels_ids: |
62 | | - FASHION_WEB: "G-DF1P3RRJ8S" |
63 | | - OTHER_CHANNEL: "G-WX1RJ8SP3R" |
64 | 59 | ``` |
0 commit comments