tavy315/sylius-customer-pools-plugin
Composer 安装命令:
composer require tavy315/sylius-customer-pools-plugin
包简介
Sylius plugin for managing customer pools.
关键字:
README 文档
README
This plugin for Sylius allows you to manage customer pools.
Supports Doctrine ORM driver only.
Customer Pool is a collection of Customers that is assigned to a specific channel. Thanks to this concept, if you have two channels, each of them has a separate customer pool, then customers that have accounts in channel A, and have not registered in channel B, will not be able to log in to channel B with credentials they have specified in channel A (which is the behaviour happening in Sylius open source edition). This feature allows you to sell via multiple channels, creating a illusion of shopping in completely different stores, while you still have one administration panel.
Screenshots
Customer Pools:
Customer:
Installation
Step 1: Install the plugin
Open a command console, enter your project directory and execute the following command to download the latest stable version of this plugin:
$ composer require tavy315/sylius-customer-pools-plugin
This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.
Step 2: Enable the plugin
Then, enable the plugin by adding it to the list of registered plugins/bundles in config/bundles.php file of your project:
<?php $bundles = [ Tavy315\SyliusCustomerPoolsPlugin\Tavy315SyliusCustomerPoolsPlugin::class => ['all' => true], ];
Step 3: Configure the plugin
# config/packages/tavy315_sylius_customer_pools.yaml imports: - { resource: "@Tavy315SyliusCustomerPoolsPlugin/Resources/config/app/config.yaml" }
Step 4: Customize models
Read more about Sylius models customization here.
Customize your Customer model
Add a Tavy315\SyliusCustomerPoolsPlugin\Model\Customer\CustomerPoolTrait trait to your App\Entity\Customer\Customer class.
-
If you use
annotationsmapping:<?php // src/Entity/Customer/Customer.php namespace App\Entity\Customer; use Doctrine\ORM\Mapping as ORM; use Sylius\Component\Core\Model\Customer as BaseCustomer; use Tavy315\SyliusCustomerPoolsPlugin\Model\Customer\CustomerPoolAwareInterface; use Tavy315\SyliusCustomerPoolsPlugin\Model\Customer\CustomerPoolTrait; /** * @ORM\Entity * @ORM\Table(name="sylius_customer") */ class Customer extends BaseCustomer implements CustomerPoolAwareInterface { use CustomerPoolTrait; }
Step 5: Update your database schema
$ php bin/console doctrine:migrations:diff $ php bin/console doctrine:migrations:migrate
Step 6: Add UserChecker to security.yaml
This will restrict the user to login to a Channel having different Customer Pool setup. If no Customer Pool is selected on the customer or current channel, it will skip the check and allow login.
security: firewalls: shop: user_checker: tavy315_sylius_customer_pools.security.user_checker
Usage
From now, you can attach a customer pool to any customer.
tavy315/sylius-customer-pools-plugin 适用场景与选型建议
tavy315/sylius-customer-pools-plugin 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 415 次下载、GitHub Stars 达 1, 最近一次更新时间为 2021 年 01 月 12 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「sylius」 「sylius-plugin」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 tavy315/sylius-customer-pools-plugin 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 tavy315/sylius-customer-pools-plugin 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 tavy315/sylius-customer-pools-plugin 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Implementation of the Omnibus Directive for Sylius application.
Bulk export of sylius resources
Sylius plugin that integrates Addwish
Setono example plugin for Sylius.
Will translate fragments of text automatically
Use price tiers in your Sylius store.
统计信息
- 总下载量: 415
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 16
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-01-12

