Products don't show - or items show zero quantities incorrectly

If a client adds spaces to the inventory boxes in the 'Inventory' screen of the product edit section of the storeadmin area, those spaces may be converted to zeros. That means that your items will show incorrectly as out of stock.

To correct this, you can have your clients remove any spaces in the inventory boxes.

OR

Make the following changes to your files, to automatically remove the spaces for the client:

  1. Open the itemlist.php and items.php files in the /storeadmin/ folder.

  2. In both files, change the line:

    if ($inventory[$i] >= 0 AND $inventory[$i] != "")

    to:

    $inventory[$i] = trim($inventory[$i]);
    if ($inventory[$i] >= 0 AND $inventory[$i] != "" AND is_numeric($inventory[$i]))
  3. In the itemlist.php file, also change the line:

    if ($thisinv[$x] >= 0 AND $thisinv[$x] != "")

    to:

    $thisinv[$x] = trim($thisinv[$x]);
    if ($thisinv[$x] >= 0 AND $thisinv[$x] != "" AND is_numeric($thisinv[$x]))
  4. And again in the itemlist.php file, also change the line:

    if ($generalinv == "" AND $generalinv != "0")

    to:

    $generalinv = trim($generalinv);
    if ($generalinv == "" AND $generalinv != "0" AND !is_numeric($generalinv))
  5. Save and reload the files.

  6. Your clients should look for items with zero inventory counts; if any show zero in stock when there aren't any counts, select the 'Inventory' screen and save to reset those counts.