Cart Provider should be able to initalize cart if not found #2149
hsdonkin
started this conversation in
Ideas + Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Would love to be able to pass a flag into
CartProvider
likeonLoadCreate
!I'm running into a weird situation where I need to send an add to cart event to analytics. When the line item is added with
linesAdd
, the cart technically doesn't exist yet, soid
fromuseCart()
is undefined.It would be much easier if I could guarantee a cart exists before the form is submitted. I've tried a workaround where I call
cartCreate()
ifcartReady
and nocartId
, but it creates some other bugs in our app where theonLinesAdd
callbacks get triggered bycartCreate()
Beta Was this translation helpful? Give feedback.
All reactions