hydrolift Posted November 23, 2006 Posted November 23, 2006 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>
hydrolift Posted November 24, 2006 Author Posted November 24, 2006 Anyone who have an idea? :sweating:
dittones Posted November 24, 2006 Posted November 24, 2006 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
hydrolift Posted November 24, 2006 Author Posted November 24, 2006 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.
hydrolift Posted November 24, 2006 Author Posted November 24, 2006 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']; }
Recommended Posts
Archived
This topic is now archived and is closed to further replies.