Thomp
Archived-
Posts
36 -
Joined
-
Last visited
Everything posted by Thomp
-
Has anyone been able to merge this contrib with anti-robot registrations? I tried doing a merger and it did not work out that well. Here is my code: (ive got no clue why it does not work) <?php /* $Id: wholesale.php,v 1.42 2003/06/12 12:17:07 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions [url="http://www.oscommerce.com"]http://www.oscommerce.com[/url] Copyright © 2003 osCommerce Released under the GNU General Public License */ require('includes/application_top.php'); // BOF Anti Robot Validation v2.5 if (ACCOUNT_VALIDATION == 'true' && WHOLESALE_VALIDATION == 'true') { require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ACCOUNT_VALIDATION); include_once('includes/functions/' . FILENAME_ACCOUNT_VALIDATION); } // EOF Anti Robot Registration v2.5 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_WHOLESALE); $error = false; if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'send')) { // BOF Anti Robotic Registration v2.5 if (ACCOUNT_VALIDATION == 'true' && WHOLESALE_VALIDATION == 'true') { $sql = "SELECT * FROM " . TABLE_ANTI_ROBOT_REGISTRATION . " WHERE session_id = '" . tep_session_id() . "' LIMIT 1"; if( !$result = tep_db_query($sql) ) { $error = true; $entry_antirobotreg_error = true; $text_antirobotreg_error = ERROR_VALIDATION_1; } else { $entry_antirobotreg_error = false; $anti_robot_row = tep_db_fetch_array($result); if (( strtoupper($HTTP_POST_VARS['antirobotreg']) != $anti_robot_row['reg_key'] ) || ($anti_robot_row['reg_key'] == '') || (strlen($antirobotreg) != ENTRY_VALIDATION_LENGTH)) { $error = true; $entry_antirobotreg_error = true; $text_antirobotreg_error = ERROR_VALIDATION_2; } else { $sql = "DELETE FROM " . TABLE_ANTI_ROBOT_REGISTRATION . " WHERE session_id = '" . tep_session_id() . "'"; if( !$result = tep_db_query($sql) ) { $error = true; $entry_antirobotreg_error = true; $text_antirobotreg_error = ERROR_VALIDATION_3; } else { $sql = "OPTIMIZE TABLE " . TABLE_ANTI_ROBOT_REGISTRATION . ""; if( !$result = tep_db_query($sql) ) { $error = true; $entry_antirobotreg_error = true; $text_antirobotreg_error = ERROR_VALIDATION_4; } else { $entry_antirobotreg_error = false; } } } } if ($entry_antirobotreg_error == true) $messageStack->add('wholesale_submit', $text_antirobotreg_error); } // EOF Anti Robotic Registration v2.5 $name = tep_db_prepare_input($HTTP_POST_VARS['name']); $email_address = tep_db_prepare_input($HTTP_POST_VARS['email']); $enquiry = tep_db_prepare_input($HTTP_POST_VARS['enquiry']); $store_name = tep_db_prepare_input($HTTP_POST_VARS['store_name']); $store_phone = tep_db_prepare_input($HTTP_POST_VARS['store_phone']); $store_address = tep_db_prepare_input($HTTP_POST_VARS['store_address']); $store_tax_id = tep_db_prepare_input($HTTP_POST_VARS['store_tax_id']); // BOF Anti Robot Registration v2.5 if (tep_validate_email($email_address)) { $error = true; $messageStack->add('wholesale_submit', ENTRY_EMAIL_ADDRESS_CHECK_ERROR); } elseif (!$entry_antirobotreg_error == true) { tep_mail(STORE_OWNER, WHOLESALE_EMAIL, EMAIL_SUBJECT, 'Store Name: ' . $store_name . "\r\n\r\n" . 'Name: ' . $name . "\r\n\r\n" . 'Phone: ' . $store_phone . "\r\n\r\n" . 'Address: ' . $store_address . "\r\n\r\n" . 'Tax ID: ' . $store_tax_id . "\r\n\r\n" . 'Background information: ' . $enquiry, $name, $email_address); tep_redirect(tep_href_link(FILENAME_WHOLESALE, 'action=success')); } // EOF Anti Robotic Registration v2.5 } $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_WHOLESALE)); ?> <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> <html <?php echo HTML_PARAMS; ?>> <head> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>"> <title><?php echo TITLE; ?></title> <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>"> <link rel="stylesheet" type="text/css" href="stylesheet.css"> </head> <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0"> <!-- header //--> <?php require(DIR_WS_INCLUDES . 'header.php'); ?> <!-- header_eof //--> <!-- body //--> <table border="0" width="100%" cellspacing="3" cellpadding="3"> <tr> <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2"> <!-- left_navigation //--> <?php require(DIR_WS_INCLUDES . 'column_left.php'); ?> <!-- left_navigation_eof //--> </table></td> <!-- body_text //--> <td width="100%" valign="top"><?php echo tep_draw_form('wholesale_request', tep_href_link(FILENAME_WHOLESALE, 'action=send')); ?><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="pageHeading"><?php echo HEADING_TITLE; ?></td> </tr> </table></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php if ($messageStack->size('wholesale_submit') > 0) { ?> <tr> <td><?php echo $messageStack->output('wholesale_submit'); ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php } if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'success')) { ?> <tr> <td class="main" align="center"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_man_on_board.gif', HEADING_TITLE, '0', '0', 'align="left"') . TEXT_SUCCESS; ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"> <tr class="infoBoxContents"> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> </table></td> </tr> </table></td> </tr> <?php } else { ?> <tr> <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"> <tr class="infoBoxContents"> <td><font size="2"><?php echo ENTRY_WHOLESALE_TEXT; ?></font><br><br> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="main" colspan="2"><?php echo ENTRY_NAME; ?></td> </tr> <tr> <td class="main" colspan="2"><?php echo tep_draw_input_field('name'); ?></td> </tr> <tr> <td class="main" colspan="2"><?php echo ENTRY_EMAIL; ?></td> </tr> <tr> <td class="main" colspan="2"><?php echo tep_draw_input_field('email'); ?></td> </tr> <tr> <td class="main" colspan="2"><?php echo ENTRY_STORE_NAME; ?></td> </tr> <tr> <td class="main" colspan="2"><?php echo tep_draw_input_field('store_name'); ?> </td> </tr> <tr> <td class="main" colspan="2"><?php echo ENTRY_STORE_PHONE; ?></td> </tr> <tr> <td class="main" colspan="2"><?php echo tep_draw_input_field('store_phone'); ?> </td> </tr> <tr> <td class="main" width="40%"><?php echo ENTRY_STORE_ADDRESS; ?></td> <td> </td> </tr> <tr> <td class="main" width="40%"><?php echo tep_draw_textarea_field('store_address', 'soft', 20, 4); ?></td> <td> </td> </tr> <tr> <td class="main" colspan="2"><?php echo ENTRY_STORE_TAX_ID; ?></td> </tr> <tr> <td class="main" colspan="2"><?php echo tep_draw_input_field('store_tax_id'); ?></td> </tr> <tr> <td class="main" colspan="2"><?php echo ENTRY_ENQUIRY; ?></td> </tr> <tr> <td class="main" colspan="2"><?php echo tep_draw_textarea_field('enquiry', 'soft', 50, 15); ?></td> </tr></table></td> </tr> </table></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php // BOF Anti Robot Registration v2.5 if (ACCOUNT_VALIDATION == 'true' && strstr($PHP_SELF,'wholesale_submit') && WHOLESALE_VALIDATION == 'true') { ?> <tr> <td class="main"><b><?php echo CATEGORY_ANTIROBOTREG; ?></b></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"> <tr class="infoBoxContents"> <td><table border="0" cellspacing="2" cellpadding="2"> <tr> <?php if (ACCOUNT_VALIDATION == 'true' && strstr($PHP_SELF,'wholesale_submit') && WHOLESALE_VALIDATION == 'true') { if ($is_read_only == false || (strstr($PHP_SELF,'wholesale_submit')) ) { $sql = "DELETE FROM " . TABLE_ANTI_ROBOT_REGISTRATION . " WHERE timestamp < '" . (time() - 3600) . "' OR session_id = '" . tep_session_id() . "'"; if( !$result = tep_db_query($sql) ) { die('Could not delete validation key'); } $reg_key = gen_reg_key(); $sql = "INSERT INTO ". TABLE_ANTI_ROBOT_REGISTRATION . " VALUES ('" . tep_session_id() . "', '" . $reg_key . "', '" . time() . "')"; if( !$result = tep_db_query($sql) ) { die('Could not check registration information'); } ?> <tr> <td class="main"><table border="0" width="100%" cellspacing="0" cellpadding="2" class="formArea"> <tr> <td class="main"><table border="0" cellspacing="0" cellpadding="2"> <tr> <td class="main" width="100%" NOWRAP><span class="main"> <?php echo ENTRY_ANTIROBOTREG; ?></span></td> </tr> <tr> <td class="main" width="100%"> <?php $check_anti_robotreg_query = tep_db_query("select session_id, reg_key, timestamp from anti_robotreg where session_id = '" . tep_session_id() . "'"); $new_guery_anti_robotreg = tep_db_fetch_array($check_anti_robotreg_query); $validation_images = '<img src="validation_png.php?rsid=' . $new_guery_anti_robotreg['session_id'] . '">'; if ($entry_antirobotreg_error == true) { ?> <span> <?php echo $validation_images . ' <br> '; echo tep_draw_input_field('antirobotreg') . ' <br><b><font color="red">' . ERROR_VALIDATION . '<br>' . $text_antirobotreg_error . '</b></font>'; } else { ?> <span> <?php echo $validation_images . ' <br> '; echo tep_draw_input_field('antirobotreg', $account['entry_antirobotreg']) . ' ' . ENTRY_ANTIROBOTREG_TEXT; } } } ?> </span> </td> </tr> </table></td> </tr> </table></td> </tr> </tr> </table></td> </tr> </table></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php } // EOF Anti Robot Registration v2.5 ?> <tr> <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"> <tr class="infoBoxContents"> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td align="right"><?php echo tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> </table></td> </tr> </table></td> </tr> <?php } ?> </table></form></td> <!-- body_text_eof //--> <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2"> <!-- right_navigation //--> <?php require(DIR_WS_INCLUDES . 'column_right.php'); ?> <!-- right_navigation_eof //--> </table></td> </tr> </table> <!-- body_eof //--> <!-- footer //--> <?php require(DIR_WS_INCLUDES . 'footer.php'); ?> <!-- footer_eof //--> <br> </body> </html> <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?> Appreciate any help greatly!! Thanks!! -thomp
-
Great job! I think this is a great contribution! What I would like to see though is functionality where you could use different language banners. This would be especially important for multilanguage sites. So you would see the english banners for the english language and french banners for the french language etc. Also, If there would be a way to move the duration of months etc variables to the admin pages, that would be great. But nice job, thanks for the contrib! -thomp
-
Ok, I havent been able to find a contribution or a solution to this, I cant believe it hasnt already been solved so either I'm dumb as shit or stumbling upon something totally new. Anyway, I have a website that is live and running perfectly. I've got two languages installed and would like to install a third. How do I install a third language without showing it in the front end as I'm editing and adding text etc? Is there a way to make the new language inactive while the editing is being done? How do I hide the new language from the active shop without taking the whole language box out of the picture (already have two working languages). Would love to hear if this has already been addressed.. Thanks!
-
nothing huh? no one knows or have ever heard of such a thing?
-
Is there such a contribution? I need to have the options price change with the different languages a user selects. Is this even possible? I looked that the options values reside in PRODUCTS_OPTIONS_VALUES table, while the language id resides in PRODUCT_ATTRIBUTES. Somehow I would need to have the language added into the first mentioned table, and then have in the product_attributes.php an option to insert a price per different languages. Has anyone ever tried this? I know it sounds like a ridiculous contribution, but it would work for what I'm building. Thanks!
-
I'm sure most of you havent even noticed but admin/options_images.php does not work with multiple languages. It correctly populates the different options but fails to duplicate or add the thumbnails to other than the default language. The field products_options_values_name gets populated perfectly, the languge functionality works. But, the products_options_values_thumbnail does not, its just a blank. I've tried to figure out what is going on in the code but have no clue how to fix it. If any of you guru's have a moment to take a look, I'm sure its a simple fix since the products_options_values_name gets populated, so I dont understand why the thumbnail doesnt. Anyone who helps, positively rocks! <?php /* $Id: options_images.php,v 1.0 2003/08/18 osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ $language_id = '1'; require('includes/application_top.php'); //check that destination directory exists and is writeable if (is_dir(DIR_FS_CATALOG_IMAGES . 'options/')) { if (!is_writeable(DIR_FS_CATALOG_IMAGES . 'options/')) $messageStack->add(ERROR_OPTIONS_IMAGES_DIRECTORY_NOT_WRITEABLE, 'error'); } else { $messageStack->add(ERROR_OPTIONS_IMAGE_DIRECTORY_DOES_NOT_EXIST, 'error'); } if ($HTTP_GET_VARS['action']) { switch ($HTTP_GET_VARS['action']) { case 'save': $image_source = $HTTP_POST_FILES['value_image_input']['tmp_name']; $filename = $HTTP_POST_FILES['value_image_input']['name']; $image_destination = DIR_FS_CATALOG_IMAGES . 'options/' . $filename; $cID = tep_db_prepare_input($HTTP_GET_VARS['cID']); copy($image_source , $image_destination) or die("unable to copy $image_source to location $image_destination"); tep_db_query("update " . TABLE_PRODUCTS_OPTIONS_VALUES . " set products_options_values_thumbnail = '" . tep_db_input($filename) . "' where products_options_values_id = '" . tep_db_input($cID) . "' and language_id = '" .$language_id . "'"); tep_redirect(tep_href_link(FILENAME_OPTIONS_IMAGES, '&cID=' . $cID . '&box_id=' . $HTTP_GET_VARS['box_id'])); break; case 'update_enabled': tep_db_query("update " . TABLE_PRODUCTS_OPTIONS . " set products_options_images_enabled = 'false'"); foreach ($HTTP_POST_VARS ['option_select'] as $options_selected){ tep_db_query("update " . TABLE_PRODUCTS_OPTIONS . " set products_options_images_enabled = 'true' where products_options_id = '" . $options_selected . "'"); } break; } } ?> <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> <html <?php echo HTML_PARAMS; ?>> <head> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>"> <title><?php echo TITLE; ?></title> <link rel="stylesheet" type="text/css" href="includes/stylesheet.css"> <script language="javascript" src="includes/general.js"></script> </head> <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();"> <!-- header //--> <?php require(DIR_WS_INCLUDES . 'header.php'); ?> <!-- header_eof //--> <!-- body //--> <table border="0" width="100%" cellspacing="2" cellpadding="2"> <tr> <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft"> <!-- left_navigation //--> <?php require(DIR_WS_INCLUDES . 'column_left.php'); ?> <!-- left_navigation_eof //--> </table></td> <!-- body_text //--> <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="pageHeading"><?php echo HEADER_TITLE; ?></td> <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td> </tr> <tr><td class="smalltext">Select an option category to edit: <?php if (isset($HTTP_POST_VARS['box_select'])) $options_id = $HTTP_POST_VARS['box_select']; else if (isset($HTTP_GET_VARS['box_id']))$options_id = $HTTP_GET_VARS['box_id']; else if (isset($HTTP_GET_VARS['cID'])){ $options_query = tep_db_query("select products_options_id from " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . " where products_options_values_id='" . $HTTP_GET_VARS['cID'] . "'"); $options = tep_db_fetch_array ($options_query); $options_id = $options['products_options_id']; } else $options_id = 1; $options_query = tep_db_query("select * from " . TABLE_PRODUCTS_OPTIONS . " where language_id='" . $language_id . "'"); $i=0; while ($options = tep_db_fetch_array ($options_query)){ $values[$i]['id']= $options['products_options_id']; $values[$i]['text']= $options['products_options_name']; $i++; } echo tep_draw_form('box_selection', FILENAME_OPTIONS_IMAGES,''); echo tep_draw_pull_down_menu('box_select', $values, $options_id, 'onChange="this.form.submit();"'); echo '</form>'; ?> </td> </tr> </table></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr class="dataTableHeadingRow"> <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_NAME; ?></td> <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_IMAGE; ?></td> <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_IMAGE_NAME; ?></td> </tr> <?php $query1 = tep_db_query("select * from " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . " where products_options_id = '" . $options_id . "'" ); //First find all the products options values that belong to the selected product option while ($result1 = tep_db_fetch_array($query1)) { $products_options_values_id = $result1['products_options_values_id']; //Now pull their details from the database $query2 = tep_db_query ("select * from " . TABLE_PRODUCTS_OPTIONS_VALUES . " where products_options_values_id = '" . $products_options_values_id . "' and language_id = '" .$language_id . "'"); while ($result2 = tep_db_fetch_array($query2)) { $products_options_values_name = $result2['products_options_values_name']; $products_options_values_thumbnail = $result2['products_options_values_thumbnail']; if ($HTTP_GET_VARS['cID'] == $products_options_values_id){ $selected_value['name'] = $products_options_values_name; $selected_value['image'] = $products_options_values_thumbnail; $selected_value['id'] = $products_options_values_id; } if ( (isset($selected_value['id'])) && ($products_options_values_id == $selected_value['id']) ) { echo ' <tr class="dataTableRowSelected" onmouseover="this.style.cursor=\'hand\'" onclick="document.location.href=\'' . tep_href_link(FILENAME_OPTIONS_IMAGES, '&cID=' . $products_options_values_id . '&box_id=' . $options_id . '&action=edit') . '\'">' . "\n"; } else { echo ' <tr class="dataTableRow" onmouseover="this.className=\'dataTableRowOver\';this.style.cursor=\'hand\'" onmouseout="this.className=\'dataTableRow\'" onclick="document.location.href=\'' . tep_href_link(FILENAME_OPTIONS_IMAGES, '&cID=' . $products_options_values_id . '&box_id=' . $options_id ) . '\'">' . "\n"; } ?> <td class="dataTableContent"><?php echo $products_options_values_name ?></td> <td class="dataTableContent" align="center"><?php echo tep_image(DIR_WS_CATALOG_IMAGES . '/options/' . $products_options_values_thumbnail, $products_options_values_name, '50', '50') ?></td> <td class="dataTableContent"><?php echo $products_options_values_thumbnail ?></td> </tr> <?php } } ?> </table></td> <?php $heading = array(); $contents = array(); switch ($HTTP_GET_VARS['action']) { case 'edit': $heading[] = array('text' => '<b>'.$selected_value['name'].'</b>'); $contents = array('form' => tep_draw_form('value_image_input', FILENAME_OPTIONS_IMAGES, '&cID=' . $selected_value['id'] . '&box_id=' . $options_id . '&action=save', 'post', 'enctype="multipart/form-data"')); $contents[] = array('text' => TEXT_INFO_EDIT_INTRO); $contents[] = array('text' => '<br>' . TEXT_SELECT_FILE . '<br>' . tep_draw_file_field('value_image_input')); $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_update.gif', IMAGE_UPDATE) . ' <a href="' . tep_href_link(FILENAME_OPTIONS_IMAGES, '&cID=' . $selected_value['id']) . '&box_id=' . $options_id .'">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'); break; default: if (isset ($selected_value['id'])){ $heading[] = array('text' => '<b>' . $selected_value['name'] . '</b>'); $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_OPTIONS_IMAGES, '&cID=' . $selected_value['id'] . '&box_id=' . $box_id . '&action=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_OPTIONS_IMAGES, '&cID=' . $selected_value['id']. '&box_id=' . $box_id . '&action=delete') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a>'); break; } } if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) { echo ' <td width="25%" valign="top" align="center">' . "\n"; $box = new box; echo $box->infoBox($heading, $contents); echo ' </td>' . "\n"; } ?> </tr> <tr><td> <?php echo tep_draw_form('update_enabled_options', FILENAME_OPTIONS_IMAGES, '&cID=' . $selected_value['id'] . '&box_id=' . $options_id . '&action=update_enabled', 'post'); echo '<tr><td class="smalltext">You currently have Options as Images enabled for the following options categories:</td></tr>'; $options_query = tep_db_query("select * from " . TABLE_PRODUCTS_OPTIONS . " where language_id = '" . $language_id . "'"); echo '<tr><td class="smalltext">'; while ($options = tep_db_fetch_array ($options_query)){ if ($options['products_options_images_enabled'] == 'true') $checked = true; else $checked = false; echo $options['products_options_name'] . tep_draw_selection_field('option_select[' . $options['products_options_id'] . ']', 'checkbox', $options['products_options_id'], $checked) . ' | '; } echo tep_image_submit('button_update.gif', IMAGE_UPDATE); echo '</td></tr>'; ?> </table></td> </tr> </table></td> <!-- body_text_eof //--> </tr> </table> <!-- body_eof //--> <!-- footer //--> <?php require(DIR_WS_INCLUDES . 'footer.php'); ?> <!-- footer_eof //--> <br> </body> </html> <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
-
Tried installing the anti-robot for the review system but all I get is an empty box in the review page. Has anyone been able to install this mod to the anti-robot contrib? -Thomp
-
Has anyone tried combining FEC with Anti Robot Registration, or SuperContact US mods? I've run into a brick wall with trying to integrate the FEC create_account3.php file and the create_account.php that the Anti Robot requires. The real problem I guess arises from the account_box.php and account_box2.php files. I was able to get the account_box.php to work but the latter just doesnt seem to work. Here is the code I've done so far. If anyone would be able to help, it would be much appreciated, and I'm sure others would love to see it too since I couldnt find anyone doing this yet! I have a feeling this is a easy fix, but please help me out here! From account_box2.php <?php if($fromlogin!=1){ ?> <tr> <td class="main"><b><?php if($fromlogin!=1){echo CATEGORY_CREATE_ACCOUNT;}else{echo CATEGORY_PASSWORD;} ?></b></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"> <tr class="infoBoxContents"> <td><table border="0" cellspacing="2" cellpadding="2"> <?php if($fromlogin!=1){ ?> <tr> <td class="main"><?php echo ENTRY_CREATEACCOUNT; ?></td> </tr> <tr> <td class="main"><?php echo tep_draw_checkbox_field('createaccount', 'Y',$checked = false ,'id="toggle"' ) . ' ' . YES_ACCOUNT; ?></td> </tr> <tr><td> <p id="lorem" ><span class="infoBoxContents"><?php echo ENTRY_PASSWORD.' '; ?> <?php echo tep_draw_password_field('password') . ' ' . (tep_not_null(ENTRY_PASSWORD_TEXT) ? '<span class="inputRequirement">' . ENTRY_PASSWORD_TEXT . '</span>': ''); ?><br><span class="infoBoxContents"> <?php echo ENTRY_PASSWORD_CONFIRMATION; ?> <?php echo tep_draw_password_field('confirmation') . ' ' . (tep_not_null(ENTRY_PASSWORD_CONFIRMATION_TEXT) ? '<span class="inputRequirement">' . ENTRY_PASSWORD_CONFIRMATION_TEXT . '': '</span>'); ?> </p></td></tr> </table></td> </tr> </table> <?php } ?></td> </tr> <!-- // BOF Anti Robot Registration v2.6--> <?php if (ACCOUNT_VALIDATION == 'true' && strstr($PHP_SELF,'create_account') && ACCOUNT_CREATE_VALIDATION == 'true') { ?> <tr> <td class="main"><b><?php echo CATEGORY_ANTIROBOTREG; ?></b></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"> <tr class="infoBoxContents"> <td><table border="0" cellspacing="2" cellpadding="2"> <tr> <?php if (ACCOUNT_VALIDATION == 'true' && strstr($PHP_SELF,'create_account') && ACCOUNT_CREATE_VALIDATION == 'true') { if ($is_read_only == false || (strstr($PHP_SELF,'create_account')) ) { $sql = "DELETE FROM " . TABLE_ANTI_ROBOT_REGISTRATION . " WHERE timestamp < '" . (time() - 3600) . "' OR session_id = '" . tep_session_id() . "'"; if( !$result = tep_db_query($sql) ) { die('Could not delete validation key'); } $reg_key = gen_reg_key(); $sql = "INSERT INTO ". TABLE_ANTI_ROBOT_REGISTRATION . " VALUES ('" . tep_session_id() . "', '" . $reg_key . "', '" . time() . "')"; if( !$result = tep_db_query($sql) ) { die('Could not check registration information'); } ?> <tr> <td class="main"><table border="0" width="100%" cellspacing="0" cellpadding="2" class="formArea"> <tr> <td class="main"><table border="0" cellspacing="0" cellpadding="2"> <tr> <td class="main" width="100%" NOWRAP><span class="main"> <?php echo ENTRY_ANTIROBOTREG; ?></span></td> </tr> <tr> <td class="main" width="100%"> <?php $check_anti_robotreg_query = tep_db_query("select session_id, reg_key, timestamp from anti_robotreg where session_id = '" . tep_session_id() . "'"); $new_guery_anti_robotreg = tep_db_fetch_array($check_anti_robotreg_query); $validation_images = tep_image('validation_png.php?rsid=' . $new_guery_anti_robotreg['session_id']); if ($entry_antirobotreg_error == true) { ?> <span> <?php echo $validation_images . ' <br> '; echo tep_draw_input_field('antirobotreg') . ' <br><b><font color="red">' . ERROR_VALIDATION . '<br>' . $text_antirobotreg_error . '</b></font>'; } else { ?> <span> <?php echo $validation_images . ' <br> '; echo tep_draw_input_field('antirobotreg', $account['entry_antirobotreg']) . ' ' . ENTRY_ANTIROBOTREG_TEXT; } } } ?> </span> </td> </tr> </table></td> </tr> </table></td> </tr> </tr> </table></td> </tr> </table></td> </tr> <!-- // EOF Anti Robot Registration v2.6--> <?php }else{include('includes/fec/account_box.php'); } ?>
-
Craig, Thanks for your Help! Exactly as I thought, it was the mysql version that was causing the problems. I have now switched servers and have the same setup as above. Everything works beautifully! On a side note, I'm still trying to merge MVS and FEC but the checkout_shipping.php is giving me all sorts of headaches. You mentioned sometime back that you knew of someone who had succesfully merged them, could you point me in their direction or is there a way to get in touch with that person. I would love to see their checkout_shipping.php file and get this thing solved! Thanks again!! Regards, Thomp
-
Hi Craig, Just to follow up on my problem. I did some testing to see if the other contribs that I've installed were at fault. So I made a vanilla install of OsC and then installed MVS on that. Assuming that the installation package of MVS is rock solid, and other users are installing it successfully then it should work with a vanilla OsC. Well the end result was the same. The damn shipping modules in the vendor management would not update. Basically no values are being passed forward. So assuming that there are no problems with the MVS package, then its gotta be the MySQL? Again I read that an older version of MySQL cant handle certain syntax that a newer one can, so some of the code in MVS is not compatible with MySQL 3.23. With the rest of OsC showing no signs of incompatibility or problems, I just cant make any other sense of this. <_< I'm seriously thinking of dumping my current hosting service and switching to another one with newer MySQL version, but taking that step just because of a hypothesis makes me a little uneasy. Could it possibly be anything else? :blink: -Thomp ps. I'm sure you've noticed that I'm a persistent little bugger.. (or just plain stubborn) :lol:
-
I started thinking, could this be caused by an old version of mysql not working with the MVS code? Particularly subqueries? As far as I know, the mysql that is on my server is version 3.23.37 If this is the case, how would I go about fixing this? -thomp
-
Hi Craig, Thanks for your help with this. I'm really miffed. Ive gone over the vendor_modules.php a few times new, compared it with modules.php and cant really find anything a miss. :blink: I just dont get it. The modules.php works just fine, but the vendor_modules.php doesnt. Like you said, the values are not being passed between the database and the form. I just cant figure out how to fix it.. or where to even begin! :'( could it possibly be some other file that is messing the update up? I dont even get any error messages into my server logs. Its just really really weird. The database looks correct, just as the installation says. I've tirelessly tried to check the other contribs; FEC, HTC and Ultrapics that they dont interfere with MVS. What am I missing here? Appreciate your help!! -thomp :'(
-
Thanks. I did that and got this in response: :'( the $value: 1 and the $key: I'm able to do changes elsewhere in the shop, its just the MVS module that is not updating the database. Are the session variables different somehow than what I am running right now? Ive got the latest version of OsC. -thomp :blink:
-
Hi Craig, thanks for your help! I tried adding the echo to the location you suggested. Nothing happened after I had installed it and tinkered around with the shipping options in the vendor shipping module admin side. No text, no info, no update. I wouldnt think my environment is the culprit, but could my other contribs be preventing MVS from working? I have BOF, SEO and FEC installed. All are running just fine. Have you heard any incompatibility issues with these and MVS? If there is, which files could be causing the problem? I've been going over all the modified files and just cant see what could cause this problem. Thanks again! -Tuomo
-
RonR, thanks for the reply. I'm sure some people have done that.. but trust me.. I aint one of those people.. -thomp
-
Thanks Craig! I will try it out and report how it goes! -thomp
-
HI Folks! :D I've run into a pretty serious issue and I dont know even where to begin debugging it. Any suggestions are more than welcome! For some reason, after I have "installed" shipping options for any particular vendor, I am unable to edit those shipping options. I can enter the edit screen, and change the values but the update just wont work. None of my changes will register in the database. What part of the code do I need to fix to get this function to work again?? Thanks for your help!! :blush: -Thomp
-
Please help! I installed FEC and MVS, I've managed to get them both working together except when a customer clicks Buy Now, it goes to the "new" payment screen with the shipping info integrated just as FEC is supposed to but when the user clicks the Continue button, it goes to the old payment screen again and only after that does it go forward to the confirmation (basically adding an extra useless step) I'm thinking that maybe the checkout_process.php file is somehow messed up. Does anyone have ideas where to start to look for the possible cause for this? Thanks!! -thomp
-
Anyone? So no-one has modified their MVS to ship based on US States not countries and have the weight functionality as central to their shipping cost calculation? -Thomp
-
Has anyone been able to modify this contribution to work with the famous MVS contribution? If you have, how did you do it? Could you please share your code for others to see!!? I've been fiddling with the code, and it just cant manage it to work.. please take a look below: Released under the GNU General Public License */ class regions { var $code, $title, $description, $enabled, $regions, $vendors_id; // class constructor function regions() { $this->vendors_id = ($products['vendors_id'] <= 0) ? 1 : $products['vendors_id']; $this->code = 'regions'; $this->title = MODULE_SHIPPING_REGIONS_TEXT_TITLE; $this->description = MODULE_SHIPPING_REGIONS_TEXT_DESCRIPTION; $this->icon = ''; $this->tax_class = MODULE_SHIPPING_REGIONS_TAX_CLASS; $this->enabled = MODULE_SHIPPING_REGIONS_STATUS; $this->sort_order = MODULE_SHIPPING_REGIONS_SORT_ORDER; // CUSTOMIZE THIS SETTING FOR THE NUMBER OF States NEEDED $this->regions = 3; } // class methods function quote($method = '', $module = '', $vendors_id = '1') { global $HTTP_POST_VARS, $order, $shipping_weight, $cart, $total_count; if (MODULE_SHIPPING_REGIONS_MODE == 'price') { $order_total_price = $cart->show_total(); } if (MODULE_SHIPPING_REGIONS_MODE == 'weight') { $order_total_price = $shipping_weight; } if (MODULE_SHIPPING_REGIONS_MODE == 'per_item') { $order_total_price = $total_count; } if (MODULE_SHIPPING_REGIONS_MODE == 'percentage') { $order_total_price = $cart->show_total(); } $dest_state = $order->delivery['state']; $dest_country = $order->delivery['country']['title']; $dest_region = 0; $error = false; for ($i=1; $i<=$this->regions($vendors_id); $i++) { $regions_table = constant('MODULE_SHIPPING_REGIONS_' . $vendors_id . '_' . $i); $country_states_or_countries = split("[,]", $regions_table); if (in_array($dest_state, $country_states_or_countries)) { $dest_region = $i; break; } } if ($dest_region == 0) { for ($i=1; $i<=$this->regions($vendors_id); $i++) { $regions_table = constant('MODULE_SHIPPING_REGIONS_' . $vendors_id . '_' . $i); $country_states_or_countries = split("[,]", $regions_table); if (in_array($dest_country, $country_states_or_countries)) { $dest_region = $i; break; } } } if ($dest_region == 0) { $i = $this->regions($vendors_id); $regions_table = constant('MODULE_SHIPPING_REGIONS' . $vendors_id . '_' . $i); $country_states_or_countries = split("[,]", $regions_table); if (in_array("All", $country_states_or_countries)) $dest_region = $this->regions($vendors_id); } if ($dest_region == 0) { $error = true; } else { $shipping = -1; $region_cost = constant('MODULE_SHIPPING_REGIONS_COST_' . $vendors_id . '_' . $i); $regions_table = split("[:,]" , $region_cost); if (MODULE_SHIPPING_REGIONS_MODE == 'price') { for ($i=0; $i<sizeof($regions_table); $i+=2) { if ($order_total_price <= $regions_table[$i]) { $shipping = $regions_table[$i+1]; $shipping_method = MODULE_SHIPPING_REGIONS_TEXT_WAY . ' ' . "$dest_state, $dest_country" . ' ' . MODULE_SHIPPING_REGIONS_TEXT_UNITS; break; } } } if (MODULE_SHIPPING_REGIONS_MODE == 'weight') { for ($i=0; $i<sizeof($regions_table); $i+=2) { if ($order_total_price <= $regions_table[$i]) { $shipping = $regions_table[$i+1]; $shipping_method = MODULE_SHIPPING_REGIONS_WEIGHT . ' ' . $shipping_weight . ' ' . MODULE_SHIPPING_REGIONS_WEIGHT_TEXT . ' ' . "$dest_state, $dest_country" . ' ' . MODULE_SHIPPING_REGIONS_TEXT_UNITS; break; } } } if (MODULE_SHIPPING_REGIONS_MODE == 'per_item') { for ($i=0; $i<sizeof($regions_table); $i+=2) { if ($order_total_price <= $regions_table[$i]) { $shipping = $regions_table[$i+1] * $order_total_price; $shipping_method = MODULE_SHIPPING_REGIONS_ITEMS . ' ' . $total_count . ' ' . MODULE_SHIPPING_REGIONS_ITEMS_TEXT . ' ' . "$dest_state, $dest_country" . ' ' . MODULE_SHIPPING_REGIONS_TEXT_UNITS; break; } } } if (MODULE_SHIPPING_REGIONS_MODE == 'percentage') { for ($i=0; $i<sizeof($regions_table); $i+=2) { if ($order_total_price <= $regions_table[$i]) { $shipping = ($regions_table[$i+1] / 100) * $order_total_price; $shipping_method = MODULE_SHIPPING_REGIONS_TEXT_WAY . ' ' . "$dest_state, $dest_country" . ' ' . MODULE_SHIPPING_REGIONS_TEXT_UNITS; break; } } } if ($shipping == -1) { $shipping_cost = 0; $shipping_method = MODULE_SHIPPING_REGIONS_UNDEFINED_RATE; } else { $shipping_cost = ($shipping + MODULE_SHIPPING_REGIONS_HANDLING + SHIPPING_HANDLING); } } $this->quotes = array('id' => $this->code, 'module' => MODULE_SHIPPING_REGIONS_TEXT_TITLE, 'methods' => array(array('id' => $this->code, 'title' => $shipping_method, 'cost' => $shipping_cost))); if ($this->tax_class($vendors_id) > 0) { $this->quotes['tax'] = tep_get_tax_rate($this->tax_class($vendors_id), $order->delivery['country']['id'], $order->delivery['zone_id']); } if (tep_not_null($this->icon)) $this->quotes['icon'] = tep_image($this->icon, $this->title); if ($error == true) $this->quotes['error'] = MODULE_SHIPPING_REGIONS_INVALID_ZONE; return $this->quotes; } function check($vendors_id='1') { if (!isset($this->_check)) { $check_query = tep_db_query("select configuration_value from " . TABLE_VENDOR_CONFIGURATION . " where vendors_id = '". $vendors_id ."' and configuration_key = 'MODULE_SHIPPING_REGIONS_STATUS_" . $vendors_id . "'"); $this->_check = tep_db_num_rows($check_query); } return $this->_check; } function install($vendors_id='1') { // $vID = $vendors_id; tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (vendors_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set function, date_added) VALUES ('" . $vendors_id . "', 'Enable US Regions Method', 'MODULE_SHIPPING_REGIONS_STATUS_" . $vendors_id . "', '1', 'Do you want to offer Regions rate shipping?', '6', '0', now())"); tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (vendors_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use function, set function, date_added) values ('" . $vendors_id . "', 'Sort Order', 'MODULE_SHIPPING_REGIONS_SORT_ORDER_" . $vendors_id . "', '1', 'Sort order of display.', '6', '1', now())"); tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (vendors_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Tax Class', 'MODULE_SHIPPING_REGIONS_TAX_CLASS_" . $vendors_id . "', '1', 'Use the following tax class on the shipping fee.', '6', '2', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())"); tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (vendors_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('" . $vendors_id . "', 'Handling Fee', 'MODULE_SHIPPING_REGIONS_HANDLING_" . $vendors_id . "', '0.00', 'Handling Fee for this shipping method', '6', '3', now())"); tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (vendors_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('" . $vendors_id . "', 'Mode', 'MODULE_SHIPPING_REGIONS_MODE_" . $vendors_id . "','price', 'Is the shipping table based on total weight, total amount of order, number of itmes, or a percentage of the total price.', '6', '4', 'tep_cfg_select_option(array(\'weight\', \'price\', \'per_item\', \'percentage\'), ', now())"); for ($i = 1; $i <= $this->regions($vendors_id); $i++) { $default_countries = ''; if ($i == 1) { $default_states_or_countries = 'Connecticut'; $default_prices = '30:8.95,75:10.95,150:16.95,400:21.95,10000:25.95'; } if ($i == 2) { $default_states_or_countries = 'Alabama,Arizona,Arkansas,California,Colorado,Connecticut,Delaware,District of Columbia,Florida,Georgia,Idaho,Illinois,Indiana,Iowa,Kansas,Kentucky,Louisiana,M aine,Maryland,Massachusetts,Michigan,Minnesota,Mississippi,Missouri,Montana'; $default_prices = '30:10.95,75:12.95,150:18.95,400:23.95,10000:27.95'; } if ($i == 3) { $default_states_or_countries = 'Nebraska,Nevada,New Hampshire,New Jersey,New Mexico,New York,North Carolina,North Dakota,Ohio,Oklahoma,Oregon,Pennsylvania,Rhode Island,South Carolina,South Dakota,Texas,Utah,Vermont,Virginia,Washington,West Virginia,Wisconsin,Wyoming'; $default_prices = '30:10.95,75:12.95,150:18.95,400:23.95,10000:27.95'; } tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (vendors_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('" . $vendors_id . "','Region " . $i ." States/Countries', 'MODULE_SHIPPING_REGIONS_" . $vendors_id . "_" . $i ."', '" . $default_states_or_countries . "', 'Comma separated list of States and/or Countries " . $i . ".', '6', '0', now())"); tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (vendors_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('" . $vendors_id . "', 'Region " . $i ." Shipping Table', 'MODULE_SHIPPING_REGIONS_COST_" . $vendors_id . "_" . $i ."', '" . $default_prices . "' , '(weight/price/# of items/)<b>:</b>(shipping cost/percentage) " . $i . ".', '6', '0', now())"); } } function remove($vendors_id) { $keys = ''; $keys_array = $this->keys($vendors_id); for ($i=0; $i<sizeof($keys_array); $i++) { $keys .= "'" . $keys_array[$i] . "',"; } $keys = substr($keys($vendors_id), 0, -1); tep_db_query("delete from " . TABLE_VENDOR_CONFIGURATION . " where vendors_id = '". $vendors_id ."' and configuration_key in (" . $keys . ")"); } function keys($vendors_id) { $keys = array('MODULE_SHIPPING_REGIONS_STATUS_' . $vendors_id, 'MODULE_SHIPPING_REGIONS_SORT_ORDER_' . $vendors_id, 'MODULE_SHIPPING_REGIONS_HANDLING_' . $vendors_id, 'MODULE_SHIPPING_REGIONS_MODE_' . $vendors_id, 'MODULE_SHIPPING_REGIONS_TAX_CLASS_' . $vendors_id); for ($i=1; $i<=$this->regions($vendors_id); $i++) { $keys[] = 'MODULE_SHIPPING_REGIONS_' . $vendors_id . '_' . $i; $keys[] = 'MODULE_SHIPPING_REGIONS_COST_' . $vendors_id . '_' . $i; } return $keys; } } ?> Thanks for your help!! -thomp
-
Ok, got it working.. sort of.. Please correct me if I'm wrong, but in the Vendors Shipping module, when I set a zones rate. It only allows me to set zones per country, not per state? Is there a way for me to do that or am I missing something? The functionality that I'm looking for is as follows: Shipping Per Vendor Per Product = Per Zone (state's) flat fee x product weight + shipping and handling I have made three zones out of the US, with all of the states falling into one of those zones. When the customer checks out the product, and enters payment details, it picks up the shipping address state and makes the above calculation giving the shipping cost. Is this already implemented in MVS? Am I just missing it (could very well be). Thanks a ton for your help, much appreciated!! -thomp
-
Hi Folks, I'm really looking forward to the functionality that MVS brings. But I am having a helluva time trying to merge FEC and MVS. Could someone post the working code for checkout_shipping.php that has both of those contribs working together? Thanks for your help!! -Thomp
-
I have a somewhat similar problem as some people in this thread have described. The options that I have show up twice, once with the correct option type and a second time with just a regular radio button. When they appear with the correct option type, it only shows the first item in that group, but not the second one's. But as they are shown the second time, the radio button one's show all of the options that I have listed. I am fairly certain its an issue with my product_info.php file. I just cant pinpoint it. Any suggestions? <?php /* $Id: product_info.php,v 1.97 2003/07/01 14:34:54 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ require('includes/application_top.php'); require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_INFO); $product_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'"); $product_check = tep_db_fetch_array($product_check_query); ?> <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> <html <?php echo HTML_PARAMS; ?>> <head> <?php // BOF: Header Tag Controller v2.6.0 if ( file_exists(DIR_WS_INCLUDES . 'header_tags.php') ) { require(DIR_WS_INCLUDES . 'header_tags.php'); } else { ?> <title><?php echo TITLE; ?></title> <?php } // EOF: Header Tag Controller v2.6.0 ?> <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>"> <link rel="stylesheet" type="text/css" href="stylesheet.css"> <script language="javascript"> function popupWindow(url) { window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,res izable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,le ft=150') } /* DDB - 041031 - Form Field Progress Bar */ /*********************************************** * Form Field Progress Bar- By Ron Jonk- http://www.euronet.nl/~jonkr/ * Modified by Dynamic Drive for minor changes * Script featured/ available at Dynamic Drive- http://www.dynamicdrive.com * Please keep this notice intact ***********************************************/ function textCounter(field,counter,maxlimit,linecounter) { // text width// var fieldWidth = parseInt(field.offsetWidth); var charcnt = field.value.length; // trim the extra text if (charcnt > maxlimit) { field.value = field.value.substring(0, maxlimit); } else { // progress bar percentage var percentage = parseInt(100 - (( maxlimit - charcnt) * 100)/maxlimit); document.getElementById(counter).style.width = parseInt((fieldWidth*percentage)/100)+"px"; document.getElementById(counter).innerHTML="Limit: "+percentage+"%" // color correction on style from CCFFF -> CC0000 setcolor(document.getElementById(counter),percentage,"background-color"); } } function setcolor(obj,percentage,prop){ obj.style[prop] = "rgb(80%,"+(100-percentage)+"%,"+(100-percentage)+"%)"; } </script> </head> <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0"> <!-- header //--> <?php require(DIR_WS_INCLUDES . 'header.php'); ?> <!-- header_eof //--> <!-- body //--> <table border="0" width="100%" cellspacing="3" cellpadding="3"> <tr> <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2"> <!-- left_navigation //--> <?php require(DIR_WS_INCLUDES . 'column_left.php'); ?> <!-- left_navigation_eof //--> </table></td> <!-- body_text //--> <td width="100%" valign="top"><?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product')); ?><table border="0" width="100%" cellspacing="0" cellpadding="0"> <?php if ($product_check['total'] < 1) { ?> <tr> <td><?php new infoBox(array(array('text' => TEXT_PRODUCT_NOT_FOUND))); ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"> <tr class="infoBoxContents"> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_HOME) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> </table></td> </tr> </table></td> </tr> <?php } else { //BOF UltraPics //BOF Original /* $product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'"); */ //EOF Original $product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, p.products_image_med, p.products_image_lrg, p.products_image_sm_1, p.products_image_xl_1, p.products_image_sm_2, p.products_image_xl_2, p.products_image_sm_3, p.products_image_xl_3, p.products_image_sm_4, p.products_image_xl_4, p.products_image_sm_5, p.products_image_xl_5, p.products_image_sm_6, p.products_image_xl_6, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'"); //EOF UltraPics $product_info = tep_db_fetch_array($product_info_query); tep_db_query("update " . TABLE_PRODUCTS_DESCRIPTION . " set products_viewed = products_viewed+1 where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and language_id = '" . (int)$languages_id . "'"); if ($new_price = tep_get_products_special_price($product_info['products_id'])) { //GroupDiscount start $products_price = '<s>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price_nodiscount($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>'; //GroupDiscount end } else { $products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])); } if (tep_not_null($product_info['products_model'])) { $products_name = $product_info['products_name'] . '<br><span class="smallText">[' . $product_info['products_model'] . ']</span>'; } else { $products_name = $product_info['products_name']; } ?> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td valign="top"><h1><?php echo $products_name; ?></h1></td> <td align="right" valign="top"><h1><?php echo $products_price; ?></h1></td> </tr> </table></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td class="main"> <?php if (tep_not_null($product_info['products_image'])) { ?> <table border="0" cellspacing="0" cellpadding="2" align="right"> <tr> <td align="center" class="smallText"> <!--BOF UltraPics--> <?php if ($product_info['products_image_med']!='') { $new_image = $product_info['products_image_med']; $image_width = MEDIUM_IMAGE_WIDTH; $image_height = MEDIUM_IMAGE_HEIGHT; } else { $new_image = $product_info['products_image']; $image_width = SMALL_IMAGE_WIDTH; $image_height = SMALL_IMAGE_HEIGHT; } ?> <!--EOF UltraPics--> <script language="javascript"><!-- //BOF UltraPics //BOF Original /* document.write('<?php echo '<a href="java script:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id']) . '\\\')">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>'); */ //EOF Original document.write('<?php echo '<a href="java script:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id'] . 'ℑ=0') . '\\\')">' . tep_image(DIR_WS_IMAGES . $new_image, addslashes($product_info['products_name']), $image_width, $image_height, 'hspace="5" vspace="5"') . '<br>' . tep_image_button('image_enlarge.gif', TEXT_CLICK_TO_ENLARGE) . '</a>'; ?>'); //EOF UltraPics //--></script> <noscript> <!--BOF UltraPics--> <!--BOF Original--><!-- <?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?> --><!--EOF Original--> <?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image_med']) . '">' . tep_image(DIR_WS_IMAGES . $new_image . 'ℑ=0', addslashes($product_info['products_name']), $image_width, $image_height, 'hspace="5" vspace="5"') . '<br>' . tep_image_button('image_enlarge.gif', TEXT_CLICK_TO_ENLARGE) . '</a>'; ?> <!--EOF UltraPics--> </noscript> </td> </tr> </table> <?php } ?> <p><?php echo stripslashes($product_info['products_description']); ?></p> <?php $products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "'"); $products_attributes = tep_db_fetch_array($products_attributes_query); if ($products_attributes['total'] > 0) { ?> <table border="0" cellspacing="0" cellpadding="2"> <tr> <td class="main" colspan="2"><?php echo TEXT_PRODUCT_OPTIONS; ?></td> </tr> <?php //clr 030714 update query to pull option_type $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name, popt.products_options_type, popt.products_options_length, popt.products_options_comment from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name"); while ($products_options_name = tep_db_fetch_array($products_options_name_query)) { //clr 030714 add case statement to check option type switch ($products_options_name['products_options_type']) { case PRODUCTS_OPTIONS_TYPE_TEXT: //CLR 030714 Add logic for text option $products_attribs_query = tep_db_query("select distinct patrib.options_values_price, patrib.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = '" . $products_options_name['products_options_id'] . "'"); $products_attribs_array = tep_db_fetch_array($products_attribs_query); $tmp_html = '<input type="text" name ="id[' . TEXT_PREFIX . $products_options_name['products_options_id'] . ']" size="' . $products_options_name['products_options_length'] .'" maxlength="' . $products_options_name['products_options_length'] . '" value="' . $cart->contents[$HTTP_GET_VARS['products_id']]['attributes_values'][$products_options_name['products_options_id']] .'"> ' . $products_options_name['products_options_comment']; if ($products_attribs_array['options_values_price'] != '0') { $tmp_html .= '(' . $products_attribs_array['price_prefix'] . $currencies->display_price($products_attribs_array['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .')'; } ?> <tr> <td class="main"><?php echo $products_options_name['products_options_name'] . ':'; ?></td> <td class="main"><?php echo $tmp_html; ?></td> </tr> <?php break; case PRODUCTS_OPTIONS_TYPE_TEXTAREA: //CLR 030714 Add logic for text option $products_attribs_query = tep_db_query("select distinct patrib.options_values_price, patrib.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = '" . $products_options_name['products_options_id'] . "'"); $products_attribs_array = tep_db_fetch_array($products_attribs_query); $tmp_html = '<textarea onKeyDown="textCounter(this,\'progressbar' . $products_options_name['products_options_id'] . '\',' . $products_options_name['products_options_length'] . ')" onKeyUp="textCounter(this,\'progressbar' . $products_options_name['products_options_id'] . '\',' . $products_options_name['products_options_length'] . ')" onFocus="textCounter(this,\'progressbar' . $products_options_name['products_options_id'] . '\',' . $products_options_name['products_options_length'] . ')" wrap="soft" name="id[' . TEXT_PREFIX . $products_options_name['products_options_id'] . ']" rows=5 id="id[' . TEXT_PREFIX . $products_options_name['products_options_id'] . ']" value="' . $cart->contents[$HTTP_GET_VARS['products_id']]['attributes_values'][$products_options_name['products_options_id']] . '"></textarea> <div id="progressbar' . $products_options_name['products_options_id'] . '" class="progress"></div> <script>textCounter(document.getElementById("id[' . TEXT_PREFIX . $products_options_name['products_options_id'] . ']"),"progressbar' . $products_options_name['products_options_id'] . '",' . $products_options_name['products_options_length'] . ')</script>';?> <!-- DDB - 041031 - Form Field Progress Bar //--> <tr> <?php if ($products_attribs_array['options_values_price'] != '0') { ?> <td class="main"><?php echo $products_options_name['products_options_name'] . '<br>(' . $products_options_name['products_options_comment'] . ' ' . $products_attribs_array['price_prefix'] . $currencies->display_price($products_attribs_array['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . ')'; ?></td> <?php } else { ?> <td class="main"><?php echo $products_options_name['products_options_name'] . '<br>(' . $products_options_name['products_options_comment'] . ')'; ?></td> <?php } ?> <td class="main"><?php echo $tmp_html; ?></td> </tr> <?php break; case PRODUCTS_OPTIONS_TYPE_RADIO: //CLR 030714 Add logic for radio buttons $tmp_html = '<table>'; $products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . $products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . $languages_id . "'"); $checked = true; while ($products_options_array = tep_db_fetch_array($products_options_query)) { $tmp_html .= '<tr><td class="main">'; $tmp_html .= tep_draw_radio_field('id[' . $products_options_name['products_options_id'] . ']', $products_options_array['products_options_values_id'], $checked); $checked = false; $tmp_html .= $products_options_array['products_options_values_name']; $tmp_html .=$products_options_name['products_options_comment']; if ($products_options_array['options_values_price'] != '0') { $tmp_html .= '(' . $products_options_array['price_prefix'] . $currencies->display_price($products_options_array['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') '; } $tmp_html .= '</tr></td>'; } $tmp_html .= '</table>'; ?> <tr> <td class="main"><?php echo $products_options_name['products_options_name'] . ':'; ?></td> <td class="main"><?php echo $tmp_html; ?></td> </tr> <?php break; case PRODUCTS_OPTIONS_TYPE_CHECKBOX: //CLR 030714 Add logic for checkboxes $products_attribs_query = tep_db_query("select distinct patrib.options_values_id, patrib.options_values_price, patrib.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = '" . $products_options_name['products_options_id'] . "'"); $products_attribs_array = tep_db_fetch_array($products_attribs_query); echo '<tr><td class="main">' . $products_options_name['products_options_name'] . ': </td><td class="main">'; echo tep_draw_checkbox_field('id[' . $products_options_name['products_options_id'] . ']', $products_attribs_array['options_values_id']); echo $products_options_name['products_options_comment']; if ($products_attribs_array['options_values_price'] != '0') { echo '(' . $products_attribs_array['price_prefix'] . $currencies->display_price($products_attribs_array['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') '; } echo '</td></tr>'; break; default: //clr 030714 default is select list //clr 030714 reset selected_attribute variable $selected_attribute = false; $products_options_array = array(); $products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'"); while ($products_options = tep_db_fetch_array($products_options_query)) { $products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']); if ($products_options['options_values_price'] != '0') { $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') '; } } if (isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) { $selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']]; } else { $selected_attribute = false; } ?> <tr> <td class="main"><?php echo $products_options_name['products_options_name'] . ':'; ?></td> <td class="main"><?php echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute) . $products_options_name['products_options_comment']; ?></td> </tr> <?php } //clr 030714 end switch } //clr 030714 end while ?> </table> <?php //Options as Images. This whole php clause needs to be added if (OPTIONS_AS_IMAGES_ENABLED == 'true') include ('options_images.php'); } ?> </td> </tr> <!--BOF UltraPics--> <?php if (ULTIMATE_ADDITIONAL_IMAGES == 'enable') include(DIR_WS_MODULES . 'additional_images.php'); ?> <!--EOF UltraPics--> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php $reviews_query = tep_db_query("select count(*) as count from " . TABLE_REVIEWS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'"); $reviews = tep_db_fetch_array($reviews_query); if ($reviews['count'] > 0) { ?> <tr> <td class="main"><?php echo TEXT_CURRENT_REVIEWS . ' ' . $reviews['count']; ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php } if (tep_not_null($product_info['products_url'])) { ?> <tr> <td class="main"><?php echo sprintf(TEXT_MORE_INFORMATION, tep_href_link(FILENAME_REDIRECT, 'action=url&goto=' . urlencode($product_info['products_url']), 'NONSSL', true, false)); ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php } if ($product_info['products_date_available'] > date('Y-m-d H:i:s')) { ?> <tr> <td align="center" class="smallText"><?php echo sprintf(TEXT_DATE_AVAILABLE, tep_date_long($product_info['products_date_available'])); ?></td> </tr> <?php } else { ?> <tr> <td align="center" class="smallText"><?php echo sprintf(TEXT_DATE_ADDED, tep_date_long($product_info['products_date_added'])); ?></td> </tr> <?php } ?> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"> <tr class="infoBoxContents"> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params()) . '">' . tep_image_button('button_reviews.gif', IMAGE_BUTTON_REVIEWS) . '</a>'; ?></td> <td class="main" align="right"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> </table></td> </tr> </table></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td> <?php if ((USE_CACHE == 'true') && empty($SID)) { echo tep_cache_also_purchased(3600); } else { include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS); } } ?> </td> </tr> </table></form></td> <!-- body_text_eof //--> <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2"> <!-- right_navigation //--> <?php require(DIR_WS_INCLUDES . 'column_right.php'); ?> <!-- right_navigation_eof //--> </table></td> </tr> </table> <!-- body_eof //--> <!-- footer //--> <?php require(DIR_WS_INCLUDES . 'footer.php'); ?> <!-- footer_eof //--> <br> </body> </html> <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?> Thanks for your help!! -Thomp
-
Hi All, I have a problem in installing these two contribs and getting them to work properly. Unfortunately, I know how add these contribs, but I'm not much of a php coder. If anyone could help, it would be greatly appreciated!! The problem is that the options are not being listed fully, only the first option in a group shows and the rest dont show up. Also, none of the images show. Please help!!! Here is my product_info.php after installing these two contribs: <?php /* $Id: product_info.php,v 1.97 2003/07/01 14:34:54 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ require('includes/application_top.php'); require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_INFO); $product_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'"); $product_check = tep_db_fetch_array($product_check_query); ?> <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> <html <?php echo HTML_PARAMS; ?>> <head> <?php // BOF: Header Tag Controller v2.6.0 if ( file_exists(DIR_WS_INCLUDES . 'header_tags.php') ) { require(DIR_WS_INCLUDES . 'header_tags.php'); } else { ?> <title><?php echo TITLE; ?></title> <?php } // EOF: Header Tag Controller v2.6.0 ?> <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>"> <link rel="stylesheet" type="text/css" href="stylesheet.css"> <script language="javascript"> function popupWindow(url) { window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,res izable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,le ft=150') } /* DDB - 041031 - Form Field Progress Bar */ /*********************************************** * Form Field Progress Bar- By Ron Jonk- http://www.euronet.nl/~jonkr/ * Modified by Dynamic Drive for minor changes * Script featured/ available at Dynamic Drive- http://www.dynamicdrive.com * Please keep this notice intact ***********************************************/ function textCounter(field,counter,maxlimit,linecounter) { // text width// var fieldWidth = parseInt(field.offsetWidth); var charcnt = field.value.length; // trim the extra text if (charcnt > maxlimit) { field.value = field.value.substring(0, maxlimit); } else { // progress bar percentage var percentage = parseInt(100 - (( maxlimit - charcnt) * 100)/maxlimit); document.getElementById(counter).style.width = parseInt((fieldWidth*percentage)/100)+"px"; document.getElementById(counter).innerHTML="Limit: "+percentage+"%" // color correction on style from CCFFF -> CC0000 setcolor(document.getElementById(counter),percentage,"background-color"); } } function setcolor(obj,percentage,prop){ obj.style[prop] = "rgb(80%,"+(100-percentage)+"%,"+(100-percentage)+"%)"; } </script> </head> <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0"> <!-- header //--> <?php require(DIR_WS_INCLUDES . 'header.php'); ?> <!-- header_eof //--> <!-- body //--> <table border="0" width="100%" cellspacing="3" cellpadding="3"> <tr> <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2"> <!-- left_navigation //--> <?php require(DIR_WS_INCLUDES . 'column_left.php'); ?> <!-- left_navigation_eof //--> </table></td> <!-- body_text //--> <td width="100%" valign="top"><?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product')); ?><table border="0" width="100%" cellspacing="0" cellpadding="0"> <?php if ($product_check['total'] < 1) { ?> <tr> <td><?php new infoBox(array(array('text' => TEXT_PRODUCT_NOT_FOUND))); ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"> <tr class="infoBoxContents"> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_HOME) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> </table></td> </tr> </table></td> </tr> <?php } else { //BOF UltraPics //BOF Original /* $product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'"); */ //EOF Original $product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, p.products_image_med, p.products_image_lrg, p.products_image_sm_1, p.products_image_xl_1, p.products_image_sm_2, p.products_image_xl_2, p.products_image_sm_3, p.products_image_xl_3, p.products_image_sm_4, p.products_image_xl_4, p.products_image_sm_5, p.products_image_xl_5, p.products_image_sm_6, p.products_image_xl_6, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'"); //EOF UltraPics $product_info = tep_db_fetch_array($product_info_query); tep_db_query("update " . TABLE_PRODUCTS_DESCRIPTION . " set products_viewed = products_viewed+1 where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and language_id = '" . (int)$languages_id . "'"); if ($new_price = tep_get_products_special_price($product_info['products_id'])) { //GroupDiscount start $products_price = '<s>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price_nodiscount($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>'; //GroupDiscount end } else { $products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])); } if (tep_not_null($product_info['products_model'])) { $products_name = $product_info['products_name'] . '<br><span class="smallText">[' . $product_info['products_model'] . ']</span>'; } else { $products_name = $product_info['products_name']; } ?> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td valign="top"><h1><?php echo $products_name; ?></h1></td> <td align="right" valign="top"><h1><?php echo $products_price; ?></h1></td> </tr> </table></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td class="main"> <?php if (tep_not_null($product_info['products_image'])) { ?> <table border="0" cellspacing="0" cellpadding="2" align="right"> <tr> <td align="center" class="smallText"> <!--BOF UltraPics--> <?php if ($product_info['products_image_med']!='') { $new_image = $product_info['products_image_med']; $image_width = MEDIUM_IMAGE_WIDTH; $image_height = MEDIUM_IMAGE_HEIGHT; } else { $new_image = $product_info['products_image']; $image_width = SMALL_IMAGE_WIDTH; $image_height = SMALL_IMAGE_HEIGHT; } ?> <!--EOF UltraPics--> <script language="javascript"><!-- //BOF UltraPics //BOF Original /* document.write('<?php echo '<a href="java script:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id']) . '\\\')">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>'); */ //EOF Original document.write('<?php echo '<a href="java script:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id'] . 'ℑ=0') . '\\\')">' . tep_image(DIR_WS_IMAGES . $new_image, addslashes($product_info['products_name']), $image_width, $image_height, 'hspace="5" vspace="5"') . '<br>' . tep_image_button('image_enlarge.gif', TEXT_CLICK_TO_ENLARGE) . '</a>'; ?>'); //EOF UltraPics //--></script> <noscript> <!--BOF UltraPics--> <!--BOF Original--><!-- <?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?> --><!--EOF Original--> <?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image_med']) . '">' . tep_image(DIR_WS_IMAGES . $new_image . 'ℑ=0', addslashes($product_info['products_name']), $image_width, $image_height, 'hspace="5" vspace="5"') . '<br>' . tep_image_button('image_enlarge.gif', TEXT_CLICK_TO_ENLARGE) . '</a>'; ?> <!--EOF UltraPics--> </noscript> </td> </tr> </table> <?php } ?> <p><?php echo stripslashes($product_info['products_description']); ?></p> <?php $products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "'"); $products_attributes = tep_db_fetch_array($products_attributes_query); if ($products_attributes['total'] > 0) { ?> <table border="0" cellspacing="0" cellpadding="2"> <tr> <td class="main" colspan="2"><?php echo TEXT_PRODUCT_OPTIONS; ?></td> </tr> <?php //clr 030714 update query to pull option_type $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name, popt.products_options_type, popt.products_options_length, popt.products_options_comment from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name"); while ($products_options_name = tep_db_fetch_array($products_options_name_query)) { //clr 030714 add case statement to check option type switch ($products_options_name['products_options_type']) { case PRODUCTS_OPTIONS_TYPE_TEXT: //CLR 030714 Add logic for text option $products_attribs_query = tep_db_query("select distinct patrib.options_values_price, patrib.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = '" . $products_options_name['products_options_id'] . "'"); $products_attribs_array = tep_db_fetch_array($products_attribs_query); $tmp_html = '<input type="text" name ="id[' . TEXT_PREFIX . $products_options_name['products_options_id'] . ']" size="' . $products_options_name['products_options_length'] .'" maxlength="' . $products_options_name['products_options_length'] . '" value="' . $cart->contents[$HTTP_GET_VARS['products_id']]['attributes_values'][$products_options_name['products_options_id']] .'"> ' . $products_options_name['products_options_comment']; if ($products_attribs_array['options_values_price'] != '0') { $tmp_html .= '(' . $products_attribs_array['price_prefix'] . $currencies->display_price($products_attribs_array['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .')'; } ?> <tr> <td class="main"><?php echo $products_options_name['products_options_name'] . ':'; ?></td> <td class="main"><?php echo $tmp_html; ?></td> </tr> <?php break; case PRODUCTS_OPTIONS_TYPE_TEXTAREA: //CLR 030714 Add logic for text option $products_attribs_query = tep_db_query("select distinct patrib.options_values_price, patrib.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = '" . $products_options_name['products_options_id'] . "'"); $products_attribs_array = tep_db_fetch_array($products_attribs_query); $tmp_html = '<textarea onKeyDown="textCounter(this,\'progressbar' . $products_options_name['products_options_id'] . '\',' . $products_options_name['products_options_length'] . ')" onKeyUp="textCounter(this,\'progressbar' . $products_options_name['products_options_id'] . '\',' . $products_options_name['products_options_length'] . ')" onFocus="textCounter(this,\'progressbar' . $products_options_name['products_options_id'] . '\',' . $products_options_name['products_options_length'] . ')" wrap="soft" name="id[' . TEXT_PREFIX . $products_options_name['products_options_id'] . ']" rows=5 id="id[' . TEXT_PREFIX . $products_options_name['products_options_id'] . ']" value="' . $cart->contents[$HTTP_GET_VARS['products_id']]['attributes_values'][$products_options_name['products_options_id']] . '"></textarea> <div id="progressbar' . $products_options_name['products_options_id'] . '" class="progress"></div> <script>textCounter(document.getElementById("id[' . TEXT_PREFIX . $products_options_name['products_options_id'] . ']"),"progressbar' . $products_options_name['products_options_id'] . '",' . $products_options_name['products_options_length'] . ')</script>';?> <!-- DDB - 041031 - Form Field Progress Bar //--> <tr> <?php if ($products_attribs_array['options_values_price'] != '0') { ?> <td class="main"><?php echo $products_options_name['products_options_name'] . '<br>(' . $products_options_name['products_options_comment'] . ' ' . $products_attribs_array['price_prefix'] . $currencies->display_price($products_attribs_array['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . ')'; ?></td> <?php } else { ?> <td class="main"><?php echo $products_options_name['products_options_name'] . '<br>(' . $products_options_name['products_options_comment'] . ')'; ?></td> <?php } ?> <td class="main"><?php echo $tmp_html; ?></td> </tr> <?php break; case PRODUCTS_OPTIONS_TYPE_RADIO: //CLR 030714 Add logic for radio buttons $tmp_html = '<table>'; $products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . $products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . $languages_id . "'"); $checked = true; while ($products_options_array = tep_db_fetch_array($products_options_query)) { $tmp_html .= '<tr><td class="main">'; $tmp_html .= tep_draw_radio_field('id[' . $products_options_name['products_options_id'] . ']', $products_options_array['products_options_values_id'], $checked); $checked = false; $tmp_html .= $products_options_array['products_options_values_name']; $tmp_html .=$products_options_name['products_options_comment']; if ($products_options_array['options_values_price'] != '0') { $tmp_html .= '(' . $products_options_array['price_prefix'] . $currencies->display_price($products_options_array['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') '; } $tmp_html .= '</tr></td>'; } $tmp_html .= '</table>'; ?> <tr> <td class="main"><?php echo $products_options_name['products_options_name'] . ':'; ?></td> <td class="main"><?php echo $tmp_html; ?></td> </tr> <?php break; case PRODUCTS_OPTIONS_TYPE_CHECKBOX: //CLR 030714 Add logic for checkboxes $products_attribs_query = tep_db_query("select distinct patrib.options_values_id, patrib.options_values_price, patrib.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = '" . $products_options_name['products_options_id'] . "'"); $products_attribs_array = tep_db_fetch_array($products_attribs_query); echo '<tr><td class="main">' . $products_options_name['products_options_name'] . ': </td><td class="main">'; echo tep_draw_checkbox_field('id[' . $products_options_name['products_options_id'] . ']', $products_attribs_array['options_values_id']); echo $products_options_name['products_options_comment']; if ($products_attribs_array['options_values_price'] != '0') { echo '(' . $products_attribs_array['price_prefix'] . $currencies->display_price($products_attribs_array['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') '; } echo '</td></tr>'; break; default: //clr 030714 default is select list //clr 030714 reset selected_attribute variable $selected_attribute = false; $products_options_array = array(); $products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'"); while ($products_options = tep_db_fetch_array($products_options_query)) { $products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']); if ($products_options['options_values_price'] != '0') { $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') '; } } if (isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) { $selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']]; } else { $selected_attribute = false; } ?> <tr> <td class="main"><?php echo $products_options_name['products_options_name'] . ':'; ?></td> <td class="main"><?php echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute) . $products_options_name['products_options_comment']; ?></td> </tr> <?php } //clr 030714 end switch } //clr 030714 end while ?> </table> <?php } //clr 030714 end if ?> </td> </tr> <!--BOF UltraPics--> <?php if (ULTIMATE_ADDITIONAL_IMAGES == 'enable') include(DIR_WS_MODULES . 'additional_images.php'); ?> <!--EOF UltraPics--> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php $reviews_query = tep_db_query("select count(*) as count from " . TABLE_REVIEWS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'"); $reviews = tep_db_fetch_array($reviews_query); if ($reviews['count'] > 0) { ?> <tr> <td class="main"><?php echo TEXT_CURRENT_REVIEWS . ' ' . $reviews['count']; ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php } if (tep_not_null($product_info['products_url'])) { ?> <tr> <td class="main"><?php echo sprintf(TEXT_MORE_INFORMATION, tep_href_link(FILENAME_REDIRECT, 'action=url&goto=' . urlencode($product_info['products_url']), 'NONSSL', true, false)); ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php } if ($product_info['products_date_available'] > date('Y-m-d H:i:s')) { ?> <tr> <td align="center" class="smallText"><?php echo sprintf(TEXT_DATE_AVAILABLE, tep_date_long($product_info['products_date_available'])); ?></td> </tr> <?php } else { ?> <tr> <td align="center" class="smallText"><?php echo sprintf(TEXT_DATE_ADDED, tep_date_long($product_info['products_date_added'])); ?></td> </tr> <?php } ?> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"> <tr class="infoBoxContents"> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params()) . '">' . tep_image_button('button_reviews.gif', IMAGE_BUTTON_REVIEWS) . '</a>'; ?></td> <td class="main" align="right"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> </table></td> </tr> </table></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td> <?php if ((USE_CACHE == 'true') && empty($SID)) { echo tep_cache_also_purchased(3600); } else { include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS); } } ?> </td> </tr> </table></form></td> <!-- body_text_eof //--> <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2"> <!-- right_navigation //--> <?php require(DIR_WS_INCLUDES . 'column_right.php'); ?> <!-- right_navigation_eof //--> </table></td> </tr> </table> <!-- body_eof //--> <!-- footer //--> <?php require(DIR_WS_INCLUDES . 'footer.php'); ?> <!-- footer_eof //--> <br> </body> </html> <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?> Thanks for your time! Again, your help would be greatly appreciated!! Regards, Thomp
-
[Contribution] Header Tags Controller for Admin MS 2.2
Thomp replied to Farrukh's topic in General Add-Ons Support
Thanks Jack!! Fantastic job with the contrib! Great job, and it works beautifully! -Thomp