承接 sylius/admin-order-creation-plugin 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

sylius/admin-order-creation-plugin

最新稳定版本:v0.16.0

Composer 安装命令:

composer require sylius/admin-order-creation-plugin

包简介

Sylius Plugin for order creation in Admin panel

README 文档

README

⚠️ BEWARE! This repository has been deprecated and will not be maintained or evolved by the Sylius Team. You can still use it with compatible Sylius versions, but at your own risk, as no bugs will be fixed on it.

Sylius Logo.

Admin Order Creation Plugin

This plugin allows to create an order in admin panel.

Screenshot showing the order creation page, Shipments&Payments section

Business value

So far it was up to the Customer to place an order using available product variants as well as payment and shipping methods.

The whole process of placing an order is not that obvious, however. For some reason a Customer may feel a little bit confused when a promotion is no longer available or shipping method is not eligible for given area. Here comes Admin Order Creation Plugin.

Briefly speaking, it allows an Administrator to place or reorder an order in the name of a Customer. It helps them solve even more of Customers' fundamental problems and equips an Administrator with basic tools making creating an order possible.

Admin Order Creation Plugin processes are strongly based on standard Order model taken from SyliusCoreBundle. The only things that differ are order creation context and business requirements. Right now it is up to the Administrator to provide a channel, locale and currency in which an Order is created. What's more, the Administrator is able to add a discount for any item or the whole Order, which is, technically speaking, a new type of Sylius Adjustments.

After creating an Order via Admin panel, this new Order is listed like any other order placed via Sylius.

Installation

Beware!

This installation instruction assumes that you're using Symfony Flex. If you don't, take a look at the legacy installation instruction. However, we strongly encourage you to use Symfony Flex, it's much quicker! :)

  1. Require plugin with composer:

    composer require sylius/admin-order-creation-plugin

    Remember to allow community recipes with composer config extra.symfony.allow-contrib true or during plugin installation process

  2. Copy Sylius templates overridden in plugin to your templates directory (e.g templates/bundles/):

    mkdir -p templates/bundles/SyliusAdminBundle/
    cp -R vendor/sylius/admin-order-creation-plugin/src/Resources/views/SyliusAdminBundle/* templates/bundles/SyliusAdminBundle/
  3. Override repositories

    1. Create repository classes
      mkdir src/Repository
      touch src/Repository/CustomerRepository.php
      touch src/Repository/ProductVariantRepository.php
    2. Paste the following content to the src/Repository/CustomerRepository.php:
      <?php
      
      declare(strict_types=1);
      
      namespace App\Repository;
      
      use Sylius\AdminOrderCreationPlugin\Doctrine\ORM\CustomerRepositoryInterface;
      use Sylius\AdminOrderCreationPlugin\Doctrine\ORM\CustomerRepositoryTrait;
      use Sylius\Bundle\CoreBundle\Doctrine\ORM\CustomerRepository as BaseCustomerRepository;
      
      final class CustomerRepository extends BaseCustomerRepository implements CustomerRepositoryInterface
      {
          use CustomerRepositoryTrait;
      }
    3. Paste the following content to the src/Repository/ProductVariantRepository.php:
      <?php
      
      declare(strict_types=1);
      
      namespace App\Repository;
      
      use Sylius\AdminOrderCreationPlugin\Doctrine\ORM\ProductVariantRepositoryInterface;
      use Sylius\AdminOrderCreationPlugin\Doctrine\ORM\ProductVariantRepositoryTrait;
      use Sylius\Bundle\CoreBundle\Doctrine\ORM\ProductVariantRepository as BaseProductVariantRepository;
      
      final class ProductVariantRepository extends BaseProductVariantRepository implements ProductVariantRepositoryInterface
      {
          use ProductVariantRepositoryTrait;
      }
    4. Configure repositories in config/packages/_sylius.yaml:
     sylius_customer:
         resources:
             customer:
                 classes:
                     model: App\Entity\Customer\Customer
    +                repository: App\Repository\CustomerRepository
    
     sylius_product:
         resources:
             product_variant:
                 classes:
                     model: App\Entity\Product\ProductVariant
    +                repository: App\Repository\ProductVariantRepository

Extension points

Admin Order Creation Plugin makes it possible to add custom discount during order creation - thus some of Order Show templates need to be replaced with those placed in Resources/views package.

Payment link generation and sending process is based on logic placed in the PaymentLinkCreationListener class. Thus, it can be easily replaced with suitable implementation.

Adjustments set is not closed and strictly defined - adding custom adjustment means defining a new constant in the AdjustmentType class.

Significant part of Reorder Processing is inspired by official Sylius Customer Reorder Plugin. In case of the need for more processors, just add new class implementing ReorderProcessor interface, declare it in reorder_processing.xml file and match it with a proper tag.

Admin Order Creation process is based on Symfony Forms. To find out more about Symfony Forms extension possibilities, check out Symfony Docs.

Security issues

If you think that you have found a security issue, please do not use the issue tracker and do not post it publicly. Instead, all security issues must be sent to security@sylius.com.

sylius/admin-order-creation-plugin 适用场景与选型建议

sylius/admin-order-creation-plugin 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 649.95k 次下载、GitHub Stars 达 58, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「symfony」 「e-commerce」 「sylius」 「sylius-plugin」 「admin order creation」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 sylius/admin-order-creation-plugin 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 sylius/admin-order-creation-plugin 我们能提供哪些服务?
定制开发 / 二次开发

基于 sylius/admin-order-creation-plugin 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 649.95k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 58
  • 点击次数: 20
  • 依赖项目数: 4
  • 推荐数: 0

GitHub 信息

  • Stars: 58
  • Watchers: 14
  • Forks: 53
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 未知