TotalChoice Hosting Family Forums: Selling Limited Items Need Suggestions On Best Practices - TotalChoice Hosting Family Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Selling Limited Items Need Suggestions On Best Practices

#1 User is offline   memooney 

  • New To The Neighborhood
  • Pip
  • Group: Members
  • Posts: 9
  • Joined: 18-February 04

Posted 29 November 2005 - 07:09 PM

I'm setting up an online purchase system for a cooking store. They offer classes for their customers. The classes have a limited size (e.g., 20 people max). In the past, the classes have sold out in a matter of hours. So here is my concern:
Let's say Sally wants 2 seats in the Sushi class and 1 seat in the grilling class, and 1 seat in the pastry class. She adds the 2 seats in the Sushi class to her cart, then continues to the grilling class and adds 1 seat for that class to the cart, then on to the pastry class and adds a seat, then wants to check out.
It's very likely that if I wait until she checks out to "reserve" those seats for her, someone else will have purchased them. So I need to "reserve" the seats when she adds them to her cart. That's no problem. My concern is, what do I do if she doesn't check out? These seats are pulled from the class, and are now unused.
I've got ideas rolling around in my head, but I'm guessing some of you have already faced something like this, so I'm hoping you can save me some time and figuring it out.
Basically, I'm adding a record to the DB that pulls the seat when she adds it to the cart. So what do you think the best way is to double check on a regular basis (every 15 minutes or so) that Sally has completed her transaction?
Matthew

#2 User is offline   TCH-Rob 

  • Help Desk Manager
  • PipPipPipPip
  • Group: Members
  • Posts: 7,818
  • Joined: 11-March 03

Posted 29 November 2005 - 08:21 PM

You could use sessions that have a timeout on them. That way, if nothing is done in a certain period of time the transaction should be negated and those items go back into the pool.

#3 User is offline   memooney 

  • New To The Neighborhood
  • Pip
  • Group: Members
  • Posts: 9
  • Joined: 18-February 04

Posted 01 December 2005 - 10:02 AM

I guess I'm lost then. How can I control records in the DB with sessions? If the session times out on the user's computer, how does the record get updated in the DB?

#4 User is offline   Deverill 

  • Immediate Family
  • PipPipPipPip
  • Group: Members
  • Posts: 3,317
  • Joined: 21-July 03

Posted 01 December 2005 - 10:42 AM

Hi Matthew,
In a PC application I'd mark the seat "Tentatively reserved" when she clicks it and then "Permanently reserved" when she checks out. Then you could periodically go through and if they aren't still working (session still active?)on it you could "unreserve" the Tentative ones.

Not too sure how to do this in a web environment - a timed script or session timeouts, etc - but it may get you going in the right direction. Hope it helps!
"A winner is simply willing to do what a loser won't."

#5 User is offline   memooney 

  • New To The Neighborhood
  • Pip
  • Group: Members
  • Posts: 9
  • Joined: 18-February 04

Posted 03 December 2005 - 11:28 AM

Thanks for the suggestions. I have an idea and from the "Server Side" of things I want your opinions. Originally, I was thinking of something along the lines of what Jim suggested. However, I was planning to have an automated way of doing things. So here is my thought. When Sally adds some seats to her cart, it "reserves" the seats in the DB and adds the epoch date. Then if she completes the checkout, it would update to purchased from "reserved." To address the poeple that don't check, I was thinking of using a CRON job to execute a script that would query the DB and look for any "reserved" that are more the 30 minutes old and release those seats.
Historically, the classes sell out in about 2-3 hours. So I was planning to have teh CRON job run every 30 minutes on the day the registration opens. Then every 6 hours have that to catch any stragglers. Does that sound like a solution that will work? I haven't used CRON job before, but understand how they work.
From the server side of this do you see any problems or concerns in running this CRON job as I've described?

Thanks

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users