This plugin allows to define shipping rates using weight tables.
-
Run
composer require --no-scripts webgriffe/sylius-table-rate-shipping-plugin: it's normal that the "cache:clear" command, that is executed automatically at the end, fails because you have to do the next steps. -
If they have not been added automatically, you have to add these bundles to
config/bundles.phpfile:Webgriffe\SyliusTableRateShippingPlugin\WebgriffeSyliusTableRateShippingPlugin::class => ['all' => true],
-
Add the plugin's configs by creating the file
config/packages/webgriffe_sylius_table_rate_shipping_plugin.yamlwith the following content:imports: - { resource: "@WebgriffeSyliusTableRateShippingPlugin/config/config.yaml" }
-
Add the plugin's routes by creating the file
config/routes/webgriffe_sylius_table_rate_shipping_plugin.yamlwith the following content:webgriffe_sylius_table_rate_shipping_plugin_admin: resource: "@WebgriffeSyliusTableRateShippingPlugin/config/routes/admin.yaml" prefix: /%sylius_admin.path_name%
-
Finish the installation by updating the database schema:
bin/console cache:clear bin/console doctrine:migrations:migrate
To contribute you need to:
-
Clone this repository into you development environment and go to the plugin's root directory,
-
Then, from the plugin's root directory, run the following commands:
composer install
-
Copy
tests/TestApplication/.envintests/TestApplication/.env.localand set configuration specific for your development environment. -
Link node_modules:
ln -s vendor/sylius/test-application/node_modules node_modules
-
Run docker (create a
compose.override.ymlif you need to customize services):docker-compose up -d
-
Then, from the plugin's root directory, run the following commands:
composer test-app-init
-
Run your local server:
symfony server:ca:install symfony server:start -d
-
Now at http://localhost:8080/ you have a full Sylius testing application which runs the plugin
-
Coding Standard
vendor/bin/ecs check --fix
-
Psalm
vendor/bin/psalm
-
PHPStan
vendor/bin/phpstan analyse
After your changes you must ensure that the tests are still passing.
First setup your test database:
```bash
APP_ENV=test vendor/bin/console doctrine:database:create
APP_ENV=test vendor/bin/console doctrine:migrations:migrate -n
# Optionally load data fixtures
APP_ENV=test vendor/bin/console sylius:fixtures:load -n
```
And build assets:
(cd vendor/sylius/test-application && yarn install)
(cd vendor/sylius/test-application && yarn build)
vendor/bin/console assets:installThe current CI suite runs the following tests:
- PHPUnit
vendor/bin/phpunit- PHPSpec
vendor/bin/phpspec run- Behat (non-JS scenarios)
vendor/bin/behat --strict --tags="~@javascript"-
Behat (JS scenarios)
-
Start Headless Chrome:
google-chrome-stable --enable-automation --disable-background-networking --no-default-browser-check --no-first-run --disable-popup-blocking --disable-default-apps --allow-insecure-localhost --disable-translate --disable-extensions --no-sandbox --enable-features=Metal --headless --remote-debugging-port=9222 --window-size=2880,1800 --proxy-server='direct://' --proxy-bypass-list='*' http://127.0.0.1
- Install SSL certificates (only once needed) and run test application's webserver on
127.0.0.1:8080:
symfony server:ca:install APP_ENV=test symfony server:start --port=8080 --dir=tests/TestApplication/public --daemon
- Run Behat:
vendor/bin/behat --strict --tags="@javascript"
This library is under the MIT license. See the complete license in the LICENSE file.
Developed by Webgriffe®.
