Guest Posted September 11, 2008 Share Posted September 11, 2008 my problem is that I doubled the name <?php $products_query = tep_db_query("select products_name, products_id from " . TABLE_PRODUCTS_DESCRIPTION . " order by products_name"); if ($number_of_rows = tep_db_num_rows($products_query)) { $products_array = array(); while ($products = tep_db_fetch_array($products_query)) { $products_name = ((strlen($products['products_name']) > MAX_DISPLAY_MANUFACTURER_NAME_LEN) ? substr($products['products_name'], 0, MAX_DISPLAY_MANUFACTURER_NAME_LEN) . '..' : $products['products_name']); $products_array[] = array('id' => $products['products_id'], 'text' => $products_name); } $info_box_contents = array(); $info_box_contents[] = array('form' => tep_draw_form('products', tep_href_link(FILENAME_PRODUCT_INFO, '', 'NONSSL', false), 'get'), 'text' => tep_draw_pull_down_menu('products_id', $products_array, (isset($HTTP_GET_VARS['products_id']) ? $HTTP_GET_VARS['products_id'] : ''), 'onChange="this.form.submit();" size="' . MAX_MANUFACTURERS_LIST . '" style="width: 100%"') . tep_hide_session_id()); new infoBox1($info_box_contents); } ?> Quote Link to comment Share on other sites More sharing options...
Guest Posted September 11, 2008 Share Posted September 11, 2008 Solutions <?php $products_query = tep_db_query("SELECT products_id, products_name FROM " . TABLE_PRODUCTS_DESCRIPTION . " WHERE language_id = '" . $languages_id . "' ORDER BY products_name"); if ($number_of_rows = tep_db_num_rows($products_query)) { $products_array = array(); while ($products = tep_db_fetch_array($products_query)) { $products_name = ((strlen($products['products_name']) > '50') ? substr($products['products_name'], 0, '50') . '..' : $products['products_name']); $products_array[] = array('id' => $products['products_id'], 'text' => $products_name); } $info_box_contents = array(); $info_box_contents[] = array('form' => tep_draw_form('products', tep_href_link(FILENAME_PRODUCT_INFO, '', 'NONSSL', false), 'get'), 'text' => tep_draw_pull_down_menu('products_id', $products_array, (isset($HTTP_GET_VARS['products_id']) ? $HTTP_GET_VARS['products_id'] : ''), 'onChange="this.form.submit();" size="' . MAX_MANUFACTURERS_LIST . '" style="width: 100%"') . tep_hide_session_id()); new infoBox1($info_box_contents); } ?> and include status ? any idea Quote Link to comment Share on other sites More sharing options...
Guest Posted September 11, 2008 Share Posted September 11, 2008 (edited) Solution <?php $products_query = tep_db_query("select distinct p.products_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by pd.products_name "); if ($number_of_rows = tep_db_num_rows($products_query)) { $products_array = array(); if ($products_name < 2) { $products_array[] = array('id' => '', 'text' => PULL_DOWN_DEFAULT); } while ($products = tep_db_fetch_array($products_query)) { $products_name = ((strlen($products['products_name']) > '50') ? substr($products['products_name'], 0, '50') . '..' : $products['products_name']); $products_array[] = array('id' => $products['products_id'], 'text' => $products_name); } $info_box_contents = array(); $info_box_contents[] = array('form' => tep_draw_form('products', tep_href_link(FILENAME_PRODUCT_INFO, '', 'NONSSL', false), 'get'), 'text' => tep_draw_pull_down_menu('products_id', $products_array, (isset($HTTP_GET_VARS['products_id']) ? $HTTP_GET_VARS['products_id'] : ''), 'onChange="this.form.submit();" size="' . '1' . '" style="width: 100%"') . tep_hide_session_id()); new infoBox($info_box_contents); } ?> Edited September 11, 2008 by davchi2005 Quote Link to comment Share on other sites More sharing options...
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.