Out of Stock Options Do Not Appear
The site builder has a setting called 'Out of Stock' in the 'Catalog Setup' which controls whether out of stock items appear in the catalog. If this field is set to 'Yes', out of stock items appear, but show as unavailable/out of stock (and cannot be ordered). If this field is set to 'No', out of stock items do not appear.
However, this functionality does not carry through to options as it should. Instead, out of stock options (ie. ones that have zero in stock) just do not appear.
To change this behavior to function as expected, you can modify the system as follows. (Note: This modification is only valid for version 2.72; all future versions will have this update.)
-
Open the products_options.php file in the /enc/ folder and find the following code (around line 90):
else if ($attrow[0] <= 0 AND $inventorycheck == "No") $attributedisplay .= " (out of stock - on backorder)";
Just *after* that line, add the code:
else if ($attrow[0] <= 0 AND $Show_OOS == "Yes") $attributedisplay .= " (out of stock)";
-
Open the products_variables.php file in the /enc/ folder and find the following code (around line 354):
else { if ($inv == 1) $display_inventory .= str_replace(" are ", " is ", $label_limitinv1); else $display_inventory .= $label_limitinv1; $display_inventory .= $inv; if ($opt) $display_inventory .= " $opt"; $display_inventory .= $label_limitinv2; }Change this code to:
else { if (empty($inv) AND $Show_OOS == "Yes") $display_inventory .= "No $opt available"; else { if ($inv == 1) $display_inventory .= str_replace(" are ", " is ", $label_limitinv1); else $display_inventory .= $label_limitinv1; $display_inventory .= $inv; if ($opt) $display_inventory .= " $opt"; $display_inventory .= $label_limitinv2; } } -
In the storeadmin area, select the 'Out of Stock' setting and change it to 'Yes' so that options will appear as 'out of stock' if they have zero available in stock.