Welcome Guest, Not a member yet? Register   Sign In
How to handle this type of order system
#1

[eluser]copernicus[/eluser]
I have a web application that lets users order advertising space, they fill out an ad request and then go through payment. After they create a request, I want to give them an option to create another request before they checkout. Where would be the best place to store previous requests while they fill out additional ones?
#2

[eluser]vitoco[/eluser]
i think this is like a shopping cart , so maybe you can store the requests in a table associated with the user id.
#3

[eluser]copernicus[/eluser]
That's how I was going to consider it too but the way the system is now, the user creates a request before logging in or registering.
#4

[eluser]vitoco[/eluser]
if the "user" creates a request before logging in ....how do you know what user is ?? , i think the "user" must follow this steps .

1.- click the "new request" link
2.- if the "user" is logged , show him the request form
- if the "user" isn't logged , force him to loggin in , and after that...redirect him to the request form

so , it's only one more step if it's not logged.

i put USER between "", because in a close app , i think it becomes a USER only after it's logged
#5

[eluser]copernicus[/eluser]
Well I guess what we are going for is to have it kind of like Amazon, where a user can view the prices and add stuff to a cart before logging in/registering.
#6

[eluser]naren_nag[/eluser]
So create a table called temp_cart_contents (or whatever you want to call it), when a user hits your site and hits the create request button, give him a unique id and store it as a session variable -- and add whatever he's added to the cart to the temp_cart_contents table. When he registers you just move the data out of temp_car_contents and into the permanent shopping record of the user.

on click add_to_cart
if not logged in
assign temp_id
add temp_id to session_data
add temp_id, cart_data to temp_cart
else if logged in
check session_data
if temp_id is not null
move cart_data from temp_cart to permanent_cart
make temp_id equal null
add new_item to permanent_cart




Theme © iAndrew 2016 - Forum software by © MyBB