-
Notifications
You must be signed in to change notification settings - Fork 62
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
Adding multiple items, saving to db #24
Comments
Anyone will to help on this? |
Direct help with your DB integration is a bit out of scope of this repo. But off the top of my head, I would simply loop through the cart object collecting each item, its data, and push that to your database. |
If all you're looking to do is store your carts in a database then the best way would be to create a new storage driver. Take a look at Storage/Runtime.php for the methods you need and create a mysql version. Upon initialising your cart you can use the new custom class, meaning your carts are always in the database and upto date. Having said that, what it sounds like you're really trying to do is store orders, which is outside the scope of the cart package and not something we can really help with. |
I have a foreach loop but it doesn't insert multiple items would i need to pass [] as well to then store as multiple currently it only stores one item even if there' 3 in the cart contents. |
I'm having an issue (or me not understanding) how to to save more than one item to my database.
If i die and dump
Cart::contents()
i get the following: which shows two items.So the question is, how do i save these items to the DB?
@jHoldroyd @AJSturrock @outrunthewolf
The text was updated successfully, but these errors were encountered: