tavy315/sylius-sales-representatives-plugin
最新稳定版本:v0.2.3
Composer 安装命令:
composer require tavy315/sylius-sales-representatives-plugin
包简介
Sylius plugin for managing sales representatives.
关键字:
README 文档
README
This plugin for Sylius allows you to manage sales representatives.
Supports Doctrine ORM driver only.
Screenshots
Sales Representatives:
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-sales-representatives-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\SyliusSalesRepresentativesPlugin\Tavy315SyliusSalesRepresentativesPlugin::class => ['all' => true], ];
Step 3: Configure the plugin
# config/packages/tavy315_sylius_sales_representatives.yaml imports: - { resource: "@Tavy315SyliusSalesRepresentativesPlugin/Resources/config/app/config.yaml" }
Step 4: Customize models
Read more about Sylius models customization here.
Customize your Customer model
Add a Tavy315\SyliusSalesRepresentativesPlugin\Model\Customer\SalesRepresentativeTrait 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\SyliusSalesRepresentativesPlugin\Model\Customer\SalesRepresentativeAwareInterface; use Tavy315\SyliusSalesRepresentativesPlugin\Model\Customer\SalesRepresentativeTrait; /** * @ORM\Entity * @ORM\Table(name="sylius_customer") */ class Customer extends BaseCustomer implements SalesRepresentativeAwareInterface { use SalesRepresentativeTrait; }
Step 5: Update your database schema
$ php bin/console doctrine:migrations:diff $ php bin/console doctrine:migrations:migrate
Usage
From now, you can attach a sales representative to any customer; our use case is to send a copy of the order confirmation email when customer makes an order.
统计信息
- 总下载量: 1.79k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-05-19

