Cert++
Close

Custom Cart Calculate orchestrator and default calculator sequence

Key Takeaway

By default, shipping, postShipping and taxes run only during checkout. To run them as the cart changes, a custom orchestrator must add isCartItemChanged() to their conditions, and tax also needs a custom tax calculator.

The Cart Calculate API lets a developer control how a Commerce cart is recalculated, both in the cart and during checkout. A custom orchestrator is an Apex class that decides which calculators run (pricing, promotions, inventory, shipping, postShipping, taxes), in what order, and after which buyer actions. You need to know the default sequence and its trigger logic before you can safely change either one.

Three levels of control

The Cart Calculate API has three levels of control:

  • Orchestrators decide which calculators run and when.
  • Calculators do the cart calculations, such as shipping and tax.
  • Services do specific calculations that can reach beyond the cart. For example, the pricing service also affects product detail pages.
Salesforce Accredited B2B Commerce Developer Professional Study Guide

Checklist progress

0/124Learned

Code implementations against the 4 crucial reference implementations used in checkout and payment interfaces with in-depth knowledge of all supported actions

0/23

Prepare for the Exam

Play Today's Certle

Study Community

Ask questions and get the latest info from other Salesforce Accredited B2B Commerce Developer Professional studiers.