staaf Posted September 25, 2006 Posted September 25, 2006 I know the problem is in the code that has to be added to the /catalog/admin/includes/functions/html_output.php this is the code I added to it: //draw products multiselect box function tep_draw_products_mselect($name, $parameters = '', $selected_vals) { global $currencies, $languages_id; if ($exclude == '') { $exclude = array(); } $select_string = '<select name="' . $name . '"'; if ($parameters) $select_string .= ' ' . $parameters; $select_string .= ' multiple>'; if (!in_array($products['products_id'], $exclude)) { $select_string .= '<option value="' . $products['products_id'] . '">' . $products['products_name'] . ' (' . $currencies->format($products['products_price']) . ')</option>'; } if (!in_array((int)$products['products_id'].":".(int)$sdek, $exclude)) { } $select_string .= '</select>'; return $select_string; } //draw products multiselect delete box function tep_draw_products_delete_mselect($name, $parameters = '', $selected_vals) { global $currencies, $languages_id; if ($exclude == '') { $exclude = array(); } $select_string = '<select name="' . $name . '"'; if ($parameters) $select_string .= ' ' . $parameters; $select_string .= ' multiple>'; $products_query = tep_db_query("select p.products_id, pd.products_name, s.featured_id, s.featured_date_added, s.featured_last_modified, s.expires_date, s.date_status_change, s.status from " . TABLE_PRODUCTS . " p, " . TABLE_FEATURED . " s, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and p.products_id = s.products_id order by pd.products_name"); while ($products = tep_db_fetch_array($products_query)) { $select_string .= '<option value="' . $products['featured_id'] . '">' . $products['products_model'] . ' ' . $products['products_name'].'</option>\n'; } $select_string .= '</select>'; return $select_string; } and this is the result when I try to add a product: http://www.rooneysmerkkleding.nl/featuredprob.jpg The product list should be filled with all the products in the catalogus.. help mehhh Quote
staaf Posted September 26, 2006 Author Posted September 26, 2006 please help me to fix the query ? anyone ? (there is really a lack of feedback on the oscommerce contributions unfortunatly) Quote
staaf Posted September 26, 2006 Author Posted September 26, 2006 please help me to fix the query ? anyone ? (there is really a lack of feedback on the oscommerce contributions unfortunatly) Fixed the problem myself: this is the proper piece of code for this modification in the html_output.php //draw products multiselect box function tep_draw_products_mselect($name, $parameters = '', $selected_vals) { global $currencies, $languages_id; if ($exclude == '') { $exclude = array(); } $select_string = '<select name="' . $name . '"'; if ($parameters) $select_string .= ' ' . $parameters; $select_string .= ' multiple>'; $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by products_name"); while ($products = tep_db_fetch_array($products_query)) { if (!in_array($products['products_id'], $exclude)) { $select_string .= '<option value="' . $products['products_id'] . '">' . $products['products_name'] . ' (' . $currencies->format($products['products_price']) . ')</option>'; } } $select_string .= '</select>'; return $select_string; } //draw products multiselect delete box function tep_draw_products_delete_mselect($name, $parameters = '', $selected_vals) { global $currencies, $languages_id; if ($exclude == '') { $exclude = array(); } $select_string = '<select name="' . $name . '"'; if ($parameters) $select_string .= ' ' . $parameters; $select_string .= ' multiple>'; $products_query = tep_db_query("select p.products_id, pd.products_name, s.featured_id, s.featured_date_added, s.featured_last_modified, s.expires_date, s.date_status_change, s.status from " . TABLE_PRODUCTS . " p, " . TABLE_FEATURED . " s, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and p.products_id = s.products_id order by pd.products_name"); while ($products = tep_db_fetch_array($products_query)) { $select_string .= '<option value="' . $products['featured_id'] . '">' . $products['products_model'] . ' ' . $products['products_name'].'</option>\n'; } $select_string .= '</select>'; return $select_string; } Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.