Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How do I make a drop down box?


rubygirl

Recommended Posts

Posted

Here is what I have so far:

 

<tr>

<td>

<?php

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_SHOP_BY_PRICE);

 

 

 

$info_box_contents = array();

$info_box_contents[] = array('align' => 'left',

'text' => BOX_HEADING_SHOP_BY_PRICE

);

new infoBoxHeading($info_box_contents, false, false, tep_href_link(FILENAME_SHOP_BY_PRICE, '', 'NONSSL'));

 

 

 

$info_box_contents = array();

 

for ($range=0; $range<sizeof($price_ranges); $range++) {

$info_box_contents[] = array('align' => 'left',

'text' => '<a href="' . tep_href_link(FILENAME_SHOP_BY_PRICE, 'range=' . $range , 'NONSSL') . '">' . $price_ranges[$range] . '</a><br>'

);

}

new infoBox($info_box_contents);

 

?>

</td>

</tr>

 

 

 

but I want it to display as a drop down instead of a list.....

 

 

help please??

Posted

What do you want the drop down to do?

 

-Matt

Posted

display the search by price that I have - right now the info box lists the prices - I would like it to be a dropdown box instead - to help conserve space.

Posted

	for ($range=0; $range<sizeof($price_ranges); $range++) {

  	 $info_box_contents[] = array('align' => 'left',

                                'text'  => '<a href="' . tep_href_link(FILENAME_SHOP_BY_PRICE, 'range=' . $range , 'NONSSL') . '">' . $price_ranges[$range] . '</a><br>' 

                               );

}

to

   $price_range_array[] = array();

for ($range=0; $range<sizeof($price_ranges); $range++) {

     $price_range_array[] = array('id' => $range, 'text' => $price_ranges[$range]);

   }

   $info_box_contents[] = array('align' => 'left', 'text' => tep_draw_pull_down_menu(BOX_HEADING_SHOP_BY_PRICE, $price_range_array));

To reach your goal, I suspect that you will also need to add a form inside the infoBox (enclosing your drop down menu) and a submit button to make it go to other pages.

 

Hth,

Matt

Posted

okay so the dropdown was made with your code and yes I do still need to set it up so that when a choice is selected - it automatically goes to the right area - similar to both the manufacturers and the categories - I don't know why I can't get this to work - I am obvioulsy having a brain dead moment - anymore ideas on how to add the needed functionality?

Archived

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

×
×
  • Create New...