Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

HELP! Browser Compatibilty For Developing! HELP!


Guest

Recommended Posts

Check out my store with a sample product. Every thing displays fine in Firefox however in IE the product options are supposed to change the shirts color behind the product image. I can find no errors in the coding do far so thats why I need a second opinion. affecting code:

The Divs that are shown or hidden:

<style>
 .hide{
        display: none;
 }
</style>


<script type="text/javascript">
 function showHide(form){
   for(var i=0;i<document.getElementsByTagName('div').length;i++){
     if(/hide/.test(document.getElementsByTagName('div')[i].className))
        document.getElementsByTagName('div')[i].style.display = 'none';
   }

     if(document.getElementById(form['id[2]'].value+form['id[3]'].value))
        document.getElementById(form['id[2]'].value+form['id[3]'].value).style.display = 'block';
 }
</script>
<DIV style="WIDTH: 470px; POSITION: relative; HEIGHT: 388px">
<DIV id="27" style="WIDTH: 470px; POSITION: absolute; TOP: 0px; LEFT: 0px; HEIGHT: 388px"><img src="images/tshirtwhite.png" width="470" height="388"></DIV>
<DIV id="26" class="hide" style="WIDTH: 470px; POSITION: absolute; TOP: 0px; LEFT: 0px; HEIGHT: 388px"><img src="images/tshirtblack.png" width="470" height="388"></DIV>
<DIV id="10"  class="hide" style="WIDTH: 470px; POSITION: absolute; TOP: 0px; LEFT: 0px; HEIGHT: 388px"><img src="images/tshirtpurple.png" width="470" height="388"></DIV>
<DIV id="11"  class="hide" style="WIDTH: 470px; POSITION: absolute; TOP: 0px; LEFT: 0px; HEIGHT: 388px"><img src="images/tshirtlime.png" width="470" height="388"></DIV>
<DIV id="2711"  class="hide" style="WIDTH: 470px; POSITION: absolute; TOP: 0px; LEFT: 0px; HEIGHT: 388px"><img src="images/tshirtorange.png" width="470" height="388"></DIV>
<DIV id="2610"  class="hide" style="WIDTH: 470px; POSITION: absolute; TOP: 0px; LEFT: 0px; HEIGHT: 388px"><img src="images/tshirtpurple.png" width="470" height="388"></DIV>
<DIV id="pimage" style="WIDTH: 350px; POSITION: absolute; TOP: 90px; LEFT: 60px; HEIGHT: 288px"><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*2, SMALL_IMAGE_HEIGHT*2, '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*2, SMALL_IMAGE_HEIGHT*2, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>
</noscript></DIV></DIV>

 

And the Form that Controls the Divs:

<table border="0" cellspacing="0" cellpadding="5" align="right" valign="top">
           <tr align="center" valign="top">
             <td class="main" colspan="2"><center><img src="images/options.png"></center></td>
           </tr><tr><td><FORM NAME="formName"></td></tr>
<?php
     $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name");
     while ($products_options_name = tep_db_fetch_array($products_options_name_query)) {
       $products_options_array = array();
       $products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'");
       while ($products_options = tep_db_fetch_array($products_options_query)) {
         $products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']);
         if ($products_options['options_values_price'] != '0') {
           $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') ';
         }
       }

       if (isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) {
         $selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']];
       } else {
         $selected_attribute = false;
       }
?>

     <tr>
             <td class="main" align="left" valign="top"><?php echo $products_options_name['products_options_name'] . ':'; ?></td>
             <td class="main" align="left" valign="top"><?php echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute); ?></td>
           </tr>
<?php
     }
?>
   <tr><td></FORM></td></tr></table>

Please Help me figure this out!:confused:

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...