📄 attributes.php
字号:
// iii 030813 added: support for file fields
if ($products_options_names->fields['products_options_type'] == PRODUCTS_OPTIONS_TYPE_FILE) {
$number_of_uploads++;
if (zen_run_normal() == true and zen_check_show_prices() == true) {
// $cart->contents[$_GET['products_id']]['attributes_values'][$products_options_name['products_options_id']]
$tmp_html = '<input type="file" name="id[' . TEXT_PREFIX . $products_options_names->fields['products_options_id'] . ']" id="' . 'attrib-' . $products_options_names->fields['products_options_id'] . '-' . $products_options_value_id . '" /><br />' . $_SESSION['cart']->contents[$prod_id]['attributes_values'][$products_options_names->fields['products_options_id']] . "\n" .
zen_draw_hidden_field(UPLOAD_PREFIX . $number_of_uploads, $products_options_names->fields['products_options_id']) . "\n" .
zen_draw_hidden_field(TEXT_PREFIX . UPLOAD_PREFIX . $number_of_uploads, $_SESSION['cart']->contents[$prod_id]['attributes_values'][$products_options_names->fields['products_options_id']]);
} else {
$tmp_html = '';
}
$tmp_html .= $products_options_details;
}
// collect attribute image if it exists and to be drawn in table below
if ($products_options_names->fields['products_options_images_style'] == '0' or ($products_options_names->fields['products_options_type'] == PRODUCTS_OPTIONS_TYPE_FILE or $products_options_names->fields['products_options_type'] == PRODUCTS_OPTIONS_TYPE_TEXT or $products_options_names->fields['products_options_type'] == '0') ) {
if ($products_options->fields['attributes_image'] != '') {
$tmp_attributes_image_row++;
// if ($tmp_attributes_image_row > PRODUCTS_IMAGES_ATTRIBUTES_PER_ROW) {
if ($tmp_attributes_image_row > $products_options_names->fields['products_options_images_per_row']) {
$tmp_attributes_image .= '<br class="clearBoth" />' . "\n";
$tmp_attributes_image_row = 1;
}
$tmp_attributes_image .= '<div class="attribImg">' . zen_image(DIR_WS_IMAGES . $products_options->fields['attributes_image']) . (PRODUCT_IMAGES_ATTRIBUTES_NAMES == '1' ? '<br />' . $products_options->fields['products_options_values_name'] : '') . '</div>' . "\n";
}
}
// Read Only - just for display purposes
if ($products_options_names->fields['products_options_type'] == PRODUCTS_OPTIONS_TYPE_READONLY) {
// $tmp_html .= '<input type="hidden" name ="id[' . $products_options_names->fields['products_options_id'] . ']"' . '" value="' . stripslashes($products_options->fields['products_options_values_name']) . ' SELECTED' . '" /> ' . $products_options->fields['products_options_values_name'];
$tmp_html .= $products_options_details . '<br />';
} else {
$zv_display_select_option ++;
}
// default
// find default attribute if set to for default dropdown
if ($products_options->fields['attributes_default']=='1') {
$selected_attribute = $products_options->fields['products_options_values_id'];
}
$products_options->MoveNext();
}
//echo 'TEST I AM ' . $products_options_names->fields['products_options_name'] . ' Type - ' . $products_options_names->fields['products_options_type'] . '<br />';
// Option Name Type Display
switch (true) {
// text
case ($products_options_names->fields['products_options_type'] == PRODUCTS_OPTIONS_TYPE_TEXT):
if ($show_attributes_qty_prices_icon == 'true') {
$options_name[] = '<label class="attribsInput" for="' . 'attrib-' . $products_options_names->fields['products_options_id'] . '-' . $products_options_value_id . '">' . ATTRIBUTES_QTY_PRICE_SYMBOL . $products_options_names->fields['products_options_name'] . '</label>';
} else {
$options_name[] = '<label class="attribsInput" for="' . 'attrib-' . $products_options_names->fields['products_options_id'] . '-' . $products_options_value_id . '">' . $products_options_names->fields['products_options_name'] . '</label>';
}
$options_menu[] = $tmp_html . "\n";
$options_comment[] = $products_options_names->fields['products_options_comment'];
$options_comment_position[] = ($products_options_names->fields['products_options_comment_position'] == '1' ? '1' : '0');
break;
// checkbox
case ($products_options_names->fields['products_options_type'] == PRODUCTS_OPTIONS_TYPE_CHECKBOX):
if ($show_attributes_qty_prices_icon == 'true') {
$options_name[] = ATTRIBUTES_QTY_PRICE_SYMBOL . $products_options_names->fields['products_options_name'];
} else {
$options_name[] = $products_options_names->fields['products_options_name'];
}
$options_menu[] = $tmp_checkbox . "\n";
$options_comment[] = $products_options_names->fields['products_options_comment'];
$options_comment_position[] = ($products_options_names->fields['products_options_comment_position'] == '1' ? '1' : '0');
break;
// radio buttons
case ($products_options_names->fields['products_options_type'] == PRODUCTS_OPTIONS_TYPE_RADIO):
if ($show_attributes_qty_prices_icon == 'true') {
$options_name[] = ATTRIBUTES_QTY_PRICE_SYMBOL . $products_options_names->fields['products_options_name'];
} else {
$options_name[] = $products_options_names->fields['products_options_name'];
}
$options_menu[] = $tmp_radio . "\n";
$options_comment[] = $products_options_names->fields['products_options_comment'];
$options_comment_position[] = ($products_options_names->fields['products_options_comment_position'] == '1' ? '1' : '0');
break;
// file upload
case ($products_options_names->fields['products_options_type'] == PRODUCTS_OPTIONS_TYPE_FILE):
if ($show_attributes_qty_prices_icon == 'true') {
$options_name[] = '<label class="attribsUploads" for="' . 'attrib-' . $products_options_names->fields['products_options_id'] . '-' . $products_options_value_id . '">' . ATTRIBUTES_QTY_PRICE_SYMBOL . $products_options_names->fields['products_options_name'] . '</label>';
} else {
$options_name[] = '<label class="attribsUploads" for="' . 'attrib-' . $products_options_names->fields['products_options_id'] . '-' . $products_options_value_id . '">' . $products_options_names->fields['products_options_name'] . '</label>';
}
$options_menu[] = $tmp_html . "\n";
$options_comment[] = $products_options_names->fields['products_options_comment'];
$options_comment_position[] = ($products_options_names->fields['products_options_comment_position'] == '1' ? '1' : '0');
break;
// READONLY
case ($products_options_names->fields['products_options_type'] == PRODUCTS_OPTIONS_TYPE_READONLY):
$options_name[] = $products_options_names->fields['products_options_name'];
$options_menu[] = $tmp_html . "\n";
$options_comment[] = $products_options_names->fields['products_options_comment'];
$options_comment_position[] = ($products_options_names->fields['products_options_comment_position'] == '1' ? '1' : '0');
break;
// dropdown menu auto switch to selected radio button display
case ($products_options->RecordCount() == 1):
if ($show_attributes_qty_prices_icon == 'true') {
$options_name[] = '<label class="switchedLabel ONE" for="' . 'attrib-' . $products_options_names->fields['products_options_id'] . '-' . $products_options_value_id . '">' . ATTRIBUTES_QTY_PRICE_SYMBOL . $products_options_names->fields['products_options_name'] . '</label>';
} else {
$options_name[] = $products_options_names->fields['products_options_name'];
}
$options_menu[] = zen_draw_radio_field('id[' . $products_options_names->fields['products_options_id'] . ']', $products_options_value_id, 'selected', 'id="' . 'attrib-' . $products_options_names->fields['products_options_id'] . '-' . $products_options_value_id . '"') . '<label class="attribsRadioButton" for="' . 'attrib-' . $products_options_names->fields['products_options_id'] . '-' . $products_options_value_id . '">' . $products_options_details . '</label>' . "\n";
$options_comment[] = $products_options_names->fields['products_options_comment'];
$options_comment_position[] = ($products_options_names->fields['products_options_comment_position'] == '1' ? '1' : '0');
break;
default:
// normal dropdown menu display
if (isset($_SESSION['cart']->contents[$prod_id]['attributes'][$products_options_names->fields['products_options_id']])) {
$selected_attribute = $_SESSION['cart']->contents[$prod_id]['attributes'][$products_options_names->fields['products_options_id']];
} else {
// selected set above
// echo 'Type ' . $products_options_names->fields['products_options_type'] . '<br />';
}
if ($show_attributes_qty_prices_icon == 'true') {
$options_name[] = ATTRIBUTES_QTY_PRICE_SYMBOL . $products_options_names->fields['products_options_name'];
} else {
$options_name[] = '<label class="attribsSelect" for="' . 'attrib-' . $products_options_names->fields['products_options_id'] . '">' . $products_options_names->fields['products_options_name'] . '</label>';
}
$options_menu[] = zen_draw_pull_down_menu('id[' . $products_options_names->fields['products_options_id'] . ']', $products_options_array, $selected_attribute, 'id="' . 'attrib-' . $products_options_names->fields['products_options_id'] . '"') . "\n";
$options_comment[] = $products_options_names->fields['products_options_comment'];
$options_comment_position[] = ($products_options_names->fields['products_options_comment_position'] == '1' ? '1' : '0');
break;
}
// attributes images table
$options_attributes_image[] = $tmp_attributes_image . "\n";
$products_options_names->MoveNext();
}
// manage filename uploads
$_GET['number_of_uploads'] = $number_of_uploads;
// zen_draw_hidden_field('number_of_uploads', $_GET['number_of_uploads']);
zen_draw_hidden_field('number_of_uploads', $number_of_uploads);
}
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -