Creating Matrices
Step-by-step guide to creating product-customer pricing matrices with attribute matching and customer assignments.
Quick Start
- Catalog >Product-Customer Matrices → Click "Add New"
- Fill basic info (name, priority, dates, attributes relation)
- Configure customer matching attributes
- Save matrix
- Add products with prices and quantity tiers
- Assign customers (automatic via attributes OR manual)
- Activate matrix
Creating a Matrix Container
Step 1: Navigate to Grid
Admin Panel >Catalog > Product-Customer Matrices
Grid shows existing matrices with:
- Name
- Active status
- Priority
- Attributes Relation (AND/OR)
- Date range
- Website
- Number of products
- Number of assigned customers
- Actions
Step 2: Add New Matrix
Click Add New button.
Step 3: Fill Basic Information
Name (Required)
Descriptive name for the matrix.
Examples:
- "Wholesale US 2025"
- "VIP Contract - ACME Corp"
- "California Regional Pricing"
- "Black Friday Campaign"
- "Partner Pricing - Company A"
Best Practices:
- Include year for time-bound pricing
- Include customer segment/tier
- Avoid generic names ("Test", "Matrix 1")
Is Active (Required)
Toggle matrix on/off.
- Yes: Matrix evaluated for customer matching
- No: Matrix ignored, even if customers match attributes
Use Case: Prepare matrices in advance, activate when ready.
Priority (Optional)
Numeric value (0-999) for conflict resolution.
- Default: 0
- Higher = precedence
- Examples:
- 10: Standard pricing
- 20: Promotional pricing
- 30: VIP/contract pricing
- 40: Emergency overrides
Leave gaps (10, 20, 30) not consecutive (10, 11, 12) to allow insertions later.
From Date (Optional)
Start date for matrix validity.
- Format: YYYY-MM-DD
- NULL: Active immediately
- Example:
2025-06-01(Summer campaign start)
To Date (Optional)
End date for matrix validity.
- Format: YYYY-MM-DD
- NULL: No expiration
- Must be >= From Date
- Example:
2025-08-31(Summer campaign end)
Website (Required)
Website scope for matrix.
- Default: Default website
- Multi-website: Select specific site
- Effect: Only customers on this website match
Attributes Relation (Required)
Logic for combining multiple attributes.
- AND (Default): ALL filled attributes must match
- OR: ANY filled attribute matches
AND Example:
Attributes: - Customer Group: Wholesale (2) - Country: US - Region: California Customer must be: Wholesale AND US AND CaliforniaOR Example:
Attributes: - Customer Group: Wholesale (2) - Customer Group: VIP (4) Customer must be: Wholesale OR VIPBest Practice: Use AND for precise targeting, OR for broad targeting.
Customer Matching Attributes
These fields enable automatic customer assignment. When customers match attributes, they're auto-assigned to matrix.
Important: Attributes work together based on attributes_relation field (AND/OR).
Customer Group
Match by customer group ID.
Field: Multiple select dropdown
Example:
- Select "Wholesale" (ID 2) and "VIP" (ID 4)
- AND mode: Customer must be in BOTH groups (impossible - customers belong to one group)
- OR mode: Customer can be Wholesale OR VIP (correct usage)
Use Case:
- OR mode: Multiple groups (Wholesale, VIP, Partner)
- AND mode: Single group + other attributes
Company
Match by company name from customer account.
Field: Text input
Example: "ACME Corporation"
Matching:
- Loose mode: "ACME" matches "ACME Corp", "acme corporation"
- Exact mode: Must be exactly "ACME Corporation"
Use Case: B2B contract pricing for specific companies
Tax/VAT Number
Match by tax identification number.
Field: Text input
Example: "DE123456789"
Use Case:
- EU VAT-registered businesses
- Tax-exempt organizations
- Verified business accounts
Notes:
- Usually exact match (even in loose mode)
- Format-sensitive (include dashes/spaces as stored)
Postcode
Match by billing or shipping postcode.
Field: Text input
Example: "90210"
Use Case:
- ZIP code-based regional pricing
- Local delivery zones
Notes:
- Checks both billing AND shipping addresses
- Match if EITHER address matches
- Loose mode: "9021" matches "90210"
Region
Match by state/province/region.
Field: Text input
Example: "California"
Use Case:
- State-specific pricing
- Regional campaigns
- Tax jurisdictions
Data Quality:
- Magento stores region as text (not ID)
- "California" vs "CA" might not match
- Standardize or use loose matching
Country
Match by country code.
Field: Text input (2-letter ISO code)
Example: "US"
Use Case:
- Country-specific pricing
- Currency localization
- Regulatory compliance
Notes:
- Always 2-letter ISO codes (US, DE, GB, FR, etc.)
- Exact match even in loose mode
- Most common matching attribute
Step 4: Save Matrix
Click Save button.
Matrix container created! Now add products.
Adding Products to Matrix
Method 1: From Matrix Edit Page
- Edit matrix → Navigate to "Products" tab
- Click "Add Products"
- Select products from grid (checkboxes)
- Set prices for each product:
- Quantity: Tier threshold (e.g., 1, 10, 50, 100)
- Price: Price value
- From Date: Start date (optional, overrides matrix date)
- To Date: End date (optional, overrides matrix date)
- Save
Method 2: Bulk Import
Use the CSV Import/Export Add-On for bulk changes:
The Magento ImportExport entity PricesystemProductCustomerMatrix uses a structured CSV format (matrix rows + related attribute/customer rows).
Tip: Export first and use the exported CSV as your template (it matches your installed version/config).
Method 3: Product Attribute Rules
Configure automatic product selection based on attributes.
Example:
- Category: "Summer Collection"
- Attribute Set: "Apparel"
- Custom Attribute: "wholesale_eligible = Yes"
Result: All products matching attributes automatically included.
Creating Quantity Tiers
Add multiple price entries for same product with different qty values.
Example: Graduated Wholesale Pricing
Matrix: "Wholesale 2025" Product: "Widget Pro"
| Qty Tier | Price | Description |
|---|---|---|
| 1 | $100 | Standard price |
| 10 | $95 | Bulk discount (5%) |
| 50 | $90 | Volume discount (10%) |
| 100 | $85 | Major volume (15%) |
Customer orders 75 units: Gets $90/unit (Qty 50 tier applies)
How Qty Tiers Work:
- System finds largest qty tier <= cart quantity
- If customer orders 25 units: Uses qty=10 tier ($95)
- If customer orders 150 units: Uses qty=100 tier ($85)
Assigning Customers to Matrix
Method 1: Automatic Assignment (Recommended)
Configure matching attributes on matrix (see above).
Example:
Matrix: "Wholesale US 2025" Attributes Relation: AND Customer Group: Wholesale (2) Country: US Region: CaliforniaResult: All wholesale customers in California, USA auto-assigned.
Configuration Required:
enable_auto_assign_customers = Yes
Trigger Points:
- Customer logs in
- Customer updates profile
- Customer group changes
- Admin manually triggers re-evaluation
- Cron job (if configured)
Method 2: Manual Customer Assignment
Matrix Edit Page >Customers Tab:
- Click "Add Customers"
- Search and select customers
- Optional: Set customer-specific dates:
- From Date: Override matrix from_date for this customer
- To Date: Override matrix to_date for this customer
- Save
Result: Only selected customers assigned.
Use Cases:
- Override automatic rules for specific customers
- Exception handling (VIP gets special matrix)
- Testing with test customers
Customer-Specific Date Example:
Matrix Dates: 2025-01-01 to 2025-12-31 Customer #123 Override: 2025-01-01 to 2025-06-30 (6-month contract) Customer #456 Override: NULL (uses matrix dates)Common Workflows
Workflow 1: Wholesale Pricing
Goal: Create wholesale pricing for US customers in 2025.
Create matrix:
- Name: "Wholesale US 2025"
- Active: Yes
- Priority: 15
- Attributes Relation: AND
- From Date: 2025-01-01
- To Date: 2025-12-31
- Customer Group: Wholesale (2)
- Country: US
Add products:
- Import CSV with all products
- Or add manually via Products tab
- Set quantity tiers: qty=1, qty=10, qty=50, qty=100
Test:
- Log in as wholesale customer in US
- Verify prices display
- Test quantity tier changes in cart
Workflow 2: Seasonal Campaign
Goal: Black Friday sale (Nov 29 - Dec 2, 2025) for all customers.
Create matrix:
- Name: "Black Friday 2025"
- Active: Yes
- Priority: 25 (higher than standard pricing)
- From Date: 2025-11-29
- To Date: 2025-12-02
- Customer Group: General (1) - all customers
- No other attributes (all customers match)
Add products:
- Select sale products
- Set discounted prices (single qty=1 tier)
Automatic:
- Activates Nov 29
- Deactivates Dec 3
- No manual intervention
Workflow 3: Multi-Company B2B Pricing
Goal: 3 partner companies with different pricing.
Create matrices:
- Matrix A: "Partner - ACME Corp" (Company = "ACME", Priority 30)
- Matrix B: "Partner - XYZ Inc" (Company = "XYZ", Priority 30)
- Matrix C: "Partner - Global LLC" (Company = "Global", Priority 30)
Add products:
- Same products across all matrices
- Different prices per matrix (negotiated rates)
Result:
- ACME employees see ACME pricing
- XYZ employees see XYZ pricing
- Global employees see Global pricing
Workflow 4: Regional + Group Targeting
Goal: California wholesale customers get special pricing on California-specific products.
Create matrix:
- Name: "CA Wholesale 2025"
- Active: Yes
- Priority: 20
- Attributes Relation: AND
- Customer Group: Wholesale (2)
- Country: US
- Region: "California"
Add products:
- Select California-themed products only
- Set wholesale prices with qty tiers
Result:
- California wholesale: See special prices
- California retail: Don't see (not wholesale)
- Texas wholesale: Don't see (not California)
Workflow 5: VIP + Extra Savings
Goal: VIP customers get 15% off everything, plus 25% off selected products.
Create matrices:
- Matrix 1: "VIP Base Pricing" (Priority 30, all products, 15% discount)
- Matrix 2: "VIP Extra Savings" (Priority 32, selected products, 25% discount)
- Both: Customer Group = VIP (4)
Configuration:
merge_matrix_qtys = Yes(best price wins)
Result:
- VIP customers get 15% off all products (Matrix 1)
- VIP customers get 25% off selected products (Matrix 2 wins for those products)
Workflow 6: Contract with Customer Override
Goal: Annual contract with ACME Corp, but Customer #12345 has 6-month trial.
Create matrix:
- Name: "Contract - ACME Corp 2025"
- Active: Yes
- Priority: 35
- From Date: 2025-01-01
- To Date: 2025-12-31
- Company: "ACME"
Add products:
- Contract products with negotiated prices
Assign customers:
- Automatic: All ACME employees via company match
- Manual: Customer #12345 with override dates: 2025-01-01 to 2025-06-30
Result:
- Most ACME employees: 2025-01-01 to 2025-12-31
- Customer #12345: 2025-01-01 to 2025-06-30 (6-month trial)
Multi-Attribute Matching Examples
Example 1: AND Logic (Precise Targeting)
Matrix Configuration:
Attributes Relation: AND Customer Group: Wholesale (2) Country: US Region: CaliforniaCustomer Matching:
Customer A: - Group: Wholesale ✓ - Country: US ✓ - Region: California ✓ → MATCH (all three attributes match) Customer B: - Group: Wholesale ✓ - Country: US ✓ - Region: Texas ✗ → NO MATCH (region doesn't match) Customer C: - Group: Retail ✗ - Country: US ✓ - Region: California ✓ → NO MATCH (group doesn't match)Example 2: OR Logic (Broad Targeting)
Matrix Configuration:
Attributes Relation: OR Customer Group: Wholesale (2), VIP (4)Customer Matching:
Customer A: - Group: Wholesale ✓ → MATCH (one attribute matches) Customer B: - Group: VIP ✓ → MATCH (one attribute matches) Customer C: - Group: Retail ✗ → NO MATCH (no attributes match)Example 3: Complex Scenario
Goal: Wholesale customers in California OR VIP customers anywhere.
Solution: Create TWO matrices:
Matrix 1: "CA Wholesale" (Priority 20) - Attributes Relation: AND - Group: Wholesale - Country: US - Region: California Matrix 2: "VIP All Regions" (Priority 30) - Attributes Relation: AND - Group: VIP - (no location attributes)Result:
- California wholesale customers: Matrix 1
- VIP customers (any location): Matrix 2
- VIP customers in California: Matrix 2 wins (higher priority)
Testing Matrix Assignment
Test Plan
Create test matrix:
- Name: "Test - Wholesale US"
- Customer Group: Wholesale (2)
- Country: US
- Active: Yes
Create test customer:
- Group: Wholesale
- Country: US
- Company: "Test Co"
Test assignment:
- Log in as test customer
- Check assigned matrices (admin: Customer Edit >Matrices tab)
- Verify matrix appears
Test exclusion:
- Change customer country to DE
- Log out, log back in
- Verify matrix NOT assigned
Test re-assignment:
- Change customer back to US
- Log out, log back in
- Verify matrix re-assigned
Priority System in Action
Scenario: Customer Matches Multiple Matrices
Setup:
- Customer: John Doe (Wholesale group, California, ACME Corp)
- Matrix A: "Wholesale 2025" (Priority 15) - Matches group
- Matrix B: "California Special" (Priority 20) - Matches region
- Matrix C: "ACME Contract" (Priority 30) - Matches company
Configuration 1: merge_matrix_qtys = No
- Result: Only Matrix C applies (highest priority)
- Product X: Uses Matrix C prices only
Configuration 2: merge_matrix_qtys = Yes
- Result: Merge qty tiers from all three
- Matrix A: qty=1 ($100), qty=10 ($95)
- Matrix B: qty=25 ($92)
- Matrix C: qty=50 ($88)
- Customer gets: qty=1 ($100), qty=10 ($95), qty=25 ($92), qty=50 ($88)
- Best price from each matrix at each tier!
Troubleshooting
Matrix Not Showing for Customer
Checklist:
- ✓ Is Active = Yes?
- ✓ Date range valid? (from_date <= today <= to_date)
- ✓ Website matches?
- ✓ Customer matches attributes (check attributes_relation: AND/OR)?
- ✓ Auto-assignment enabled? (
enable_auto_assign_customers = Yes) - ✓ Customer logged in recently? (triggers evaluation)
- ✓ Cache cleared?
Debug SQL:
-- Check customer attributes SELECT entity_id, group_id, email, company FROM customer_entity WHERE entity_id = 123; -- Check matrix matching attributes SELECT m.id, m.name, m.priority, m.attributes_relation, ma.attribute_code, ma.attribute_value FROM pricesystem_product_customer_matrix m LEFT JOIN pricesystem_product_customer_matrix_attribute ma ON ma.matrix_id = m.id WHERE m.is_active = 1 ORDER BY m.priority DESC; -- Check assignments SELECT * FROM pricesystem_product_customer_matrix_customer WHERE customer_id = 123;Wrong Prices Displaying
Checklist:
- ✓ Multiple matrices match? (check priority)
- ✓ Merge config? (
merge_matrix_qtyssetting) - ✓ Product exists in matrix?
- ✓ Quantity tier matches cart quantity?
- ✓ Date ranges valid? (matrix + customer-specific)
- ✓ Other pricesystem modules active? (check price resolution order)
Attributes Not Matching
Common Issues:
- AND vs OR: Check
attributes_relationfield - Data quality: Company name mismatch ("ACME" vs "ACME Corp")
- Match mode: Loose vs Exact (check
match_exact_typeconfig) - Empty attributes: Ensure at least one attribute filled
Best Practices
Naming Conventions
- Include year: "Wholesale 2025"
- Include segment: "VIP Contract - ACME"
- Include region: "California Regional"
- Avoid generics: "Test", "Matrix 1"
Priority Management
- Use tiers: 0, 10, 20, 30 (not 1, 2, 3, 4)
- Leave gaps: Insert later without renumbering
- Document hierarchy: Team reference
Attribute Selection
- Start simple: Group + Country
- Add complexity: Region, Company
- Test thoroughly: Edge cases
- Document logic: Why these attributes?
Performance
- Don't over-create: 100s OK, 1000s might slow
- Use specific attributes: Group faster than Company matching
- Cache enabled: Production setting
- Monitor: Regular audits
Next Steps
- Matrix Pricing System - Deep dive into core architecture
- Multi-Attribute Matching - Advanced attribute logic
- Priority Resolution - Conflict resolution strategies
