Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

njtermite

Archived
  • Posts

    89
  • Joined

  • Last visited

About njtermite

  • Birthday 12/31/1982

Profile Information

  • Real Name
    Mark
  • Gender
    Male
  • Location
    New Jeresy, USA
  • Website

njtermite's Achievements

  1. Hi Guys, I'm having a problem with my compare, I have it installed on a custom layout. My compare button isn't showing up. My first check box on the page is acting like the compare button, when checked it takes it to the compare page. Could some please look at my code for me? Thanks, Mark product_listing.php <?php /* $Id: product_listing.php,v 1.44 2003/06/09 22:49:59 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ $listing_split = new splitPageResults($listing_sql, MAX_DISPLAY_SEARCH_RESULTS, 'p.products_id'); if ( ($listing_split->number_of_rows > 0) && ( (PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3') ) ) { ?> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="smallText"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td> <td class="smallText" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td> </tr> </table> <?php } /* BoF Compare Products side-by-side */ echo tep_draw_form('compare', tep_href_link(basename('compare.php'), tep_get_all_get_params(array('action')) ));?> <?php /* EoF Compare Products side-by-side */ $list_box_contents = array(); /* BoF Compare Products side-by-side Insert first column to add checkbox to compare products */ $list_box_contents[0][] = array('align' => "center", 'params' => 'class="productListing-heading"', 'text' => TABLE_HEADING_COMPARE . '<br>' . tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</form>'); /* EoF Compare Products side-by-side */ for ($col=0, $n=sizeof($column_list); $col<$n; $col++) { switch ($column_list[$col]) { case 'PRODUCT_LIST_MODEL': $lc_text = TABLE_HEADING_MODEL; $lc_align = ''; break; case 'PRODUCT_LIST_NAME': $lc_text = TABLE_HEADING_PRODUCTS; $lc_align = ''; break; case 'PRODUCT_LIST_MANUFACTURER': $lc_text = TABLE_HEADING_MANUFACTURER; $lc_align = ''; break; case 'PRODUCT_LIST_PRICE': $lc_text = TABLE_HEADING_PRICE; $lc_align = 'right'; break; case 'PRODUCT_LIST_QUANTITY': $lc_text = TABLE_HEADING_QUANTITY; $lc_align = 'right'; break; case 'PRODUCT_LIST_WEIGHT': $lc_text = TABLE_HEADING_WEIGHT; $lc_align = 'right'; break; case 'PRODUCT_LIST_IMAGE': $lc_text = TABLE_HEADING_IMAGE; $lc_align = 'center'; break; case 'PRODUCT_LIST_BUY_NOW': $lc_text = TABLE_HEADING_BUY_NOW; $lc_align = 'center'; break; } if ( ($column_list[$col] != 'PRODUCT_LIST_BUY_NOW') && ($column_list[$col] != 'PRODUCT_LIST_IMAGE') ) { $lc_text = tep_create_sort_heading($HTTP_GET_VARS['sort'], $col+1, $lc_text); } $list_box_contents[0][] = array('align' => $lc_align, 'params' => 'class="productListing-heading"', 'text' => ' ' . $lc_text . ' '); } if ($listing_split->number_of_rows > 0) { $rows = 0; /* BoF Compare Products side-by-side Generate hidden fields to submit with each checkbox */ $hidden_get_variables = ''; reset($HTTP_GET_VARS); while (list($key, $value) = each($HTTP_GET_VARS)) { if ((substr($key,0,8) != 'columns_') && ($key != tep_session_name()) && ($key != 'x') && ($key != 'y')) { $hidden_get_variables .= tep_draw_hidden_field($key, $value); } } /* EoF Compare Products side-by-side */ $listing_query = tep_db_query($listing_split->sql_query); while ($listing = tep_db_fetch_array($listing_query)) { $rows++; /* BoF Compare Products side-by-side Hide all columns selected except for this product, which will be generated by the checkbox form is needed */ $hidden_get_columns = ''; reset($HTTP_GET_VARS); while (list($key, $value) = each($HTTP_GET_VARS)) { if ((substr($key,0,8) == 'columns_') && ($key != 'columns_'.$listing['products_id']) ) { $hidden_get_columns .= tep_draw_hidden_field($key, $value); } } /* EoF Compare Products side-by-side */ if (($rows/2) == floor($rows/2)) { $list_box_contents[] = array('params' => 'class="productListing-even"'); } else { $list_box_contents[] = array('params' => 'class="productListing-odd"'); } $cur_row = sizeof($list_box_contents) - 1; /* BoF Compare Products side-by-side Add checkbox to compare products */ $lc_align = 'center'; // $lc_text = tep_draw_form('compare', tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=compare&columns_cnt='.$columns_cnt), 'get'); $lc_text = tep_draw_form('compare', tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) ), 'get'); $lc_text .= tep_draw_checkbox_field('columns_'.$listing['products_id'],$listing['products_id'],false,'onclick="this.form.submit();"'); $lc_text .= $hidden_get_variables; $lc_text .= $hidden_get_columns; $lc_text .= tep_hide_session_id(); $lc_text .= '</form>'; $list_box_contents[$cur_row][] = array('align' => $lc_align, 'params' => 'class="productListing-data"', 'text' => $lc_text); /* EoF Compare Products side-by-side */ for ($col=0, $n=sizeof($column_list); $col<$n; $col++) { $lc_align = ''; switch ($column_list[$col]) { case 'PRODUCT_LIST_MODEL': //$lc_align = ''; $lc_model_text = ' ' . $listing['products_model'] . ' '; $lc_model_2_text = ' ' . $listing['products_model_2'] . ' '; $products_type = ' ' . $listing['products_type'] . ' '; $products_code = ' ' . $listing['products_code'] . ' '; $products_short_description = $listing['products_info'] . ' '; $products_default_price = ' ' . $currencies->display_price($listing['products_default_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . ' '; $products_lease_price = ' ' . $currencies->display_price($listing['products_lease_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . ' '; $more_info_button = ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . tep_image_button('more_info.gif', 'More Information') . '</a> '; break; case 'PRODUCT_LIST_NAME': // $lc_align = ''; if (isset($HTTP_GET_VARS['manufacturers_id'])) { $lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a>'; } else { $lc_text_name = ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a> '; } break; case 'PRODUCT_LIST_MANUFACTURER': //$lc_align = ''; $lc_manufacturer_text = '<a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing['manufacturers_id']) . '">' . $listing['manufacturers_name'] . '</a>'; break; case 'PRODUCT_LIST_PRICE': // $lc_align = 'right'; $lc_SS_price_text = ' ' . $currencies->display_price($listing['specials_new_products_price'], tep_get_tax_rate($listing['products_tax_class_id'])); $lc_dd_price_text = ' ' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . ' '; break; case 'PRODUCT_LIST_QUANTITY': $lc_align = 'right'; $lc_text = ' ' . $listing['products_quantity'] . ' '; break; case 'PRODUCT_LIST_WEIGHT': $lc_align = 'right'; $lc_text = ' ' . $listing['products_weight'] . ' '; break; case 'PRODUCT_LIST_IMAGE': //$lc_align = 'center'; if (isset($HTTP_GET_VARS['manufacturers_id'])) { $lc_image_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing['products_image'], $listing['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>'; } else { $lc_image_text = ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing['products_image'], $listing['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a> '; } break; case 'PRODUCT_LIST_BUY_NOW': // $lc_align = 'center'; $lc_buy_now_text = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']) . '">' . tep_image_button('add_to_cart.gif', IMAGE_BUTTON_BUY_NOW) . '</a> '; $lc_model_text = $listing['products_model']; $lc_model_2_text = $listing['products_model_2']; $products_model_3 = $listing['products_model_3']; $products_category = $listing['products_category']; $products_type = $listing['products_type']; $products_code = $listing['products_code']; $products_short_description = $listing['products_info']; $products_default_price = $currencies->display_price($listing['products_default_price'], tep_get_tax_rate($listing['products_tax_class_id'])); $products_lease_price = ' ' . $currencies->display_price($listing['products_lease_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . ' '; $more_info_button = ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . tep_image_button('more_info.gif', 'More Information') . '</a> '; $more_info_link_1 = ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . "…details and options." . '</a> '; $lc_manufacturer_text = '<a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing['manufacturers_id']) . '">' . $listing['manufacturers_name'] . '</a>'; break; } //$list_box_contents[$cur_row][] = array('align' => $lc_align, // 'params' => 'class="productListing-data"', //'text' => $lc_text); } ?> <table border="1" width="100%" cellspacing="0" bordercolor="#666666" cellpadding="0"> <tr> <td width="100%" > <table border="0" width="100%"> <tr> <td width="15%" rowspan="2" valign ="top"> <?php if ( $listing['specials_new_products_price'] != 0 ) { ?> <IMG SRC="images/bluelight_spacer.gif"><br> <IMG SRC="images/bluelight.gif"><br> <?php echo '<br>'; }else{ } ?> <?php echo $lc_image_text; ?><br> <IMG SRC="images/review1.gif"><br> <IMG SRC="images/review_spacer.gif"><br> <?php echo $lc_text; ?><IMG SRC="images/compare1.gif"> </td> <td width="15%" rowspan="2" valign ="top"><font id="productBox">Product Type</font> <font id="productBoxSubHeading">[Category]</font><font id="productBoxContent"><br><?php echo $products_category; ?></font><br> <font id="productBoxSubHeading">[Type]</font><br><font id="productBoxContent"><?php echo $products_type; ?></font><br> <font id="ProductBox">Manufacturer</font> <font id="productBoxSubHeading">[Make]</font><br><font id="productBoxContent"><?php echo $lc_manufacturer_text; ?></font><br> <font id="productBoxSubHeading">[Model]</font><br><font id="productBoxContent"><?php echo $lc_model_text; ?></font><br> <?php if ( $lc_model_2_text != "" ) { ?> <font id="productBoxContentModel2"> <?php echo ($lc_model_2_text). '<br>'; ?></font> <?php } ?> <?php if ( $products_model_3 != "" ) { ?> <font id="productBoxContentModel2"> <?php echo ($products_model_3). '<br>'; ?></font> <?php } ?> <font id="productBoxSubHeading">[Code]</font><br><font id="productBoxContentCode"><?php echo $products_code;?></td> <td width="50%" valign ="top"><center><font id="DescriptiontBox">Description</font></center> <?php echo $products_short_description . '<br>';?> </td> <td width="10%" valign ="top"><center><IMG SRC="images/signal_light1.gif"><br> <font id="productSalePrice"><?php echo $products_default_price; ?></font><br><br> <IMG SRC="images/signal_light2.gif"><br> <font id="productDDPrice"><?php echo $lc_dd_price_text; ?></font><br> <br> <?php if ( $listing['specials_new_products_price'] != 0 ) { ?> <IMG SRC="images/bluelight2.gif"><br> <font id="productSpecialPriceList"><?php echo $lc_SS_price_text; ?></font> <?php echo '<br>'; }else{ echo '<br>'; } ?> <?php if ( $listing['products_lease_price'] != 0 ) { ?> <font id="productLeaseFor">or lease for...</font><br> <font id="productLeaseMonthly">Monthly</font> <font id="productLeasePriceList"><?php echo $products_lease_price .'/36'; ?></font> <font id="productLeaseMonthly">Months</b></font> <?php echo '<br>'; }else{ echo '<br>'; } ?> </center> </td> </tr> <tr> <td width="50%" valign="top"><center><?php echo $more_info_button; ?></center> </td> <td width="10%" valign="top"><center><?php echo $lc_buy_now_text; ?></center> </td> </tr> </table></td> </tr> </table> <br> <? } // new productListingBox($list_box_contents); } else { $list_box_contents = array(); $list_box_contents[0] = array('params' => 'class="productListing-odd"'); $list_box_contents[0][] = array('params' => 'class="productListing-data"', 'text' => TEXT_NO_PRODUCTS); new productListingBox($list_box_contents); } if ( ($listing_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3')) ) { ?> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="smallText"><?php echo $listing_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td> <td class="smallText" align="right"><?php echo TEXT_RESULT_PAGE . ' ' . $listing_split->display_links(MAX_DISPLAY_PAGE_LINKS, tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td> </tr> </table> <?php } ?>
×
×
  • Create New...