conneqt / module-special-prices
N/A
Package info
git.dev.epartment.nl/conneqt/m2/special-prices
Type:magento2-module
pkg:composer/conneqt/module-special-prices
Requires
- php: >=8.1
- conneqt/m2-base: *
- magento/framework: *
Requires (Dev)
- phpunit/phpunit: ^10.5
Suggests
None
Provides
None
Conflicts
None
Replaces
None
- dev-develop
- 1.8.0
- 1.7.1
- 1.7.0.1
- 1.7.0
- 1.6.14
- 1.6.13
- 1.6.12
- 1.6.11
- 1.6.10
- 1.6.9
- 1.6.8
- 1.6.7
- 1.6.6
- 1.6.5
- 1.6.4
- 1.6.3
- 1.6.2
- 1.6.1
- 1.6.0
- 1.5.3
- 1.5.2
- 1.5.1
- 1.5.0
- 1.4.20
- 1.4.19
- 1.4.18
- 1.4.17.1
- 1.4.17
- 1.4.16
- 1.4.15
- 1.4.14
- 1.4.13
- 1.4.12
- 1.4.11
- 1.4.10
- 1.4.9.1
- 1.4.9
- 1.4.8
- 1.4.7
- 1.4.6
- 1.4.5
- 1.4.4
- 1.4.3
- 1.4.2
- 1.4.1
- 1.4.0
- 1.3.0
- 1.2.9
- 1.2.8
- 1.2.7
- 1.2.6
- 1.2.5
- 1.2.4
- 1.2.3
- 1.2.2
- 1.2.1
- 1.2.0
- 1.1.7
- 1.1.6
- 1.1.5
- 1.1.4
- 1.1.3
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.13
- 1.0.12
- 1.0.11
- 1.0.10
- 1.0.9
- 1.0.8
- 1.0.7
- 1.0.6
- 1.0.4
- 1.0.2
- 1.0.1
- 1.0.0
- dev-feature/admin-rule-editing
- dev-feature/php8.4-support
- dev-feature/GNN-354
- dev-feature/code-fixes
- dev-feature/bug-fixes
- dev-feature/improved-special-price-cache-clearing
- dev-feature/fix-broken-cleanup
- dev-feature/frontend-price-overview
- dev-feature/quality-of-life-improvements
This package is auto-updated.
Last update: 2026-09-02 09:45:06 UTC
README
Magento 2 module for customer-specific and group-specific pricing.
It stores price rules in a custom table and applies them during product price rendering, tier price rendering, cart/quote calculation, and customer-facing pricing overview pages.
What this module does
This module lets you define prices for:
- a specific customer or a customer group
- a specific SKU or a product group attribute
- optional quantity breaks
- optional date ranges
- optional price list references per store/customer
- either an explicit price or a discount percentage
Typical use cases:
- customer contracts
- B2B assortment pricing
- store-specific price lists
- tier pricing outside Magento's native tier-price model
- guest pricing based on configured price-list references
How it works
- Special-price rows are stored in the
conneqt_special_pricestable. - Each row can target one customer dimension (
customer_idorcustomer_group) and one product dimension (product_skuorproduct_group). - When Magento renders a product price or recalculates a quote, the module resolves the active customer values, product values, quantity, date range, price-list references, and optional priority.
- Matching rows are converted into concrete prices:
priceis used directlydiscountis calculated against the current base/final price
- If multiple rows match, the configured
price_rangedecides whether the lowest, highest, or average value wins. - The resolved price is then used in product price display, tier price display, and quote item custom prices.
Main features
- Web API to add and remove special prices
- Support for customer-based and customer-group-based pricing
- Support for SKU-based and product-group-based matching
- Optional guest pricing
- Optional tier pricing via
qty - Optional priority filtering
- Optional Redis-backed result caching
- Customer account page with a pricing overview
- Admin pricing overview grid
- Automatic cleanup cron for stale rows
Requirements
- PHP
>=8.1 - Magento 2 module:
conneqt/module-special-prices - Dependency:
conneqt/m2-base
Configuration
Magento Admin path:
Stores -> Configuration -> Conneqt -> Special Prices
Important settings include:
- Enabled: turns the pricing logic on or off
- Force Special Price: forces the resolved special price even when Magento would normally keep a lower base price
- Price Range: choose
lowest,highest, oraveragewhen multiple rules match - Guest Customer Special Prices: allows guest users to receive prices from guest price-list mappings
- Customer Id Attribute: customer attribute used to resolve
customer_id - Customer Group Id Attribute: customer attribute used to resolve
customer_group - Customer Group Separator: splits a single customer attribute into multiple group values
- Product Group Attribute: product attribute used to resolve
product_group - Update Price: updates an existing matching row instead of inserting a new one
- Price List References: maps store IDs to guest/customer price-list references
- Priority Enabled / Priority Order: limits matches to the min/max priority value
- Enable Convert Currency: converts the resolved price through Magento currency conversion
- Discount Enabled: writes discount values to quote items when a special price is applied
- Custom Price Page Enabled: adds a customer account page with active prices
- Price Result Caching: enables Redis-backed caching of price calculation results
- Automatic cleanup: removes rows that have not been updated for a configured number of days
Entry points
Frontend
- Customer account link:
special-prices/pricing/overview - Layout handle:
special_prices_pricing_overview - Template:
view/frontend/templates/pricing_overview.phtml
Adminhtml
- Menu entry:
Catalog -> Pricing Overview - Route frontName:
conneqt_specialprices - Main grid UI component:
view/adminhtml/ui_component/conneqt_pricing_listing.xml
Web API
POST /V1/special-prices/addPricesPOST /V1/special-prices/removePricePOST /V1/special-prices/removeCustomerPricesPOST /V1/special-prices/removeProductPrices
Detailed request/response documentation lives in API.md.
Required fields on a price rule
No field on the rule form is required on its own — the requirements are combinations, and the rule form now enforces them before it submits, with the same messages the save controller returns:
| Rule | Fields |
|---|---|
| At least one must be filled | price or discount |
| At least one must be filled | product_sku or product_group |
| At most one may be filled | customer_id or customer_group |
| At most one may be filled | product_sku or product_group |
Leaving both customer fields empty is valid and creates a generic fallback rule that applies to every customer, including guests. Leaving both product fields empty is not: such a row can never match, because the product filter only matches a row on its SKU or on its product group.
date_to must not be earlier than date_from, and a filled product_sku / customer_id
must resolve to an existing product / customer. Those are checked on save.
Configurable products: parent and child rules
A price rule on a configurable SKU does not price its simple products by itself. To cover the simples, enable Apply this rule to child products of the configurable on the rule form. The form then lists the child products with a checkbox each, so a rule can cover all of them or only a selection.
On save:
- Selected children without a rule get their own SKU-targeted rule, linked to the parent
through
parent_entity_id. - Selected children that already have their own matching rule (same customer target, quantity and price-list reference) adopt the parent's values and become linked to it. Those children start deselected, so an existing rule is never taken over unless the admin selects it explicitly.
- Deselected children lose the rule they received from this parent.
- Changing a value on the parent (for example the discount) is propagated to every linked child, so re-opening the rule and editing it updates all covered products at once.
Editing a linked child rule directly breaks its link to the parent as soon as one of its matching or value fields changes; the description does not break the link. Deleting a parent rule asks whether the linked child rules should be deleted as well or kept and unlinked.
Important files
| File | What it does |
|---|---|
etc/db_schema.xml | Declares the conneqt_special_prices table and its matching fields such as customer, product, qty, date range, price list, and priority. |
etc/di.xml | Registers the module's API implementations, pricing overrides, and plugins that hook into Magento pricing and quote logic. |
etc/webapi.xml | Declares the REST endpoints for adding and removing prices. |
etc/adminhtml/system.xml | Defines all admin configuration options for pricing, caching, frontend page visibility, and cleanup. |
Helper/PriceAdd.php | Main write service for inserting/updating prices, deduplicating input, cache invalidation, and cleanup behavior. |
Helper/PriceRemove.php | Removes price rows by customer/product scope. |
Helper/PriceGet.php | Builds the matching query for current customer, product, quantity, date range, price list, and priority. |
Helper/PriceList.php | Resolves active price-list references from store config and the customer price_list_reference attribute. |
Model/PriceCalculator.php | Converts matched rows into final prices and applies the configured lowest/highest/average strategy. |
Pricing/Price/SpecialPrice.php | Magento price model that resolves special prices for logged-in and guest customers during storefront rendering. |
Pricing/Price/TierPriceExtension.php | Extends Magento tier pricing so special-price rows with qty > 1 appear as tier prices. |
Pricing/Price/BasePriceExtension.php | Adjusts Magento base-price selection and optionally forces the special price. |
Plugin/QuotePrices.php | Applies the resolved special price to quote items so checkout totals use the same pricing logic. |
Plugin/ResultCache.php | Caches price-calculation results in Redis using SKU, customer, quantity, and price-list references in the cache key. |
Plugin/CustomerSessionContext.php | Pushes customer data into HTTP context so pricing can work during cached storefront rendering. |
Block/PricingOverview.php | Builds the customer account price overview page. |
Ui/DataProvider/Pricing/PricingDataProvider.php | Feeds the admin pricing overview grid with joined customer and product data. |
Model/ChildProductRuleResolver.php | Resolves the child products of a configurable rule and their default selection state. |
Model/LinkedChildRuleManager.php | Manages the parent_entity_id link: propagating, adopting, unlinking and deleting child rules. |
Setup/Patch/Data/CustomerPriceListAttribute.php | Adds the customer attribute price_list_reference, used to extend store-level price-list mappings. |
Cron/CleanTableCronjob.php | Daily cleanup job for rows that have not been updated recently. |
Tests
Test/Unitruns against the module on its own — no Magento installation, no database — and is what this repository's GitLab pipeline runs.Test/Integrationcovers the SQL matching semantics and the configurable parent/child save path, and needs a Magento project with an integration test database.
See Test/README.md for the exact commands and for the traps involved in
running the integration suite against an existing project.
Related extension packages
The following packages extend or integrate with this module:
conneqt/module-infor-special-pricesconneqt/module-multivers-special-pricesconneqt/module-special-prices-search-ultimateconneqt/module-sap-service-layer-special-pricesconneqt/module-gransier-special-prices
API documentation
- Local API guide:
API.md - Postman reference: https://documenter.getpostman.com/view/18025045/2sA2xfYZFp
Notes and limitations
The codebase is primarily focused on simple product pricing flows. Based on the current source, the following areas should be verified carefully in a project before production rollout:
- configurable products
- grouped products
- tax interactions
- interaction with Magento catalog price rules and other discount logic