Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Product Attributes - Option Type Feature


macmizer

Recommended Posts

I have installed the Product Attributes - Option Type Feature contribution. I have changed the following items in the database:

 

products_options_length VARCHAR Length/Value 255

 

products_options_value_text VARCHAR Length/Value 255

 

Of course I have already added this new field called Theme: and I am using that TEXT field option so I can request custom info from the user/customer. I need to be able to create about 2 fields that can contain at least 255 characters or more. I have tried changing both these items to TEXT instead of VARCHAR in the database and put the value to 255 on each but I cannot type more than 128 characters in the input field on the product that has the Theme field added to it. Any suggestions? I would prefer to be able to let the customer add more than 255 on these two fields.

 

You can view what I have at this demo site.

 

http://demos.onlineacc.com/shop/product_in...cc7576ace0ac8bc

 

I also want to change the field so that all the text is not on one straight line.I would prefer it be on multiple lines. That would be secondary of course.

 

Rob.

[email protected]

Link to comment
Share on other sites

I just published version v1.7 of Option Type Feature : Version v1.6 has been updated to include textarea option type fields so that text is not limited anymore to 32 characters. This new feature has been requested *a lot* on the support thread.

 

This is the changelog for v1.7 :

 

- Updated file "ReadMe.html" to include correct information on new textarea type option (read Step 4)

- /includes/configure.php : added new value 'PRODUCTS_OPTIONS_TYPE_TEXTAREA (4)'.

- changed column datatype of customers_basket_attributes.products_options_value_text from varchar(32) to "text".

- added admin support of fields products_options_length and products_options_comment (no need anymore to update the database manually).

- added javascript "Form Field Progress bar" to indicate how many characters are left for the customer to type. The size is determined by the 'products_options_length' field. Thanks to Dynamic Drive for this script (http://www.dynamicdrive.com).

- added stylesheet.css in package : needed for javascript Form Field Progress bar (new style '.progress')

- includes price tax fix of 26.07.2004 by Patrick_S

- includes dutch language file for admin/producs_attributes.php (thanks to Stef Verlint)

 

You can find it here :

 

URL : 7 Nov 2004 - Product Attributes - Option Type Feature v1.7

 

Support thread : http://www.oscommerce.com/forums/index.php?sho...ic=57259&st=100

 

Try it it and tell me how it works.

 

Didier.

Link to comment
Share on other sites

I just published version v1.7 of Option Type Feature : Version v1.6 has been updated to include textarea option type fields so that text is not limited anymore to 32 characters. This new feature has been requested *a lot* on the support thread.

 

This is the changelog for v1.7 :

 

- Updated file "ReadMe.html" to include correct information on new textarea type option (read Step 4)

- /includes/configure.php : added new value 'PRODUCTS_OPTIONS_TYPE_TEXTAREA (4)'.

- changed column datatype of customers_basket_attributes.products_options_value_text from varchar(32) to "text".

- added admin support of fields products_options_length and products_options_comment (no need anymore to update the database manually).

- added javascript "Form Field Progress bar" to indicate how many characters are left for the customer to type. The size is determined by the 'products_options_length' field. Thanks to Dynamic Drive for this script (http://www.dynamicdrive.com).

- added stylesheet.css in package : needed for javascript Form Field Progress bar (new style '.progress')

- includes price tax fix of 26.07.2004 by Patrick_S

- includes dutch language file for admin/producs_attributes.php (thanks to Stef Verlint)

 

You can find it here :

 

URL : 7 Nov 2004 - Product Attributes - Option Type Feature v1.7

 

Support thread : http://www.oscommerce.com/forums/index.php?sho...ic=57259&st=100

 

Try it it and tell me how it works.

 

Didier.

 

 

Thanks for the update. I will check it out. But I did want to let you know something. Although this is not 100% an issue with your code. I was working my butt off trying to track down why your contribution and a new contribution did not work together well. What happened was I had played with a couple of other contributions in the past few weeks. Each of them I backed out except the file upload contribution. I needed that one. I then downloaded yours first and implemented it. It worked fine. Then I downloaded Options as Images. After installing and testing Options as Images that worked well also. But I had been testing it on a brand new product I created in my cart and on the product I did not have anything but the options as images. In other words, no fields that came with your contribution were inserted onto this one product that had the options as images. So once I put fields from your contribution and the options as images all on one page, the options as images fields worhed but it broke the fields from your contribution. It turned all text fields for your contribution from an user input text field to a pulldown that was empty. I spoke to someone else that had implemented options as images but they did not use your contribution yet. He indicated that it looks like when Options as images is true (turned on) that it sends the user from the product_info.php page to the newly added options_images.php page. Which of course this page does not include anything from the products_info page. I did try to merge them together somehow but I am not good at troubleshooting php code issues. Have you run into this yet? Do you know anyone that uses both of these contributions, yours and the Options as Images?

Link to comment
Share on other sites

You're lucky Robert ! I also use the "Options as Images" contribution and it works very well together with the Option Type feature. I have dropped the "options_images.php" page and integrated everything in product_info.php. Simplier for maintaining the code.

 

Here is MY product_info.php page. I think it won't work on your shop (too much customised) but you can check the code and compares with yours. ;)

 

<?php
/*
 $Id: product_info.php,v 1.98 2003/09/02 18:52:33 project3000 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);

// begin dynamic meta tags query
//	$the_product_info_query = tep_db_query("select count(*) as total, pd.products_name, pd.products_description, p.products_model, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'" . " and pd.language_id ='" .  (int)$languages_id . "' group by p.products_id");  // DDB - 041024 - no get of unneeded fields
$product_info_query = tep_db_query("select pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image,  p.products_mediumimage, p.products_largeimage, pd.products_url, p.products_id," .
       " p.manufacturers_id, m.manufacturers_name, p.products_price, p.products_weight," .
       " p.products_price1, p.products_price2, p.products_price3, p.products_price4," .
       " p.products_price5, p.products_price6, p.products_price7, p.products_price8," .
       " p.products_price1_qty, p.products_price2_qty, p.products_price3_qty, p.products_price4_qty," .
       " p.products_price5_qty, p.products_price6_qty, p.products_price7_qty, p.products_price8_qty," .
       " p.products_qty_blocks," .
       " p.products_tax_class_id, p.products_date_added, p.products_date_available," .
       " IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price," .
       " IF(s.status, s.specials_new_products_price, p.products_price) as final_price" .
       " from " . TABLE_PRODUCTS_DESCRIPTION . " pd," .
       "      " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id," .
       "      " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id" .
       " where p.products_status = '1'" .
       "   and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'" .
       "   and pd.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'" .
       "   and pd.language_id = '". (int)$languages_id . "'");
$count = tep_db_num_rows($product_info_query);
   $product_info = tep_db_fetch_array($product_info_query);

//    $the_product_info = tep_db_fetch_array($the_product_info_query);
$the_product_name = strip_tags ($product_info['products_name'], "");
$the_product_description = strip_tags ($product_info['products_description'], "");
$the_product_model = strip_tags ($product_info['products_model'], "");
//	$the_manufacturer_query = tep_db_query("select m.manufacturers_id, m.manufacturers_name from " . TABLE_MANUFACTURERS . " m left join " . TABLE_MANUFACTURERS_INFO . " mi on (m.manufacturers_id = mi.manufacturers_id and mi.languages_id = '" . (int)$languages_id . "'), " . TABLE_PRODUCTS . " p  where p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and p.manufacturers_id = m.manufacturers_id"); 
//    $the_manufacturers = tep_db_fetch_array($the_manufacturer_query);

//	DDB - 041026 - not done anymore as we have a product query just above $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>
<META HTTP-EQUIV="imagetoolbar" CONTENT="no" />
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE_PI ?>: <?php echo $the_product_name; ?></title>
<meta name="keywords" content="<?php echo TITLE_PI . ',' . $the_product_name . ',' . $the_product_model;?>">
<meta name="description" content="<?php echo $the_product_name . "," . $the_product_description; ?>">
<meta name="robots" content="index, all" />
<meta name="Revisit" content="After 10 days" />
<meta name="rating" content="safe for kids" />
<meta name="copyright" content="Elena Debbaut, www.e-graphics.ch, tous droits reserv?s 2002, 2003, 2004" />
<meta name="author" content="Elena Debbaut" />
<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=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 OnLoad="scrmg();runmikescroll()" 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_info['total'] < 1) {
 if ($count < 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_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 {
	 // DDB - 040724 - BIG IMAGE
//    $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 . "'");
//    $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_mediumimage, p.products_largeimage, pd.products_url, p.products_price, p.products_price1, p.products_price2, p.products_price3, p.products_price4, p.products_price5, p.products_price6, p.products_price7, p.products_price8, p.products_price1_qty, p.products_price2_qty, p.products_price3_qty, p.products_price4_qty, p.products_price5_qty, p.products_price6_qty, p.products_price7_qty, p.products_price8_qty, p.products_qty_blocks, 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 . "'");	// DDB - 041016 - Price Break
//    $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 . "'");

/* DDB - 041016 - Price Break
   if ($new_price = tep_get_products_special_price($product_info['products_id'])) 
{
     $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($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>';
   } else {
     $products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));
   }
*/
//	$pf->loadProduct((int)$HTTP_GET_VARS['products_id'], (int)$languages_id);
$pf->parse($product_info);    
$products_price = $pf->getPriceString();

//    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 class="pageHeading" valign="top"><?php echo $product_info['products_name']; ?></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'])) {	
// =========================================================== IMAGE BLOCK ============================================================
?>
         <table border="0" cellspacing="0" cellpadding="2" align="right">
           <tr>
             <td align="center" class="smallText">  
<!-- DDB - 040814 - replaced   	 <script language="javascript">//--><!--
document.write('<?php //echo '<a href="javascript: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>'; ?>');
   //--><!--</script>
   <noscript>
   <?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>'; ?>
   </noscript>
//-->    
   <!--
   <script language="javascript">
   document.write('<?php echo '<a href="javascript: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>' . tep_image(DIR_WS_IMAGES . 'zoom.gif', TEXT_CLICK_TO_ENLARGE) . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>');
   </script>
   <noscript>
   <?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>' . tep_image(DIR_WS_IMAGES . 'zoom.gif', TEXT_CLICK_TO_ENLARGE) . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>
   </noscript>
   -->
   <?php 
  	 echo '<a onclick="javascript:popupWindow(\'' 
     , tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id']) , '\'); return false;" '
     , '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>' 
     , tep_image(DIR_WS_IMAGES . 'zoom.gif', TEXT_CLICK_TO_ENLARGE)
     , TEXT_CLICK_TO_ENLARGE
     , '</a>'; 
   ?>
             </td>
           </tr>
	 <tr>
         <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
           </tr>
	 <tr>
   <!-- PRICE //-->
   <td class="pageHeading" align="center"><?php echo $products_price; ?></td>
           </tr>
	 <tr>
         <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
           </tr>
	 <tr>
   <!-- QUANTITY BOX //-->
   <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"> 
  	 <tr class="infoBoxContents" align="center">
<!--      <td><?php echo TEXT_QUANTITY . ' ' . tep_draw_input_field('quantity', '1', 'SIZE=4 maxlength=4') . tep_draw_separator('pixel_trans.gif', '5', '1') . tep_draw_hidden_field('products_id', $product_info['products_id']) . '     ' . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART, 'align=absmiddle'); ?></td>
//-->
     <td><?php echo TEXT_QUANTITY . ' ' . tep_draw_input_field('quantity', $pf->adjustQty(1), 'SIZE=4 maxlength=4') . tep_draw_separator('pixel_trans.gif', '5', '1') . tep_draw_hidden_field('products_id', $product_info['products_id']) . '     ' . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART, 'align=absmiddle'); ?></td>
  	 </tr>
   </table></td>
	 </tr>
	 <tr>
         <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
           </tr>
	 <tr>
   <!-- PDF DATASHEET //-->
   <td class="smallText"><?php echo '<a href="' . tep_href_link(FILENAME_PDF_DATASHEET, 'products_id=' . $product_info['products_id']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . 'pdf.gif', TEXT_PRODUCT_FICHE) . ' <b>' . TEXT_PRODUCT_FICHE . '</b></a>';?></td>
	 </tr>
	 <tr>
   <!-- TELL A FRIEND //-->
   <td class="smallText"><?php echo '<a href="' . tep_href_link(FILENAME_TELL_A_FRIEND, 'products_id=' . $product_info['products_id']) . '" target="_blank">' . tep_image_submit('button_tell_a_friend.gif', BOX_HEADING_TELL_A_FRIEND) . ' <b>' . BOX_TELL_A_FRIEND_TEXT . '</b></a>';?></td>
	 </tr>
   <?php
   //-- ADD TO FAVORITES v1.2//-->
   if (strstr ($HTTP_USER_AGENT, "MSIE")) {
  	 $sid_str = '&' . tep_session_name() . '=' . tep_session_id();
  	 $sstr = array($sid_str);	
  	 $rstr = array(""); 
  	 $REQUESTED_SHORT_URI = str_replace($sstr, $rstr, $REQUEST_URI);
  	 $self = "http://" . $HTTP_HOST . $REQUESTED_SHORT_URI;
  	 $sea_str = array("'", '"');
  	 $rep_str = array("\'", "");
  	 $text = '<a href="javascript:window.external.AddFavorite(\'' . $self . '\', \'' . STORE_NAME . ' - ' . str_replace($sea_str, $rep_str, $product_info['products_name']) . '\')">' . tep_image(DIR_WS_IMAGES . 'add.gif', TEXT_BOOKMARK) . ' <b>' . TEXT_BOOKMARK . "</b></a>";
    	 }
//	code v1.1b 	 if (strstr ($HTTP_USER_AGENT, "MSIE")) 
//    {
//   	 $url = HTTP_SERVER . DIR_WS_CATALOG . FILENAME_PRODUCT_INFO . "?products_id=" . $product_info['products_id'];
//   	 $text = "<a href=\"javascript:window.external.AddFavorite('$url','" . STORE_NAME . " - " . str_replace("'", "\'", $products_name) . "')\">" . tep_image(DIR_WS_IMAGES . 'add.gif', TEXT_BOOKMARK) . ' <b>' . TEXT_BOOKMARK . "</b></a>";
   ?>
   <tr>
  	 <td class="smallText"><?php echo $text;?></td>    
   </tr>
         </table>
<?php
   } // end of image
// ===================================================== DESCRIPTION BLOCK ==========================================================
?>  
 <p><?php echo stripslashes($product_info['products_description']); ?></p>
 <span class="smallText">
 <?php  
 if (tep_not_null($product_info['products_model'])) 
 {
	 echo tep_image(DIR_WS_IMAGES . 'pointer_blue.gif', '') . PRODUCT_MODEL . $product_info['products_model'] . '<br>'; 	 
 }
 if (tep_not_null($product_info['manufacturers_name']))
 {
	 echo tep_image(DIR_WS_IMAGES . 'pointer_blue.gif', '') . TEXT_PRODUCT_MANUFACTURER . $product_info['manufacturers_name'] . '  ' . '<a href="' . tep_href_link(FILENAME_DIMENSIONS, 'manufacturers_id=' . $product_info['manufacturers_id']) . '&products_id=' . $product_info['products_id'] . '" target="_blank">' . tep_image(DIR_WS_IMAGES . 'help.gif', TEXT_HELP) . '</a><br>';
 }
 echo tep_image(DIR_WS_IMAGES . 'pointer_blue.gif', '') . BOX_INFORMATION_COLORS . '  ' . '<a href="' . tep_href_link(FILENAME_COLORS, 'products_id=' . $product_info['products_id']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . 'help.gif', TEXT_HELP) . '</a><br>'; 
 echo tep_image(DIR_WS_IMAGES . 'pointer_blue.gif', '') . BOX_INFORMATION_FONTS . '  ' . '<a href="' . tep_href_link(FILENAME_FONTS, 'products_id=' . $product_info['products_id']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . 'help.gif', TEXT_HELP) . '</a><br><br>'; 
  	 ?>
 </span>
<?php
// ===================================================== OPTIONS BLOCK ============================================================
// DDB - 031026 - Options Image
   $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, popt.products_options_images_enabled 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_sort_order");	// DDB - 031120 - changed products_options_name + CLR get options_type, options_length, options_comment
//	$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 . "'");
   $num_options = tep_db_num_rows($products_options_name_query);
//   	 $products_attributes = tep_db_fetch_array($products_attributes_query);
//   	 if ($products_attributes['total'] > 0) 
   if ($num_options > 0) 
{
?>
         <table bordercolor="#A18887" border="1" cellspacing="0" cellpadding="2">
           <tr class="optionsTextContent">
             <?php  echo '<td class="optionsTextHeading" colspan="2">' . TEXT_PRODUCT_OPTIONS . TEXT_PRODUCT_OPTIONS_2; ?></td>
           </tr>
<?php
//      $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, popt.products_options_images_enabled 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_sort_order");	// DDB - 031120 - changed products_options_name + CLR get options_type, options_length, options_comment
     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 = '<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'];
	 $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 . "' order by pov.products_options_values_sort_order");
           $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, pov.products_options_values_thumbnail, 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 . "' order by pov.products_options_values_sort_order");	// DDB - 031030 - add order by
      	 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'], 
             'thumbnail' => $products_options['products_options_values_thumbnail']);
           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 class="optionsTextContent">
             <td class="main" valign="top"><?php echo $products_options_name['products_options_name'] . ''; ?></td>
<?php 
	 if ($products_options_name['products_options_images_enabled'] == 'false')
	 {
   echo '<td class="main">' . tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute) . '</td></tr>';
           } 
	 else 
	 {
        $count=0;
   $number=0;
   echo '<td class="main"><table><tr>';
               foreach ($products_options_array as $opti_array)
   {
  	 echo '<td><table cellspacing="1" cellpadding="0" border="0">';
  	 if (OPTIONS_IMAGES_CLICK_ENLARGE == 'true') 
     echo '<td align="center"><a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_OPTIONS_IMAGES_POPUP, 'oID=' . $opti_array['id']) .'\')">' . tep_image(DIR_WS_IMAGES . 'options/' . $opti_array['thumbnail'], $opti_array['text'], OPTIONS_IMAGES_WIDTH, OPTIONS_IMAGES_HEIGHT) . '</a></td></tr>';
  	 else 
     echo '<tr><td align="center">' . tep_image(DIR_WS_IMAGES . 'options/' . $opti_array['thumbnail'], $opti_array['text'], OPTIONS_IMAGES_WIDTH, OPTIONS_IMAGES_HEIGHT) . '</td></tr>';
  	 echo '<tr><td class="main" align="center">' . $opti_array['text'] . '</td></tr>';
  	 if ($number==0)
     echo '<tr><td align="center"><input type="radio" name ="id[' . $products_options_name['products_options_id'] . ']" value="' . $opti_array['id'] . '" checked></td></tr></table></td>';
  	 else
     echo '<tr><td align="center"><input type="radio" name ="id[' . $products_options_name['products_options_id'] . ']" value="' . $opti_array['id'] . '" ></td></tr></table></td>';
  	 $count++;
  	 $number++;
                   if ($count%OPTIONS_IMAGES_NUMBER_PER_ROW == 0) 
  	 {
     echo '</tr><tr>';
     $count = 0;
  	 }
   }
   echo '</table>';
	 }
?>
      	 </td></tr>
<?php
 }	// switch
     }	// while
?>
    </table>
<?php
   } // if
?>
       </td>
     </tr>
<!-- DDB - 040807 - no reviews at all 
<?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>
<!-- DDB - 031207 - no more display         <td align="center" class="smallText"><?php //echo sprintf(TEXT_DATE_ADDED, tep_date_long($product_info['products_date_added'])); ?></td> //-->
 <td></td>
     </tr>
<?php
   }
?>
     <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);
//     echo tep_draw_separator('pixel_trans.gif', '100%', '1');
//     include(DIR_WS_MODULES . FILENAME_XSELL_PRODUCTS); // DDB - for Xsell
// 	 } else {
    include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS);
    echo tep_draw_separator('pixel_trans.gif', '100%', '1');
    include(DIR_WS_MODULES . FILENAME_XSELL_PRODUCTS); 
// 	 }
	 ?>
       </td>
     </tr>
  <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '50'); ?></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>
<!-- DDB - 031014 - added 'back' button //-->	
   <?php
       $back = sizeof($navigation->path)-2;
       if (isset($navigation->path[$back])) {
   ?>
               <td class="main" align="left"><?php echo '<a href="' . tep_href_link($navigation->path[$back]['page'], tep_array_to_string($navigation->path[$back]['get'], array('action')), $navigation->path[$back]['mode']) . '">' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>
   <?php
      }
   ?>
<!-- DDB - 040807 - no reviews at all            
   <td class="main" align="center"><?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>
//-->
<!-- DDB - 040808 - add Quantity box and moved beneath product image
              <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>
<?php
 }
?>
       </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'); ?>

 

Didier.

Link to comment
Share on other sites

@Robert: ok..I've seen your error after having tested your page on my shop ! You have put all the OTP code in the case where OPTIONS_AS_IMAGES_ENABLED is disabled. The "else" case has no OTF code at all. So as you have it enabled, you only have the standard dropdownbox.

 

To give you a hint, change line 124 to

 

if (OPTIONS_AS_IMAGES_ENABLED == 'true'){.

 

You will have a textbox instead of a dropdown box, what is the default code for the Option as Images code.

 

An advice : if you want to display the options as images, have only 1 code with Options as Images and OTF together. Much easier to maintain.

 

I also saw that you forgot to add "popt.products_options_images_enabled" in one of the queries (line 135).

 

Didier.

Link to comment
Share on other sites

I just published version v1.7 of Option Type Feature : Version v1.6 has been updated to include textarea option type fields so that text is not limited anymore to 32 characters. This new feature has been requested *a lot* on the support thread.

 

This is the changelog for v1.7 :

 

- Updated file "ReadMe.html" to include correct information on new textarea type option (read Step 4)

- /includes/configure.php : added new value 'PRODUCTS_OPTIONS_TYPE_TEXTAREA (4)'.

- changed column datatype of customers_basket_attributes.products_options_value_text from varchar(32) to "text".

- added admin support of fields products_options_length and products_options_comment (no need anymore to update the database manually).

- added javascript "Form Field Progress bar" to indicate how many characters are left for the customer to type. The size is determined by the 'products_options_length' field. Thanks to Dynamic Drive for this script (http://www.dynamicdrive.com).

- added stylesheet.css in package : needed for javascript Form Field Progress bar (new style '.progress')

- includes price tax fix of 26.07.2004 by Patrick_S

- includes dutch language file for admin/producs_attributes.php (thanks to Stef Verlint)

 

You can find it here :

 

URL : 7 Nov 2004 - Product Attributes - Option Type Feature v1.7

 

Support thread : http://www.oscommerce.com/forums/index.php?sho...ic=57259&st=100

 

Try it it and tell me how it works.

 

Didier.

 

 

Since I implemented your last version 1.6.1, what do I do to implement the new changes? I read the install doc and it is like identical to the last one almost. But now I have to do everything from scratch? By the way I had went back to my original osCommerce installation and other contribs then implemented your 1.6.1 and did not implement the Options as Images. I thought since there is a new version of this contrib you produced that there would also be a document explaining what to do if a person implemented a previous version.

 

Rob.

Link to comment
Share on other sites

I just published version v1.7 of Option Type Feature : Version v1.6 has been updated to include textarea option type fields so that text is not limited anymore to 32 characters. This new feature has been requested *a lot* on the support thread.

 

This is the changelog for v1.7 :

 

- Updated file "ReadMe.html" to include correct information on new textarea type option (read Step 4)

- /includes/configure.php : added new value 'PRODUCTS_OPTIONS_TYPE_TEXTAREA (4)'.

- changed column datatype of customers_basket_attributes.products_options_value_text from varchar(32) to "text".

- added admin support of fields products_options_length and products_options_comment (no need anymore to update the database manually).

- added javascript "Form Field Progress bar" to indicate how many characters are left for the customer to type. The size is determined by the 'products_options_length' field. Thanks to Dynamic Drive for this script (http://www.dynamicdrive.com).

- added stylesheet.css in package : needed for javascript Form Field Progress bar (new style '.progress')

- includes price tax fix of 26.07.2004 by Patrick_S

- includes dutch language file for admin/producs_attributes.php (thanks to Stef Verlint)

 

You can find it here :

 

URL : 7 Nov 2004 - Product Attributes - Option Type Feature v1.7

 

Support thread : http://www.oscommerce.com/forums/index.php?sho...ic=57259&st=100

 

Try it it and tell me how it works.

 

Didier.

 

I tell you I am just not having any luck. I implemented this new version. I first use a diff program to merge the changes but that didn't work out too well so I deployed all of your files from your contrib to my server. Of course I backed up all files before doing a diff and after I decided to deploy your files. The admin product attributes seems to work but my product_info.php page doesn't work. Well I should say your product_info.php page is not working properly. I get my product page but no image is showing, the details of the product are above that long bar that stretches across the screen. The logo is gone and all my product detail is up above where the logo would be. That straight bar is gone, the bar that contain the Cart Contents link etc. Not sure what happened but now it is all messed up. Not even sure what page of code to put here. Has this happened to anyone before?

 

Rob.

Link to comment
Share on other sites

Hi Rob,

 

Don't worry..it happens to everyone but it get nasty once you start mixing contributions. You really must understand what every line of code is doin.

 

1. there was an error in my product_info page. There is a comment too much at the beginning of the javascript (without a close tag). If you follow the official support thread for this contribution, maybe you read post #120

 

http://www.oscommerce.com/forums/index.php?sho...c=57259&st=100#

 

Will be fixed if I publish version v1.71. In the meanwhil, drop the html comment tag after the <script> tag and you will have a full functioning product_info page.

 

2. there is almost never an explanation in case of an upgrade to a newer version. This would demand a bit too much work according to me. Updating a contribution is already a lot of work. What I do, is using Winmerge and compare the files of the latest version with my files. This is not easy but indispensable once you have a customised shop.

 

Didier.

Link to comment
Share on other sites

Hi Rob,

 

Don't worry..it happens to everyone but it get nasty once you start mixing contributions. You really must understand what every line of code is doin.

 

1. there was an error in my product_info page. There is a comment too much at the beginning of the javascript (without a close tag). If you follow the official support thread for this contribution, maybe you read post #120

 

http://www.oscommerce.com/forums/index.php?sho...c=57259&st=100#

 

Will be fixed if I publish version v1.71. In the meanwhil, drop the html comment tag after the <script> tag and you will have a full functioning product_info page.

 

2. there is almost never an explanation in case of an upgrade to a newer version. This would demand a bit too much work according to me. Updating a contribution is already a lot of work. What I do, is using Winmerge and compare the files of the latest version with my files. This is not easy but indispensable once you have a customised shop.

 

Didier.

 

 

Hey.... that worked for me. removing the comment worked. I am closer. So far it all looks good except for the file upload option that I added about a month ago. The product has 6 attributes for uploading a file. Right now those file uploads are showing a textarea instead of the file upload (browse) button. I can upload the file to you to see if you know where the problem is but I will look at it more myself. If you want to take a look then let me know. I have an issue with the /catalog/admin/product_attributes.php page. Once I added your items with a merge program, the file upload attribute is now set to Textarea within the osCommerce administration. Another thing I noticed is that if i want to add a new product option there is a en: field and a comment field next to it then an insert button. In the past you would be able to enter text then choose the pulldown to choose 1-4 options, in my case 1-5 because I had a 5th item called File Upload. Is this the way the new product_attributes.php page should behave? Should I first add the item and click the Insert button then go to edit the item then set the option type? If that is the case then I just have to figure out why this product_attributes page has an issue with the file upload option that I added.

 

product_attributes.php code:

<?php

/*

 $Id: products_attributes.php,v 1.52 2003/07/10 20:46:01 dgw_ 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');

 $languages = tep_get_languages();

 

 $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');

 

 if (tep_not_null($action)) {

   $page_info = '';

   if (isset($HTTP_GET_VARS['option_page'])) $page_info .= 'option_page=' . $HTTP_GET_VARS['option_page'] . '&';

   if (isset($HTTP_GET_VARS['value_page'])) $page_info .= 'value_page=' . $HTTP_GET_VARS['value_page'] . '&';

   if (isset($HTTP_GET_VARS['attribute_page'])) $page_info .= 'attribute_page=' . $HTTP_GET_VARS['attribute_page'] . '&';

   if (tep_not_null($page_info)) {

     $page_info = substr($page_info, 0, -1);

   }

 

   switch ($action) {

     case 'add_product_options':

       $products_options_id = tep_db_prepare_input($HTTP_POST_VARS['products_options_id']);

       $option_name_array = $HTTP_POST_VARS['option_name'];

       $option_type = $HTTP_POST_VARS['option_type']; //clr 030714 update to add option type to products_option

 $option_length = $HTTP_POST_VARS['option_length']; //clr 030714 update to add option length to products_option

 

       for ($i=0, $n=sizeof($languages); $i<$n; $i ++) {

         $option_name = tep_db_prepare_input($option_name_array[$languages[$i]['id']]);

   $option_comment = $HTTP_POST_VARS['option_comment']; //clr 030714 update to add option comment to products_option

 

         tep_db_query("insert into " . TABLE_PRODUCTS_OPTIONS . " (products_options_id, products_options_name, language_id, products_options_type, products_options_length, products_options_comment) values ('" . (int)$products_options_id . "', '" . tep_db_input($option_name) . "', '" . (int)$languages[$i]['id'] . "', '" . $option_type . "', '" . $option_length . "', '" . $option_comment[$languages[$i]['id']]  . "')");

       }

       tep_redirect(tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, $page_info));

       break;

     case 'add_product_option_values':

       $value_name_array = $HTTP_POST_VARS['value_name'];

       $value_id = tep_db_prepare_input($HTTP_POST_VARS['value_id']);

       $option_id = tep_db_prepare_input($HTTP_POST_VARS['option_id']);

 

       for ($i=0, $n=sizeof($languages); $i<$n; $i ++) {

         $value_name = tep_db_prepare_input($value_name_array[$languages[$i]['id']]);

 

         tep_db_query("insert into " . TABLE_PRODUCTS_OPTIONS_VALUES . " (products_options_values_id, language_id, products_options_values_name) values ('" . (int)$value_id . "', '" . (int)$languages[$i]['id'] . "', '" . tep_db_input($value_name) . "')");

       }

 

       tep_db_query("insert into " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . " (products_options_id, products_options_values_id) values ('" . (int)$option_id . "', '" . (int)$value_id . "')");

 

       tep_redirect(tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, $page_info));

       break;

     case 'add_product_attributes':

       $products_id = tep_db_prepare_input($HTTP_POST_VARS['products_id']);

       $options_id = tep_db_prepare_input($HTTP_POST_VARS['options_id']);

       $values_id = tep_db_prepare_input($HTTP_POST_VARS['values_id']);

       $value_price = tep_db_prepare_input($HTTP_POST_VARS['value_price']);

       $price_prefix = tep_db_prepare_input($HTTP_POST_VARS['price_prefix']);

 

       tep_db_query("insert into " . TABLE_PRODUCTS_ATTRIBUTES . " values ('', '" . (int)$products_id . "', '" . (int)$options_id . "', '" . (int)$values_id . "', '" . tep_db_input($value_price) . "', '" . tep_db_input($price_prefix) . "')");

 

       if (DOWNLOAD_ENABLED == 'true') {

         $products_attributes_id = tep_db_insert_id();

 

         $products_attributes_filename = tep_db_prepare_input($HTTP_POST_VARS['products_attributes_filename']);

         $products_attributes_maxdays = tep_db_prepare_input($HTTP_POST_VARS['products_attributes_maxdays']);

         $products_attributes_maxcount = tep_db_prepare_input($HTTP_POST_VARS['products_attributes_maxcount']);

 

         if (tep_not_null($products_attributes_filename)) {

           tep_db_query("insert into " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " values (" . (int)$products_attributes_id . ", '" . tep_db_input($products_attributes_filename) . "', '" . tep_db_input($products_attributes_maxdays) . "', '" . tep_db_input($products_attributes_maxcount) . "')");

         }

       }

 

       tep_redirect(tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, $page_info));

       break;

     case 'update_option_name':

       $option_name_array = $HTTP_POST_VARS['option_name'];

    $option_type = $HTTP_POST_VARS['option_type']; //clr 030714 update to add option type to products_option

    $option_length = $HTTP_POST_VARS['option_length']; //clr 030714 update to add option length to products_option

       $option_id = tep_db_prepare_input($HTTP_POST_VARS['option_id']);

 

       for ($i=0, $n=sizeof($languages); $i<$n; $i ++) {

         $option_name = tep_db_prepare_input($option_name_array[$languages[$i]['id']]);

   $option_comment = $HTTP_POST_VARS['option_comment']; //clr 030714 update to add option comment to products_option

 

         tep_db_query("update " . TABLE_PRODUCTS_OPTIONS . " set products_options_name = '" . tep_db_input($option_name) . "', products_options_type = '" . $option_type . "', products_options_length = '" . $option_length . "', products_options_comment = '" . $option_comment[$languages[$i]['id']] . "' where products_options_id = '" . (int)$option_id . "' and language_id = '" . (int)$languages[$i]['id'] . "'");

       }

 

       tep_redirect(tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, $page_info));

       break;

     case 'update_value':

       $value_name_array = $HTTP_POST_VARS['value_name'];

       $value_id = tep_db_prepare_input($HTTP_POST_VARS['value_id']);

       $option_id = tep_db_prepare_input($HTTP_POST_VARS['option_id']);

 

       for ($i=0, $n=sizeof($languages); $i<$n; $i ++) {

         $value_name = tep_db_prepare_input($value_name_array[$languages[$i]['id']]);

 

         tep_db_query("update " . TABLE_PRODUCTS_OPTIONS_VALUES . " set products_options_values_name = '" . tep_db_input($value_name) . "' where products_options_values_id = '" . tep_db_input($value_id) . "' and language_id = '" . (int)$languages[$i]['id'] . "'");

       }

 

       tep_db_query("update " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . " set products_options_id = '" . (int)$option_id . "'  where products_options_values_id = '" . (int)$value_id . "'");

 

       tep_redirect(tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, $page_info));

       break;

     case 'update_product_attribute':

       $products_id = tep_db_prepare_input($HTTP_POST_VARS['products_id']);

       $options_id = tep_db_prepare_input($HTTP_POST_VARS['options_id']);

       $values_id = tep_db_prepare_input($HTTP_POST_VARS['values_id']);

       $value_price = tep_db_prepare_input($HTTP_POST_VARS['value_price']);

       $price_prefix = tep_db_prepare_input($HTTP_POST_VARS['price_prefix']);

       $attribute_id = tep_db_prepare_input($HTTP_POST_VARS['attribute_id']);

 

       tep_db_query("update " . TABLE_PRODUCTS_ATTRIBUTES . " set products_id = '" . (int)$products_id . "', options_id = '" . (int)$options_id . "', options_values_id = '" . (int)$values_id . "', options_values_price = '" . tep_db_input($value_price) . "', price_prefix = '" . tep_db_input($price_prefix) . "' where products_attributes_id = '" . (int)$attribute_id . "'");

 

       if (DOWNLOAD_ENABLED == 'true') {

         $products_attributes_filename = tep_db_prepare_input($HTTP_POST_VARS['products_attributes_filename']);

         $products_attributes_maxdays = tep_db_prepare_input($HTTP_POST_VARS['products_attributes_maxdays']);

         $products_attributes_maxcount = tep_db_prepare_input($HTTP_POST_VARS['products_attributes_maxcount']);

 

         if (tep_not_null($products_attributes_filename)) {

           tep_db_query("replace into " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " set products_attributes_id = '" . (int)$attribute_id . "', products_attributes_filename = '" . tep_db_input($products_attributes_filename) . "', products_attributes_maxdays = '" . tep_db_input($products_attributes_maxdays) . "', products_attributes_maxcount = '" . tep_db_input($products_attributes_maxcount) . "'");

         }

       }

 

       tep_redirect(tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, $page_info));

       break;

     case 'delete_option':

       $option_id = tep_db_prepare_input($HTTP_GET_VARS['option_id']);

 

       tep_db_query("delete from " . TABLE_PRODUCTS_OPTIONS . " where products_options_id = '" . (int)$option_id . "'");

 

       tep_redirect(tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, $page_info));

       break;

     case 'delete_value':

       $value_id = tep_db_prepare_input($HTTP_GET_VARS['value_id']);

 

       tep_db_query("delete from " . TABLE_PRODUCTS_OPTIONS_VALUES . " where products_options_values_id = '" . (int)$value_id . "'");

       tep_db_query("delete from " . TABLE_PRODUCTS_OPTIONS_VALUES . " where products_options_values_id = '" . (int)$value_id . "'");

       tep_db_query("delete from " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . " where products_options_values_id = '" . (int)$value_id . "'");

 

       tep_redirect(tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, $page_info));

       break;

     case 'delete_attribute':

       $attribute_id = tep_db_prepare_input($HTTP_GET_VARS['attribute_id']);

 

       tep_db_query("delete from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_attributes_id = '" . (int)$attribute_id . "'");

 

// added for DOWNLOAD_ENABLED. Always try to remove attributes, even if downloads are no longer enabled

       tep_db_query("delete from " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " where products_attributes_id = '" . (int)$attribute_id . "'");

 

       tep_redirect(tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, $page_info));

       break;

   }

 }

 

//CLR 030312 add function to draw pulldown list of option types

// Draw a pulldown for Option Types

function draw_optiontype_pulldown($name, $default = '') {

 $values = array();

 $values[] = array('id' => 0, 'text' => 'Select');

 $values[] = array('id' => 1, 'text' => 'Text');

 $values[] = array('id' => 2, 'text' => 'Radio');

 $values[] = array('id' => 3, 'text' => 'Checkbox');

 $values[] = array('id' => 4, 'text' => 'Textarea');

 return tep_draw_pull_down_menu($name, $values, $default);

}

 

//CLR 030312 add function to translate type_id to name

// Translate option_type_values to english string

function translate_type_to_name($opt_type) {

 if ($opt_type == 0) return 'Select';

 if ($opt_type == 1) return 'Text';

 if ($opt_type == 2) return 'Radio';

 if ($opt_type == 3) return 'Checkbox';

 if ($opt_type == 4) return 'Textarea';

 return 'Error ' . $opt_type;

}

 

?>

<!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"><!--

function go_option() {

 if (document.option_order_by.selected.options[document.option_order_by.selected.selectedIndex].value != "none") {

   location = "<?php echo tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'option_page=' . ($HTTP_GET_VARS['option_page'] ? $HTTP_GET_VARS['option_page'] : 1)); ?>&option_order_by="+document.option_order_by.selected.options[document.option_order_by.selected.selectedIndex].value;

 }

}

//--></script>

</head>

<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">

<!-- 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="0">

<!-- options and values//-->

     <tr>

       <td width="100%"><table width="100%" border="0" cellspacing="0" cellpadding="0">

         <tr>

           <td valign="top" width="50%"><table width="100%" border="0" cellspacing="0" cellpadding="2">

<!-- options //-->

<?php

 if ($action == 'delete_product_option') { // delete product option

   $options = tep_db_query("select products_options_id, products_options_name from " . TABLE_PRODUCTS_OPTIONS . " where products_options_id = '" . (int)$HTTP_GET_VARS['option_id'] . "' and language_id = '" . (int)$languages_id . "'");

   $options_values = tep_db_fetch_array($options);

?>

             <tr>

               <td class="pageHeading"> <?php echo $options_values['products_options_name']; ?> </td>

               <td> <?php echo tep_image(DIR_WS_IMAGES . 'pixel_trans.gif', '', '1', '53'); ?> </td>

             </tr>

             <tr>

               <td><table border="0" width="100%" cellspacing="0" cellpadding="2">

                 <tr>

                   <td colspan="3"><?php echo tep_black_line(); ?></td>

                 </tr>

<?php

   $products = tep_db_query("select p.products_id, pd.products_name, pov.products_options_values_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov, " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_DESCRIPTION . " pd where pd.products_id = p.products_id and pov.language_id = '" . (int)$languages_id . "' and pd.language_id = '" . (int)$languages_id . "' and pa.products_id = p.products_id and pa.options_id='" . (int)$HTTP_GET_VARS['option_id'] . "' and pov.products_options_values_id = pa.options_values_id order by pd.products_name");

   if (tep_db_num_rows($products)) {

?>

                 <tr class="dataTableHeadingRow">

                   <td class="dataTableHeadingContent" align="center"> <?php echo TABLE_HEADING_ID; ?> </td>

                   <td class="dataTableHeadingContent"> <?php echo TABLE_HEADING_PRODUCT; ?> </td>

                   <td class="dataTableHeadingContent"> <?php echo TABLE_HEADING_OPT_VALUE; ?> </td>

                 </tr>

                 <tr>

                   <td colspan="3"><?php echo tep_black_line(); ?></td>

                 </tr>

<?php

     $rows = 0;

     while ($products_values = tep_db_fetch_array($products)) {

       $rows++;

?>

                 <tr class="<?php echo (floor($rows/2) == ($rows/2) ? 'attributes-even' : 'attributes-odd'); ?>">

                   <td align="center" class="smallText"> <?php echo $products_values['products_id']; ?> </td>

                   <td class="smallText"> <?php echo $products_values['products_name']; ?> </td>

                   <td class="smallText"> <?php echo $products_values['products_options_values_name']; ?> </td>

                 </tr>

<?php

     }

?>

                 <tr>

                   <td colspan="3"><?php echo tep_black_line(); ?></td>

                 </tr>

                 <tr>

                   <td colspan="3" class="main"><br><?php echo TEXT_WARNING_OF_DELETE; ?></td>

                 </tr>

                 <tr>

                   <td align="right" colspan="3" class="main"><br><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, (isset($HTTP_GET_VARS['value_page']) ? 'value_page=' . $HTTP_GET_VARS['value_page'] . '&' : '') . (isset($HTTP_GET_VARS['attribute_page']) ? 'attribute_page=' . $HTTP_GET_VARS['attribute_page'] : ''), 'NONSSL') . '">'; ?><?php echo tep_image_button('button_cancel.gif', ' cancel '); ?></a> </td>

                 </tr>

<?php

   } else {

?>

                 <tr>

                   <td class="main" colspan="3"><br><?php echo TEXT_OK_TO_DELETE; ?></td>

                 </tr>

                 <tr>

                   <td class="main" align="right" colspan="3"><br><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'action=delete_option&option_id=' . $HTTP_GET_VARS['option_id'], 'NONSSL') . '">'; ?><?php echo tep_image_button('button_delete.gif', ' delete '); ?></a>   <?php echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, (isset($HTTP_GET_VARS['order_by']) ? 'order_by=' . $HTTP_GET_VARS['order_by'] . '&' : '') . (isset($HTTP_GET_VARS['page']) ? 'page=' . $HTTP_GET_VARS['page'] : ''), 'NONSSL') . '">'; ?><?php echo tep_image_button('button_cancel.gif', ' cancel '); ?></a> </td>

                 </tr>

<?php

   }

?>

               </table></td>

             </tr>

<?php

 } else {

   if (isset($HTTP_GET_VARS['option_order_by'])) {

     $option_order_by = $HTTP_GET_VARS['option_order_by'];

   } else {

     $option_order_by = 'products_options_id';

   }

?>

             <tr>

               <td colspan="2" class="pageHeading"> <?php echo HEADING_TITLE_OPT; ?> </td>

               <td align="right"><br><form name="option_order_by" action="<?php echo FILENAME_PRODUCTS_ATTRIBUTES; ?>"><select name="selected" onChange="go_option()"><option value="products_options_id"<?php if ($option_order_by == 'products_options_id') { echo ' SELECTED'; } ?>><?php echo TEXT_OPTION_ID; ?></option><option value="products_options_name"<?php if ($option_order_by == 'products_options_name') { echo ' SELECTED'; } ?>><?php echo TEXT_OPTION_NAME; ?></option></select></form></td>

             </tr>

             <tr>

               <td colspan="3" class="smallText">

<?php

   $per_page = MAX_ROW_LISTS_OPTIONS;

   $options = "select * from " . TABLE_PRODUCTS_OPTIONS . " where language_id = '" . (int)$languages_id . "' order by " . $option_order_by;

   if (!isset($option_page)) {

     $option_page = 1;

   }

   $prev_option_page = $option_page - 1;

   $next_option_page = $option_page + 1;

 

   $option_query = tep_db_query($options);

 

   $option_page_start = ($per_page * $option_page) - $per_page;

   $num_rows = tep_db_num_rows($option_query);

 

   if ($num_rows <= $per_page) {

     $num_pages = 1;

   } else if (($num_rows % $per_page) == 0) {

     $num_pages = ($num_rows / $per_page);

   } else {

     $num_pages = ($num_rows / $per_page) + 1;

   }

   $num_pages = (int) $num_pages;

 

   $options = $options . " LIMIT $option_page_start, $per_page";

 

   // Previous

   if ($prev_option_page)  {

     echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'option_page=' . $prev_option_page) . '"> << </a> | ';

   }

 

   for ($i = 1; $i <= $num_pages; $i++) {

     if ($i != $option_page) {

       echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'option_page=' . $i) . '">' . $i . '</a> | ';

     } else {

       echo '<b><font color=red>' . $i . '</font></b> | ';

     }

   }

 

   // Next

   if ($option_page != $num_pages) {

     echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'option_page=' . $next_option_page) . '"> >> </a>';

   }

//CLR 030212 - Add column for option type

?>

               </td>

             </tr>

             <tr>

               <td colspan="6"><?php echo tep_black_line(); ?></td>

             </tr>

             <tr class="dataTableHeadingRow">

               <td class="dataTableHeadingContent"> <?php echo TABLE_HEADING_ID; ?> </td>

               <td class="dataTableHeadingContent"> <?php echo TABLE_HEADING_OPT_NAME; ?> </td>

   <td class="dataTableHeadingContent"> <?php echo TABLE_HEADING_OPT_TYPE; ?> </td> <!-- CLR 030212 - Add column for option type //-->

      <td class="dataTableHeadingContent"> <?php echo TABLE_HEADING_OPT_LENGTH; ?> </td> <!-- CLR 030212 - Add column for option length //-->

               <td class="dataTableHeadingContent"> <?php echo TABLE_HEADING_OPT_COMMENT; ?> </td> <!-- CLR 030212 - Add column for option comment //-->

               <td class="dataTableHeadingContent" align="center"> <?php echo TABLE_HEADING_ACTION; ?> </td>

             </tr>

             <tr>

               <td colspan="6"><?php echo tep_black_line(); ?></td>

             </tr>

<?php

   $next_id = 1;

   $rows = 0;

   $options = tep_db_query($options);

   while ($options_values = tep_db_fetch_array($options)) {

     $rows++;

?>

             <tr class="<?php echo (floor($rows/2) == ($rows/2) ? 'attributes-even' : 'attributes-odd'); ?>">

<?php

     if (($action == 'update_option') && ($HTTP_GET_VARS['option_id'] == $options_values['products_options_id'])) {

       echo '<form name="option" action="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'action=update_option_name', 'NONSSL') . '" method="post">';

       $inputs = '';

       for ($i = 0, $n = sizeof($languages); $i < $n; $i ++) {

         $option_name = tep_db_query("select products_options_name, products_options_length, products_options_comment from " . TABLE_PRODUCTS_OPTIONS . " where products_options_id = '" . $options_values['products_options_id'] . "' and language_id = '" . $languages[$i]['id'] . "'");

         $option_name = tep_db_fetch_array($option_name);

    $inputs .= $languages[$i]['code'] . ': <input type="text" name="option_name[' . $languages[$i]['id'] . ']" size="32" value="' . $option_name['products_options_name'] . '">  ' . TABLE_HEADING_OPT_COMMENT . ' <input type="text" name="option_comment[' . $languages[$i]['id'] . ']" size="32" value="' . $option_name['products_options_comment'] . '"><br>';

       }

//CLR 030212 - Add column for option type

?>

               <td align="center" class="smallText"> <?php echo $options_values['products_options_id']; ?><input type="hidden" name="option_id" value="<?php echo $options_values['products_options_id']; ?>"> </td>

   <td class="smallText" colspan="3"><?php echo $inputs; ?></td>

   <td class="smallText"><?php echo TABLE_HEADING_OPT_LENGTH . ' <input type="text" name="option_length" size="4" value="' . $option_name['products_options_length'] . '">'; ?></td> <!-- CLR 030212 - Add column for option length //-->

   <td class="smallText"><?php echo draw_optiontype_pulldown('option_type', $options_values['products_options_type']); ?></td> <!-- CLR 030212 - Add column for option type //-->

               <td align="center" class="smallText"> <?php echo tep_image_submit('button_update.gif', IMAGE_UPDATE); ?> <?php echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, '', 'NONSSL') . '">'; ?><?php echo tep_image_button('button_cancel.gif', IMAGE_CANCEL); ?></a> </td>

<?php

       echo '</form>' . "\n";

     } else {

//CLR 030212 - Add column for option type

?>

               <td align="center" class="smallText"> <?php echo $options_values["products_options_id"]; ?> </td>

               <td class="smallText"> <?php echo $options_values["products_options_name"]; ?> </td>

               <td class="smallText"> <?php echo translate_type_to_name($options_values["products_options_type"]); ?> </td> <!-- CLR 030212 - Add column for option type //-->

   <td class="smallText"> <?php echo $options_values["products_options_length"]; ?> </td> <!-- CLR 030212 - Add column for option length //-->

   <td class="smallText"> <?php echo $options_values["products_options_comment"]; ?> </td> <!-- CLR 030212 - Add column for option comment //-->

               <td align="center" class="smallText"> <?php echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'action=update_option&option_id=' . $options_values['products_options_id'] . '&option_order_by=' . $option_order_by . '&option_page=' . $option_page, 'NONSSL') . '">'; ?><?php echo tep_image_button('button_edit.gif', IMAGE_UPDATE); ?></a>  <?php echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'action=delete_product_option&option_id=' . $options_values['products_options_id'], 'NONSSL') , '">'; ?><?php echo tep_image_button('button_delete.gif', IMAGE_DELETE); ?></a> </td>

<?php

     }

?>

             </tr>

<?php

     $max_options_id_query = tep_db_query("select max(products_options_id) + 1 as next_id from " . TABLE_PRODUCTS_OPTIONS);

     $max_options_id_values = tep_db_fetch_array($max_options_id_query);

     $next_id = $max_options_id_values['next_id'];

   }

?>

             <tr>

               <td colspan="6"><?php echo tep_black_line(); ?></td>

             </tr>

<?php

   if ($action != 'update_option') {

?>

             <tr class="<?php echo (floor($rows/2) == ($rows/2) ? 'attributes-even' : 'attributes-odd'); ?>">

<?php

     echo '<form name="options" action="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'action=add_product_options&option_page=' . $option_page, 'NONSSL') . '" method="post"><input type="hidden" name="products_options_id" value="' . $next_id . '">';

     $inputs = '';

     for ($i = 0, $n = sizeof($languages); $i < $n; $i ++) {

 $inputs .= $languages[$i]['code'] . ': <input type="text" name="option_name[' . $languages[$i]['id'] . ']" size="32">' . TABLE_HEADING_OPT_COMMENT . ' <input type="text" name="option_comment[' . $languages[$i]['id'] . ']" size="32"><br>';

     }

//CLR 030212 - Add column for option type

?>

               <td align="center" class="smallText"> <?php echo $next_id; ?> </td>

               <td class="smallText" colspan="2"><?php echo $inputs; ?></td>

               <td align="center" class="smallText"> <?php echo tep_image_submit('button_insert.gif', IMAGE_INSERT); ?> </td>

<?php

     echo '</form>';

?>

             </tr>

             <tr>

               <td colspan="6"><?php echo tep_black_line(); ?></td>

             </tr>

<?php

   }

 }

?>

           </table></td>

<!-- options eof //-->

           <td valign="top" width="50%"><table width="100%" border="0" cellspacing="0" cellpadding="2">

<!-- value //-->

<?php

 if ($action == 'delete_option_value') { // delete product option value

   $values = tep_db_query("select products_options_values_id, products_options_values_name from " . TABLE_PRODUCTS_OPTIONS_VALUES . " where products_options_values_id = '" . (int)$HTTP_GET_VARS['value_id'] . "' and language_id = '" . (int)$languages_id . "'");

   $values_values = tep_db_fetch_array($values);

?>

             <tr>

               <td colspan="3" class="pageHeading"> <?php echo $values_values['products_options_values_name']; ?> </td>

               <td> <?php echo tep_image(DIR_WS_IMAGES . 'pixel_trans.gif', '', '1', '53'); ?> </td>

             </tr>

             <tr>

               <td><table border="0" width="100%" cellspacing="0" cellpadding="2">

                 <tr>

                   <td colspan="3"><?php echo tep_black_line(); ?></td>

                 </tr>

<?php

   $products = tep_db_query("select p.products_id, pd.products_name, po.products_options_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS . " po, " . TABLE_PRODUCTS_DESCRIPTION . " pd where pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and po.language_id = '" . (int)$languages_id . "' and pa.products_id = p.products_id and pa.options_values_id='" . (int)$HTTP_GET_VARS['value_id'] . "' and po.products_options_id = pa.options_id order by pd.products_name");

   if (tep_db_num_rows($products)) {

?>

                 <tr class="dataTableHeadingRow">

                   <td class="dataTableHeadingContent" align="center"> <?php echo TABLE_HEADING_ID; ?> </td>

                   <td class="dataTableHeadingContent"> <?php echo TABLE_HEADING_PRODUCT; ?> </td>

                   <td class="dataTableHeadingContent"> <?php echo TABLE_HEADING_OPT_NAME; ?> </td>

                 </tr>

                 <tr>

                   <td colspan="3"><?php echo tep_black_line(); ?></td>

                 </tr>

<?php

     while ($products_values = tep_db_fetch_array($products)) {

       $rows++;

?>

                 <tr class="<?php echo (floor($rows/2) == ($rows/2) ? 'attributes-even' : 'attributes-odd'); ?>">

                   <td align="center" class="smallText"> <?php echo $products_values['products_id']; ?> </td>

                   <td class="smallText"> <?php echo $products_values['products_name']; ?> </td>

                   <td class="smallText"> <?php echo $products_values['products_options_name']; ?> </td>

                 </tr>

<?php

     }

?>

                 <tr>

                   <td colspan="3"><?php echo tep_black_line(); ?></td>

                 </tr>

                 <tr>

                   <td class="main" colspan="3"><br><?php echo TEXT_WARNING_OF_DELETE; ?></td>

                 </tr>

                 <tr>

                   <td class="main" align="right" colspan="3"><br><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, (isset($HTTP_GET_VARS['value_page']) ? 'value_page=' . $HTTP_GET_VARS['value_page'] . '&' : '') . (isset($HTTP_GET_VARS['attribute_page']) ? 'attribute_page=' . $attribute_page : ''), 'NONSSL') . '">'; ?><?php echo tep_image_button('button_cancel.gif', ' cancel '); ?></a> </td>

                 </tr>

<?php

   } else {

?>

                 <tr>

                   <td class="main" colspan="3"><br><?php echo TEXT_OK_TO_DELETE; ?></td>

                 </tr>

                 <tr>

                   <td class="main" align="right" colspan="3"><br><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'action=delete_value&value_id=' . $HTTP_GET_VARS['value_id'], 'NONSSL') . '">'; ?><?php echo tep_image_button('button_delete.gif', ' delete '); ?></a>   <?php echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, '&option_page=' . $option_page . (isset($HTTP_GET_VARS['value_page']) ? '&value_page=' . $value_page : '') . (isset($HTTP_GET_VARS['attribute_page']) ? '&attribute_page=' . $attribute_page : ''), 'NONSSL') . '">'; ?><?php echo tep_image_button('button_cancel.gif', ' cancel '); ?></a> </td>

                 </tr>

<?php

   }

?>

              </table></td>

             </tr>

<?php

 } else {

?>

             <tr>

               <td colspan="3" class="pageHeading"> <?php echo HEADING_TITLE_VAL; ?> </td>

               <td> <?php echo tep_image(DIR_WS_IMAGES . 'pixel_trans.gif', '', '1', '53'); ?> </td>

             </tr>

             <tr>

               <td colspan="4" class="smallText">

<?php

   $per_page = MAX_ROW_LISTS_OPTIONS;

   $values = "select pov.products_options_values_id, pov.products_options_values_name, pov2po.products_options_id from " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov left join " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . " pov2po on pov.products_options_values_id = pov2po.products_options_values_id where pov.language_id = '" . (int)$languages_id . "' order by pov.products_options_values_id";

   if (!isset($value_page)) {

     $value_page = 1;

   }

   $prev_value_page = $value_page - 1;

   $next_value_page = $value_page + 1;

 

   $value_query = tep_db_query($values);

 

   $value_page_start = ($per_page * $value_page) - $per_page;

   $num_rows = tep_db_num_rows($value_query);

 

   if ($num_rows <= $per_page) {

     $num_pages = 1;

   } else if (($num_rows % $per_page) == 0) {

     $num_pages = ($num_rows / $per_page);

   } else {

     $num_pages = ($num_rows / $per_page) + 1;

   }

   $num_pages = (int) $num_pages;

 

   $values = $values . " LIMIT $value_page_start, $per_page";

 

   // Previous

   if ($prev_value_page)  {

     echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'option_order_by=' . $option_order_by . '&value_page=' . $prev_value_page) . '"> << </a> | ';

   }

 

   for ($i = 1; $i <= $num_pages; $i++) {

     if ($i != $value_page) {

        echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, (isset($option_order_by) ? 'option_order_by=' . $option_order_by . '&' : '') . 'value_page=' . $i) . '">' . $i . '</a> | ';

     } else {

        echo '<b><font color=red>' . $i . '</font></b> | ';

     }

   }

 

   // Next

   if ($value_page != $num_pages) {

     echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, (isset($option_order_by) ? 'option_order_by=' . $option_order_by . '&' : '') . 'value_page=' . $next_value_page) . '"> >></a> ';

   }

?>

               </td>

             </tr>

             <tr>

               <td colspan="4"><?php echo tep_black_line(); ?></td>

             </tr>

             <tr class="dataTableHeadingRow">

               <td class="dataTableHeadingContent"> <?php echo TABLE_HEADING_ID; ?> </td>

               <td class="dataTableHeadingContent"> <?php echo TABLE_HEADING_OPT_NAME; ?> </td>

               <td class="dataTableHeadingContent"> <?php echo TABLE_HEADING_OPT_VALUE; ?> </td>

               <td class="dataTableHeadingContent" align="center"> <?php echo TABLE_HEADING_ACTION; ?> </td>

             </tr>

             <tr>

               <td colspan="4"><?php echo tep_black_line(); ?></td>

             </tr>

<?php

   $next_id = 1;

   $rows = 0;

   $values = tep_db_query($values);

   while ($values_values = tep_db_fetch_array($values)) {

     $options_name = tep_options_name($values_values['products_options_id']);

     $values_name = $values_values['products_options_val

Link to comment
Share on other sites

Hey.... that worked for me.  removing the comment worked. I am closer.  So far it all looks good except for the file upload option that I added about a month ago.  The product has 6 attributes for uploading a file.  Right now those file uploads are showing a textarea instead of the file upload (browse) button.  I can upload the file to you to see if you know where the problem is but I will look at it more myself.  If you want to take a look then let me know.  I have an issue with the /catalog/admin/product_attributes.php page.  Once I added your items with a merge program, the file upload attribute is now set to Textarea within the osCommerce administration.  Another thing I noticed is that if i want to add a new product option there is a en: field and a comment field next to it then an insert button.  In the past you would be able to enter text then choose the pulldown to choose 1-4 options, in my case 1-5 because I had a 5th item called File Upload.  Is this the way the new product_attributes.php page should behave?  Should I first add the item and click the Insert button then go to edit the item then set the option type?  If that is the case then I just have to figure out why this product_attributes page has an issue with the file upload option that I added.

 

product_attributes.php code:

 

I have done some troubleshooting and i now have the pulldown I was missing before. But I still have the issue with the Option Type column showing Textarea as the option type for my options that used to be set to File. File was for file uploads. I added an extra array in your code to take care of the File item that was missing in my pulldown. Code is below.

<?php

/*

 $Id: products_attributes.php,v 1.52 2003/07/10 20:46:01 dgw_ 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');

 $languages = tep_get_languages();

 

 $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');

 

 if (tep_not_null($action)) {

   $page_info = '';

   if (isset($HTTP_GET_VARS['option_page'])) $page_info .= 'option_page=' . $HTTP_GET_VARS['option_page'] . '&';

   if (isset($HTTP_GET_VARS['value_page'])) $page_info .= 'value_page=' . $HTTP_GET_VARS['value_page'] . '&';

   if (isset($HTTP_GET_VARS['attribute_page'])) $page_info .= 'attribute_page=' . $HTTP_GET_VARS['attribute_page'] . '&';

   if (tep_not_null($page_info)) {

     $page_info = substr($page_info, 0, -1);

   }

 

   switch ($action) {

     case 'add_product_options':

       $products_options_id = tep_db_prepare_input($HTTP_POST_VARS['products_options_id']);

       $option_name_array = $HTTP_POST_VARS['option_name'];

       $option_type = $HTTP_POST_VARS['option_type']; //clr 030714 update to add option type to products_option

 $option_length = $HTTP_POST_VARS['option_length']; //clr 030714 update to add option length to products_option

 

       for ($i=0, $n=sizeof($languages); $i<$n; $i ++) {

         $option_name = tep_db_prepare_input($option_name_array[$languages[$i]['id']]);

   $option_comment = $HTTP_POST_VARS['option_comment']; //clr 030714 update to add option comment to products_option

 

         tep_db_query("insert into " . TABLE_PRODUCTS_OPTIONS . " (products_options_id, products_options_name, language_id, products_options_type, products_options_length, products_options_comment) values ('" . (int)$products_options_id . "', '" . tep_db_input($option_name) . "', '" . (int)$languages[$i]['id'] . "', '" . $option_type . "', '" . $option_length . "', '" . $option_comment[$languages[$i]['id']]  . "')");

       }

// iii 030811 added:  For TEXT and FILE option types, automatically add

// PRODUCTS_OPTIONS_VALUE_TEXT to the TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS

       switch ($option_type) {

         case PRODUCTS_OPTIONS_TYPE_TEXT:

         case PRODUCTS_OPTIONS_TYPE_FILE:

           tep_db_query("insert into " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . " (products_options_values_id, products_options_id) values ('" . PRODUCTS_OPTIONS_VALUES_TEXT_ID .  "', '" .  (int)$products_options_id .  "')");

           break;

       }

 

// iii 030811 added:  END

       tep_redirect(tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, $page_info));

       break;

     case 'add_product_option_values':

       $value_name_array = $HTTP_POST_VARS['value_name'];

       $value_id = tep_db_prepare_input($HTTP_POST_VARS['value_id']);

       $option_id = tep_db_prepare_input($HTTP_POST_VARS['option_id']);

 

       for ($i=0, $n=sizeof($languages); $i<$n; $i ++) {

         $value_name = tep_db_prepare_input($value_name_array[$languages[$i]['id']]);

 

         tep_db_query("insert into " . TABLE_PRODUCTS_OPTIONS_VALUES . " (products_options_values_id, language_id, products_options_values_name) values ('" . (int)$value_id . "', '" . (int)$languages[$i]['id'] . "', '" . tep_db_input($value_name) . "')");

       }

 

       tep_db_query("insert into " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . " (products_options_id, products_options_values_id) values ('" . (int)$option_id . "', '" . (int)$value_id . "')");

 

       tep_redirect(tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, $page_info));

       break;

     case 'add_product_attributes':

// iii 030811 added:  For TEXT and FILE option types, ignore option value

// entered by administrator and use PRODUCTS_OPTIONS_VALUES_TEXT instead.

       $products_options_query = tep_db_query("select products_options_type from " . TABLE_PRODUCTS_OPTIONS . " where products_options_id = '" . $HTTP_POST_VARS['options_id'] . "'");

       $products_options_array = tep_db_fetch_array($products_options_query);

       $values_id = tep_db_prepare_input((($products_options_array['products_options_type'] == PRODUCTS_OPTIONS_TYPE_TEXT) or ($products_options_array['products_options_type'] == PRODUCTS_OPTIONS_TYPE_FILE)) ? PRODUCTS_OPTIONS_VALUE_TEXT_ID : $HTTP_POST_VARS['values_id']);

// iii 030811 added:  END

       $products_id = tep_db_prepare_input($HTTP_POST_VARS['products_id']);

       $options_id = tep_db_prepare_input($HTTP_POST_VARS['options_id']);

//        $values_id = tep_db_prepare_input($HTTP_POST_VARS['values_id']);

       $value_price = tep_db_prepare_input($HTTP_POST_VARS['value_price']);

       $price_prefix = tep_db_prepare_input($HTTP_POST_VARS['price_prefix']);

 

       tep_db_query("insert into " . TABLE_PRODUCTS_ATTRIBUTES . " values ('', '" . (int)$products_id . "', '" . (int)$options_id . "', '" . (int)$values_id . "', '" . tep_db_input($value_price) . "', '" . tep_db_input($price_prefix) . "')");

 

       if (DOWNLOAD_ENABLED == 'true') {

         $products_attributes_id = tep_db_insert_id();

 

         $products_attributes_filename = tep_db_prepare_input($HTTP_POST_VARS['products_attributes_filename']);

         $products_attributes_maxdays = tep_db_prepare_input($HTTP_POST_VARS['products_attributes_maxdays']);

         $products_attributes_maxcount = tep_db_prepare_input($HTTP_POST_VARS['products_attributes_maxcount']);

 

         if (tep_not_null($products_attributes_filename)) {

           tep_db_query("insert into " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " values (" . (int)$products_attributes_id . ", '" . tep_db_input($products_attributes_filename) . "', '" . tep_db_input($products_attributes_maxdays) . "', '" . tep_db_input($products_attributes_maxcount) . "')");

         }

       }

 

       tep_redirect(tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, $page_info));

       break;

     case 'update_option_name':

       $option_name_array = $HTTP_POST_VARS['option_name'];

    $option_type = $HTTP_POST_VARS['option_type']; //clr 030714 update to add option type to products_option

    $option_length = $HTTP_POST_VARS['option_length']; //clr 030714 update to add option length to products_option

       $option_id = tep_db_prepare_input($HTTP_POST_VARS['option_id']);

 

       for ($i=0, $n=sizeof($languages); $i<$n; $i ++) {

         $option_name = tep_db_prepare_input($option_name_array[$languages[$i]['id']]);

   $option_comment = $HTTP_POST_VARS['option_comment']; //clr 030714 update to add option comment to products_option

 

         tep_db_query("update " . TABLE_PRODUCTS_OPTIONS . " set products_options_name = '" . tep_db_input($option_name) . "', products_options_type = '" . $option_type . "', products_options_length = '" . $option_length . "', products_options_comment = '" . $option_comment[$languages[$i]['id']] . "' where products_options_id = '" . (int)$option_id . "' and language_id = '" . (int)$languages[$i]['id'] . "'");

       }

 

// iii added 030811:  automate insertion or deletion of text option values

       switch ($option_type) {

         case PRODUCTS_OPTIONS_TYPE_TEXT:

         case PRODUCTS_OPTIONS_TYPE_FILE:

//            tep_db_query("delete from " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . " where products_options_id = '" . $HTTP_POST_VARS['option_id'] . "'"); // disabled because this could cause trouble if someone changed types unintentionally and deleted all their option values.  Shops with small numbers of values per option should consider uncommenting this.

           tep_db_query("insert into " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . " values (NULL, '" . $HTTP_POST_VARS['option_id'] . "', '" . PRODUCTS_OPTIONS_VALUES_TEXT_ID . "')");

           break;

         default:

           tep_db_query("delete from " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . " where products_options_values_id = '" . PRODUCTS_OPTIONS_VALUES_TEXT_ID . "'");

       }

// iii added 030811:  END

       tep_redirect(tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, $page_info));

       break;

     case 'update_value':

       $value_name_array = $HTTP_POST_VARS['value_name'];

       $value_id = tep_db_prepare_input($HTTP_POST_VARS['value_id']);

       $option_id = tep_db_prepare_input($HTTP_POST_VARS['option_id']);

 

       for ($i=0, $n=sizeof($languages); $i<$n; $i ++) {

         $value_name = tep_db_prepare_input($value_name_array[$languages[$i]['id']]);

 

         tep_db_query("update " . TABLE_PRODUCTS_OPTIONS_VALUES . " set products_options_values_name = '" . tep_db_input($value_name) . "' where products_options_values_id = '" . tep_db_input($value_id) . "' and language_id = '" . (int)$languages[$i]['id'] . "'");

       }

 

       tep_db_query("update " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . " set products_options_id = '" . (int)$option_id . "'  where products_options_values_id = '" . (int)$value_id . "'");

 

       tep_redirect(tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, $page_info));

       break;

     case 'update_product_attribute':

// iii 030811 added:  Enforce rule that TEXT and FILE Options use value PRODUCTS_OPTIONS_VALUE_TEXT_ID

       $products_options_query = tep_db_query("select products_options_type from " . TABLE_PRODUCTS_OPTIONS . " where products_options_id = '" . $HTTP_POST_VARS['options_id'] . "'");

       $products_options_array = tep_db_fetch_array($products_options_query);

       switch ($products_options_array['products_options_type']) {

         case PRODUCTS_OPTIONS_TYPE_TEXT:

         case PRODUCTS_OPTIONS_TYPE_FILE:

           $values_id = PRODUCTS_OPTIONS_VALUE_TEXT_ID;

           break;

         default:

       $values_id = tep_db_prepare_input($HTTP_POST_VARS['values_id']);

}

// iii 030811 added END

 

       $products_id = tep_db_prepare_input($HTTP_POST_VARS['products_id']);

       $options_id = tep_db_prepare_input($HTTP_POST_VARS['options_id']);

//        $values_id = tep_db_prepare_input($HTTP_POST_VARS['values_id']);

       $value_price = tep_db_prepare_input($HTTP_POST_VARS['value_price']);

       $price_prefix = tep_db_prepare_input($HTTP_POST_VARS['price_prefix']);

       $attribute_id = tep_db_prepare_input($HTTP_POST_VARS['attribute_id']);

 

       tep_db_query("update " . TABLE_PRODUCTS_ATTRIBUTES . " set products_id = '" . (int)$products_id . "', options_id = '" . (int)$options_id . "', options_values_id = '" . (int)$values_id . "', options_values_price = '" . tep_db_input($value_price) . "', price_prefix = '" . tep_db_input($price_prefix) . "' where products_attributes_id = '" . (int)$attribute_id . "'");

 

       if (DOWNLOAD_ENABLED == 'true') {

         $products_attributes_filename = tep_db_prepare_input($HTTP_POST_VARS['products_attributes_filename']);

         $products_attributes_maxdays = tep_db_prepare_input($HTTP_POST_VARS['products_attributes_maxdays']);

         $products_attributes_maxcount = tep_db_prepare_input($HTTP_POST_VARS['products_attributes_maxcount']);

 

         if (tep_not_null($products_attributes_filename)) {

           tep_db_query("replace into " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " set products_attributes_id = '" . (int)$attribute_id . "', products_attributes_filename = '" . tep_db_input($products_attributes_filename) . "', products_attributes_maxdays = '" . tep_db_input($products_attributes_maxdays) . "', products_attributes_maxcount = '" . tep_db_input($products_attributes_maxcount) . "'");

         }

       }

 

       tep_redirect(tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, $page_info));

       break;

     case 'delete_option':

       $option_id = tep_db_prepare_input($HTTP_GET_VARS['option_id']);

 

       tep_db_query("delete from " . TABLE_PRODUCTS_OPTIONS . " where products_options_id = '" . (int)$option_id . "'");

       tep_db_query("delete from " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . " where products_options_id = '" . (int)$option_id . "' and products_options_values_id = '" . PRODUCTS_OPTIONS_VALUES_TEXT_ID . "'");

 

       tep_redirect(tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, $page_info));

       break;

     case 'delete_value':

       $value_id = tep_db_prepare_input($HTTP_GET_VARS['value_id']);

 

       tep_db_query("delete from " . TABLE_PRODUCTS_OPTIONS_VALUES . " where products_options_values_id = '" . (int)$value_id . "'");

       tep_db_query("delete from " . TABLE_PRODUCTS_OPTIONS_VALUES . " where products_options_values_id = '" . (int)$value_id . "'");

       tep_db_query("delete from " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . " where products_options_values_id = '" . (int)$value_id . "'");

 

       tep_redirect(tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, $page_info));

       break;

     case 'delete_attribute':

       $attribute_id = tep_db_prepare_input($HTTP_GET_VARS['attribute_id']);

 

       tep_db_query("delete from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_attributes_id = '" . (int)$attribute_id . "'");

 

// added for DOWNLOAD_ENABLED. Always try to remove attributes, even if downloads are no longer enabled

       tep_db_query("delete from " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " where products_attributes_id = '" . (int)$attribute_id . "'");

 

       tep_redirect(tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, $page_info));

       break;

   }

 }

 

//iii 031103 added to get results from database option type query

 $products_options_types_list = array();

 $products_options_types_query = tep_db_query("select products_options_types_id, products_options_types_name from " . TABLE_PRODUCTS_OPTIONS_TYPES . " where language_id='" . (int)$languages_id . "' order by products_options_types_id");

 while ($products_options_type_array = tep_db_fetch_array($products_options_types_query)) {

   $products_options_types_list[$products_options_type_array['products_options_types_id']] = $products_options_type_array['products_options_types_name'];

 }

 

//CLR 030312 add function to draw pulldown list of option types

// Draw a pulldown for Option Types

//iii 031103 modified to use results of database option type query from above

function draw_optiontype_pulldown($name, $default = '') {

 global $products_options_types_list;

 $values = array();

 $values[] = array('id' => 0, 'text' => 'Select');

 $values[] = array('id' => 1, 'text' => 'Text');

 $values[] = array('id' => 2, 'text' => 'Radio');

 $values[] = array('id' => 3, 'text' => 'Checkbox');

 $values[] = array('id' => 4, 'text' => 'File');

 $values[] = array('id' => 5, 'text' => 'Textarea');

 return tep_draw_pull_down_menu($name, $values, $default);

}

 

//CLR 030312 add function to translate type_id to name

// Translate option_type_values to english string

//iii 031103 modified to use results of database option type query from above

function translate_type_to_name($opt_type) {

 if ($opt_type == 0) return 'Select';

 if ($opt_type == 1) return 'Text';

 if ($opt_type == 2) return 'Radio';

 if ($opt_type == 3) return 'Checkbox';

 if ($opt_type == 4) return 'Textarea';

 if ($opt_type == 5) return 'Textarea';

 return 'Error ' . $opt_type;

}

 

?>

<!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"><!--

function go_option() {

 if (document.option_order_by.selected.options[document.option_order_by.selected.selectedIndex].value != "none") {

   location = "<?php echo tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'option_page=' . ($HTTP_GET_VARS['option_page'] ? $HTTP_GET_VARS['option_page'] : 1)); ?>&option_order_by="+document.option_order_by.selected.options[document.option_order_by.selected.selectedIndex].value;

 }

}

//--></script>

</head>

<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">

<!-- 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="0">

<!-- options and values//-->

     <tr>

       <td width="100%"><table width="100%" border="0" cellspacing="0" cellpadding="0">

         <tr>

           <td valign="top" width="50%"><table width="100%" border="0" cellspacing="0" cellpadding="2">

<!-- options //-->

<?php

 if ($action == 'delete_product_option') { // delete product option

   $options = tep_db_query("select products_options_id, products_options_name from " . TABLE_PRODUCTS_OPTIONS . " where products_options_id = '" . (int)$HTTP_GET_VARS['option_id'] . "' and language_id = '" . (int)$languages_id . "'");

   $options_values = tep_db_fetch_array($options);

?>

             <tr>

               <td class="pageHeading"> <?php echo $options_values['products_options_name']; ?> </td>

               <td> <?php echo tep_image(DIR_WS_IMAGES . 'pixel_trans.gif', '', '1', '53'); ?> </td>

             </tr>

             <tr>

               <td><table border="0" width="100%" cellspacing="0" cellpadding="2">

                 <tr>

                   <td colspan="3"><?php echo tep_black_line(); ?></td>

                 </tr>

<?php

   $products = tep_db_query("select p.products_id, pd.products_name, pov.products_options_values_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov, " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_DESCRIPTION . " pd where pd.products_id = p.products_id and pov.language_id = '" . (int)$languages_id . "' and pd.language_id = '" . (int)$languages_id . "' and pa.products_id = p.products_id and pa.options_id='" . (int)$HTTP_GET_VARS['option_id'] . "' and pov.products_options_values_id = pa.options_values_id order by pd.products_name");

   if (tep_db_num_rows($products)) {

?>

                 <tr class="dataTableHeadingRow">

                   <td class="dataTableHeadingContent" align="center"> <?php echo TABLE_HEADING_ID; ?> </td>

                   <td class="dataTableHeadingContent"> <?php echo TABLE_HEADING_PRODUCT; ?> </td>

                   <td class="dataTableHeadingContent"> <?php echo TABLE_HEADING_OPT_VALUE; ?> </td>

                 </tr>

                 <tr>

                   <td colspan="3"><?php echo tep_black_line(); ?></td>

                 </tr>

<?php

     $rows = 0;

     while ($products_values = tep_db_fetch_array($products)) {

       $rows++;

?>

                 <tr class="<?php echo (floor($rows/2) == ($rows/2) ? 'attributes-even' : 'attributes-odd'); ?>">

                   <td align="center" class="smallText"> <?php echo $products_values['products_id']; ?> </td>

                   <td class="smallText"> <?php echo $products_values['products_name']; ?> </td>

                   <td class="smallText"> <?php echo $products_values['products_options_values_name']; ?> </td>

                 </tr>

<?php

     }

?>

                 <tr>

                   <td colspan="3"><?php echo tep_black_line(); ?></td>

                 </tr>

                 <tr>

                   <td colspan="3" class="main"><br><?php echo TEXT_WARNING_OF_DELETE; ?></td>

                 </tr>

                 <tr>

                   <td align="right" colspan="3" class="main"><br><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, (isset($HTTP_GET_VARS['value_page']) ? 'value_page=' . $HTTP_GET_VARS['value_page'] . '&' : '') . (isset($HTTP_GET_VARS['attribute_page']) ? 'attribute_page=' . $HTTP_GET_VARS['attribute_page'] : ''), 'NONSSL') . '">'; ?><?php echo tep_image_button('button_cancel.gif', ' cancel '); ?></a> </td>

                 </tr>

<?php

   } else {

?>

                 <tr>

                   <td class="main" colspan="3"><br><?php echo TEXT_OK_TO_DELETE; ?></td>

                 </tr>

                 <tr>

                   <td class="main" align="right" colspan="3"><br><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'action=delete_option&option_id=' . $HTTP_GET_VARS['option_id'], 'NONSSL') . '">'; ?><?php echo tep_image_button('button_delete.gif', ' delete '); ?></a>   <?php echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, (isset($HTTP_GET_VARS['order_by']) ? 'order_by=' . $HTTP_GET_VARS['order_by'] . '&' : '') . (isset($HTTP_GET_VARS['page']) ? 'page=' . $HTTP_GET_VARS['page'] : ''), 'NONSSL') . '">'; ?><?php echo tep_image_button('button_cancel.gif', ' cancel '); ?></a> </td>

                 </tr>

<?php

   }

?>

               </table></td>

             </tr>

<?php

 } else {

   if (isset($HTTP_GET_VARS['option_order_by'])) {

     $option_order_by = $HTTP_GET_VARS['option_order_by'];

   } else {

     $option_order_by = 'products_options_id';

   }

?>

             <tr>

               <td colspan="2" class="pageHeading"> <?php echo HEADING_TITLE_OPT; ?> </td>

               <td align="right"><br><form name="option_order_by" action="<?php echo FILENAME_PRODUCTS_ATTRIBUTES; ?>"><select name="selected" onChange="go_option()"><option value="products_options_id"<?php if ($option_order_by == 'products_options_id') { echo ' SELECTED'; } ?>><?php echo TEXT_OPTION_ID; ?></option><option value="products_options_name"<?php if ($option_order_by == 'products_options_name') { echo ' SELECTED'; } ?>><?php echo TEXT_OPTION_NAME; ?></option></select></form></td>

             </tr>

             <tr>

               <td colspan="3" class="smallText">

<?php

   $per_page = MAX_ROW_LISTS_OPTIONS;

   $options = "select * from " . TABLE_PRODUCTS_OPTIONS . " where language_id = '" . (int)$languages_id . "' order by " . $option_order_by;

   if (!isset($option_page)) {

     $option_page = 1;

   }

   $prev_option_page = $option_page - 1;

   $next_option_page = $option_page + 1;

 

   $option_query = tep_db_query($options);

 

   $option_page_start = ($per_page * $option_page) - $per_page;

   $num_rows = tep_db_num_rows($option_query);

 

   if ($num_rows <= $per_page) {

     $num_pages = 1;

   } else if (($num_rows % $per_page) == 0) {

     $num_pages = ($num_rows / $per_page);

   } else {

     $num_pages = ($num_rows / $per_page) + 1;

   }

   $num_pages = (int) $num_pages;

 

   $options = $options . " LIMIT $option_page_start, $per_page";

 

   // Previous

   if ($prev_option_page)  {

     echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'option_page=' . $prev_option_page) . '"> << </a> | ';

   }

 

   for ($i = 1; $i <= $num_pages; $i++) {

     if ($i != $option_page) {

       echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'option_page=' . $i) . '">' . $i . '</a> | ';

     } else {

       echo '<b><font color=red>' . $i . '</font></b> | ';

     }

   }

 

   // Next

   if ($option_page != $num_pages) {

     echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'option_page=' . $next_option_page) . '"> >> </a>';

   }

//CLR 030212 - Add column for option type

?>

               </td>

             </tr>

             <tr>

               <td colspan="6"><?php echo tep_black_line(); ?></td>

             </tr>

             <tr class="dataTableHeadingRow">

               <td class="dataTableHeadingContent"> <?php echo TABLE_HEADING_ID; ?> </td>

               <td class="dataTableHeadingContent"> <?php echo TABLE_HEADING_OPT_NAME; ?> </td>

   <td class="dataTableHeadingContent"> <?php echo TABLE_HEADING_OPT_TYPE; ?> </td> <!-- CLR 030212 - Add column for option type //-->

      <td class="dataTableHeadingContent"> <?php echo TABLE_HEADING_OPT_LENGTH; ?> </td> <!-- CLR 030212 - Add column for option length //-->

               <td class="dataTableHeadingContent"> <?php echo TABLE_HEADING_OPT_COMMENT; ?> </td> <!-- CLR 030212 - Add column for option comment //-->

               <td class="dataTableHeadingContent" align="center"> <?php echo TABLE_HEADING_ACTION; ?> </td>

             </tr>

             <tr>

               <td colspan="6"><?php echo tep_black_line(); ?></td>

             </tr>

<?php

   $next_id = 1;

   $rows = 0;

   $options = tep_db_query($options);

   while ($options_values = tep_db_fetch_array($options)) {

     $rows++;

?>

             <tr class="<?php echo (floor($rows/2) == ($rows/2) ? 'attributes-even' : 'attributes-odd'); ?>">

<?php

     if (($action == 'update_option') && ($HTTP_GET_VARS['option_id'] == $options_values['products_options_id'])) {

       echo '<form name="option" action="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'action=update_option_name', 'NONSSL') . '" method="post">';

       $inputs = '';

       for ($i = 0, $n = sizeof($languages); $i < $n; $i ++) {

         $option_name = tep_db_query("select products_options_name, products_options_length, products_options_comment from " . TABLE_PRODUCTS_OPTIONS . " where products_options_id = '" . $options_values['products_options_id'] . "' and language_id = '" . $languages[$i]['id'] . "'");

         $option_name = tep_db_fetch_array($option_name);

    $inputs .= $languages[$i]['code'] . ': <input type="text" name="option_name[' . $languages[$i]['id'] . ']" size="32" value="' . $option_name['products_options_name'] . '">  ' . TABLE_HEADING_OPT_COMMENT . ' <input type="text" name="option_comment[' . $languages[$i]['id'] . ']" size="32" value="' . $option_name['products_options_comment'] . '"><br>';

       }

//CLR 030212 - Add column for option type

?>

               <td align="center" class="smallText"> <?php echo $options_values['products_options_id']; ?><input type="hidden" name="option_id" value="<?php echo $options_values['products_options_id']; ?>"> </td>

   <td class="smallText" colspan="3"><?php echo $inputs; ?></td>

   <td class="smallText"><?php echo TABLE_HEADING_OPT_LENGTH . ' <input type="text" name="option_length" size="4" value="' . $option_name['products_options_length'] . '">'; ?></td> <!-- CLR 030212 - Add column for option length //-->

   <td class="smallText"><?php echo draw_optiontype_pulldown('option_type', $options_values['products_options_type']); ?></td> <!-- CLR 030212 - Add column for option type //-->

               <td align="center" class="smallText"> <?php echo tep_image_submit('button_update.gif', IMAGE_UPDATE); ?> <?php echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, '', 'NONSSL') . '">'; ?><?php echo tep_image_button('button_cancel.gif', IMAGE_CANCEL); ?></a> </td>

<?php

       echo '</form>' . "\n";

     } else {

//CLR 030212 - Add column for option type

?>

               <td align="center" class="smallText"> <?php echo $options_values["products_options_id"]; ?> </td>

               <td class="smallText"> <?php echo $options_values["products_options_name"]; ?> </td>

               <td class="smallText"> <?php echo translate_type_to_name($options_values["products_options_type"]); ?> </td> <!-- CLR 030212 - Add column for option type //-->

   <td class="smallText"> <?php echo $options_values["products_options_length"]; ?> </td> <!-- CLR 030212 - Add column for option length //-->

   <td class="smallText"> <?php echo $options_values["products_options_comment"]; ?> </td> <!-- CLR 030212 - Add column for option comment //-->

               <td align="center" class="smallText"> <?php echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'action=update_option&option_id=' . $options_values['products_options_id'] . '&option_order_by=' . $option_order_by . '&option_page=' . $option_page, 'NONSSL') . '">'; ?><?php echo tep_image_button('button_edit.gif', IMAGE_UPDATE); ?></a>  <?php echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'action=delete_product_option&option_id=' . $options_values['products_options_id'], 'NONSSL') , '">'; ?><?php echo tep_image_button('button_delete.gif', IMAGE_DELETE); ?></a> </td>

<?php

     }

?>

             </tr>

<?php

     $max_options_id_query = tep_db_query("select max(products_options_id) + 1 as next_id from " . TABLE_PRODUCTS_OPTIONS);

     $max_options_id_values = tep_db_fetch_array($max_options_id_query);

     $next_id = $max_options_id_values['next_id'];

   }

?>

             <tr>

               <td colspan="6"><?php echo tep_black_line(); ?></td>

             </tr>

<?php

   if ($action != 'update_option') {

?>

             <tr class="<?php echo (floor($rows/2) == ($rows/2) ? 'attributes-even' : 'attributes-odd'); ?>">

<?php

     echo '<form name="options" action="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'action=add_product_options&option_page=' . $option_page, 'NONSSL') . '" method="post"><input type="hidden" name="products_options_id" value="' . $next_id . '">';

     $inputs = '';

     for ($i = 0, $n = sizeof($languages); $i < $n; $i ++) {

 $inputs .= $languages[$i]['code'] . ': <input type="text" name="option_name[' . $languages[$i]['id'] . ']" size="32">' . TABLE_HEADING_OPT_COMMENT . ' <input type="text" name="option_comment[' . $languages[$i]['id'] . ']" size="32"><br>';

     }

//CLR 030212 - Add column for option type

?>

               <td align="center" class="smallText"> <?php echo $next_id; ?> </td>

               <td class="smallText" colspan="2"><?php echo $inputs; ?></td>

               <td class="smallText"><?php echo draw_optiontype_pulldown('option_type'); ?></td>

               <td align="center" class="smallText"> <?php echo tep_image_submit('button_insert.gif', IMAGE_INSERT); ?> </td>

<?php

     echo '</form>';

?>

             </tr>

             <tr>

               <td colspan="6"><?php echo tep_black_line(); ?></td>

             </tr>

<?php

   }

 }

?>

           </table></td>

<!-- options eof //-->

           <td valign="top" width="50%"><table width="100%" border="0" cellspacing="0" cellpadding="2">

<!-- value //-->

<?php

 if ($action == 'delete_option_value') { // delete product option value

   $values = tep_db_query("select products_options_values_id, products_options_values_name from " . TABLE_PRODUCTS_OPTIONS_VALUES . " where products_options_values_id = '" . (int)$HTTP_GET_VARS['value_id'] . "' and language_id = '" . (int)$languages_id . "'");

   $values_values = tep_db_fetch_array($values);

?>

             <tr>

               <td colspan="3" class="pageHeading"> <?php echo $values_values['products_options_values_name']; ?> </td>

               <td> <?php echo tep_image(DIR_WS_IMAGES . 'pixel_trans.gif', '', '1', '53'); ?> </td>

             </tr>

             <tr>

               <td><table border="0" width="100%" cellspacing="0" cellpadding="2">

                 <tr>

                   <td colspan="3"><?php echo tep_black_line(); ?></td>

                 </tr>

<?php

   $products = tep_db_query("select p.products_id, pd.products_name, po.products_options_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS . " po, " . TABLE_PRODUCTS_DESCRIPTION . " pd where pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and po.language_id = '" . (int)$languages_id . "' and pa.products_id = p.products_id and pa.options_values_id='" . (int)$HTTP_GET_VARS['value_id'] . "' and po.products_options_id = pa.options_id order by pd.products_name");

   if (tep_db_num_rows($products)) {

?>

                 <tr class="dataTableHeadingRow">

                   <td class="dataTableHeadingContent" align="center"> <?php echo TABLE_HEADING_ID; ?> </td>

                   <td class="dataTableHeadingContent"> <?php echo TABLE_HEADING_PRODUCT; ?> </td>

                   <td class="dataTableHeadingContent"> <?php echo TABLE_HEADING_OPT_NAME; ?> </td>

                 </tr>

                 <tr>

                   <td colspan="3"><?php echo tep_black_line(); ?></td>

                 </tr>

<?php

     while ($products_values = tep_db_fetch_array($products)) {

       $rows++;

?>

                 <tr class="<?php echo (floor($rows/2) == ($rows/2) ? 'attributes-even' : 'attributes-odd'); ?>">

                   <td align="center" class="smallText"> <?php echo $products_values['products_id']; ?> </td>

                   <td class="smallText"> <?php echo $products_values['products_name']; ?> </td>

                   <td class="smallText"> <?php echo $products_values['products_options_name']; ?> </td>

                 </tr>

<?php

     }

?>

                 <tr>

                   <td colspan="3"><?php echo tep_black_line(); ?></td>

                 </tr>

                 <tr>

                   <td class="main" colspan="3"><br><?php echo TEXT_WARNING_OF_DELETE; ?></td>

                 </tr>

                 <tr>

                   <td class="main" align="right" colspan="3"><br><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, (isset($HTTP_GET_VARS['value_page']) ? 'value_page=' . $HTTP_GET_VARS['value_page'] . '&' : '') . (isset($HTTP_GET_VARS['attribute_page']) ? 'attribute_page=' . $attribute_page : ''), 'NONSSL') . '">'; ?><?php echo tep_image_button('button_cancel.gif', ' cancel '); ?></a> </td>

                 </tr>

<?php

   } else {

?>

                 <tr>

                   <td class="main" colspan="3"><br><?php echo TEXT_OK_TO_DELETE; ?></td>

                 </tr>

                 <tr>

                   <td class="main" align="right" colspan="3"><br><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, 'action=delete_value&value_id=' . $HTTP_GET_VARS['value_id'], 'NONSSL') . '">'; ?><?php echo tep_image_button('button_delete.gif', ' delete '); ?></a>   <?php echo '<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, '&option_page=' . $option_page . (isset($HTTP_GET_VARS['value_page']) ? '&value_page=' . $value_page : '') . (isset($HTTP_GET_VARS['attribute_page']) ? '&attribute_page=' . $attribute_page : ''), 'NONSSL') . '">'; ?><?php echo tep_image_button('button_cancel.gif', ' cancel '); ?></a> </td>

                 </tr>

<?php

   }

?>

              </table></td>

             </tr>

<?php

 } else {

?>

             <tr>

               <td colspan="3" class="pageHeading"> <?php echo HEADING_TITLE_VAL; ?> </td>

               <td> <?php echo tep_image(DIR_WS_IMAGES . 'pixel_trans.gif', '', '1', '53'); ?> </td>

             </tr>

             <tr>

     

Link to comment
Share on other sites

  • 4 weeks later...

Spaceboy, or anyone else who is in the know :D

 

Will you please take a look at my code and see if you can find out where I have gone wrong.

 

I am trying to get option type feature, options as images, and priceupdate v3 to all work together (as well as attribute sorter/copier)

 

So far I have options as images, attribute sorter/copier working well together, The price updater works as long as options as images is not enabled (I think it has to do with calling to the sep. options as images php file (so I have tried to combine it)).

 

I "think" option type feature is working, but for the life of me can't get a box to show up. In the admin I get everything to show, but the option_value that is supposed to be TEXT fulls under one of my other Options, and Not the Option I want. I can't change it unless I do it manually in the database. I also am not too sure exactly How to setup a text area box. What I would like is:

 

And Option called Engraving, with a textarea (upto 5 lines). I would like an option-value Engraving-TEXT (is this correct?). From here I am lost on what to do to get the box.

 

 

I have as mentioned above tried to combine the options as images php file with the product info file in the hopes of solving both issues I have with options as images (getting price updater to work with options as images enabled, and getting the correct box styles to show with option type feature.)

 

Below is my Product_info.php file. (The page comes up with no erros, BUT the page is all screwed up. Left column is fine, center is possitioned over where the Right Column should be, the line (add to cart, reveiws, etc..) shows below the Left Column, and the Right Column shows below that. The Header and Footer are correct though.

 

I have been working on this for a week now, and I am at a loss. Every time I think I have one part fixed another breaks.

 

Could someone please double check my coding and see what corrections I need to make.

 

Thank you!

RavenWulf

 

<?php
/*
 $Id: product_info.php,v 1.98 2003/09/02 18:52:33 project3000 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);

// WebMakers.com Added: Attribute Sorter - Definitions
// Move to /languages/english

 $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: WebMakers.com Changed: Header Tag Controller v1.0
// Replaced by header_tags.php
if ( file_exists(DIR_WS_INCLUDES . 'header_tags.php') ) {
 require(DIR_WS_INCLUDES . 'header_tags.php');
} else {
?> 
<title><?php echo TITLE; ?></title>
<?php
}
// EOF: WebMakers.com Changed: Header Tag Controller v1.0
?>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<?php include ('includes/ssl_provider.js.php');
	 include ('option.js');
?> 

<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
  include (DIR_WS_INCLUDES . 'products_next_previous.php');
  ?>
<?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_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 {
// BOF MaxiDVD: Modified For Ultimate Images Pack!
   $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 MaxiDVD: Modified For Ultimate Images Pack!
   $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'])) {
     $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($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>';
   $nuPrice = $currencies->display_price($new_price, tep_get_tax_rate($product_info_values['products_tax_class_id']));
   } else {
     $products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));
 $nuPrice = $products_price;
   }
$nuPrice = str_replace(",", "", $nuPrice);
   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">
<?php
// BOF: WebMakers.com Added: Show Category and Image
if (SHOW_CATEGORIES=='1') {
?>
         <tr><td colspan="2"><table align="right">
           <tr>
             <td class="main" align="center"><?php echo tep_image(DIR_WS_IMAGES . tep_get_categories_image(tep_get_products_catagory_id($product_info_values['products_id']))); ?></td>
           </tr>
           <tr>
             <td class="main" align="center"><?php echo tep_get_categories_name(tep_get_products_catagory_id($product_info_values['products_id'])); ?></td>
           </tr>
         </table></td></tr>
<?php
}
// EOF: WebMakers.com Added: Show Category and Image
?>
         <tr>
           <td class="pageHeading" valign="top"><?php echo $products_name; ?></td>
           <td class="pageHeading" align="right" valign="top"><?php echo $products_price; ?></td>
     <input type="hidden" name="nuPrice" value="<?php echo str_replace("$","",$nuPrice); ?>">
         </tr>
    <tr>
    <td><?php echo '<a href="' . tep_href_link(FILENAME_PDF_DATASHEET, 'products_id=' . $product_info['products_id']) .'" target="_blank">' . tep_image('images/pdf.gif') . '  Click here to printout a PDF datasheet for this product'.'</a>'; ?></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 MaxiDVD: Modified For Ultimate Images Pack! //-->
<?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;}?>
<script language="javascript"><!--
document.write('<?php echo '<a href="javascript: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>'; ?>');
//--></script>
    	 <tr>
              <td align="center" class="smallText">
<?php // ################### Ask a question ############## ?>    
      <a href="ask_a_question.php?products_id=<?php echo $product_info['products_id']; ?>" ONMOUSEOVER="window.status='.<?php echo TEXT_QUESTION; ?> .'; return true">
  <?php echo TEXT_QUESTION; ?> <b><?php echo $product_info['products_name']; ?></b></a>
<?php // ################ end added ask a question ############ ?>
      	 </td>
            </tr>
<noscript>
     <?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, 'class=shadow1', 'hspace="5" vspace="5"') . '<br>' . tep_image_button('image_enlarge.gif', TEXT_CLICK_TO_ENLARGE) . '</a>'; ?>
</noscript>
<!-- // EOF MaxiDVD: Modified For Ultimate Images Pack! //-->

             </td>
           </tr>
  	 </table>
<?php
   }
?>
         <p><?php echo stripslashes($product_info['products_description']); ?></p>
<?php
   if (OPTIONS_AS_IMAGES_ENABLED == 'false'){
   $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
///////////////////////////////////////////////////////////////////////////
// BOF: attribute options



     $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, popt.products_options_sort_order 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_optionssort_order");
     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();
// BOF: WebMakers.com Added: Attributes Copy and Sort
 if ( PRODUCTS_OPTIONS_SORT_BY_PRICE !='1' ) {
       $products_options_query = tep_db_query("select pa.products_options_sort_order, 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 = '" . $HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . $products_options_name_values['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . $languages_id . "'" . " order by pa.products_options_sort_order, pov.products_options_values_name");
 } else {
       $products_options_query = tep_db_query("select pa.products_options_sort_order, 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 = '" . $HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . $products_options_name_values['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . $languages_id . "'" . " order by pa.products_options_sort_order, pa.options_values_price");
 }
// EOF: WebMakers.com Added: Attributes Copy and Sort
// original products options query        $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, "onChange='showPrice(this.form);'") . $products_options_name['products_options_comment']; ?></td>
           </tr>
<?php
       }  //clr 030714 end switch
     }
?>
         </table>
<?php
   }
// EOF: attribute options
///////////////////////////////////////////////////////////////////////////
 //Options as Images. Add the curly bracket as shown on the next line
}
?>

<?php
//Options as Images. This whole php clause needs to be added
//if (OPTIONS_AS_IMAGES_ENABLED == 'true') include ('options_images.php'); 
if (OPTIONS_AS_IMAGES_ENABLED == 'true'){
//Begin Options as Images
   $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>
             <?php  echo '<td class="main" colspan="2">' . TEXT_PRODUCT_OPTIONS . '<br>Please select your desired option using the buttons provided'; ?>
    	 <?php if (OPTIONS_IMAGES_CLICK_ENLARGE == 'true') echo '<br>Click the images to enlarge';?>
    	 </td>
           </tr>
        	 
<?php
	 $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name, popt.products_options_sort_order, popt.products_options_images_enabled 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_sort_order");
     while ($products_options_name = tep_db_fetch_array($products_options_name_query)) {
       $products_options_array = array();
       $products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pov.products_options_values_thumbnail, 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 . "'order by pa.products_options_sort_order");
       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'], 'thumbnail' => $products_options['products_options_values_thumbnail']);
         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" valign="top"><?php echo $products_options_name['products_options_name'] . ':'; ?></td>
<?php 
    	 if ($products_options_name['products_options_images_enabled'] == 'false'){
       echo '<td class="main">' . tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute, "onChange='showPrice(this.form);'") . '</td></tr>';
              }     
              else {
        $count=0;
       echo '<td class="main"><table><tr>';
               foreach ($products_options_array as $opti_array){
          echo '<td><table cellspacing="1" cellpadding="0" border="0">';
          if (OPTIONS_IMAGES_CLICK_ENLARGE == 'true') 
           echo '<td align="center"><a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_OPTIONS_IMAGES_POPUP, 'oID=' . $opti_array['id']) .'\')">' . tep_image(DIR_WS_IMAGES . 'options/' . $opti_array['thumbnail'], $opti_array['text'], OPTIONS_IMAGES_WIDTH, OPTIONS_IMAGES_HEIGHT, 'class=shadow1') . '</a></td></tr>';
           else echo '<tr><td align="center">' . tep_image(DIR_WS_IMAGES . 'options/' . $opti_array['thumbnail'], $opti_array['text'], OPTIONS_IMAGES_WIDTH, OPTIONS_IMAGES_HEIGHT) . '</td></tr>';
              echo '<tr><td class="main" align="center">' . $opti_array['text'] . '</td></tr>';
              if (($selected_attribute == false && $count == 0) || ($selected_attribute == $opti_array['id'])) {
              echo '<tr><td align="center"><input type="radio" name ="id[' . $products_options_name['products_options_id'] . ']" value="' . $opti_array['id'] . '" onChange="showPrice(this.form)"></td></tr></table></td>';
                      
            	 }
            	 else {
                   echo '<tr><td align="center"><input type="radio" name ="id[' . $products_options_name['products_options_id'] . ']" value="' . $opti_array['id'] . '" onChange="showPrice(this.form)"></td></tr></table></td>';
                 //echo '<tr><td align="center"><input type="radio" name ="id[' . $products_options_name['products_options_id'] . ']" value="' . $opti_array['id'] . '" ></td></tr></table></td>';
                 } 
              $count++;
                     if ($count%OPTIONS_IMAGES_NUMBER_PER_ROW == 0) {
                echo '</tr><tr>';
               $count = 0;
              }
            }
      	 echo '</table>';
       }
}
?>
  	 
       </td></tr>
<?php
     }
?>
    </table>
<?php
   }
// BOF MaxiDVD: Modified For Ultimate Images Pack!
if (ULTIMATE_ADDITIONAL_IMAGES == 'Enable') { include(DIR_WS_MODULES . 'additional_images.php'); }
// BOF MaxiDVD: Modified For Ultimate Images Pack!
; ?>

     <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 . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd where r.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and r.reviews_id = rd.reviews_id and rd.languages_id = '" . (int)$languages_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>
       <tr><td align="center"><b><div id="productNEWprice"></b></div></td></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>
               <!-- Wish List 2.3 Start -->
               <td align="center" class="main"><?php echo tep_draw_hidden_field('wishlist_action', 'add_wishlist') . tep_image_submit('button_wishlist.gif', IMAGE_BUTTON_ADD_WISHLIST, 'onClick="document.cart_quantity.action=\''. FILENAME_WISHLIST . '\';document.cart_quantity.submit();"'. ' action=add_wishlist'); ?></td>
               <!-- Wish List 2.3 End   -->
       <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
//added for cross -sell
  if ( (USE_CACHE == 'true') && !SID) { 
     echo tep_cache_also_purchased(3600);
    include(DIR_WS_MODULES . FILENAME_XSELL_PRODUCTS); 
   } else {
    include(DIR_WS_MODULES . FILENAME_XSELL_PRODUCTS); 
     include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS);
   }
 }
 //EOF for cross sell
?>
       </td>
     </tr>
   </table></form></td>
<!-- body_text_eof //-->
<script language="javascript">
<!--
 showPrice(cart_quantity);
//-->
</script>
  <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'); ?>

 

@Robert: ok..I've seen your error after having tested your page on my shop ! You have put all the OTP code in the case where OPTIONS_AS_IMAGES_ENABLED is disabled. The "else" case has no OTF code at all. So as you have it enabled, you only have the standard dropdownbox.

 

To give you a hint, change line 124 to

 

if (OPTIONS_AS_IMAGES_ENABLED == 'true'){.

 

You will have a textbox instead of a dropdown box, what is the default code for the Option as Images code.

 

An advice : if you want to display the options as images, have only 1 code with Options as Images and OTF together. Much easier to maintain.

 

I also saw that you forgot to add "popt.products_options_images_enabled" in one of the queries (line 135).

 

Didier.

Link to comment
Share on other sites

is anyone able to take a look at this and help me figure out what is going on?

 

Thanks

RW

 

Spaceboy, or anyone else who is in the know  :D

 

Will you please take a look at my code and see if you can find out where I have gone wrong.

 

I am trying to get option type feature, options as images, and priceupdate v3 to all work together (as well as attribute sorter/copier)

 

So far I have options as images, attribute sorter/copier working well together, The price updater works as long as options as images is not enabled (I think it has to do with calling to the sep.  options as images php file (so I have tried to combine it)).

 

I "think" option type feature is working, but for the life of me can't get a box to show up.  In the admin I get everything to show, but the option_value that is supposed to be TEXT fulls under one of my other Options, and Not the Option I want. I can't change it unless I do it manually in the database.  I also am not too sure exactly How to setup a text area box.  What I would like is:

 

And Option called Engraving, with a textarea (upto 5 lines).  I would like an option-value Engraving-TEXT (is this correct?).  From here I am lost on what to do to get the box.

I have as mentioned above tried to combine the options as images php file with the product info file in the hopes of solving both issues I have with options as images (getting price updater to work with options as images enabled, and getting the correct box styles to show with option type feature.)

 

Below is my Product_info.php file.  (The page comes up with no erros, BUT the page is all screwed up.  Left column is fine, center is possitioned over where the Right Column should be, the line (add to cart, reveiws, etc..) shows below the Left Column, and the Right Column shows below that.  The Header and Footer are correct though.

 

I have been working on this for a week now, and I am at a loss. Every time I think I have one part fixed another breaks.

 

Could someone please double check my coding and see what corrections I need to make.

 

Thank you!

RavenWulf

 

<?php
/*
?$Id: product_info.php,v 1.98 2003/09/02 18:52:33 project3000 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);

// WebMakers.com Added: Attribute Sorter - Definitions
// Move to /languages/english

?$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: WebMakers.com Changed: Header Tag Controller v1.0
// Replaced by header_tags.php
if ( file_exists(DIR_WS_INCLUDES . 'header_tags.php') ) {
?require(DIR_WS_INCLUDES . 'header_tags.php');
} else {
?> 
<title><?php echo TITLE; ?></title>
<?php
}
// EOF: WebMakers.com Changed: Header Tag Controller v1.0
?>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<?php include ('includes/ssl_provider.js.php');
?	include ('option.js');
?> 

<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
? include (DIR_WS_INCLUDES . 'products_next_previous.php');
? ?>
<?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_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 {
// BOF MaxiDVD: Modified For Ultimate Images Pack!
? ?$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 MaxiDVD: Modified For Ultimate Images Pack!
? ?$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'])) {
? ? ?$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($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>';
? ?$nuPrice = $currencies->display_price($new_price, tep_get_tax_rate($product_info_values['products_tax_class_id']));
? ?} else {
? ? ?$products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));
?$nuPrice = $products_price;
? ?}
$nuPrice = str_replace(",", "", $nuPrice);
? ?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">
<?php
// BOF: WebMakers.com Added: Show Category and Image
if (SHOW_CATEGORIES=='1') {
?>
? ? ? ? ?<tr><td colspan="2"><table align="right">
? ? ? ? ? ?<tr>
? ? ? ? ? ? ?<td class="main" align="center"><?php echo tep_image(DIR_WS_IMAGES . tep_get_categories_image(tep_get_products_catagory_id($product_info_values['products_id']))); ?></td>
? ? ? ? ? ?</tr>
? ? ? ? ? ?<tr>
? ? ? ? ? ? ?<td class="main" align="center"><?php echo tep_get_categories_name(tep_get_products_catagory_id($product_info_values['products_id'])); ?></td>
? ? ? ? ? ?</tr>
? ? ? ? ?</table></td></tr>
<?php
}
// EOF: WebMakers.com Added: Show Category and Image
?>
? ? ? ? ?<tr>
? ? ? ? ? ?<td class="pageHeading" valign="top"><?php echo $products_name; ?></td>
? ? ? ? ? ?<td class="pageHeading" align="right" valign="top"><?php echo $products_price; ?></td>
? ? ?<input type="hidden" name="nuPrice" value="<?php echo str_replace("$","",$nuPrice); ?>">
? ? ? ? ?</tr>
? ? <tr>
? ? <td><?php echo '<a href="' . tep_href_link(FILENAME_PDF_DATASHEET, 'products_id=' . $product_info['products_id']) .'" target="_blank">' . tep_image('images/pdf.gif') . ' ?Click here to printout a PDF datasheet for this product'.'</a>'; ?></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 MaxiDVD: Modified For Ultimate Images Pack! //-->
<?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;}?>
<script language="javascript"><!--
document.write('<?php echo '<a href="javascript: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>'; ?>');
//--></script>
? ? ?	<tr>
? ? ? ? ? ? ? <td align="center" class="smallText">
<?php // ################### Ask a question ############## ?> ? ?
? ? ? <a href="ask_a_question.php?products_id=<?php echo $product_info['products_id']; ?>" ONMOUSEOVER="window.status='.<?php echo TEXT_QUESTION; ?> .'; return true">
? <?php echo TEXT_QUESTION; ?> <b><?php echo $product_info['products_name']; ?></b></a>
<?php // ################ end added ask a question ############ ?>
? ? ? ?	</td>
? ? ? ? ? ? </tr>
<noscript>
? ? ?<?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, 'class=shadow1', 'hspace="5" vspace="5"') . '<br>' . tep_image_button('image_enlarge.gif', TEXT_CLICK_TO_ENLARGE) . '</a>'; ?>
</noscript>
<!-- // EOF MaxiDVD: Modified For Ultimate Images Pack! //-->

? ? ? ? ? ? ?</td>
? ? ? ? ? ?</tr>
? ?	</table>
<?php
? ?}
?>
? ? ? ? ?<p><?php echo stripslashes($product_info['products_description']); ?></p>
<?php
? ?if (OPTIONS_AS_IMAGES_ENABLED == 'false'){
? ?$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
///////////////////////////////////////////////////////////////////////////
// BOF: attribute options
? ? ?$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, popt.products_options_sort_order 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_optionssort_order");
? ? ?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();
// BOF: WebMakers.com Added: Attributes Copy and Sort
?if ( PRODUCTS_OPTIONS_SORT_BY_PRICE !='1' ) {
? ? ? ?$products_options_query = tep_db_query("select pa.products_options_sort_order, 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 = '" . $HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . $products_options_name_values['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . $languages_id . "'" . " order by pa.products_options_sort_order, pov.products_options_values_name");
?} else {
? ? ? ?$products_options_query = tep_db_query("select pa.products_options_sort_order, 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 = '" . $HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . $products_options_name_values['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . $languages_id . "'" . " order by pa.products_options_sort_order, pa.options_values_price");
?}
// EOF: WebMakers.com Added: Attributes Copy and Sort
// original products options query ? ? ? ?$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, "onChange='showPrice(this.form);'") . $products_options_name['products_options_comment']; ?></td>
? ? ? ? ? ?</tr>
<?php
? ? ? ?} ?//clr 030714 end switch
? ? ?}
?>
? ? ? ? ?</table>
<?php
? ?}
// EOF: attribute options
///////////////////////////////////////////////////////////////////////////
?//Options as Images. Add the curly bracket as shown on the next line
}
?>

<?php
//Options as Images. This whole php clause needs to be added
//if (OPTIONS_AS_IMAGES_ENABLED == 'true') include ('options_images.php'); 
if (OPTIONS_AS_IMAGES_ENABLED == 'true'){
//Begin Options as Images
? ?$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>
? ? ? ? ? ? ?<?php ?echo '<td class="main" colspan="2">' . TEXT_PRODUCT_OPTIONS . '<br>Please select your desired option using the buttons provided'; ?>
? ? ?	<?php if (OPTIONS_IMAGES_CLICK_ENLARGE == 'true') echo '<br>Click the images to enlarge';?>
? ? ?	</td>
? ? ? ? ? ?</tr>
? ? ? ? ?	
<?php
?	$products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name, popt.products_options_sort_order, popt.products_options_images_enabled 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_sort_order");
? ? ?while ($products_options_name = tep_db_fetch_array($products_options_name_query)) {
? ? ? ?$products_options_array = array();
? ? ? ?$products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pov.products_options_values_thumbnail, 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 . "'order by pa.products_options_sort_order");
? ? ? ?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'], 'thumbnail' => $products_options['products_options_values_thumbnail']);
? ? ? ? ?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" valign="top"><?php echo $products_options_name['products_options_name'] . ':'; ?></td>
<?php 
? ? ?	if ($products_options_name['products_options_images_enabled'] == 'false'){
? ? ? ?echo '<td class="main">' . tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute, "onChange='showPrice(this.form);'") . '</td></tr>';
? ? ? ? ? ? ? } ? ? 
? ? ? ? ? ? ? else {
? ? ? ? $count=0;
? ? ? ?echo '<td class="main"><table><tr>';
? ? ? ? ? ? ? ?foreach ($products_options_array as $opti_array){
? ? ? ? ? echo '<td><table cellspacing="1" cellpadding="0" border="0">';
? ? ? ? ? if (OPTIONS_IMAGES_CLICK_ENLARGE == 'true') 
? ? ? ? ? ?echo '<td align="center"><a href="javascript:popupWindow(\'' . tep_href_link(FILENAME_OPTIONS_IMAGES_POPUP, 'oID=' . $opti_array['id']) .'\')">' . tep_image(DIR_WS_IMAGES . 'options/' . $opti_array['thumbnail'], $opti_array['text'], OPTIONS_IMAGES_WIDTH, OPTIONS_IMAGES_HEIGHT, 'class=shadow1') . '</a></td></tr>';
? ? ? ? ? ?else echo '<tr><td align="center">' . tep_image(DIR_WS_IMAGES . 'options/' . $opti_array['thumbnail'], $opti_array['text'], OPTIONS_IMAGES_WIDTH, OPTIONS_IMAGES_HEIGHT) . '</td></tr>';
? ? ? ? ? ? ? echo '<tr><td class="main" align="center">' . $opti_array['text'] . '</td></tr>';
? ? ? ? ? ? ? if (($selected_attribute == false && $count == 0) || ($selected_attribute == $opti_array['id'])) {
? ? ? ? ? ? ? echo '<tr><td align="center"><input type="radio" name ="id[' . $products_options_name['products_options_id'] . ']" value="' . $opti_array['id'] . '" onChange="showPrice(this.form)"></td></tr></table></td>';
? ? ? ? ? ? ? ? ? ? ? 
? ? ? ? ? ? ?	}
? ? ? ? ? ? ?	else {
? ? ? ? ? ? ? ? ? ?echo '<tr><td align="center"><input type="radio" name ="id[' . $products_options_name['products_options_id'] . ']" value="' . $opti_array['id'] . '" onChange="showPrice(this.form)"></td></tr></table></td>';
? ? ? ? ? ? ? ? ?//echo '<tr><td align="center"><input type="radio" name ="id[' . $products_options_name['products_options_id'] . ']" value="' . $opti_array['id'] . '" ></td></tr></table></td>';
? ? ? ? ? ? ? ? ?} 
? ? ? ? ? ? ? $count++;
? ? ? ? ? ? ? ? ? ? ?if ($count%OPTIONS_IMAGES_NUMBER_PER_ROW == 0) {
? ? ? ? ? ? ? ? echo '</tr><tr>';
? ? ? ? ? ? ? ?$count = 0;
? ? ? ? ? ? ? }
? ? ? ? ? ? }
? ? ? ?	echo '</table>';
? ? ? ?}
}
?>
? ?	
? ? ? ?</td></tr>
<?php
? ? ?}
?>
? ? </table>
<?php
? ?}
// BOF MaxiDVD: Modified For Ultimate Images Pack!
if (ULTIMATE_ADDITIONAL_IMAGES == 'Enable') { include(DIR_WS_MODULES . 'additional_images.php'); }
// BOF MaxiDVD: Modified For Ultimate Images Pack!
; ?>

? ? ?<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 . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd where r.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and r.reviews_id = rd.reviews_id and rd.languages_id = '" . (int)$languages_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>
? ? ? ?<tr><td align="center"><b><div id="productNEWprice"></b></div></td></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>
? ? ? ? ? ? ? ?<!-- Wish List 2.3 Start -->
? ? ? ? ? ? ? ?<td align="center" class="main"><?php echo tep_draw_hidden_field('wishlist_action', 'add_wishlist') . tep_image_submit('button_wishlist.gif', IMAGE_BUTTON_ADD_WISHLIST, 'onClick="document.cart_quantity.action=\''. FILENAME_WISHLIST . '\';document.cart_quantity.submit();"'. ' action=add_wishlist'); ?></td>
? ? ? ? ? ? ? ?<!-- Wish List 2.3 End ? -->
? ? ? ?<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
//added for cross -sell
? if ( (USE_CACHE == 'true') && !SID) { 
? ? ?echo tep_cache_also_purchased(3600);
? ? include(DIR_WS_MODULES . FILENAME_XSELL_PRODUCTS); 
? ?} else {
? ? include(DIR_WS_MODULES . FILENAME_XSELL_PRODUCTS); 
? ? ?include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS);
? ?}
?}
?//EOF for cross sell
?>
? ? ? ?</td>
? ? ?</tr>
? ?</table></form></td>
<!-- body_text_eof //-->
<script language="javascript">
<!--
?showPrice(cart_quantity);
//-->
</script>
? <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'); ?>

Link to comment
Share on other sites

Just checking in to see if anyon out there has a minute to look at this. I have a feeling it is a pretty easy fix, but don't know where exactly to do it. ANY HELP on this would be great.

 

Thanks!

RW

 

is anyone able to take a look at this and help me figure out what is going on?

 

Thanks

RW

Link to comment
Share on other sites

  • 1 year later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...