Commerce Price Rule
Categories
Component ID
Component name
Component type
Maintenance status
Development status
Component security advisory coverage
Downloads
Component created
Component changed
Component body
Price Rules allow store owners to customise product prices based on a variety of conditions, such as based on user role, product type or product variation type, for specific products or specific product variations, or other custom conditions such as the IP address or the country of the customer. When conditions are met, the product's price is calculated based on the defined calculation method which can be a percentage or fixed amount off the base product price, a price defined on a price list, or a custom solution.
How is this different to Promotions
Promotions do not change the base price of the product. Instead they change the order subtotal on the cart and checkout pages, based on coupons that the user may have entered.
Price Rules change the base product price as it is displayed on product pages. Users do not have to do anything to get the special price because the conditions are automatically calculated. Users may not be necessarily aware of why they see the price they see, and on a different visit where conditions are different, such logged out vs logged in, they may be displayed different base prices.
Also, have a look at https://www.drupal.org/node/2900583
How is this different to Price List
The Price Rule module was written as a more generic solution, of which price lists is a sub-case. It also adds conditions to the mix. There is an ongoing discussion about whether to move this module to the existing commerce_pricelist namespace (https://www.drupal.org/node/2368053).
Installation and usage
Install as any module, preferrably via composer. Create one or more Price Rules, and make sure that you use the Calculated Price field formatter wherever you would like users to see the customised prices.
Development status
The module is new and it implements the first part of the architecture described at https://www.drupal.org/node/2899158. Search API integration may be added as a submodule. Price Lists are currently part of the main module, but to avoid creating tables on the database for users that don't need them it will likely be moved to a submodule. The core functionality should be expected to work, but it is still work in progress. Please test and let us know about any problems in the issue queue. We won't be supporting upgrade paths before reaching a release candidate version. If you have already installed a previous version and you want to get the latest code, you may have to uninstall the module, update the code and then install it again.
