Customer Management & CRM
Relevant source files
The following files were used as context for generating this wiki page:
- src/Core/Domain/Customer/CustomerConfiguration.php
- src/Core/Domain/CustomerService/ValueObject/CustomerThreadStatus.php
- src/Core/Domain/Customer/ValueObject/CustomerId.php
- src/Core/Domain/Customer/QueryResult/EditableCustomer.php
- src/Core/Domain/CustomerService/Command/AddOrderCustomerMessageCommand.php
- README.md
PrestaShop provides a Customer Relationship Management (CRM) system to manage shopper data, communication history, and service interactions. The system centralizes customer identities, allows for granular configuration of account behaviors, and tracks support threads associated with orders.
Sources: README.md:16-20, src/Core/Domain/Customer/CustomerConfiguration.php
Customer Domain Model
The core of the CRM revolves around the Customer domain, which handles unique identification and editable profiles. The system uses a specialized value object, CustomerId, to ensure type safety when referencing shoppers across different modules.
Customer Identification and Data
The EditableCustomer class serves as a Data Transfer Object (DTO) for retrieving and modifying shopper information. It includes personal details, account status, and marketing preferences.
The diagram shows the relationship between a customer's editable data and their unique domain identifier.
Sources: src/Core/Domain/Customer/ValueObject/CustomerId.php:25-50, src/Core/Domain/Customer/QueryResult/EditableCustomer.php:35-100
Customer Service and Communication
The CRM includes a customer service module to manage inquiries and messages. Communication is organized into threads, which can be linked to specific orders.
Thread Management
Customer interactions are categorized by status to help merchants track resolution progress. The CustomerThreadStatus value object defines the standard states for these interactions.
| Status Constant | Description |
|---|---|
STATUS_OPEN | The thread is currently active and requires attention. |
STATUS_CLOSED | The issue has been resolved and the thread is archived. |
STATUS_PENDING_1 | Indicates a secondary state (e.g., waiting for customer). |
STATUS_PENDING_2 | Indicates a tertiary state (e.g., waiting for internal review). |
Sources: src/Core/Domain/CustomerService/ValueObject/CustomerThreadStatus.php:28-40
Order-Linked Messaging
Support messages can be programmatically added to specific orders using the AddOrderCustomerMessageCommand. This links the CRM interaction directly to the commercial transaction.
This flow illustrates how a message is attached to a specific order within the CRM.
Sources: src/Core/Domain/CustomerService/Command/AddOrderCustomerMessageCommand.php:30-65
Global Customer Configuration
The system provides a central configuration interface to define global behaviors for all customers. This includes registration requirements, account features, and marketing settings.
Key Configuration Parameters
The CustomerConfiguration class manages the following shop-wide settings:
| Configuration Key | Type | Description |
|---|---|---|
is_b2b_enabled | bool | Activates Business-to-Business features like company fields. |
ask_for_birth_date | bool | Requires customers to provide their date of birth. |
ask_for_partner_offers | bool | Displays opt-in for third-party marketing offers. |
enable_password_renewal | bool | Allows customers to reset their passwords. |
send_email_after_registration | bool | Triggers a welcome email upon account creation. |
Sources: src/Core/Domain/Customer/CustomerConfiguration.php:40-150
Summary
The Customer Management and CRM system in PrestaShop facilitates the full lifecycle of a shopper, from account configuration and registration to post-purchase support. By using domain-driven design components like CustomerId and CustomerThreadStatus, the project ensures that shopper data remains consistent and structured across the ecommerce platform.
Sources: src/Core/Domain/Customer/CustomerConfiguration.php, src/Core/Domain/CustomerService/ValueObject/CustomerThreadStatus.php