osCmax v2.5 User Manual
Results 1 to 7 of 7

Customers can sometimes buy out of stock items

This is a discussion on Customers can sometimes buy out of stock items within the osCMax v2 Features Discussion forums, part of the osCmax v2.0 Forums category; I have a store with these stock settings: Check stock level true Subtract stock true Allow Checkout false Mark product ...

      
  1. #1
    Lurker holdera's Avatar
    Join Date
    Sep 2007
    Posts
    5
    Rep Power
    0


    Default Customers can sometimes buy out of stock items

    I have a store with these stock settings:

    Check stock level true
    Subtract stock true
    Allow Checkout false
    Mark product out of stock --call/email for availability
    Stock Re-order level 5

    the Admin section reports Current Version: osCMax v2.0.3

    and for the most part it works perfectly, allowing customers to see the items that are out of stock but not order them.

    But sometimes a customer successfully places an order for an out of stock item. The products table shows a negative qty after the order was placed indicating the original quantity was zero.

    I can't replicate it. The system always works fine for me. I have tried trying to buy an item with a zero qty, a negative quantity, a positive quantity that is less than my order queantity and all have failed to reproduce the problem

    I use price groups but most everyone is in the same group as my test customer (including the problem customers) , so that doesn't seem relevant.

    I do not use product attributes.

    I have hacked the price breaks mod into the store and it seems to work great in all cases.

    My store is populated by a nightly scheduled synchronization program I wrote to keep its products and stock levels etc in line with my accounting/point of sale system. It just executes sql queries to update the mysql database tables and I can confirm the stock levels are correct there. The products in question had been out of stock for some time so it isn't just a timing issue with the sync program. So i don't think this is relevant, but I mention it anyways because if someone was detailing a problem to me I'd want to know things like this.

    Has anybody had a similar problem?

  2. #2
    Lurker holdera's Avatar
    Join Date
    Sep 2007
    Posts
    5
    Rep Power
    0


    Default Re: Customers can sometimes buy out of stock items

    I have been thinking about this problem of mine. ( I have had lots of time since nobody has replied in 2 1/2 months ) I wonder if I don't properly understand the table structure and my sync program is to blame.

    The products table has a field for products_quantity and I populate it with my inventory numbers (which may be zero). But there is also a products_stock table that I haven't been populating. Should I be?

    also I notice that every time a customer successfully orders a product that is supposed to be out of stock, the products_status gets set to 0 (inactive) and the product no longer shows up in the store (and the products_quantity shows -1 which is bad n'kay?). I want out of stock products to be visible (so status = 1 or "active" I assume) and just not be purchasable. I don't want the stock to go below zero since in this case that doesn't make any sense because we don't back order out of stock items.

    Any Ideas?

  3. #3
    osCMax Development Team
    pgmarshall's Avatar
    Join Date
    Feb 2009
    Location
    London
    Posts
    2,678
    Rep Power
    49


    Smile Re: Customers can sometimes buy out of stock items

    Has anybody had a similar problem?
    Not that I have seen.

    Any Ideas?
    Have a look at catalog/includes/functions/general.php for tep_get_products_stock

    If you have a look through this function, assuming you are not using attributes (as you said), the code should be using the first $stock_query which gets the quantity from products_quantity in the products table.

    the products_status gets set to 0 (inactive) and the product no longer shows up in the store
    When a products stock gets to 0 then it is automatically disabled. You can re-enable the product to make it show again. It is the Allow Checkout set to false which is the trigger to mark the product status as 0 and hence hiding the product.

    I will raise a query in the bugtracker to ask if we should have functionality to allow checkout to be false but still display out of stock products ...

    Regards,
    pgmarshall
    _______________________________

  4. #4
    Lurker holdera's Avatar
    Join Date
    Sep 2007
    Posts
    5
    Rep Power
    0


    Default Re: Customers can sometimes buy out of stock items

    so populating the products table with zero quantity yet active products is creating a condition that couldn't occur under normal operation. Could this be why I am having problems? But even if populating the table like this had ramifications, I wouldn't think that customers would be able to buy the zero quantity items in any case if allow checkout is false.

    If I could ever reproduce the problem myself I am sure I could figure it out, but this never happens to me during testing. We just keep getting the odd order for an item that is out of stock. The customers are never helpful at detailing how they ordered the product to provide clues. Quite frustrating really. It creates a sense of unreliability with the store and that concerns me since it is my job to make it run properly and I don't really know that it's the store's fault.

  5. #5
    Lurker holdera's Avatar
    Join Date
    Sep 2007
    Posts
    5
    Rep Power
    0


    Default Re: Customers can sometimes buy out of stock items

    Hi pgmarshall, did you ever come to a consensus on the " if we should have functionality to allow checkout to be false but still display out of stock products" question?

  6. #6
    osCMax Development Team
    pgmarshall's Avatar
    Join Date
    Feb 2009
    Location
    London
    Posts
    2,678
    Rep Power
    49


    Default Re: Customers can sometimes buy out of stock items

    I have done some further testing on this issue you have raised. When I set up stocks in v2.5 with 0 quantity they do show in catalog but can not be checked out as per settings. If a stock is purchased so that none remain the stock also still displays in catalog.

    I am therefore unable to repeat the above senario - can you provide more detail of how to repeat this?

    Thanks,
    pgmarshall
    _______________________________

  7. #7
    Lurker holdera's Avatar
    Join Date
    Sep 2007
    Posts
    5
    Rep Power
    0


    Default Re: Customers can sometimes buy out of stock items

    Once a night, I populate the products and related tables via an sql query on an accounting program database to sync only items and prices that have changed with the in-store point of sale system. Every 2 hours during the day I sync changed quantities with the in-store point of sale system. Many items have a zero qty but I set the active flag to true so they are still visible. This all appears to work correctly. When I test the system, I can confirm that the system does NOT allow me to buy out of stock items or place an order for more items than are in stock. I have tested a fair amount and it always works for me.

    But orders keep showing up for out of stock items and I don't know how this can happen. The qty for the item was zero before the sale and -1 after (assuming an order of 1). The item is also set to inactive at the time of the order.

    when I check to see if it is just related to timing with the synchronization, I can see that the item in question had not been updated lately because the qty hadn't changed in the accounting system.

    I have added the price break mod but the checkout functionality has not been modified.

    I don't know what other info I can provide. Since I am the only person experiencing this, I think that maybe it has to do with how I populate the data. But I did a pretty thorough job of mimicking how the system does it when one manually adds a product, other than perhaps adding an item with zero qty but still active.

Similar Threads

  1. Number Items in Cart without items displaying in $cartbox
    By michael_s in forum New osCommerce Contributions
    Replies: 0
    Last Post: 12-15-2008, 10:50 AM
  2. Make out of stock items ACTIVE
    By ScaleCreep in forum osCmax v2 Customization/Mods
    Replies: 2
    Last Post: 01-10-2008, 07:44 AM
  3. How to prevent out of stock items becoming inactive?
    By ScaleCreep in forum osCommerce 2.2 Modification Help
    Replies: 1
    Last Post: 02-15-2005, 08:37 PM
  4. Downloaded Items don't reduce Stock Quantity
    By midwestwebsites in forum osCmax v1.7 Discussion
    Replies: 3
    Last Post: 11-01-2003, 11:28 AM
  5. Disabling "Buy Now" for items out of stock.
    By Axe in forum osCommerce 2.2 Modification Help
    Replies: 1
    Last Post: 10-17-2002, 08:01 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •