Skip to content

Commit

Permalink
Merge pull request #10 from BitBagCommerce/OP-508
Browse files Browse the repository at this point in the history
OP-508 - installation.md - new standard
  • Loading branch information
senghe authored Sep 10, 2024
2 parents 6d8e90d + 56703ad commit 08b93e0
Show file tree
Hide file tree
Showing 5 changed files with 116 additions and 50 deletions.
60 changes: 13 additions & 47 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,59 +35,25 @@ This **open-source plugin was developed to help the Sylius community**. If you h

[![](https://bitbag.io/wp-content/uploads/2020/10/button-contact.png)](https://bitbag.io/contact-us/?utm_source=github&utm_medium=referral&utm_campaign=plugins_dpdpl-shipping-export)

# Installation
## Installation

```bash
composer require bitbag/dpd-pl-shipping-export-plugin
```

Add plugin dependencies to your `config/bundles.php` file:
```php
return [
...

BitBag\DpdPlShippingExportPlugin\DpdPlShippingExportPlugin::class => ['all' => true]
];
```

Import required config in your `config/packages/_sylius.yaml` file:
```yaml
imports:
...

- { resource: "@DpdPlShippingExportPlugin/Resources/config/config.yml" }
```
Import routing in your `config/routes.yaml` file:

```yaml
bitbag_shipping_export_plugin:
resource: "@BitBagSyliusShippingExportPlugin/Resources/config/routing.yml"
prefix: /admin
```

Clear application cache by using command:

```bash
bin/console cache:clear
```
---
### Requirements

Verify database schema changes:
We work on stable, supported and up-to-date versions of packages. We recommend you to do the same.

```bash
bin/console doctrine:schema:update --dump-sql
```
| Package | Version |
|---------------|-----------------|
| PHP | \>=8.0 |
| sylius/sylius | 1.12.x - 1.13.x |
| MySQL | \>= 5.7 |
| NodeJS | \>= 18.x |

Update your database schema
----
### Full installation guide
- [See the full installation guide](doc/installation.md)

```bash
bin/console doctrine:schema:update --force --complete
```
# Usage
### Important!
If non-existent postal codes are provided - both in the "shipping gateway" and during the order, export of the shipment will not be possible. For the plugin to work properly, it is also necessary to add the weight of the products.
# About us

---

BitBag is a company of people who **love what they do** and do it right. We fulfill the eCommerce technology stack with **Sylius**, Shopware, Akeneo, and Pimcore for PIM, eZ Platform for CMS, and VueStorefront for PWA. Our goal is to provide real digital transformation with an agile solution that scales with the **clients’ needs**. Our main area of expertise includes eCommerce consulting and development for B2C, B2B, and Multi-vendor Marketplaces.</br>
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
}
],
"require": {
"php": "^8.0 || ^8.1",
"php": "^8.0",
"bitbag/shipping-export-plugin": "^3.0",
"msztorc/php-dpd-api": "^2.1",
"sylius/sylius": "~1.12.0 || ~1.13.0",
Expand Down
86 changes: 86 additions & 0 deletions doc/installation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# Installation

## Overview:
GENERAL
- [Requirements](#requirements)
- [Composer](#composer)
- [Basic configuration](#basic-configuration)
---
ADDITIONAL
- [Known Issues](#known-issues)
---

## Requirements:
We work on stable, supported and up-to-date versions of packages. We recommend you to do the same.

| Package | Version |
|---------------|-----------------|
| PHP | \>=8.0 |
| sylius/sylius | 1.12.x - 1.13.x |
| MySQL | \>= 5.7 |
| NodeJS | \>= 18.x |

## Composer:
```bash
composer require bitbag/dpd-pl-shipping-export-plugin
```

## Basic configuration:
Add plugin dependencies to your `config/bundles.php` file:

```php
# config/bundles.php

return [
...
BitBag\DpdPlShippingExportPlugin\DpdPlShippingExportPlugin::class => ['all' => true]
];
```

Import required config in your `config/packages/_sylius.yaml` file:

```yaml
# config/packages/_sylius.yaml

imports:
...
- { resource: "@DpdPlShippingExportPlugin/Resources/config/config.yml" }
```
Import routing in your `config/routes.yaml` file:
```yaml
# config/routes.yaml
bitbag_shipping_export_plugin:
resource: "@BitBagSyliusShippingExportPlugin/Resources/config/routing.yml"
prefix: /admin
```

### Update your database
First, please run legacy-versioned migrations by using command:
```bash
bin/console doctrine:migrations:migrate
```

After migration, please create a new diff migration and update database:
```bash
bin/console doctrine:migrations:diff
bin/console doctrine:migrations:migrate
```

### Clear application cache by using command:
```bash
bin/console cache:clear
```
**Note:** If you are running it on production, add the `-e prod` flag to this command.

## Known issues
### Translations not displaying correctly
For incorrectly displayed translations, execute the command:
```bash
bin/console cache:clear
```
### Errors when attempting to export a shipment
- If non-existent postal codes are provided - both in the shipping gateway and during the order,
export of the shipment will not be possible.
- For the plugin to work properly, it is also necessary to add the weight of the products.
9 changes: 8 additions & 1 deletion tests/Application/config/bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
<?php

/*
* This file has been created by developers from BitBag.
* Feel free to contact us once you face any issues or want to start
* You can find more information about us on https://bitbag.io and write us
* an email on hello@bitbag.io.
*/

declare(strict_types=1);

use Symfony\Component\Dotenv\Dotenv;
Expand All @@ -20,4 +27,4 @@

$_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? null) ?: 'dev';
$_SERVER['APP_DEBUG'] = $_SERVER['APP_DEBUG'] ?? $_ENV['APP_DEBUG'] ?? 'prod' !== $_SERVER['APP_ENV'];
$_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = (int) $_SERVER['APP_DEBUG'] || filter_var($_SERVER['APP_DEBUG'], \FILTER_VALIDATE_BOOLEAN) ? '1' : '0';
$_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = (int) $_SERVER['APP_DEBUG'] || filter_var($_SERVER['APP_DEBUG'], \FILTER_VALIDATE_BOOLEAN) ? '1' : '0';
9 changes: 8 additions & 1 deletion tests/Application/public/index.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
<?php

/*
* This file has been created by developers from BitBag.
* Feel free to contact us once you face any issues or want to start
* You can find more information about us on https://bitbag.io and write us
* an email on hello@bitbag.io.
*/

declare(strict_types=1);

use Tests\BitBag\DpdPlShippingExportPlugin\Application\Kernel;
use Symfony\Component\ErrorHandler\Debug;
use Symfony\Component\HttpFoundation\Request;
use Tests\BitBag\DpdPlShippingExportPlugin\Application\Kernel;

require dirname(__DIR__) . '/config/bootstrap.php';

Expand Down

0 comments on commit 08b93e0

Please sign in to comment.