useCartDiscountCodesUpdateCallback

The useCartDiscountCodesUpdateCallback hook returns a callback that can be used to update the cart's discount codes. It must be a descendent of a CartProvider component.

Example code

Return value

A callback to update the cart's discount codes. The callback expects an array of strings corresponding to the discount codes to apply to the cart.