Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Desperately need help integrating dropdown today!!


ecroskey

Recommended Posts

Posted

Hi folks, I desperately need help getting this dropdown integrated into the checkout_confirmation page today or I am going to loose my job tomorrow!

 

Below is the code for my dropdown, pulling advertisers from the database. I need to integrate this dropdown into the checkout_confirmation page so that it passes the info to the checkout_process page and I can't figure out for the life of me how to get it to do that! On the checkout_process page I need to call the advertiser_code (see sql query) as a variable, and I don't know how to do that either.

 

Please help me!

 

 <?php
 $info_box_contents = array();
 $advertisers_query = tep_db_query("select advertiser_id, advertiser_name, advertiser_code from " . TABLE_ADVERTISERS . " order by advertiser_id");
 if (tep_db_num_rows($advertisers_query) <= MAX_DISPLAY_ADVERTISERS_IN_A_LIST) {
// Display a list
   $advertisers_list = '';
   while ($advertisers = tep_db_fetch_array($advertisers_query)) {
     $advertisers_name = ((strlen($advertisers['advertiser_name']) > MAX_DISPLAY_ADVERTISERS_NAME_LEN) ? substr($advertisers['advertiser_name'], 0, MAX_DISPLAY_ADVERTISERS_NAME_LEN) . '..' : $advertisers['advertiser_name']);
     if (isset($HTTP_GET_VARS['advertiser_id']) && ($HTTP_GET_VARS['advertiser_id'] == $advertisers['advertiser_id'])) $advertisers_name = '<b>' . $advertisers_name .'</b>';
     $advertisers_list .= '<a href="' . tep_href_link(FILENAME_DEFAULT, 'advertiser_id=' . $advertisers['advertiser_id']) . '">' . $advertisers_name . '</a><br>';
   }

   $info_box_contents = array();
   $info_box_contents[] = array('text' => substr($advertisers_list, 0, -4));
 } else {
// Display a drop-down
   $advertisers_array = array();
   if (MAX_ADVERTISERS_LIST < 2) {
     $advertisers_array[] = array('id' => '', 'text' => PULL_DOWN_DEFAULT);
   }

   while ($advertisers = tep_db_fetch_array($advertisers_query)) {
     $advertisers_name = ((strlen($advertisers['advertiser_name']) > MAX_DISPLAY_ADVERTISERS_NAME_LEN) ? substr($advertisers['advertiser_name'], 0, MAX_DISPLAY_ADVERTISERS_NAME_LEN) . '..' : $advertisers['advertiser_name']);
     $advertisers_array[] = array('id' => $advertisers['advertiser_id'],
                                    'text' => $advertisers_name);
   }

   $info_box_contents = array();
   $info_box_contents[] = array('form' => tep_draw_form('advertisers', tep_href_link(FILENAME_DEFAULT, '', 'NONSSL', false), 'get'),
                                'text' => tep_draw_pull_down_menu('advertiser_id', $advertisers_array, $HTTP_POST_VARS['advertiser_code']. MAX_ADVERTISERS_LIST . '" style="width: 250"') . tep_hide_session_id());
 }

 new infoBox($info_box_contents);
?>

Archived

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

×
×
  • Create New...