Skip to content

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

RouteControllerMethodHTTPDescription
marketing_adminAdv_marketing_adminindexGETProduct catalogs page with vendor/category filters
marketing_admin/find_customersAdv_marketing_adminfindCustomersGETCustomer finder page with tag-based filters
marketing_admin/export_tagsAdv_marketing_adminexportTagsGETExport tagged customers as CSV download

Code Flow

Product Catalogs Page

  1. Admin navigates to marketing_admin.
  2. index() loads vendor list (vendors_model::vendorsCombo()), category tree (product_category_model::get_childs_combo()), and active currencies.
  3. Renders the marketing/catalogs view with filter dropdowns.
  4. The view provides a form-based interface for generating product catalog PDFs or printable pages filtered by vendor and category.

Find Customers

  1. Admin navigates to marketing_admin/find_customers.
  2. findCustomers() calls getPersonalizedFilters() from the AdminCustomersTagsFilters trait.
  3. The trait loads customer tag groups and their values, populating filter dropdowns.
  4. Renders the marketing/find_customers view with tag-based filter controls.
  5. The admin selects tag criteria to narrow down customer segments.

Export Customers by Tags

  1. Admin submits tag filters to marketing_admin/export_tags.
  2. Feature gate: Checks registry->value('SMART_RECOMMENDATIONS', 'IS_ENABLED_CUSTOMER_TAG'). Returns 404 if disabled.
  3. Calls customer_tag_model::getCustomersWithTags($filters) to retrieve matching customers.
  4. Builds a CSV with BOM bytes (for Excel UTF-8 compatibility): ID;MAIL;PHONE;MOBILE;VALUE.
  5. For each customer: id, mail, landphone, mobilephone, turnover (formatted number).
  6. Forces download as customers_{timestamp}.csv using CI's force_download().

Domain Layer

No modern domain layer for the marketing admin itself. The AdminCustomersTagsFilters trait bridges to the audience module's models.


Architecture

ComponentPathPurpose
Adv_marketing_adminecommercen/eshop/controllers/Adv_marketing_admin.phpAdmin controller (105 lines)
AdminCustomersTagsFiltersecommercen/traits/AdminCustomersTagsFilters.phpShared trait for loading tag-based customer filters
product_category_modelecommercen/eshop/models/Category tree for catalog filters
vendors_modelecommercen/eshop/models/Vendor list for catalog filters
customer_tag_modelecommercen/audience/models/Customer tags for audience export
currencies_modelecommercen/eshop/models/Active currencies for catalog display
Routesapplication/config/routes.php:424-429Route definitions

Data Model

This flow does not own any tables. It reads from:

TablePurpose
shop_vendor / shop_vendor_muiVendor list for catalog filters
shop_product_category / shop_product_category_muiCategory tree for catalog filters
shop_customerCustomer data for export
shop_customer_tagsCustomer tag assignments
shop_customer_tag_groupsTag group definitions
currenciesActive currency list

Configuration

SourceKeyDescription
RegistrySMART_RECOMMENDATIONS / IS_ENABLED_CUSTOMER_TAGFeature gate for tag-based export

Required roles: AUTH_ROLE_ADVISABLE, AUTH_ROLE_ADMIN, AUTH_ROLE_MARKETING.


Client Extension Points

  • Override controller: Extend Marketing_admin in application/modules/eshop/controllers/ to add custom catalog formats or export fields.
  • Override trait: The AdminCustomersTagsFilters trait is shared with Adv_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

  1. Feature gate: The exportTags function requires SMART_RECOMMENDATIONS.IS_ENABLED_CUSTOMER_TAG to be enabled. If disabled, returns 404.
  2. CSV format: Uses semicolon (;) as delimiter (European locale convention), with BOM bytes for Excel UTF-8 compatibility.
  3. Role restriction: Only accessible to AUTH_ROLE_MARKETING and above.
  4. Turnover formatting: Customer value is formatted using formatNumber() for locale-appropriate decimal display.