To checkout only selected cartLines in a cart #1040
wychoong
started this conversation in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
To be able to only checkout selected items from a cart
example
Describe the solution you'd like
Cart::checkoutOnly([ ...Purchasable ])
Describe alternatives you've considered
as suggested by @glennjacobs possible workaround would be to create a new cart with just those items in and send to the checkout.
there is a downside of this, if the user didn't actually finish off the checkout process, the system will left with multiple stale carts. also, need to handle how to get all items in the cart while only calculating the selected and display the info, by handling 2 carts?
Additional context
these are my findings on possible way to add this into core, which is very little minimal code change
currently I'm adding
checkout = false
tometa
using the existingupdateLine
methodand it works like this
Screen.Recording.2023-02-26.at.01.54.04.mov
next item to look into will be how to handle remaining items
in the demo, what I understand is the paid cart need to be
CartSession::forget()
manually by the dev, which is perfectly fine.so the possible way will be
checkout
cartLinesCreateOrder
action, move none checkout cartLines into a new cart, store the new cart id as a meta in current cart's meta, and then have an apiCartSession::UseRemainingItemsCart()
to retrieve the cart ornull
Beta Was this translation helpful? Give feedback.
All reactions