Closed ricokahler closed 3 years ago
@jivewise Can you help provide some insight on this question? Thanks!
@ricokahler I believe the ItemBody
declaration will need to be updated here: https://github.com/bigcommerce/storefront-data-hooks/blob/master/src/api/cart/index.ts#L17 to be optional.
I will work with @amckemie to make a PR for that soon, or you can feel free to do so if you have the time!
The variantId
should be optional.
If a product has modifiers, omit the variant_id and instead use the option_selections array to describe both the variant and the modifier selections Documentation
It will be included in the next release
Looking at the typescript types for
useAddItem
, it doesn't seem like there is a way to add items to the cart that don't have a variant.How do I do this?