定制 kmatulewicz/sylius-baselinker 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

kmatulewicz/sylius-baselinker

Composer 安装命令:

composer require kmatulewicz/sylius-baselinker

包简介

Baselinker API plugin for Sylius.

README 文档

README

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.

How to test plugin

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

Installation

The plugin can be installed in an existing or new sylius-standard application.

  1. Run:

    composer require kmatulewicz/sylius-baselinker
  2. Check presence of plugin entry in config/bundles.php:

    SyliusBaselinkerPlugin\SyliusBaselinkerPlugin::class => ['all' => true],
    
  3. Add to config/packages/_sylius.yaml:

    - { resource: "@SyliusBaselinkerPlugin/Resources/config/config.yml" }
  4. Add to config/routes.yaml:

    sylius_baselinker:
        resource: "@SyliusBaselinkerPlugin/Resources/config/routing.yml"
  5. Add SyliusBaselinkerPlugin\Entity\OrderInterface and SyliusBaselinkerPlugin\Entity\OrderTrait to src/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;
    }
  6. 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
    
  7. Execute migrations:

    bin/console doctrine:migrations:migrate
  8. Rebuild the cache to display all new translations correctly:

    bin/console cache:clear
    bin/console cache:warmup
  9. Go to admin panel and set order source and statuses associations on Baselinker section.

Usage

This plugin provides commands:

  1. baselinker:orders:add Adds not synchronized shop orders to Baselinker.
  2. baselinker:orders:payments Adds to Baselinker payments done in shop after last synchronization.
  3. baselinker:orders:statuses Checks for status changes of synchronized orders. Applies shop order status change to corresponding Baselinker status.

统计信息

  • 总下载量: 7
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-04-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固