Appearance
Marketing Admin & Product Catalogs
Flow ID: AD-42 | Module(s): eshop, audience | Complexity: Medium Last Updated: 2026-04-04
Business Context
The marketing admin module provides tools for creating targeted product catalogs and finding/exporting customer segments. It serves as a lightweight marketing workspace within the admin panel, combining product catalog generation (filtered by vendor and category) with customer audience discovery based on customer tags.
This module integrates with the customer tagging system (Smart Recommendations / Plus) to allow admins to filter customers by tags, view their contact details, and export them as CSV files for use in external marketing platforms (Mailchimp, Meta Ads, etc.).
API Reference
REST Endpoints
No REST API. The marketing admin is a legacy-only feature.
Legacy Admin Routes
| Route | Controller | Method | HTTP | Description |
|---|---|---|---|---|
marketing_admin | Adv_marketing_admin | index | GET | Product catalogs page with vendor/category filters |
marketing_admin/find_customers | Adv_marketing_admin | findCustomers | GET | Customer finder page with tag-based filters |
marketing_admin/export_tags | Adv_marketing_admin | exportTags | GET | Export tagged customers as CSV download |
Code Flow
Product Catalogs Page
- Admin navigates to
marketing_admin. index()loads vendor list (vendors_model::vendorsCombo()), category tree (product_category_model::get_childs_combo()), and active currencies.- Renders the
marketing/catalogsview with filter dropdowns. - The view provides a form-based interface for generating product catalog PDFs or printable pages filtered by vendor and category.
Find Customers
- Admin navigates to
marketing_admin/find_customers. findCustomers()callsgetPersonalizedFilters()from theAdminCustomersTagsFilterstrait.- The trait loads customer tag groups and their values, populating filter dropdowns.
- Renders the
marketing/find_customersview with tag-based filter controls. - The admin selects tag criteria to narrow down customer segments.
Export Customers by Tags
- Admin submits tag filters to
marketing_admin/export_tags. - Feature gate: Checks
registry->value('SMART_RECOMMENDATIONS', 'IS_ENABLED_CUSTOMER_TAG'). Returns 404 if disabled. - Calls
customer_tag_model::getCustomersWithTags($filters)to retrieve matching customers. - Builds a CSV with BOM bytes (for Excel UTF-8 compatibility):
ID;MAIL;PHONE;MOBILE;VALUE. - For each customer:
id,mail,landphone,mobilephone,turnover(formatted number). - Forces download as
customers_{timestamp}.csvusing CI'sforce_download().
Domain Layer
No modern domain layer for the marketing admin itself. The AdminCustomersTagsFilters trait bridges to the audience module's models.
Architecture
| Component | Path | Purpose |
|---|---|---|
Adv_marketing_admin | ecommercen/eshop/controllers/Adv_marketing_admin.php | Admin controller (105 lines) |
AdminCustomersTagsFilters | ecommercen/traits/AdminCustomersTagsFilters.php | Shared trait for loading tag-based customer filters |
product_category_model | ecommercen/eshop/models/ | Category tree for catalog filters |
vendors_model | ecommercen/eshop/models/ | Vendor list for catalog filters |
customer_tag_model | ecommercen/audience/models/ | Customer tags for audience export |
currencies_model | ecommercen/eshop/models/ | Active currencies for catalog display |
| Routes | application/config/routes.php:424-429 | Route definitions |
Data Model
This flow does not own any tables. It reads from:
| Table | Purpose |
|---|---|
shop_vendor / shop_vendor_mui | Vendor list for catalog filters |
shop_product_category / shop_product_category_mui | Category tree for catalog filters |
shop_customer | Customer data for export |
shop_customer_tags | Customer tag assignments |
shop_customer_tag_groups | Tag group definitions |
currencies | Active currency list |
Configuration
| Source | Key | Description |
|---|---|---|
| Registry | SMART_RECOMMENDATIONS / IS_ENABLED_CUSTOMER_TAG | Feature gate for tag-based export |
Required roles: AUTH_ROLE_ADVISABLE, AUTH_ROLE_ADMIN, AUTH_ROLE_MARKETING.
Client Extension Points
- Override controller: Extend
Marketing_admininapplication/modules/eshop/controllers/to add custom catalog formats or export fields. - Override trait: The
AdminCustomersTagsFilterstrait is shared withAdv_audience_admin-- overriding it affects both controllers. - Custom export fields: Override
exportTags()to add custom columns (e.g., loyalty tier, last order date).
Business Rules
- Feature gate: The
exportTagsfunction requiresSMART_RECOMMENDATIONS.IS_ENABLED_CUSTOMER_TAGto be enabled. If disabled, returns 404. - CSV format: Uses semicolon (
;) as delimiter (European locale convention), with BOM bytes for Excel UTF-8 compatibility. - Role restriction: Only accessible to
AUTH_ROLE_MARKETINGand above. - Turnover formatting: Customer value is formatted using
formatNumber()for locale-appropriate decimal display.
Related Flows
- AD-46 Audience Management REST -- Modern REST API for audience/segment management
- AD-04 Customer Management Admin -- Customer detail pages where tags are assigned
- AD-15 Attributes & Tags -- Tag/group definitions used in filters