Sessions in an e-commerce environment

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
zarkolazarov
Forum Newbie
Posts: 6
Joined: Mon Jun 04, 2007 9:14 pm

Sessions in an e-commerce environment

Post by zarkolazarov »

Hi there,

I was wondering if anyone can give me a few pointers about using the sessions in an e-commerce environment.
Namely, I have a php based e-commerce solution and the goal I'm going for is that users can browse through the website, looking every category and product, while the cart is positioned on the right side and always visible, and users (logged in or not, doesn't matter) can add products to the cart. I have all this accomplished.
But when they press the checkout button, I want the code to check if the user is logged in or not, and if not to take him to login.php, else proceedto the payment page. In other words I don't want not registered users to be able to checkout and bye products.
I'm not very skillful with sessions and cookies, so I don't know how would I achieve this.

If anyone has some suggestions, please reply to my post..

Thanks
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

It is usual in the seesion to store the user login status separately from something like shopping cart data. You use the independently.
(#10850)
User avatar
zarkolazarov
Forum Newbie
Posts: 6
Joined: Mon Jun 04, 2007 9:14 pm

RE:

Post by zarkolazarov »

Thanks for the tips
Post Reply