Appearance
Admin Customer Management
Flow ID: AD-04 Module(s): eshop, audience Complexity: Medium Last Updated: 2026-04-03
Business Context
Admin customer management provides CRUD for customer profiles with dual-address support (billing + shipping), order history viewing, loyalty points management, behavioral analytics (referrer, payment preferences, order frequency), GDPR data export/deletion, and audience tag assignment. Customers are segmented into registered, guest, and B2B types with separate listing views.
Entry Points
| Type | Path / Trigger | Controller | Method |
|---|---|---|---|
| Admin | Customer listing | ecommercen/eshop/controllers/Adv_customers_admin.php | index() |
| Admin | Registered only | same | registered() |
| Admin | Guests only | same | unregistered() |
| Admin | B2B only | same | b2b() |
| Admin | Customer detail | same | view($id) |
| Admin | Order history | same | order_history($customerId) |
| AJAX | Customer search | same | search() — JSON autocomplete for order creation |
Key Operations
Customer Listing (index() line 49-124): Paginated grid (default 50 rows) with search/filter persisted in session. Supports sorting by any column. Attaches latest admin note to each customer. Four parallel views for customer types: all, registered, guest, B2B — each with cross-redirect logic if filter doesn't match the view.
Customer Detail/Edit (view() line 206-284):
- Dual address: billing (name, address, city, postal, county, phone) + shipping (sendto_* fields) + company/invoice fields
- Order matching: by customer ID (default) or by email (across duplicate accounts, via
?joined=false) - Loyalty points: if
POINT_SYSTEM.IS_ENABLED, admin can set points directly - Behavioral analytics (if Smart Recommendations enabled): referrer chart, payment method chart, payment way chart, average days between orders + predicted next order date
- Customer class: tiered loyalty grade based on total spend (3 configurable thresholds in registry)
- Matomo visitor profile: async-loaded analytics from Matomo if enabled
Related Data (viewExtras() line 286-294): Email history, top purchased products, wishlist items, admin notes (with authorship), audience tags, personality analytics.
GDPR Compliance:
deleteUser()(line 347): Anonymizes viaSanitize_model->sanitizeAll()exportData()(line 354): Downloads all customer data as JSON (user_data.json)
Exports:
exportSearchedCustomers(): CSV with BOM (ID, guest flag, name, email, phone, points, orders, total spend, creation date)exportViberCustomers(): CSV for Viber marketing campaigns (customer ID, phone, creation date)
Business Rules
| Rule | Description |
|---|---|
| Customer types: registered/guest/B2B | Separate listing views with cross-redirect validation |
| Order matching dual mode | By ID (exact) or by email (across accounts) — toggled via ?joined param |
| Customer class = tiered by spend | 3 tiers from registry: ESHOP_CUSTOMER_GRADE_{1,2,3}_VALUE |
| Loyalty points admin-editable | Only if POINT_SYSTEM.IS_ENABLED |
| Audience tags conditional | Only if SMART_RECOMMENDATIONS.IS_ENABLED_CUSTOMER_TAG |
| Predicted next order | Average days between orders + last order date = prediction |
| Auth: ADVISABLE, ADMIN, or ORDERS role | Line 18-24 |
| Pagination persisted in session | crLimit, crPage, customersSearch session keys |
Data Model
| Table | Purpose |
|---|---|
shop_customer | Customer profiles (billing + shipping + company fields) — 50 columns |
shop_order | Order history per customer |
shop_customer_tag | Audience/behavioral tags — 6.8M rows, 9 tag groups, avg 25.6 tags per tagged customer |
shop_customer_message_history | Email/SMS communication history with 30-day retention cleanup |
shop_customer_sms_marketing | SMS/Viber consent tracking with provider_id field |
shop_customer_campaign | Campaign assignment infrastructure — exists but currently unused (0 rows) |
eshop_notes | Admin-authored internal notes |
shop_wishlist | Customer wishlist items |
shop_customer B2B fields
The shop_customer table includes dedicated B2B columns beyond the standard profile fields:
| Column | Purpose |
|---|---|
company_name | Business/company name |
company_afm | Tax identification number (AFM — Greek VAT number) |
company_doy | Tax office (DOY — Greek tax authority branch) |
profession | Customer's profession/business activity |
shop_customer_tag — Behavioral tagging system
The tagging system is high-volume (6.8M tags in production) with 9 tag groups averaging 25.6 tags per tagged customer. Tags are used for audience segmentation (AD-22), personalized recommendations, and campaign targeting. The volume indicates aggressive automated tagging from browsing behavior, purchase history, and recommendation engine signals.
shop_customer_sms_marketing — SMS/Viber consent
Tracks opt-in consent for SMS and Viber marketing channels. The provider_id field links to the SMS/Viber delivery provider, enabling multi-provider dispatch.
shop_customer_campaign — Campaign infrastructure (unused)
The table schema and model code exist but contain 0 rows in production. This suggests planned but unimplemented campaign assignment functionality, or a deprecated feature that was never activated.
shop_customer_message_history — Communication log
Stores email and SMS message history per customer. A 30-day retention cleanup job periodically purges old records to manage table size.
Client Customization Points
| Override Type | Base File | Override In |
|---|---|---|
| Customer admin controller | ecommercen/eshop/controllers/Adv_customers_admin.php | application/modules/eshop/controllers/ |
viewExtras() method | Same | Client override — add custom data to detail view |
| Customer model | ecommercen/eshop/models/Adv_customer_model.php | application/modules/eshop/models/ |
| Registry tier values | registry table | Per-client DB |
REST API Endpoints
All REST endpoints require JWT authentication. Routes support an optional (\w{2})/ language prefix (e.g., /el/rest/...). POST is used for both create and update operations (not PUT).
Customer (9 operations)
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | /rest/customer/me | JWT | Get authenticated customer's own profile |
| POST | /rest/customer/me | JWT | Update authenticated customer's own profile |
| POST | /rest/customer/me/password | JWT | Change authenticated customer's password |
| GET | /rest/customer/customer | JWT | List customers (paginated, filterable) |
| GET | /rest/customer/customer/item | JWT | Get customer field metadata (schema introspection) |
| GET | /rest/customer/customer/{id} | JWT | Get single customer by ID |
| POST | /rest/customer/customer | JWT | Create new customer |
| POST | /rest/customer/customer/{id} | JWT | Update existing customer |
| DELETE | /rest/customer/customer/{id} | JWT | Delete customer |
CustomerTag (6 operations)
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | /rest/customer/customer-tag | JWT | List customer tags (paginated, filterable) |
| GET | /rest/customer/customer-tag/item | JWT | Get customer tag field metadata |
| GET | /rest/customer/customer-tag/{id} | JWT | Get single customer tag by ID |
| POST | /rest/customer/customer-tag | JWT | Create new customer tag |
| POST | /rest/customer/customer-tag/{id} | JWT | Update existing customer tag |
| DELETE | /rest/customer/customer-tag/{id} | JWT | Delete customer tag |
CustomerSmsMarketing (6 operations)
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | /rest/customer/customer-sms-marketing | JWT | List SMS/Viber marketing consents (paginated, filterable) |
| GET | /rest/customer/customer-sms-marketing/item | JWT | Get SMS marketing field metadata |
| GET | /rest/customer/customer-sms-marketing/{id} | JWT | Get single SMS marketing record by ID |
| POST | /rest/customer/customer-sms-marketing | JWT | Create new SMS marketing consent record |
| POST | /rest/customer/customer-sms-marketing/{id} | JWT | Update existing SMS marketing consent record |
| DELETE | /rest/customer/customer-sms-marketing/{id} | JWT | Delete SMS marketing consent record |
CustomerReview (6 operations)
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | /rest/customer/customer-review | JWT | List customer reviews (paginated, filterable) |
| GET | /rest/customer/customer-review/item | JWT | Get customer review field metadata |
| GET | /rest/customer/customer-review/{id} | JWT | Get single customer review by ID |
| POST | /rest/customer/customer-review | JWT | Create new customer review |
| POST | /rest/customer/customer-review/{id} | JWT | Update existing customer review |
| DELETE | /rest/customer/customer-review/{id} | JWT | Delete customer review |
CustomerCampaign (6 operations)
Note: The
shop_customer_campaigntable has 0 rows in production. This is unused infrastructure for a planned/deprecated campaign assignment feature.
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | /rest/customer/customer-campaign | JWT | List customer campaigns (paginated, filterable) |
| GET | /rest/customer/customer-campaign/item | JWT | Get customer campaign field metadata |
| GET | /rest/customer/customer-campaign/{id} | JWT | Get single customer campaign by ID |
| POST | /rest/customer/customer-campaign | JWT | Create new customer campaign assignment |
| POST | /rest/customer/customer-campaign/{id} | JWT | Update existing customer campaign assignment |
| DELETE | /rest/customer/customer-campaign/{id} | JWT | Delete customer campaign assignment |
CustomerMessageHistory (6 operations)
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | /rest/customer/customer-message-history | JWT | List customer message history (paginated, filterable) |
| GET | /rest/customer/customer-message-history/item | JWT | Get message history field metadata |
| GET | /rest/customer/customer-message-history/{id} | JWT | Get single message history record by ID |
| POST | /rest/customer/customer-message-history | JWT | Create new message history record |
| POST | /rest/customer/customer-message-history/{id} | JWT | Update existing message history record |
| DELETE | /rest/customer/customer-message-history/{id} | JWT | Delete message history record |
Route config: application/config/rest_routes.php lines 598-698. Controllers: src/Rest/Customer/Controllers/ — Customer, CustomerTag, CustomerSmsMarketing, CustomerReview, CustomerCampaign, CustomerMessageHistory.
Related Flows
- CF-10 Customer Auth — customer registration/login (frontend)
- CF-32 Loyalty Points — points earning/spending system
- AD-22 Audience & Campaigns — customer segmentation
- AD-03 Order Management — order history viewing from customer detail
- AD-40 Internal Notes — admin notes per customer (
eshop_notestable) - AD-41 Customer Mail History — email communication log per customer
- AD-23 Gift Cards — gift card orders in customer order history
- AD-54 POS / Phone Orders — manual order creation with customer lookup