Quote Originally Posted by limelites View Post
Ahaaaaaaa, figured this one out guys!!

For anyone else having a problem with this issue, just look at re-installing the files that shipped with the stock_by_attributes mod.

I've just cured my problems by overwriting /includes/classes/order.php with the order.php from "stock_by_attributes_4-7MULTIADD mod"

Somehow some other mod had corrupted the data that updates the "Quantity in Stock" in ADMIN>CATALOG>PRODUCTS WITH ATTRIBUTES".

It is now updating the Quantity in Stock Column with each sale. All working perfectly now.

Additionally, if you want the attribute in the drop down menu to automatically disable when the attribute quantity = zero, then you have to open /includes/modules/attributes.php and replace this:
PHP 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
with this:
PHP Code:
$sql=    "SELECT  pov.products_options_values_id,
                            pov.products_options_values_name,
                            pa.*,
                            pwas.*
                FROM   " 
TABLE_PRODUCTS_OPTIONS_VALUES " pov, " TABLE_PRODUCTS_ATTRIBUTES " pa LEFT JOIN " TABLE_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    (pwas.quantity > 0 or pwas.quantity IS NULL)
                  and    pa.options_values_id = pov.products_options_values_id
                 and       pov.language_id = '" 
. (int)$_SESSION['languages_id'] . "' " .
                
$order_by
hello limelites or anybody who can help me ,i had followed the advice as ontop however after changing the text , i recieved this error message on stocks with 0 qty updated in the products with attributes page.
1146 Table 'beb0917211113392.TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK' doesn't exist
in:
[SELECT pov.products_options_values_id, pov.products_options_values_name, pa.*, pwas.* FROM zen_products_options_values pov, zen_products_attributes pa LEFT JOIN TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK pwas ON pwas.stock_attributes = pa.products_attributes_id WHERE pa.products_id = '3' and pa.options_id = '1' and (pwas.quantity > 0 or pwas.quantity IS NULL) and pa.options_values_id = pov.products_options_values_id and pov.language_id = '1' order by LPAD(pa.products_options_sort_order,11,"0"), pov.products_options_values_name]

Can anybody help me with this???? Thanks alot i am using v 1.38 zen cart along with v4.7 ajax with orders.php updated from multiadd.

My site is www.bebemummy.com