Skip to content
Discussion options

You must be logged in to vote

Hi 👋 great question!

There are two common approaches to customizing cart logic in Medusa:

Extending CartService

  • You can create a custom service that extends CartService and override methods like create or update.
  • This is useful if you need to change how carts behave at the core level (e.g., automatically attaching metadata or enforcing custom rules).

Using Event Subscribers

  • If you don’t want to modify the service directly, you can listen to events like cart.created or cart.updated.
  • This is safer for upgrades since you’re not overriding Medusa’s core methods.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by rob0pup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants