Unstoppable Domains

Quantities in an ecommerce cart

Spaceship Spaceship
Watch

sourcez

Established Member
Impact
12
Just doing a small ecommerce project at the moment that has very specific requirements, so I've decided to DIY it; payment gateway is PayPal.

Having mixed thoughts about how to manage product quantities though. When someone buys something I want the quantities to be reduced etc.

What's the best way of doing this?

I personally thought save the data to DB, wait for PayPal IPN and upon successful response reduce quantities...but what happens if during this window someone else completes checkout, reducing quantities to zero...the original customer would still be able to checkout..even though quantities were ZERO...

Ideas welcome!
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Hmm its a toughy, I think the way a lot of e-commerce stores work it is that once they've checked out it takes the quantities down, effectively it reserves the items. If the user then doesn't pay or paypal responds that its been cancelled or rejected it releases the items again effectively putting them back in stock.

You would also have a cron or script acting as a cron to check if items have been paid for or not every 30mins or so (as PayPal doesn't always tell you if an orders been cancelled), so you would log the checkout with a timestamp and if it hasn't been paid for within 30 minutes or so it will also release the products and cancel the order.

90% of the time if a user spends the time entering in their details to complete checkout they will carry on and pay anyways.

It requires a little more coding but prevents situations where people might be going for the same last item in stock.
 
1
•••
Thanks for the suggestions, that's how I'll do it I think. Thankfully it's all coded already so just modifications at this stage. :)
 
0
•••

We're social

Unstoppable Domains
Domain Recover
NameMaxi - Your Domain Has Buyers
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back