It seems to me that there's a problem with checkbox attributes.
in functions_lookups.php
function zen_get_products_stock processes the $attributes variable passed as argument in this way:
if(is_array($attributes) and sizeof($attributes) > 0){
....
then
$query = 'select products_attributes_id from '.TABLE_PRODUCTS_ATTRIBUTES.' '.$first_search.' and products_id="'.$products_id.'" order by products_attributes_id';
$attributes_new = $db->Execute($query);
at this point we have an array with products_attributes_id
then
while(!$attributes_new->EOF){
$stock_attributes[] = $attributes_new->fields['products_attributes_id'];
$attributes_new->MoveNext();
}
if(sizeof($stock_attributes) > 1){
$stock_attributes = implode(',',$stock_attributes);
} else {
$stock_attributes = $stock_attributes[0];
}
$stock_query = 'select quantity as products_quantity from '.TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK.' where products_id = "'.(int)$products_id.'" and stock_attributes="'.$stock_attributes.'"';
the problem is $stock_attributes = implode(',',$stock_attributes);
because this code is executed even if I selected only 2 values of the same checkbox attribute and when this occurs, $stock_attributes value is something like '14,15' but of course if they're 2 values of the same checkbox attribute they won't be stored in TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK in this way.
So the result of the last query will be 0, and the quantity will be 0- product_quantity, --> always marked as out of stock.
Ok, discovered the problem, now searching the solution. Any help is appreciated.
Paolo De Dionigi
Co-maintainer of Zen Cart Italia