#cart.updated events

6 messages · Page 1 of 1 (latest)

wise rock
#

I'm running my project locally and am seeing cart.updated events for items being added to the cart. I don't receive any events when removing an item from cart or from updating the quantity. Nothing in the docs specifies any additional requirements for these events.

Any help would be appreciated.

  event: { data: { id } },
  container,
}: SubscriberArgs<{
  id?: string;
}>) {
  console.log("****************** CART UPDATED ******************");
  // removed for simplicity
}

export const config: SubscriberConfig = {
  event: "cart.updated",
};

// update: altered code with latest attempt, single event, simple arg typing. Still don't receive cart item removals or amount changes

inner sparrow
#

1 https://docs.medusajs.com/learn/customization/integrate-systems/handle-event#3-handle-brandcreated-event

try to just put one event only and not two, i'm not sure if its ok to pass an array,

2 https://docs.medusajs.com/resources/references/cart/events
Based on the information in the provided knowledge sources, there is no mention of a cart.delete event in the Cart Module. The documented cart-related events are:

3
Next, you need to identify which brands must be created or updated. Since workflows are constructed internally and are only evaluated during execution, you can't access values to perform data manipulation directly. Instead, use transform from the Workflows SDK that gives you access to the real-time values of the data, allowing you to create new variables using those values.
https://docs.medusajs.com/learn/customization/integrate-systems/schedule-task

i hope it helped a litlle bit

wise rock
# inner sparrow 1 https://docs.medusajs.com/learn/customization/integrate-systems/handle-event#3...

I appreciate the time you took for your response. Unfortunately, still running into the lack of events firing.

  1. Arrays are acceptable due to the type, I had added it in attempt to see if I even got a line update event, which I didn't
    event: string | string[];
    context?: SubscriberContext;
};```

2. You're correct, there is no cart.delete, but I'm looking for line item deletion (trash can in cart to remove an item from cart). 

3. I'm not sure what "brands" you're referring to but I will continue to look into Transform in workflows to see if it helps.

Again, ty for the response!
inner sparrow
#

no problem, it's very sad that there is not a lot oof help in this discord medusa community ...
anyway, let me know if you find a solution, have nice day

wise rock
#

Looks like my team's been working with an older version of medusa, my own mistake for not verifying that. We're using 2.4, and the event emitter was added in 2.7.1. So we have an update to do.

inner sparrow
#

happy you find a solution then 🙂 have nice day