hey guys,

I need to build a shopping cart this week, and i'm looking for some help. Unlike most shopping carts, the cart will be utilized for a service(user will be paying for articles that will be posted on the site after payment is recieved)... So there won't be any shipping requirements. I want to use mysql databases and sessions or cookies depending on which are more efficient for this task.

The way the user will "add to cart", will be on the preview page(the page where the user can review/verify the article he just made) if the article is sufficient, the user can choose to buy it.
- Not sure how to impliment this...?

Now the "View Cart", will show the article titles and prices to post each article and the total price. Article cost will vary, that will depend on what category the user decides to place the article.

The "Check Out" script will gather the users payment information then send the credit card data to VeriSign.

What functions of this cart am i leaving out?
how many databases should i need?
Sessions or Cookies?
I'm also not sure where to start... it might seem stupid of me to say that, but this is the first time creating a shopping cart and i need it to function smoothly and quickly.
i'm open to code snipets...

I am not looking for another pre-built shopping cart, it needs to be "custom built". i haven't been able to find any shopping cart that will work properly with a service like this or with VeriSign PayFlow Pro. Closest one is Miva Merchant, VeriSign sends the transaction result back to Miva Mechant and not to my server.. so thats out of the question.

Thank-you for reading all this and your help! It means a lot!

    Hello,

    Generally when developing such kind of service you have to use both sessions and cookies. For session and shopping cart control you will need to use a data base. Cookies are not mandatory, but will save you a lot of time to transmit session identifier among pages that users visit. Without cookies you will have to transfer the session id in the URL which is not a good idea. For session control you could write your own library or use PHPs built-in session support which should be good enough in your case. Probably your site would be memership based, so each time a member logs in you will open a session in the data base. Your session open function might take care of timed out sessions and clean them from the sessions table. When articles are requested by user for purchase you will update another table containing article information with reference to the current session. This gives you enough information to show later shopping cart content, remove content or add additional content. Maybe it is a good idea to get some shopping cart code from a code exchange site and just see the logic in it.

    Hope this helps a bit. 🙂

      hey thanks!
      yeah i have a shopping cart, but i'm still having some trouble adapting it to my application... like i said i haven't been able to find one to work with this kind of service.

      can anyone else offer any help?

        In your case there are two questions - customizing an existing shopping cart for your needs or just writing a new one. Both methods would involve plenty of time, but I would definitely choose to write a new one. Changing somebody else's code sometimes could be a real pain in the ass, since different people have different programming habbits. My suggestion was to review the exisitng shopping cart just to understand the logic beneath and have an idea what to write. But of course there is always an alternative - ask somebody to do the job for you 😃

          yeah... unfortunatly, id rather do it myself. Just looking for some direction. I don't want this to turn out like crap. lol
          thanks

            could someone help define the componets of a shopping cart in a little detail?
            could someone go in a little more detail on the cookie end of the shopping cart, i haven't worked much with cookies.

              Write a Reply...