Skip to content

How to create a cart when none exists? #1389

Answered by blittle
magnattic asked this question in Help
Discussion options

You must be logged in to vote

@magnattic I recommend not creating a cart until it is needed. For example cart.createLines(...) optimistically creates a cart if one doesn't already exist. If someone visits your site, and they never interact with the cart, there's no reason to create one. This change should make it easier to query the cart right after it is created though: #1865

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by michenly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants