mfbv / module-group-price
Per-customer-group base price override. Group price replaces RegularPrice for matching customers and feeds catalog rules, indexers, and downstream price calculations.
Package info
github.com/mohammadbharmal/MFBV_GroupPrice
Type:magento2-module
pkg:composer/mfbv/module-group-price
Requires
- php: ~8.1.0||~8.2.0||~8.3.0||~8.4.0
- magento/framework: >=103.0
- magento/module-catalog: >=104.0
- magento/module-catalog-import-export: >=101.0
- magento/module-catalog-rule: >=101.0
- magento/module-customer: >=103.0
- magento/module-eav: >=102.0
- magento/module-import-export: >=101.0
- magento/module-store: >=101.0
This package is not auto-updated.
Last update: 2026-04-27 15:28:28 UTC
README
Per-customer-group base price override — set a dedicated base price per customer group and website. That price becomes the effective regular price for matching customers, so catalog price rules, the price index, layered navigation, and APIs stay consistent end to end.
| Package | mfbv/module-group-price |
| Module | MFBV_GroupPrice |
| Version | 1.0.0 |
| License | OSL-3.0 (see composer.json) |
| PHP | 8.1, 8.2, 8.3, 8.4 |
Why this extension
Magento’s native Group Price behaves like a discount from the catalog price. MFBV Group Price is built for B2B and multi-segment scenarios where a group’s negotiated price is the new baseline: catalog rules apply on top of that baseline, and the storefront price stack (list vs. special, rules, indexers) treats it as RegularPrice, not a parallel tier.
Features at a glance
- Admin Advanced Pricing — Dynamic rows under Advanced Pricing to assign customer group + price per website scope.
- Global on/off — Stores → Configuration → Catalog → Group Price → Enable Group Price hides admin UI, ignores saves, and restores default catalog behavior when disabled.
- REST API — Full CRUD-style access: list, upsert, and delete group prices by SKU (admin token + ACL).
- Product import — Native catalog product CSV extended with
_group_price_*columns; validation and sample file include the new fields. - Indexer integration — Hooks into catalog product price and catalog rule indexers plus dimensional price paths (simple and grouped), so listings, Elasticsearch/OpenSearch buckets, and cart/checkout match the storefront plugin layer.
- Performance-minded — Bulk repository reads for indexer runs; per-request in-memory resolution; optional Update by Schedule on price/rule indexers recommended for large catalogs.
Notable technical details
These points matter for merchants, agencies, and reviewers:
- RegularPrice replacement — A
RegularPriceplugin resolves the group-aware amount before catalog rules; unconfigured groups fall back to the normal catalog price. - Catalog rules use the group base —
CatalogRuleIndexerPluginrebases rule output so percentage/fixed rules apply from the group price, not the global list price. - Price index correctness —
ProductPriceIndexerPluginandDimensionalIndexGroupPricePluginalignfinal_price/min_price/max_priceper customer group so category pages and search filters are not wrong for logged-in segments. - Declarative schema — Data lives in
mfbv_group_pricewith FKs to product, customer group, and website; unique per(entity_id, customer_group_id, website_id). - Import semantics — Group prices are processed after product import bunches (aligned with tier price–style workflows); behavior respects module enable flag and import mode.
- ACL —
MFBV_GroupPrice::manage(REST + admin operations) andMFBV_GroupPrice::config(system configuration). - Compatibility awareness — Third-party RegularPrice plugins (e.g. B2B shared catalog, Amasty/Mirasvit pricing) may need
sortOrderreview inetc/di.xml; MSI does not conflict.
Requirements
- Magento 2.4.x (tested on 2.4.5–2.4.7-class stacks)
- PHP 8.1+
- MySQL 8.0+ or MariaDB 10.6+
- Modules:
Magento_Catalog,Magento_CatalogImportExport,Magento_ImportExport,Magento_CatalogRule,Magento_Customer(seecomposer.jsonfor version constraints)
Installation
Composer (recommended)
composer require mfbv/module-group-price bin/magento module:enable MFBV_GroupPrice bin/magento setup:upgrade bin/magento setup:di:compile bin/magento cache:flush
Manual
- Copy the
GroupPricepackage underapp/code/MFBV/GroupPrice/. - Run:
bin/magento module:enable MFBV_GroupPrice bin/magento setup:upgrade bin/magento setup:di:compile bin/magento indexer:reindex bin/magento cache:flush
setup:upgrade creates the mfbv_group_price table from etc/db_schema.xml.
Configuration
Stores → Configuration → Catalog → Group Price → General → Enable Group Price
When disabled: storefront uses default catalog prices only, admin group price fields are hidden, and saves/imports do not apply group rows.
Admin usage
- Edit a product in Admin.
- Open Advanced Pricing (link above the Price field).
- In Group Prices, use Add to set Customer Group and Price (per website as shown in the form).
- Leave a group unset to keep the global catalog price for that segment.
- Save the product.
Grant roles Catalog → Manage Customer Group Prices and Catalog → Group Price Configuration as needed under System → User Roles.
Product import (CSV)
The catalog product import adds these columns (also present in the downloadable sample when the module is enabled):
| Column | Purpose |
|---|---|
_group_price_website |
Website code (or all where applicable) |
_group_price_customer_group |
Customer group code or all |
_group_price_price |
Group base price |
Validation runs with the standard product import validator pipeline.
REST API
All routes require an admin integration or session with permission MFBV_GroupPrice::manage.
| Method | Endpoint |
|---|---|
GET |
/V1/products/:sku/group-prices/:websiteId |
POST |
/V1/products/:sku/group-prices (JSON body with customer_group_id, website_id, value) |
DELETE |
/V1/products/:sku/group-prices/:groupId/:websiteId |
See Api/GroupPriceManagementInterface.php and etc/webapi.xml for the service contract.
Price stack (simplified)
RegularPrice::getValue() → [plugin: group price if configured]
↓
Catalog rule price → Special price → Base / Final price
Indexers mirror this so indexed prices match runtime resolution for each customer group.
Indexer and performance
For high-volume catalogs, set both indexers to Update by Schedule to avoid long synchronous reindex on admin saves:
bin/magento indexer:set-mode schedule catalog_product_price bin/magento indexer:set-mode schedule catalogrule_rule bin/magento indexer:status
Typical overhead on full reindex is moderate (single-digit to low teens percent vs. baseline); background mode avoids blocking the admin UI.
Storefront caching: Magento already varies by customer group where required; no extra cache keys are introduced by this module for that reason alone.
Uninstall
bin/magento module:disable MFBV_GroupPrice bin/magento setup:upgrade bin/magento setup:di:compile bin/magento cache:flush
Declarative schema removes mfbv_group_price when the module is disabled and setup:upgrade runs.
Compatibility matrix
| Area | Notes |
|---|---|
| Elasticsearch / OpenSearch | Supported via price indexer plugins. |
| GraphQL / PWA Studio | RegularPrice resolution applies where core resolves catalog prices. |
| MSI | No direct interaction. |
| Magento B2B / other pricing modules | Review plugin sortOrder on RegularPrice and related types. |
Support and updates
For licensed / commercial deployments, use the support channel provided by MFBV (ticket portal, email, or partner agreement). Include Magento version, PHP version, module version (composer show mfbv/module-group-price), and steps to reproduce when reporting issues.
Changelog
1.0.0
- Initial release: admin Advanced Pricing UI,
mfbv_group_pricestorage, REST API, import columns, price and catalog-rule indexer integration, dimensional index support for grouped products.
License
This software is licensed under the Open Software License 3.0 (OSL-3.0). The full text is in LICENSE. SPDX identifier: OSL-3.0.