New Zenner
- Join Date:
- Apr 2006
- Posts:
- 74
- Plugin Contributions:
- 0
Stocks by attributes
In answer to my previous question, here the remedy. Many thanks to my flatmate is is somewhate more php literate than I am.
Instead of changing
$products_options_array[] = array('id' => $products_options->fields['products_options_values_id'],
'text' => $products_options->fields['products_options_values_name']);
with
$products_options_array[] = array('id' => $products_options->fields['products_options_values_id'],
'text' => $products_options->fields['products_options_values_name'] .' [' . $products_options->fields['quantity'] . ' '. TEXT_ATTRIBUTES_PIECES . ']');
as per http://www.zen-cart.com/forum/showthread.php?t=25987&page=19 post 188, change it to this instead.
if ($products_options->fields['quantity'] >0){
$dropdown_instock = TEXT_ATTRIBUTES_IN_STOCK;
} else {
$dropdown_instock = TEXT_ATTRIBUTES_NOT_IN_STOCK;
}
$products_options_array[] = array('id' => $products_options->fields['products_options_values_id'],
'text' => $products_options->fields['products_options_values_name'] .' [' . $dropdown_instock . ' '. TEXT_ATTRIBUTES_PIECES . ']');
v1.3.0.2