Cert++
Close

BuyerActions versus BuyerActionDetails in calculator logic

Key Takeaway

BuyerActions tells a custom orchestrator what kind of thing happened. BuyerActionDetails, which a custom calculator gets with getOptionalBuyerActionDetails().get(), tells the calculator exactly what changed.

BuyerActions and BuyerActionDetails both describe what the buyer did to the cart since the last calculation run, but at different levels of detail. BuyerActions gives simple true/false answers, so a custom orchestrator can choose which calculators to run. BuyerActionDetails gives a custom calculator itemized lists of exactly what changed.

Three levels of control

The Cart Calculate API has three levels of control:

  • Orchestrators control which calculators run and when.
  • Calculators handle cart calculations, such as shipping and tax.
  • Services handle specific calculations that can reach beyond the cart. For example, the Pricing service also affects product detail pages.

A custom orchestrator extends the CartExtension.CartCalculate class and is registered for the Commerce_Domain_Cart_Calculate extension point. The system calls it whenever cart calculations are needed, such as when a buyer adds a product to the cart.

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. 757 members and growing.