JEET mentioned that there are three ways to deduct inventory with an ecommerce site. These were at the cart, at payment, and when shipped. At payment was said to have a problem with two people having the possibility of ordering the same last item in their carts. Now, to me it seems that all three would have this possible problem and therefore a lock would need to be used. May I have an explanation please? Thank you, Joshua https://forums.digitalpoint.com/threads/new-schema-how-is-it-please.2866756/
Like I mentioned in the other thread, at cart time, if you deduct inventory here itself, then inventory will become zero very quickly, making the product unavailable to everyone else, and still have no real purchase made. May be person decided not to buy just on payment page, may be card did not worked, reason could be anything. They simply closed the webpage. Now to make this inventory available to other customers "again", you will have to expire the cart, and add to inventory. Problem is not in adding/deducting. Problem is, how long to wait before expiring this "open" cart. Because inventory is showing zero on website, and product is still not purchased. Seller is still holding inventory. This is why, deduct inventory when product is finally ordered and paid for, or when product is finally shipped by seller. In both those cases, you can have 2 people ordering the same product, and no "real" inventory. Which would mean, you can choose to return the payment collected, or give the customer a different date of delivery, 2-3 days ahead, when seller gets new inventory. I think best one is to deduct as soon as payment is made. In case of "deducting at seller" point, website will still keep showing inventory available, and people will keep ordering, when really there is no inventory left. Might create too many "awaiting delivery" customers.
Isn't it why PayPal, for instance, has the IPN? The actual deduction (or whatever else needs to be done) happens only after the payment is made.
When there are two orders and one product and it needs to b e resolved by the seller, what is this screen like? Thanks, Josh
Seller will see order in their own panel. Something like: <div> <p> Product name, quantity <p> Shipping address, etc etc Then a button here: <button onclick=" markProcessed( 123 )"> Mark Processed </button> </div> <div> next order and so on </div> <script> function markProcessed( id ){ //an ajax call to a php script //php script changes status of order based on id //php script also makes the change in the quantity of product ordered. //productID can be found inside orderID (orders table) //orderID is the id passed to the function }//function ends </script>
What I'm wondering is how does the site demonstrate that there is an order that has no product and there is an order that gets the product. What exactly is displayed to show this? I am thinking in someway the amount of product left is displayed next to each order.
You can display anything in that <div> box for the order. quantity left, quantity ordered. If displaying quantity left inside <div>, then don't use an ajax function to update order status etc. Use a proper new page where you adjust quantity, and return back to this page with new stats from db.