-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Marketplace] Adds the ability to set metafields on cart items #2704
Conversation
server/methods/core/cart.js
Outdated
|
||
// Copy additionalOptions into an options object to use througout the method | ||
const options = { | ||
overriteExistingMetafields: false, // Allows updating of metafields on quantity change |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in option name?
My only concern here is that Metadata not turn into ActualData. We need to not store anything there that the app relies on to do any primary logic, otherwise it should be in the schema. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
This PR adds the ability to add metafields to a cart item while adding that item to cart. This could be useful to apply additional information to an item added like affiliate tracking or geolocation, etc.
Examples:
Adds metadata to a cart item only once, and does not get updated if the same item is added to the cart again.
Adds metadata to a cart item while adding to cart, and will update every time that item is added to cart.
Final param, additionalOptions is optional.