CartModule
The active cart on commercetools: cart, creating one, adding, updating and removing lines, discount codes, and the cart's B2B fields.
import { CartModule } from "@evolve-framework/commercetools";Serves the Cart part of the GraphQL API: addressValidate, cart, cartBundleAdd, cartChangesAcknowledge, cartCreate, cartDiscountCodeAdd, cartDiscountCodeRemove, cartLineItemsAdd, cartLineItemsRemove, cartLineItemsUpdate, cartPaymentRemove, cartSetDeliveryRemarks, cartSetPurchaseOrderNumber, cartSetVatNumber, cartUpdate.
new CartModule(options: CartModuleOptions)| Option | Type | Description |
|---|---|---|
clientFactory | ClientFactory | The commercetools client its requests to the project go through, built
with |
customTypes | CartCustomTypeKeys | Keys of the custom types this project has provisioned for a cart and a line
item. Required: a missing one is a configuration error, and the framework
has no key of its own to fall back on. The |
minimumQuantityAttribute? | string | The variant attribute holding a minimum order quantity. A line asking for less is refused as BELOW_MINIMUM_QUANTITY. Omit it when there is none. |
maximumQuantityAttribute? | string | The variant attribute holding a maximum per line. A line that would hold more is refused as ABOVE_MAXIMUM_QUANTITY. Omit it when there is none. |
packSizeAttribute? | string | The variant attribute holding a pack size. A line that would hold a quantity that is not a whole number of packs is refused as NOT_A_MULTIPLE_OF_PACK_SIZE. Omit it when nothing is sold in packs. |
payments? | PaymentRegistry | The payment providers checkout can use. Required for the
|
vatNumberCheck? | VatNumberCheck | How cartSetVatNumber checks a VAT number against the register, such as
|
nameNewCarts? | boolean | Name every cart created without one after the day it was made, through
|
Extends AbstractModule<CommercetoolsLoaderContext>.

