Skip to content

Commit a943e80

Browse files
authored
Merge pull request #20 from BitBagCommerce/adjustment/update-readme
Adjustment/update readme
2 parents 93d32e6 + 3a7a1f8 commit a943e80

10 files changed

Lines changed: 32 additions & 42 deletions

File tree

README.md

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ We have a 70-person team of experts: business analysts and consultants, eCommerc
4747
***
4848

4949
* [Overview](#overview)
50-
* [Installation](#installation)
51-
* [Testing](#testing)
50+
* [Important documents](#important-documents)
5251
* [Functionalities](#functionalities)
5352
* [Demo](#demo)
5453
* [License](#license)
@@ -58,27 +57,13 @@ We have a 70-person team of experts: business analysts and consultants, eCommerc
5857
# Overview
5958

6059
----
61-
The **SyliusUserComPlugin** allows you to integrate your Sylius store with the User.com platform. User.com is a platform that allows you to automate your marketing, sales, and support processes. With this plugin, you can synchronize your Sylius store with User.com and use the data collected in your store to create personalized marketing campaigns, automate sales processes, and provide better customer support.
60+
The **SyliusUserComPlugin** is designed to seamlessly integrate User.com with any Sylius platform app, enabling businesses to monitor customer activity, synchronize agreements, and track orders effortlessly. This plugin acts as a bridge between Sylius and User.com, ensuring businesses gain valuable behavioral insights while enhancing user engagement and retention.
61+
# Important documents
6262

63+
---
6364

64-
# Installation
65-
----
66-
67-
68-
# Testing
69-
----
70-
71-
```bash
72-
$ composer install
73-
$ cd tests/Application
74-
$ yarn install
75-
$ yarn build
76-
$ bin/console assets:install public -e test
77-
$ bin/console doctrine:schema:create -e test
78-
$ bin/console server:run 127.0.0.1:8080 -d public -e test
79-
$ open http://localhost:8080
80-
$ vendor/bin/behat
81-
```
65+
- [Installation](doc/installation.md)
66+
- [Adjustments](doc/adjustments.md)
8267

8368
# Functionalities
8469

@@ -89,7 +74,9 @@ All main functionalities of the plugin are described **[here.](https://github.co
8974
If you need some help with Sylius development, don't be hesitated to contact us directly. You can fill the form on [this site](https://bitbag.io/contact-us/?utm_source=github&utm_medium=referral&utm_campaign=plugins_productbundle) or send us an e-mail at hello@bitbag.io!
9075

9176
---
77+
9278
# Demo
79+
9380
---
9481
We created a demo app with some useful use-cases of plugins! Visit http://demo.sylius.com/ to take a look at it.
9582

@@ -99,6 +86,7 @@ We created a demo app with some useful use-cases of plugins! Visit http://demo.s
9986

10087

10188
# Additional resources for developers
89+
10290
---
10391
To learn more about our contribution workflow and more, we encourage you to use the following resources:
10492
* [Sylius Documentation](https://docs.sylius.com/en/latest/)
@@ -107,17 +95,20 @@ To learn more about our contribution workflow and more, we encourage you to use
10795
* [Sylius Product Bundle Plugin Blog](https://bitbag.io/blog/product-bundling-sylius)
10896

10997
# License
98+
11099
---
111100

112101
This plugin's source code is completely free and released under the terms of the MIT license.
113102

114103
[//]: # (These are reference links used in the body of this note and get stripped out when the markdown processor does its job. There is no need to format nicely because it shouldn't be seen.)
115104

116105
# Contact
106+
117107
---
118108
This open-source plugin was developed to help the Sylius community. If you have any additional questions, would like help with installing or configuring the plugin, or need any assistance with your Sylius project - let us know! **Contact us** or send us an **e-mail to hello@bitbag.io** with your question(s).
119109

120110
# Community
111+
121112
----
122113

123114
For online communication, we invite you to chat with us & other users on **[Sylius Slack](https://sylius-devs.slack.com/).**

config/packages/messenger.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ framework:
22
messenger:
33
transports:
44
user_com_asynchronous:
5-
dsn: "%env(MESSENGER_USER_COM_ASYNCHRONOUS)%"
5+
dsn: "%env(MESSENGER_USER_COM_ASYNCHRONOUS_DSN)%"
66
retry_strategy:
77
max_retries: 5
88
#1000 * 60 * 10

doc/functionalities.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,6 @@ The **BitBagSyliusUserComPlugin** integrates **User.com** with Sylius-based stor
2929
### 6. Tag Manager Script Injection
3030
- Allows users to **inject custom scripts** via **Tag Manager**.
3131
- Enables integration with **third-party tracking tools**.
32+
33+
### 7. User information object
34+
- you can use `user_com_customer_info` in browser console to check currently logged in customer data

doc/installation.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
GOOGLE_ANALYTICS_TAG=""
1010
USER_COM_ENCRYPTION_KEY=your-32-character-long-key
1111
USER_COM_ENCRYPTION_IV=your-16-character-long-iv
12-
MESSENGER_USER_COM_ASYNCHRONOUS=""
12+
MESSENGER_USER_COM_ASYNCHRONOUS_DSN=""
1313
```
1414
3. Add plugin dependencies to `config/bundles.php` file. Make sure that none of the bundles are duplicated.
1515
```php
@@ -33,13 +33,13 @@
3333
...
3434
```
3535
36-
4. Import routes in your `config/routes.yaml` file:
36+
5. Import routes in your `config/routes.yaml` file:
3737
```yaml
3838
bitbag_sylius_user_com_plugin:
3939
resource: "@BitBagSyliusUserComPlugin/config/routes.yaml"
4040
```
4141
42-
5. Extend `Channel` entity `UserComApiAwareTrait` and implement `UserComApiAwareInterface`
42+
6. Extend `Channel` entity `UserComApiAwareTrait` and implement `UserComApiAwareInterface`
4343
```php
4444
use BitBag\SyliusUserComPlugin\Trait\UserComApiAwareTrait;
4545
use BitBag\SyliusUserComPlugin\Trait\UserComApiAwareInterface;
@@ -50,22 +50,22 @@
5050
}
5151
```
5252
53-
>`UserComApiAwareTrait` contains mapping for annotations and for attributes which are required by UserCom integration.
54-
> If you're using xml mapping, you should add mapping for those properties in your `Channel.orm.xml` file.
53+
>`UserComApiAwareTrait` contains mapping for annotations and for attributes which are required by UserCom integration. If you're using xml mapping, you should add mapping for those properties in your `Channel.orm.xml` file.
5554
56-
6. Take advantage of channel based configuration of GoogleAnalyticsPlugin by adding :
55+
7. Take advantage of channel based configuration of GoogleAnalyticsPlugin by adding :
5756
```yaml
5857
spinbits_sylius_google_analytics4:
5958
id: "%env(GOOGLE_ANALYTICS_TAG)%"
6059
enabled: true
6160
```
62-
7. Add api credentials and GTM to your channel configuration in admin panel. If you decided to extend different object, please make sure that api credentials are set
63-
8. Run yarn install and yarn build to compile assets, or the alternative solution you use for your project
61+
8. Compile assets
6462
```bash
6563
yarn install && yarn build
6664
```
67-
9. Configure consumer to run in supervisor:
65+
9. Add API credentials and GTM to your channel configuration in admin panel. If you decided to extend different object, please make sure that API credentials are set.
66+
![Channel configuration](../doc/user_com_configuration.png)
67+
68+
10. Configure consumer to run in supervisor:
6869
```bash
6970
bin/console messenger:consume user_com_asynchronous
7071
```
71-
10. While integrating with User.com via GTM, you can use `user_com_customer_info` in browser console to check currently logged in customer data.

doc/user_com_configuration.png

189 KB
Loading

src/Api/AbstractClient.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,9 @@ protected function request(
5555
}
5656

5757
if ($status >= Response::HTTP_OK && $status < Response::HTTP_MULTIPLE_CHOICES) {
58-
$this->logger->debug(sprintf(
59-
sprintf('%s User.com API request', $status),
60-
), [
58+
$this->logger->debug('User.com - Successful API request', [
6159
'path' => $path,
6260
'method' => $method,
63-
'options' => $options,
64-
'response' => $response->getContent(false),
6561
]);
6662

6763
return $response->toArray();

src/Assigner/AgreementsAssigner.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function assign(CustomerInterface $customer, array $agreements): void
2828
'email_agreement' => $customer->setSubscribedToNewsletter($value),
2929
default => $this->logger->error(
3030
sprintf(
31-
'Agreement not found. Key = %s, Value = %s, CustomerId = %s',
31+
'User.com - Agreement not found. Key = %s, Value = %s, CustomerId = %s',
3232
$key,
3333
$value,
3434
$customer->getId(),

src/Dispatcher/OrderMessageDispatcher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function __construct(
2727
public function dispatch(OrderInterface $order): void
2828
{
2929
if (null === $order->getId()) {
30-
$this->logger->error('Order ID cannot be null');
30+
$this->logger->error('User.com - Order ID cannot be null');
3131

3232
return;
3333
}

src/Manager/OrderUpdateManager.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,15 @@ private function createProductEvents(
9191
try {
9292
$eventType = self::PRODUCT_EVENT_MAP[$order->getState()] ?? null;
9393
if (null === $eventType) {
94-
$this->logger->warning(sprintf('Order #%s state "%s" is not supported.', $order->getNumber(), $order->getState()));
94+
$this->logger->warning(sprintf('User.com - Order #%s state "%s" is not supported.', $order->getNumber(), $order->getState()));
9595

9696
return;
9797
}
9898

9999
foreach ($order->getItems() as $orderItem) {
100100
$variant = $orderItem->getVariant();
101101
if (null === $variant) {
102-
$this->logger->warning(sprintf('Order item #%s does not have a variant.', $orderItem->getId()));
102+
$this->logger->warning(sprintf('User.com - Order item #%s does not have a variant.', $orderItem->getId()));
103103

104104
continue;
105105
}

tests/Application/.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,5 @@ USER_COM_FRONTEND_API_KEY=""
3737
GOOGLE_ANALYTICS_TAG=""
3838
USER_COM_ENCRYPTION_KEY=your-32-character-long-key
3939
USER_COM_ENCRYPTION_IV=your-16-character-long-
40-
MESSENGER_USER_COM_ASYNCHRONOUS="doctrine://default"
40+
MESSENGER_USER_COM_ASYNCHRONOUS_DSN="doctrine://default"
4141
###< UserCom

0 commit comments

Comments
 (0)