addShippingMethodToCartWorkflow. Validates the requested options against the cart and their calculated prices, then swaps shipping methods per seller: existing methods belonging to the sellers whose options are being added are removed, while other sellers’ methods stay untouched — so a multi-seller cart keeps one shipping method per seller. Refreshes cart items afterwards and emits cart.updated. Triggered by POST /store/carts/:id/shipping-methods.
Usage
Input
The cart to add shipping methods to.
Shipping options to add as methods.
Custom data passed through to the workflow hooks.
Result
No return value; the cart’s shipping methods are replaced per seller as a side effect.
Hooks
validate— runs after the cart is loaded with{ input, cart }.