
Originally Posted by
SurrealDesign
I second Jettrue, I'm trying to do the same, I just cannot get it to work....
If someone has their php file would be massively appreciated.
Nyssa.
I actually got it myself. I just add an if statement right before the section where the drop menu items are created. Anyway, I'm attaching my includes/modules/attributes.php. Use at your own risk and please test. This one will show how many items in stock in the drop down, but will NOT show a drop down item if its not in stock. I'm using the multiadd version, so I'm not sure if its compatible if you're using the other.
If you want to just replace what I've changed, here's my chunk starting $sql starting around line 79 in my file, and ending RIGHT BEFORE this line:
Code:
if (((CUSTOMERS_APPROVAL == '2' and $_SESSION['customer_id'] == '') or (STORE_STATUS == '1')) or ((CUSTOMERS_APPROVAL_AUTHORIZATION == '1' or CUSTOMERS_APPROVAL_AUTHORIZATION == '2') and $_SESSION['customers_authorization'] == '') or (CUSTOMERS_APPROVAL == '2' and $_SESSION['customers_authorization'] == '2') or (CUSTOMERS_APPROVAL_AUTHORIZATION == '2' and $_SESSION['customers_authorization'] != 0) ) {
Here's my chunk:
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;
$products_options = $db->Execute($sql);
$products_options_value_id = '';
$products_options_details = '';
$products_options_details_noname = '';
$tmp_radio = '';
$tmp_checkbox = '';
$tmp_html = '';
$selected_attribute = false;
$tmp_attributes_image = '';
$tmp_attributes_image_row = 0;
$show_attributes_qty_prices_icon = 'false';
while (!$products_options->EOF) {
// reset
$products_options_display_price='';
$new_attributes_price= '';
$price_onetime = '';
if($products_options->fields['quantity'] > 0)
{
$products_text_to_use = $products_options->fields['products_options_values_name'] . " (" . $products_options->fields['quantity'] . " Available)"; //yes Available is improperly hard coded
}
else
{
$products_text_to_use = $products_options->fields['products_options_values_name'];
}
if($products_options->fields['quantity'] > 0)
{
$products_options_array[] = array('id' => $products_options->fields['products_options_values_id'],
'text' => $products_text_to_use);
}
else
{}
Bookmarks