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: *
This package is auto-updated.
Last update: 2026-06-17 13:54:27 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.
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. |
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. |
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