buzuc Posted October 19, 2005 Share Posted October 19, 2005 Hi there, I'm stuck like a rat with this contribution and I will explain my problems. I need to have 2 manufacturers per product (I sell jewellery wich are made of 2 stones or pearls) so I change the manufacturers to "stones". I used manufacturer copy (how to) contribution and it works great except when I try to filter whith the dropdown list on the index page. exemple: I have one bracelet made of Coral and Turquoise, when i select "coral" in the list, my product appears but when I select "turquoise" there is no product. I think I have to modify the request in the index.php file but I tried a lot of coding and it doesn't work at all! Can someone help me ??? Quote MS2 2.2 fr + Manufacturer copy (5 manufacturers - modified to make it works) + More pics 6 + FCK Editor + zones shipping (modified without weight) + My contribution : Shopping Cart Management for Unique Products I apologize in advance for my poor English I'm French ! Link to comment Share on other sites More sharing options...
buzuc Posted October 25, 2005 Author Share Posted October 25, 2005 Here is the request inside index.php : // We show them all $listing_sql = "select distinct " . $select_column_list . " p.products_id, p.manufacturers_id, p.manufacturers2_id, p.manufacturers3_id, p.manufacturers4_id, p.manufacturers5_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m , " . TABLE_MANUFACTURERS2 . " m2, " . TABLE_MANUFACTURERS3 . " m3, " . TABLE_MANUFACTURERS4 . " m4, " . TABLE_MANUFACTURERS5 . " m5 left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id AND p.manufacturers2_id = m2.manufacturers2_id AND p.manufacturers3_id = m3.manufacturers3_id AND p.manufacturers4_id = m4.manufacturers4_id AND p.manufacturers5_id = m5.manufacturers5_id and (m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' OR m2.manufacturers2_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' OR m3.manufacturers3_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' OR m4.manufacturers4_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' OR m5.manufacturers5_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "')"; and the sql request to be clarified: SELECT DISTINCT m.manufacturers_name, p.products_image, pd.products_name, p.products_id, p.manufacturers_id, p.manufacturers2_id, p.products_price, p.products_tax_class_id, IF ( s.status, s.specials_new_products_price, NULL ) AS specials_new_products_price, IF ( s.status, s.specials_new_products_price, p.products_price ) AS final_price FROM products p, products_description pd, manufacturers m, manufacturers2 m2, manufacturers3 m3, manufacturers4 m4, manufacturers5 m5 LEFT JOIN specials s ON p.products_id = s.products_id WHERE p.products_status = '1' AND pd.products_id = p.products_id AND pd.language_id = '2' AND p.manufacturers_id = m.manufacturers_id AND p.manufacturers2_id = m2.manufacturers2_id AND p.manufacturers2_id = m3.manufacturers3_id AND p.manufacturers2_id = m4.manufacturers4_id AND p.manufacturers2_id = m5.manufacturers5_id AND ( m.manufacturers_id = '22' OR m2.manufacturers2_id = '22' OR m3.manufacturers3_id = '22' OR m4.manufacturers4_id = '22' OR m5.manufacturers5_id = '22' ) ORDER BY pd.products_name LIMIT 0 , 30 Thanks for debugging Quote MS2 2.2 fr + Manufacturer copy (5 manufacturers - modified to make it works) + More pics 6 + FCK Editor + zones shipping (modified without weight) + My contribution : Shopping Cart Management for Unique Products I apologize in advance for my poor English I'm French ! Link to comment Share on other sites More sharing options...
bobsi18 Posted June 3, 2006 Share Posted June 3, 2006 Here is the request inside index.php : // We show them all $listing_sql = "select distinct " . $select_column_list . " p.products_id, p.manufacturers_id, p.manufacturers2_id, p.manufacturers3_id, p.manufacturers4_id, p.manufacturers5_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m , " . TABLE_MANUFACTURERS2 . " m2, " . TABLE_MANUFACTURERS3 . " m3, " . TABLE_MANUFACTURERS4 . " m4, " . TABLE_MANUFACTURERS5 . " m5 left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id AND p.manufacturers2_id = m2.manufacturers2_id AND p.manufacturers3_id = m3.manufacturers3_id AND p.manufacturers4_id = m4.manufacturers4_id AND p.manufacturers5_id = m5.manufacturers5_id and (m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' OR m2.manufacturers2_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' OR m3.manufacturers3_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' OR m4.manufacturers4_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' OR m5.manufacturers5_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "')"; and the sql request to be clarified: SELECT DISTINCT m.manufacturers_name, p.products_image, pd.products_name, p.products_id, p.manufacturers_id, p.manufacturers2_id, p.products_price, p.products_tax_class_id, IF ( s.status, s.specials_new_products_price, NULL ) AS specials_new_products_price, IF ( s.status, s.specials_new_products_price, p.products_price ) AS final_price FROM products p, products_description pd, manufacturers m, manufacturers2 m2, manufacturers3 m3, manufacturers4 m4, manufacturers5 m5 LEFT JOIN specials s ON p.products_id = s.products_id WHERE p.products_status = '1' AND pd.products_id = p.products_id AND pd.language_id = '2' AND p.manufacturers_id = m.manufacturers_id AND p.manufacturers2_id = m2.manufacturers2_id AND p.manufacturers2_id = m3.manufacturers3_id AND p.manufacturers2_id = m4.manufacturers4_id AND p.manufacturers2_id = m5.manufacturers5_id AND ( m.manufacturers_id = '22' OR m2.manufacturers2_id = '22' OR m3.manufacturers3_id = '22' OR m4.manufacturers4_id = '22' OR m5.manufacturers5_id = '22' ) ORDER BY pd.products_name LIMIT 0 , 30 Thanks for debugging Has anyone else successfully added a '2nd manufacturer'??? I really really really need some help, I'm about ready to give up... I have the 2nd manufacturer installed, it works in every instance (in the advanced search, in the standard manufacturer drop down box etc) BUT NOT IN THE FILTERS. By this, I mean when you look in a particular category (for example dvds) and you filter it by the manufacturer (eg 'warner'). I'm trying to set it up so that you can filter by a 2nd manufacturer (eg 'fox') as well. I'm really really struggling, I know it's on the index.php page that stuff needs to be changed, but I'm just going around in circles. Has anyone every successfully done this? please help me out if you can!!! ~bobsi18~ Quote Link to comment Share on other sites More sharing options...
bobsi18 Posted June 3, 2006 Share Posted June 3, 2006 Has anyone else successfully added a '2nd manufacturer'??? I really really really need some help, I'm about ready to give up... I have the 2nd manufacturer installed, it works in every instance (in the advanced search, in the standard manufacturer drop down box etc) BUT NOT IN THE FILTERS. By this, I mean when you look in a particular category (for example dvds) and you filter it by the manufacturer (eg 'warner'). I'm trying to set it up so that you can filter by a 2nd manufacturer (eg 'fox') as well. I'm really really struggling, I know it's on the index.php page that stuff needs to be changed, but I'm just going around in circles. Has anyone every successfully done this? please help me out if you can!!! ~bobsi18~ The code I used to get the filter semi-working on the category pages (I'm yet to get it working on the 1st and 2nd manufacturers pages)... From index.php ('manufacturer2' is my second manufacturer) // optional Product List Filter if (PRODUCT_LIST_FILTER > 0) { if (isset($HTTP_GET_VARS['manufacturers_id'])) { $filterlist_sql = "select distinct c.categories_id as id, cd.categories_name as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where p.products_status = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and p2c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' order by cd.categories_name"; } else { $filterlist_sql= "select distinct m.manufacturers_id as id, m.manufacturers_name as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_MANUFACTURERS . " m where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and p.products_id = p2c.products_id and p2c.categories_id = '" . (int)$current_category_id . "' order by m.manufacturers_name"; } $m2filterlist_sql= "select distinct m2.manufacturer2_id as id, m2.manufacturer2_name as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_MANUFACTURER2 . " m2 where p.products_status = '1' and p.manufacturer2_id = m2.manufacturer2_id and p.products_id = p2c.products_id and p2c.categories_id = '" . (int)$current_category_id . "' order by m2.manufacturer2_name"; $filterlist_query = tep_db_query($filterlist_sql); $m2filterlist_query = tep_db_query($m2filterlist_sql); if (tep_db_num_rows($filterlist_query) > 1) { echo ' <td align="center" class="main">' . tep_draw_form('filter', FILENAME_DEFAULT, 'get') . TEXT_SHOW . ' '; if (isset($HTTP_GET_VARS['manufacturers_id'])) { echo tep_draw_hidden_field('manufacturers_id', $HTTP_GET_VARS['manufacturers_id']); $options = array(array('id' => '', 'text' => TEXT_ALL_CATEGORIES)); } else { echo tep_draw_hidden_field('cPath', $cPath); $options = array(array('id' => '', 'text' => TEXT_ALL_MANUFACTURERS)); } $options2 = array(array('id' => '', 'text' => TEXT_ALL_MANUFACTURER2)); echo tep_draw_hidden_field('sort', $HTTP_GET_VARS['sort']); while ($filterlist = tep_db_fetch_array($filterlist_query)) { $options[] = array('id' => $filterlist['id'], 'text' => $filterlist['name']); } while ($m2filterlist = tep_db_fetch_array($m2filterlist_query)) { $options2[] = array('id' => $m2filterlist['id'], 'text' => $m2filterlist['name']); } echo tep_draw_pull_down_menu('filter_id', $options, (isset($HTTP_GET_VARS['filter_id']) ? $HTTP_GET_VARS['filter_id'] : ''), 'onchange="this.form.submit()"'); echo tep_draw_pull_down_menu('m2filter_id', $options2, (isset($HTTP_GET_VARS['m2filter_id']) ? $HTTP_GET_VARS['m2filter_id'] : ''), 'onchange="this.form.submit()"'); echo '</form></td>' . "\n"; } } 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.
Note: Your post will require moderator approval before it will be visible.