setono/sylius-peak-wms-plugin

Integrate your store with Peak WMS

dev-master / 1.0.x-dev 2024-06-17 07:11 UTC

This package is auto-updated.

Last update: 2024-06-17 13:50:32 UTC


README

Sylius plugin for Peak WMS

Latest Version Software License Build Status Code Coverage

Installation

composer require setono/sylius-peak-wms-plugin

Add plugin class to your bundles.php

Make sure you add it before SyliusGridBundle, otherwise you'll get You have requested a non-existent parameter "setono_sylius_peak_wms.model.remote_event.class". exception.

<?php
$bundles = [
    // ...
    Setono\SyliusPeakWMSPlugin\SetonoSyliusPeakWMSPlugin::class => ['all' => true],
    Sylius\Bundle\GridBundle\SyliusGridBundle::class => ['all' => true],
    // ...
];

Import routing

# config/routes/setono_sylius_peak_wms.yaml
setono_sylius_peak_wms:
    resource: "@SetonoSyliusPeakWMSPlugin/Resources/config/routes.yaml"

or if your app doesn't use locales:

# config/routes/setono_sylius_peak_wms.yaml
setono_sylius_peak_wms:
    resource: "@SetonoSyliusPeakWMSPlugin/Resources/config/routes_no_locale.yaml"

Add environment variables

Add the following variables to your .env file:

###> setono/sylius-peak-wms-plugin ###
PEAK_WMS_API_KEY=YOUR_API_KEY
###< setono/sylius-peak-wms-plugin ###

Extend entities

Order entity

<?php

# src/Entity/Order/Order.php

declare(strict_types=1);

namespace App\Entity\Order;

use Setono\SyliusPeakWMSPlugin\Model\OrderInterface as PeakWMSOrderInterface;
use Setono\SyliusPeakWMSPlugin\Model\OrderTrait as PeakWMSOrderTrait;
use Sylius\Component\Core\Model\Order as BaseOrder;
use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Entity
 *
 * @ORM\Table(name="sylius_order")
 */
class Order extends BaseOrder implements PeakWMSOrderInterface
{
    use PeakWMSOrderTrait;
}

Update your database:

php bin/console doctrine:migrations:diff
php bin/console doctrine:migrations:migrate

Development

(cd tests/Application && yarn install)
(cd tests/Application && yarn build)
(cd tests/Application && bin/console assets:install)

(cd tests/Application && bin/console doctrine:database:create)
(cd tests/Application && bin/console doctrine:schema:create)

(cd tests/Application && bin/console sylius:fixtures:load -n)

(cd tests/Application && symfony serve -d)

vendor/bin/expose token <your expose token>
vendor/bin/expose default-server free # If you are not paying for Expose
vendor/bin/expose share https://127.0.0.1:8000