Important
You are browsing the documentation for version 3.1 of OroCommerce, OroCRM and OroPlatform, which is no longer maintained. Read version 5.1 (the latest LTS version) of the Oro documentation to get up-to-date information.
See our Release Process documentation for more information on the currently supported and upcoming releases.
Pricing Strategy¶
To combine prices for Customers, there are two predefined Pricing Strategies:
Merge by priority
Minimal prices
To create your own strategy, implement the PriceCombiningStrategyInterface interface and register the service with the ‘oro_pricing.price_strategy’ tag.
Example:
1 oro_pricing.pricing_strategy.merge_price_combining_strategy:
2 class: Acme\Bundle\AcmeBundle\PricingStrategy\YourPricingStrategy
3 parent: acme.pricing_strategy.your_pricing_strategy
4 tags:
5 - { name: acme.price_strategy, alias: your_strategy }
After this, your strategy will be available in the SystemConfigurationCommerceCatalogPricingPricing Strategy in the OroCommerce back-office.
Merge By Priority¶
Merge By Priority Strategy picks the first price from the given sequence of the Price Lists for an empty slot.
The Merge Allowed flag shows whether a particular Price List is allowed to be merged with the other prices. When Merge Allowed is disabled for a price list, its price will be exclusively used for the product that has no price provided in other price lists with higher priority.
Example1:
Product |
Price List |
Price |
Merge Allowed |
SKU1 |
Default PriceList |
9$ / 1 item |
true |
SKU1 |
Default PriceList |
8$ / 2 item |
true |
SKU1 |
Default PriceList |
6$ / 5 item |
true |
SKU1 |
Custom PriceList |
8$ / 1 item |
true |
SKU1 |
Custom PriceList |
7$ / 2 item |
true |
SKU1 |
Custom PriceList |
7$ / 4 item |
true |
Result:
Product |
Price |
SKU1 |
9$ / 1 item |
SKU1 |
8$ / 2 item |
SKU1 |
7$ / 4 item |
SKU1 |
6$ / 5 item |
Example 2:
Product |
Price List |
Price |
Merge Allowed |
SKU1 |
Default PriceList |
9$ / 1 item |
false |
SKU1 |
Default PriceList |
8$ / 2 item |
false |
SKU1 |
Default PriceList |
6$ / 5 item |
false |
SKU1 |
Custom PriceList |
8$ / 1 item |
true |
SKU1 |
Custom PriceList |
7$ / 2 item |
true |
SKU1 |
Custom PriceList |
7$ / 4 item |
true |
Result:
Product |
Price |
SKU1 |
9$ / 1 item |
SKU1 |
8$ / 2 item |
SKU1 |
6$ / 5 item |
Example 3:
Product |
Price List |
Price |
Merge Allowed |
SKU1 |
Default PriceList |
9$ / 1 item |
true |
SKU1 |
Default PriceList |
8$ / 2 item |
true |
SKU1 |
Default PriceList |
6$ / 5 item |
true |
SKU1 |
Custom PriceList |
8$ / 1 item |
false |
SKU1 |
Custom PriceList |
7$ / 2 item |
false |
SKU1 |
Custom PriceList |
7$ / 4 item |
false |
SKU1 |
Custom2 PriceList |
5$ / 10 item |
true |
SKU1 |
Custom2 PriceList |
4$ / 100 item |
true |
Result:
Product |
Price |
SKU1 |
9$ / 1 item |
SKU1 |
8$ / 2 item |
SKU1 |
6$ / 5 item |
SKU1 |
5$ / 10 item |
SKU1 |
4$ / 100 item |
Minimal Prices¶
Minimal Prices Strategy picks the minimum price from the given sequence of Price Lists.
Product |
Price List |
Price |
SKU1 |
Default PriceList |
9$ / 1 item |
SKU1 |
Default PriceList |
8$ / 2 item |
SKU1 |
Default PriceList |
6$ / 4 item |
SKU1 |
Custom PriceList |
8$ / 1 item |
SKU1 |
Custom PriceList |
7$ / 2 item |
SKU1 |
Custom PriceList |
7$ / 4 item |
Result:
Product |
Price |
SKU1 |
8$ / 1 item |
SKU1 |
7$ / 2 item |
SKU1 |
6$ / 4 item |