Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How to get the "PULL_DOWN_DEFAULT" incorporated in a pull down menu?


hydrolift

Recommended Posts

Posted

I have made an extra pull down menu in the featured distribution but I can't find out how to get an default choice in the pull down menu. I want to use the "PULL_DOWN_DEFAULT".

As an bonus it would be cool to get the choice I do to be instead of "PULL DOWN DEFAULT" when I choose to edit the "Featured Product".

Anyone have an idea?

 

This is the code from the "general.php":

function tep_draw_featured_category_pull_down($name, $parameters = '', $exclude = '') {

global $currencies, $languages_id;

 

if ($exclude == '') {

$exclude = array();

}

 

$select_string = '<select name="' . $name . '"';

 

if ($parameters) {

$select_string .= ' ' . $parameters;

}

 

$select_string .= '>';

 

$featured_category_query = tep_db_query("select sc.featured_category_id, sc.featured_type from " . TABLE_FEATURED_CATEGORY . " sc order by featured_type");

while ($featured_category = tep_db_fetch_array($featured_category_query)) {

if (!in_array($featured_category['featured_category_id'], $exclude)) {

$select_string .= '<option value="' . $featured_category['featured_category_id'] . '">' . $featured_category['featured_type'] . '</option>';

}

}

 

$select_string .= '</select>';

 

return $select_string;

}

 

This is the code in the "admin/featured.php":

<td class="main"><?php echo TEXT_FEATURED_TYPE; ?> </td>

<td class="main"><?php echo tep_draw_featured_category_pull_down('featured_type', 'style="font-size:10px"'); echo '' . ($sInfo->featured_type) . '';?></td>

Posted

Ak,

echo tep_draw_pull_down_menu('state', $zones_array) . ' ' . ENTRY_WAREHOUSE_STATE_ERROR;

 

If you use the function...the second field is an array that you prim with

you defaults

 

 

I hope this helps

Posted

If I put something like this in "featured.php":

$featured_category_array = array();

$featured_category_array[] = array('featured_type' => '', 'text' => PULL_DOWN_DEFAULT);

 

and put an "$featured_category_array" like this:

<td class="main"><?php echo TEXT_FEATURED_TYPE; ?> </td>

<td class="main"><?php echo tep_draw_featured_category_pull_down('featured_type', 'style="font-size:10px"', $featured_category_array); echo '' . ($sInfo->featured_type) . '';?></td>

 

But it don't work like that.

And then I have "($sInfo->featured_type)" to insert the pull down when I edit the featured product.

Posted

I tried with theese also, without any success:

 

$featured_category_array = array();

$featured_category_query = tep_db_query("select sc.featured_type from " . TABLE_FEATURED_CATEGORY . " sc");

while ($featured_category = tep_db_fetch_array($featured_category_query)) {

$featured_category_array[] = $featured_category['featured_type'];

}

Archived

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

×
×
  • Create New...