Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8898989
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T00:44:54+00:00 2026-06-15T00:44:54+00:00

I need help with handling orders and cart in my web application. I decided

  • 0

I need help with handling orders and cart in my web application.

I decided to use Cart library built in Codeigniter 2.

I’ve seen some tutorials about that Cart library and i know how to use it, but i dont know:

  • when shall I create/save that order in database? when user is adding items to cart, or shall i keep all order data in session and “move” it do database when user accepts order?
  • shall I store session id or something other in database?

I tried to see how cart/order functionality is implemented in PrestaShop, but it looks too complicated for me, im amateur PHP programmer.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T00:44:55+00:00Added an answer on June 15, 2026 at 12:44 am

    The ideal and good way to use cart is keep it in session, codeigniter’s cart class is doing the same thing, and when user gives order use this data put this order in database and do other stuff like payment gateway, shipping.
    If you want to use user to keep his order in next session, like if user add some product in cart and he quits before giving order and he is a registered user, then you can save his cart every time in database, so that if he gone away without putting order you can show him his orders next time when he logged in.

    You can store users cart data in database using $this->cart->contents(); method of cart class.
    use like this

    $cartContentString = serialize($this->cart->contents());
    

    you will get a string of cart content, you can save this string in database and later use it like

    $cartArray = unserialize($cartContentString);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need JPEG handling capabilities in my project so I decided to use jpeg-8d
I do some postdata handling on my webpage, but need some help with the
I need some help with handling validations with Twitter Bootstrap properly. The validations are
I need a little help creating a catch-all error handling page in my ICEfaces
Need some help with crypto routines in Java. Given a PKCS#7 signature, I want
need to implement a global error handling, so maybe you can help out with
Need help in exception handling. If I run this UPDATE script once it works,
I am a Java programmer working with C++ code, and need some help with
in a single main() function,so need signal handling. Use Posix Message Queue IPC mechanism
Hi there guys I need help with handling location co-ordinates with xcode; to be

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.