I just finished hacking mine. I am not advising this but it works for my site and I can't find/wait for a better answer. Use at your own risk!
I'm using ZC 1.3.8 and Stock By Attributes 1.4.9. This is for a dropdown menu with one attribute. I am not sure if this SQL is relevant to anything else.
In the file includes/modules/attributes.php around line 76 you should find this:
Code:
$sql = "select pov.products_options_values_id,
pov.products_options_values_name,
pa.*
from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov
where pa.products_id = '" . (int)$_GET['products_id'] . "'
and pa.options_id = '" . (int)$products_options_names->fields['products_options_id'] . "'
and pa.options_values_id = pov.products_options_values_id
and pov.language_id = '" . (int)$_SESSION['languages_id'] . "' " .
$order_by;
I replaced it with this:
Code:
$sql = "select pov.products_options_values_id,
pov.products_options_values_name,
pa.*
from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov
,products_with_attributes_stock ps
where pa.products_id = '" . (int)$_GET['products_id'] . "'
and pa.options_id = '" . (int)$products_options_names->fields['products_options_id'] . "'
and pa.options_values_id = pov.products_options_values_id
AND pa.products_attributes_id = ps.stock_attributes
AND pa.products_id = ps.products_id
AND ps.quantity > 0
and pov.language_id = '" . (int)$_SESSION['languages_id'] . "' " .
$order_by;
The funky indent is so you can see which lines I added.
Note that I did not use a variable name for the products_with_attributes_stock. What this does is when the attributes are selected it does not include any with Quantity 0 or less. Since this result is used to build the dropdown menu items that are out of stock never show up.
Again, this is pretty specific, but hopefully will help you solve your problem.