CSV import and export
The Import/Export package adds the pricesystem_product_customer_matrix entity to Magento's data transfer tools. It handles matrix headers, product-condition rows and direct customer assignments.
composer require mageb2b/pricesystem-productcustomermatrix-importexport:*
php bin/magento setup:upgrade
php bin/magento cache:flush
Export a small matrix from System > Data Transfer > Export and use it as the template for the target store. Keep the matrix identifier consistent across its conditions and customer assignments.
File format
The CSV uses a hierarchical row format: one header row per matrix, followed by optional child rows for its product conditions and customer assignments.
Matrix header columns:
| Column | Meaning |
|---|---|
id |
Matrix identifier — set it to keep the matrix's child rows together |
name |
Matrix name |
customer_attribute_value |
Value matched against the configured customer attribute |
website_id |
Website scope |
qty, price |
Minimum quantity and price value |
price_application_type |
Fixed, surcharge or discount type |
price_attribute_id |
Base price source for relative calculations |
attributes_relation |
AND or OR for the product conditions |
priority |
Priority for competing matrices |
valid_from, valid_to |
Optional active period |
Child-row columns (on their own rows beneath the matrix header):
| Column | Meaning |
|---|---|
matrix_attribute_attribute, matrix_attribute_value, matrix_attribute_operator |
One product condition per row |
matrix_customer_customer_id |
A directly assigned customer |
matrix_customer_date_from, matrix_customer_date_to |
Optional assignment period |
Command-line import and export
php bin/magento pricesystem:import-productcustomermatrix <import_path>
php bin/magento pricesystem:export-productcustomermatrix
Verify before importing
Before a full import, verify:
- product attribute codes and values;
- SKU and category identifiers used by conditions;
- AND or OR relation;
- customer identifiers and assignment dates;
- website, quantity, application type and matrix dates.
Import one matrix first. Test a matching and nonmatching product and customer before processing the complete file.