SyliusCon 2025
Early Bird Deal
LogoLogo
🛣️ Roadmap💻 Sylius Demo💬 Community Slack
  • Sylius Documentation
  • Sylius Plugins
  • Sylius Stack
  • 📖Sylius 2.0 Documentation
    • Organization
      • Release Cycle
      • Backwards Compatibility Promise
      • Sylius Team
      • Sylius Roadmap
  • Getting Started with Sylius
    • Installation
    • Basic Configuration
    • Shipping & Payment
    • First Product
    • Customizing the Shop
    • Customizing Business Logic
    • Using API
    • Installing Plugins
    • Deployment
    • Summary
  • The Book
    • Introduction to Sylius
    • Installation
      • System Requirements
      • Sylius CE Installation
        • Sylius CE Installation with Docker
      • ➕Sylius Plus Installation
      • Upgrading Sylius CE
      • Upgrading Sylius Plus
    • Architecture
      • Architecture Overview
      • Architectural Drivers
      • Resource Layer
      • State Machine
      • Translations
      • E-Mails
      • Contact
      • Fixtures
      • Events
    • Configuration
      • Channels
      • Locales
      • Currencies
    • Customers
      • Customer & ShopUser
      • ➕Customer Pools
      • AdminUser
      • Addresses
        • Countries
        • Zones
        • Addresses
        • Address Book
    • Products
      • Products
      • Product Reviews
      • Product Associations
      • Attributes
      • Pricing
      • Catalog Promotions
      • Taxons
      • Inventory
      • ➕Multi-Source Inventory
      • Search
    • Carts & Orders
      • Orders
      • Cart flow
      • Taxation
      • Adjustments
      • Cart Promotions
      • Coupons
      • Payments
      • 🧩Invoices
      • Shipments
    • Support
    • Contributing
      • Contributing Code
        • Submitting a Patch
        • ⚠️Security Issues
        • Coding Standards
        • Conventions
        • Sylius License and Trademark
      • Contributing Translations
      • Key Contributors
  • The Customization Guide
    • Customizing Models
      • How to add a custom model?
      • How to add a custom translatable model?
    • Customizing Forms
      • How to add a live form for a custom model?
    • Customizing Styles
    • Customizing Validation
    • Customizing Menus
    • Customizing Templates
    • Customizing Translations
    • Customizing Flashes
    • Customizing State Machines
    • Customizing Grids
    • Customizing Fixtures
    • Customizing API
    • Customizing Serialization of API
    • Customizing Payments
      • How to integrate a Payment Gateway as a Plugin?
  • 🧑‍🍳The Cookbook
  • How to resize images?
  • How to add one image to an entity?
  • How to add multiple images to an entity?
  • Sylius 1.X Documentation
    • 📓Sylius 1.x Documentation
Powered by GitBook
LogoLogo

Developer

  • Community
  • Online Course

About

  • Team

© 2025 Sylius. All Rights Reserved

On this page
  • Managing Customer Pools
  • How to create a Customer Pool programmatically?

Was this helpful?

Edit on GitHub
  1. The Book
  2. Customers

Customer Pools

PreviousCustomer & ShopUserNextAdminUser

Last updated 5 months ago

Was this helpful?

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 behavior happening in Sylius CE). This feature allows you to sell via multiple channels, creating an illusion of shopping in completely different stores, while you still have one administration panel.

Managing Customer Pools

Customer pool management is available in the administration panel in the Customers section.

New customer pools can be added through the admin UI in the section Customer Pools or via fixtures, as it is configured in src/Resource/config/fixtures.yaml for the plus fixture suite.

The configuration looks like that:

sylius_fixtures:
    suites:
        default:
            fixtures:
                customer_pool:
                    priority: 1
                    options:
                        custom:
                            default:
                                name: "Default"
                                code: "default"

Customer Pool can be assigned to a Channel, but only during its _creation_ in the Admin panel. Currently, it is not possible to modify the User Pool after the channel is created, as it would lead to certain edge cases with customers losing access to channels, after improper admin operations.

There is also a possibility to choose a specific customer pool during channel or shop customer creation in fixtures (remember to create a customer pool before assigning it to a channel):

sylius_fixtures:
    suites:
        default:
            fixtures:
                channel:
                    options:
                        custom:
                            mobile:
                                name: "Mobile"
                                code: "mobile"
                                locales:
                                    - "en_US"
                                currencies:
                                    - "USD"
                                customer_pool: "default"
                                enabled: true
                shop_user:
                    options:
                        custom:
                            -
                                email: "[email protected]"
                                first_name: "John"
                                last_name: "Doe"
                                password: "sylius"
                                customer_pool: "default"

How to create a Customer Pool programmatically?

As usual, use a factory. The only required fields for the CustomerPool entity are code and name, provide them before adding it to the repository.

/** @var CustomerPoolInterface $customerPool */
$customerPool = $this->container->get('sylius_plus.factory.customer_pool')->createNew();

$customerPool->setCode('HOME_POOL');
$customerPool->setName('Home Pool');

$this->container->get('sylius_plus.repository.customer_pool')->add($customerPool);

To assign a Customer Pool to a Channel programmatically use this simple trick:

// given that you have a $channel from repository, and a $customerPool just created above

$channel->setCustomerPool($customerPool);
➕