Skip to content

Commit 20cfaed

Browse files
committed
Updates README
1 parent 01a5f83 commit 20cfaed

1 file changed

Lines changed: 43 additions & 9 deletions

File tree

README.md

Lines changed: 43 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,39 @@
1111

1212
## Installation
1313

14+
0. This plugin requires the [MyOnlineStore/ViesBundle](https://github.com/MyOnlineStore/ViesBundle) but this is not actually compatible with Symfony 7, there is an open PR: https://github.com/MyOnlineStore/ViesBundle/pull/18
15+
16+
Thus, you have to run the following command to require a fork of the bundle which is compatible with Symfony 7:
17+
18+
```bash
19+
composer config repositories.sandwich/vies-bundle git https://github.com/mmenozzi/ViesBundle.git
20+
```
21+
22+
and you have to run this command too to allow "dev" versions of the bundle (we need the "dev-patch-1" version):
23+
24+
```bash
25+
composer config minimum-stability dev
26+
```
27+
1428
1. Require the plugin:
1529

1630
```bash
1731
composer require webgriffe/sylius-italian-invoiceable-order-plugin
1832
```
1933

20-
2. Add bundles to `config/bundles.php` file:
34+
2. If they have not been added automatically, you have to add these bundles to `config/bundles.php` file:
2135

2236
```php
2337
Sandwich\ViesBundle\SandwichViesBundle::class => ['all' => true],
2438
Webgriffe\SyliusItalianInvoiceableOrderPlugin\WebgriffeSyliusItalianInvoiceableOrderPlugin::class => ['all' => true],
2539
```
2640

41+
3. Configure your ActiveCampaign API connection parameters by creating the `config/packages/webgriffe_sylius_italian_invoiceable_order_plugin.yaml` file with the following content:
42+
```yaml
43+
imports:
44+
- { resource: "@WebgriffeSyliusItalianInvoiceableOrderPlugin/config/config.yaml" }
45+
```
46+
2747
3. By default, the parameter `app.taxation.eu_zone_code` is set to "EU", as it must be the code of a zone representing the EU. This is used to determine if an order is invoiced to a company within the EU or not. Please change this parameter according to your Sylius's zone configuration if needed:
2848

2949
```yaml
@@ -40,18 +60,32 @@
4060

4161
```bash
4262
mkdir -p config/validator/
43-
cp vendor/webgriffe/sylius-italian-invoiceable-order-plugin/tests/TestApplication/config/validator/Address.xml config/validator/
44-
cp vendor/webgriffe/sylius-italian-invoiceable-order-plugin/tests/TestApplication/config/validator/Order.xml config/validator/
63+
cp vendor/webgriffe/sylius-italian-invoiceable-order-plugin/tests/TestApplication/config/validation/Address.xml config/validator/
64+
cp vendor/webgriffe/sylius-italian-invoiceable-order-plugin/tests/TestApplication/config/validation/Order.xml config/validator/
4565
```
4666

47-
Or by merging the configuration into your existing `Address` and `Order` validator configuration.
67+
**WAIT! We are not done with this step yet.** You must edit these files to change the namespace `Tests\Webgriffe\SyliusItalianInvoiceableOrderPlugin` to your own project namespace: there are 3 references that you have to change among these files.
68+
69+
If you have the "App" as the base namespace of your app, this command should be enough:
70+
71+
Linux:
72+
```bash
73+
sed -i 's/Tests\\Webgriffe\\SyliusItalianInvoiceableOrderPlugin/App/g' config/validator/Address.xml config/validator/Order.xml
74+
```
75+
76+
MacOS:
77+
```bash
78+
sed -i '' 's/Tests\\Webgriffe\\SyliusItalianInvoiceableOrderPlugin/App/g' config/validator/Address.xml config/validator/Order.xml
79+
```
80+
81+
If you alread have some validator file for these entities you have to merge the configuration manually.
4882

4983
7. Configure Sylius to use the `Italian tax calculation` tax calculation strategy.
5084

5185
8. To properly enable group sequence validation of your Address entity you must set the `Default` validation group instead of the `sylius` validation group:
5286

5387
```yaml
54-
# config/services.yaml
88+
# config/parameters.yaml
5589
parameters:
5690
# ...
5791
sylius.form.type.address.validation_groups: ['Default']
@@ -62,11 +96,10 @@
6296
9. Run migration
6397

6498
```bash
65-
vendor/bin/console cache:clear
66-
vendor/bin/console doctrine:migrations:migrate
99+
bin/console cache:clear
100+
bin/console doctrine:migrations:migrate
67101
```
68102

69-
70103
10. Add invoiceable fields to the address show template for admin. To do so you have to override this template:
71104

72105
```bash
@@ -76,7 +109,8 @@
76109
by copying directly our implementation provided in the plugin:
77110

78111
```bash
79-
cp tests/TestApplication/templates/bundles/SyliusAdminBundle/shared/helper/address.html.twig templates/bundles/SyliusAdminBundle/shared/helper/address.html.twig
112+
mkdir -p templates/bundles/SyliusAdminBundle/shared/helper/
113+
cp vendor/webgriffe/sylius-italian-invoiceable-order-plugin/tests/TestApplication/templates/bundles/SyliusAdminBundle/shared/helper/address.html.twig templates/bundles/SyliusAdminBundle/shared/helper/address.html.twig
80114
```
81115

82116
or by copying the original template and adding the invoiceable fields by yourself. In this case your template should look like the following:

0 commit comments

Comments
 (0)