Skip to content

Add cart hooks#9

Open
nicososadevgurus wants to merge 1 commit intomasterfrom
TEC-259
Open

Add cart hooks#9
nicososadevgurus wants to merge 1 commit intomasterfrom
TEC-259

Conversation

@nicososadevgurus
Copy link
Collaborator

Add cart hooks to create, update and remove items into a cart

Pending:

  • Use anonymous session to not save the cart_id into cookies
  • Add customerId in cart when a customer logged in
  • Merge anonymous cart when customer logged in
  • Handle currency with locale config

if (!item.quantity) item.quantity = 1
const { currency } = config
let result = null
if (!cartId) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you create the cart when no id is there? I mean, is not wrong but just want to know the reasons

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because the cartId comes from the cookies, and if it is not saved in the cookies we assume that there is no cart created

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants