Needs review
Project:
UC Attribute Stock Filter
Version:
6.x-1.0-beta13
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
2 Jun 2011 at 19:01 UTC
Updated:
2 Jun 2011 at 19:01 UTC
An attribute with a negative stock value is not removed from the list. This simple patch fixes that:
--- a/sites/all/modules/uc_attribute_stock_filter/uc_attribute_stock_filter.module
+++ b/sites/all/modules/uc_attribute_stock_filter/uc_attribute_stock_filter.module
@@ -88,7 +88,7 @@ function uc_attribute_stock_filter_form_alter(&$form, $form_state, $form_id) {
$available = array();
while ($data = db_fetch_object($result)) {
$combo = unserialize($data->combination);
- if ($data->stock || !$data->active) { // Stock is available or stock tracking is NOT active
+ if ($data->stock > 0 || !$data->active) { // Stock is available or stock tracking is NOT active
$available = array_merge($available, array_values($combo)); // Merge value into array
}
}