1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Inventory reduction problem

Discussion in 'Databases' started by JoshuaEir, Jun 26, 2020.

  1. #1
    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/
     
    Solved! View solution.
    JoshuaEir, Jun 26, 2020 IP
  2. JEET

    JEET Notable Member

    Messages:
    3,825
    Likes Received:
    502
    Best Answers:
    19
    Trophy Points:
    265
    #2
    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.
     
    JEET, Jun 27, 2020 IP
  3. qwikad.com

    qwikad.com Illustrious Member Affiliate Manager

    Messages:
    7,151
    Likes Received:
    1,656
    Best Answers:
    29
    Trophy Points:
    475
    #3
    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.
     
    Last edited: Jun 27, 2020
    qwikad.com, Jun 27, 2020 IP
    JEET likes this.
  4. JoshuaEir

    JoshuaEir Member

    Messages:
    59
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    28
    #4
    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
     
    JoshuaEir, Jun 29, 2020 IP
    JEET likes this.
  5. JEET

    JEET Notable Member

    Messages:
    3,825
    Likes Received:
    502
    Best Answers:
    19
    Trophy Points:
    265
    #5
    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>
     
    JEET, Jun 29, 2020 IP
  6. JoshuaEir

    JoshuaEir Member

    Messages:
    59
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    28
    #6
    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.
     
    JoshuaEir, Jun 30, 2020 IP
    JEET likes this.
  7. #7
    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.
     
    JEET, Jun 30, 2020 IP