The Cart itself is created automatically when a buyer shops, so there is no manual Cart record to add. What an admin or developer configures is the cart calculation behavior through the Cart Calculate API. These steps describe enabling and customizing that calculation for a B2B or D2C store.
- Confirm Cart Calculate API is active
For newer webstores the Cart Calculate API is enabled by default. In Commerce setup for your store, verify that cart calculation is using the CCA framework so that pricing, promotions, inventory, shipping, and tax run through orchestrators and calculators.
- Set up pricing and promotions
Associate the right price book with the store so the pricing calculator has list and negotiated prices to read. Build your discounts in the promotion setup so the promotions calculator can apply cart-level and line-level adjustments in the correct sequence.
- Integrate tax and shipping services
If you use an external tax engine, extend the Commerce_Domain_Tax_Service base class to call it from the Taxes calculator. Configure shipping so the shipping and post-shipping steps can calculate delivery cost per CartDeliveryGroup at checkout.
- Add a custom orchestrator only if needed
When the default calculator order does not fit, write a class that extends CartExtension.CartCalculate and register it at the Commerce_Domain_Cart_Calculate extension point. Use it to reorder or skip calculators, then test the resulting totals end to end before going live.
Runs first and sets line prices; extensible through Commerce_Domain_Pricing_Service for custom contract pricing.
Applies cart-level and line-level discounts after pricing; model offers in promotion setup.
Checks availability for cart and checkout; extensible through Commerce_Domain_Inventory_Service.
Runs at checkout and is extensible through Commerce_Domain_Tax_Service to integrate an external tax provider.
- Running tax before promotions taxes a discount the buyer never pays and inflates the grand total.
- There is no Abandoned status on WebCart; an abandoned cart is an Active cart identified by its last-modified age.
- Prefer extending the calculator framework over writing triggers on WebCart or CartItem, which fights the calculation sequence.
- A slow external tax or shipping call at checkout is felt directly by the waiting buyer, so handle timeouts gracefully.