GENERAL
BACKEND
FRONTEND
ADDITIONAL
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 require bitbag/inpost-pluginAdd plugin dependencies to your config/bundles.php file:
# config/bundles.php
return [
...
BitBag\SyliusInPostPlugin\BitBagSyliusInPostPlugin::class => ['all' => true],
];Import required config in your config/packages/_sylius.yaml file:
# config/packages/_sylius.yaml
imports:
...
- { resource: "@BitBagSyliusInPostPlugin/Resources/config/config.yml" }Import routing in your config/routes.yaml file:
# config/routes.yaml
bitbag_sylius_inpost_plugin:
resource: "@BitBagSyliusInPostPlugin/Resources/config/routes.yml"This plugin was made on top of SyliusShippingExportPlugin.
Usually, Symfony Flex, if you agree, automatically adds the configuration files:
bitbag_shipping_export_plugin.yamlto theconfig/packagesdirectorybitbag_shipping_export_plugin.yamlto theconfig/routesdirectory
It also adding the appropriate entry to config/bundles.php.
If it doesn't, so please remember to do the same as above for SyliusShippingExportPlugin configuration.
You can implement entity configuration by using both xml-mapping and attribute-mapping. Depending on your preference, choose either one or the other:
First, please run legacy-versioned migrations by using command:
bin/console doctrine:migrations:migrateAfter migration, please create a new diff migration and update database:
bin/console doctrine:migrations:diff
bin/console doctrine:migrations:migrateNote: If you are running it on production, add the -e prod flag to this command.
Add the controller from the following instruction:
bin/console cache:clearNote: If you are running it on production, add the -e prod flag to this command.
Copy required templates into correct directories in your project.
AdminBundle (templates/bundles/SyliusAdminBundle):
vendor/bitbag/inpost-plugin/tests/Application/templates/bundles/SyliusAdminBundle/Order/Show/_addresses.html.twig
vendor/bitbag/inpost-plugin/tests/Application/templates/bundles/SyliusAdminBundle/ShippingMethod/_form.html.twig
ShopBundle (templates/bundles/SyliusShopBundle):
vendor/bitbag/inpost-plugin/tests/Application/templates/bundles/SyliusShopBundle/Checkout/SelectShipping/_choice.html.twig
vendor/bitbag/inpost-plugin/tests/Application/templates/bundles/SyliusShopBundle/Common/Order/_addresses.html.twig
vendor/bitbag/inpost-plugin/tests/Application/templates/bundles/SyliusShopBundle/Grid/Action/quickReturn.html.twig
Please setup your webpack.config.js file to require the plugin's webpack configuration. To do so, please put the line below somewhere on top of your webpack.config.js file:
const [bitbagInPostShop, bitbagInPostAdmin] = require('./vendor/bitbag/inpost-plugin/webpack.config.js');As next step, please add the imported consts into final module exports:
module.exports = [..., bitbagInPostShop, bitbagInPostAdmin];Add the asset configuration into config/packages/assets.yaml:
framework:
assets:
packages:
...
inpost_shop:
json_manifest_path: '%kernel.project_dir%/public/build/bitbag/inpost/shop/manifest.json'
inpost_admin:
json_manifest_path: '%kernel.project_dir%/public/build/bitbag/inpost/admin/manifest.json'Add the webpack configuration into config/packages/webpack_encore.yaml:
webpack_encore:
output_path: '%kernel.project_dir%/public/build/default'
builds:
...
inpost_admin: '%kernel.project_dir%/public/build/bitbag/inpost/admin'
inpost_shop: '%kernel.project_dir%/public/build/bitbag/inpost/shop'bin/console assets:install
bin/console sylius:theme:assets:installor (may cause errors):
bin/console assets:install --symlink
bin/console sylius:theme:assets:install --symlinkyarn install
yarn encore dev # or prod, depends on your environmentIn the .env file, the default parcel size and label type can be specified by adding:
BITBAG_INPOST_DEFAULT_PARCEL_TEMPLATE='medium'
BITBAG_INPOST_DEFAULT_LABEL_TYPE='normal'- 'small'
- 'medium'
- 'large'
- 'normal'
- 'A6'
$ composer install
$ cd tests/Application
$ yarn install
$ yarn encore dev
$ bin/console assets:install public -e test
$ bin/console doctrine:database:create -e test
$ bin/console doctrine:schema:create -e test
$ bin/console server:run 127.0.0.1:8080 -d public -e test
$ open http://localhost:8080
$ vendor/bin/behat
$ vendor/bin/phpspec runFor incorrectly displayed translations, execute the command:
bin/console cache:clearNote: If you are running it on production, add the -e prod flag to this command.