You are here:
Pricing Procedure Plans for B2B Stores
Use procedure plans to customize how prices are calculated in your B2B store. A procedure plan is a framework that combines your pricing procedure with optional custom code (Apex hooks). The procedure plan defines the sequence that your custom logic and pricing procedure follow to calculate the final price.
With procedure plans, you can:
- Apply different pricing logic to each store in your org.
- Modify pricing inputs before calculations run by using Apex prehooks.
- Modify pricing outputs after calculations run by using Apex posthooks.
A procedure plan consists of three main components:
- Context Definition: Defines the data structure used during pricing, such as account information and pricing attributes.
- Pricing Procedure: Contains your core pricing logic, rules, and calculations.
- Apex Hooks: Custom code used to integrate external systems or apply business logic that isn't possible with standard pricing rules.
Run Apex hooks before or after the pricing procedure to customize the final price calculation. For example, to calculate standard discounts and also add an environmental recycling fee, use a procedure plan. Your standard pricing procedure runs first to calculate the base price and apply volume-based discounts. Then an Apex posthook runs to calculate the recycling fee based on the discounted price and add it to the final total.
- Considerations for Pricing Procedure Plans
Review these considerations when working with pricing procedure plans in your B2B store. - Configure Pricing Procedure Plans for B2B Stores
Configure pricing procedure plans to customize how pricing is calculated in your B2B stores. Create a procedure plan from the default Commerce procedure plan template and then customize it with your own context definitions, pricing procedures, and Apex hooks. - Customize B2B Store Pricing with Apex Hooks
To support unique pricing scenarios, add custom Apex logic to your pricing procedure plans. You can use Apex hooks to apply custom business logic that modifies the pricing context before or after your pricing procedure runs. Apex hooks are custom code that run at specific points in the pricing procedure plan.

