Skip to content
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

Add CartInterface::queuedUpsertItem and CartInterface::route #135

Merged
merged 2 commits into from
Apr 16, 2021

Conversation

pdbreen
Copy link
Contributor

@pdbreen pdbreen commented Apr 16, 2021

Cart item queuing is required to support email login after an "add to cart" button is clicked. It does this by making the add-to-cart POST routes accessible w/o requiring login. The controller for the post creates the cart item and then calls queuedUpsertItem(...) which will either add the item immediately, or defer addition by storing in session data until a user login even occurs. By redirecting to the cart (which is an auth protected route) after addition, the login page will appear when needed. And, because the cart is a GET and not a POST, laravel's redirect to intended will work properly, showing the cart after email capture.

Copy link
Member

@drewroberts drewroberts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! 🚏

@drewroberts drewroberts merged commit 0237430 into main Apr 16, 2021
@drewroberts drewroberts deleted the pdbreen/feature/checkout-queue-upsert branch April 16, 2021 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants