Applied the changes below, and get the error message

1146 Table 'cactus2_zc2.products_with_attributes_stock' doesn't exist
in:
[select pov.products_options_values_id, pov.products_options_values_name, pa.* from zen_products_attributes pa join zen_products_options_values pov on pa.options_values_id = pov.products_options_values_id join products_with_attributes_stock PWAS on PWAS.stock_attributes = pa.products_attributes_id where pa.products_id = '339' and pa.options_id = '23' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '1' and PWAS.quantity > 0 order by LPAD(pa.products_options_sort_order,11,"0"), pov.products_options_values_name]

pasted the change from the post, so should be good. Zcart 1.3.8, php 5.2.6.

Stock with attributes worked OK before applying the change, with the Out of Stock items being displayed as OOS at checkout.

Verified table "cactus2_zc2.products_with_attributes_stock" does exist.

Should
"Join products_with_attributes_stock PWAS"
be
"join pa.products_with_attributes_stock PWAS" ??


Quote Originally Posted by krazykev View Post
Hi Kellan,

I did something very similar but didn't check for null/0 so didn't have to make your second change above.

select pov.products_options_values_id,
pov.products_options_values_name,
pa.*
from " . TABLE_PRODUCTS_ATTRIBUTES . " pa join " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov
on pa.options_values_id = pov.products_options_values_id
join products_with_attributes_stock PWAS
on PWAS.stock_attributes = pa.products_attributes_id
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'] . "'
and PWAS.quantity > 0 " .
$order_by;


This is in attributes.php