Cart Module
The Cart Module is the @medusajs/medusa/cart
NPM package that provides cart-related features in your Medusa and Node.js applications.
How to Use Cart Module's Service#
You can use the Cart Module's main service by resolving from the Medusa container the resource Modules.CART
imported from @medusajs/framework/utils
.
For example:
Features#
Cart Management#
Store and manage carts, including their addresses, line items, shipping methods, and more.
Apply Promotions#
Apply promotions or discounts to line items and shipping methods by adding adjustment lines that are factored into their subtotals.
Cart Context and Scoping#
A cart is scoped to a sales channel, region, and a customer.
When used with their respective modules and other commerce modules, you benefit from features like:
- Checking product availability in a sales channel.
- Retrieving pricing per region.
- Applying promotions based on the customer's group.
Was this page helpful?