This plugin is work in progress, do not use this plugin to other purpose then testing, especially do not use this plugin in production environment.
The fastest method to run dev environment is to use docker:
docker compose up -d
docker compose exec app make init
Change BL_TOKEN
in tests/Application/.env
.
Now you can set plugin in admin panel on your localhost: http://localhost/admin
, login is sylius
, password is the same as login. You can run sync commands:
docker compose exec app make symfony baselinker:orders:add
docker compose exec app make symfony baselinker:orders:payments
docker compose exec app make symfony baselinker:orders:statuses
or tests:
docker compose exec app make test
The plugin can be installed in an existing or new sylius-standard application.
-
Run:
composer require kmatulewicz/sylius-baselinker
-
Check presence of plugin entry in
config/bundles.php
:SyliusBaselinkerPlugin\SyliusBaselinkerPlugin::class => ['all' => true],
-
Add to
config/packages/_sylius.yaml
:- { resource: "@SyliusBaselinkerPlugin/Resources/config/config.yml" }
-
Add to
config/routes.yaml
:sylius_baselinker: resource: "@SyliusBaselinkerPlugin/Resources/config/routing.yml"
-
Add
SyliusBaselinkerPlugin\Entity\OrderInterface
andSyliusBaselinkerPlugin\Entity\OrderTrait
tosrc/Entity/Order/Order.php
. Final result should be similar to:// src/Entity/Order/Order.php // [...] use SyliusBaselinkerPlugin\Entity\OrderInterface; use SyliusBaselinkerPlugin\Entity\OrderTrait; // [...] class Order extends BaseOrder implements OrderInterface { use OrderTrait; }
-
Add
BL_TOKEN
to your .env file. Token can be found in Baselinker > My Account > API. If you do not have a token already, create a new one. Final result should be similar to:BL_TOKEN=token_copied_from_baselinker
-
Execute migrations:
bin/console doctrine:migrations:migrate
-
Rebuild the cache to display all new translations correctly:
bin/console cache:clear bin/console cache:warmup
-
Go to admin panel and set order source and statuses associations on Baselinker section.
This plugin provides commands:
baselinker:orders:add
Adds not synchronized shop orders to Baselinker.baselinker:orders:payments
Adds to Baselinker payments done in shop after last synchronization.baselinker:orders:statuses
Checks for status changes of synchronized orders. Applies shop order status change to corresponding Baselinker status.