conneqt/module-multivers-special-prices
Composer 安装命令:
composer require conneqt/module-multivers-special-prices
包简介
Multivers (Unit4) special price integration for conneqt/module-special-prices
README 文档
README
Magento 2 module that integrates Unit4 Multivers ERP pricing into the conneqt/module-special-prices framework. It calls the Multivers CalcSpecPriceCommand REST API to retrieve customer-specific prices and plugs in via PriceCalculatorInterface.
Requirements
- PHP >= 8.1
conneqt/module-special-prices^1.6guzzlehttp/guzzle^7.11
Installation
composer require conneqt/module-multivers-special-prices
bin/magento module:enable Conneqt_MultiversSpecialPrices
bin/magento setup:upgrade
bin/magento setup:di:compile
Configuration
Stores > Configuration > Conneqt > Multivers Special Prices
| Group | Field | Description |
|---|---|---|
| API | Base URL | Root URL of the Multivers web service, e.g. https://yourdomain/V23 |
| API | Database | Multivers administration/database code used in API paths |
| API | OAuth Token URL | Full URL of the OAuth 2.0 token endpoint (ROPC grant) |
| API | Client ID / Secret | OAuth client credentials |
| API | Username / Password | Resource owner credentials (ROPC) |
| API | Connection / Response Timeout | Seconds before aborting a request |
| Attribute Mapping | Multivers Customer ID Attribute | Customer EAV attribute code holding the Multivers customer ID (default: multivers_customer_id) |
| Attribute Mapping | Multivers Product ID Attribute | Product attribute code mapping to the Multivers item code (default: sku) |
| Pricing | Currency Code | Multivers currency code, e.g. EUR. Leave blank to use the store's base currency |
| Pricing | VAT Included | When Yes, prices from Multivers already include VAT — align Magento tax config accordingly |
| Pricing | Project ID | Optional Multivers project ID appended to every request |
| Pricing | Fallback on Missing Customer ID | When Yes, customers without a Multivers ID see the base price instead of a hard error |
| Logging | Log API Requests/Responses | Writes every CalcSpecPriceCommand call to system.log. Disable in production |
Use Test Connection in the API group to verify credentials without leaving the config screen.
Customer attribute
A data patch (AddMultiversCustomerIdAttribute) creates the multivers_customer_id varchar attribute on the customer entity and makes it available in the admin customer grid and edit form. Populate it per-customer with the matching Multivers customer ID.
How it works
PriceCalculator::calculate()resolves the Multivers customer ID from the configured attribute and the product ID from the configured attribute (fallback: SKU).- It calls
CalcSpecPriceCommandviaPriceApi. - Price resolution: if
price > 0use it directly; ifdiscount > 0derive from base price; otherwise return base price. - The parent module's
ResultCacheplugin handles Redis caching of results — no duplication here. - The OAuth bearer token is cached in Magento's config cache pool, respecting the
expires_inTTL from the token response. - Tier prices are not supported (
CalcSpecPriceCommandis single-qty only);calculateTierPricesreturnsnullto let the base module fall through.
API endpoint
POST api/{database}/CalcSpecPriceCommand
?customerId={customerId}
&productId={productId}
¤cyId={currencyId}
&quantity={quantity}
&orderDate={orderDate}
&vatIncluded={0|1}
&projectId={projectId}
Response: { "discount": float, "price": float, "stockTransferPrice": float }
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: proprietary
- 更新时间: 2026-06-26