Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

SHOW MANUFACTURERS ACCORDING TO CATEGORIES


sandesh583

Recommended Posts

Hi I would like to show all the manufacturers based on Catergories in a Drop Down Box.

 

for ex:

 

Suplements Brands :

 

Body Building ->>>> this is the category

> ASN ->>>> manufacturers

> AST

> Black Widow

Muscle Gain ->>>> this is the category

> Lady Bird ->>>> manufacturers

> Red BaK

 

 

this is the code I am trying in Manufacturer infoBox, It returns Duplicate Manufacturers and if i select multiple categories it shows drop down box for each category

 

 

 

 

*/

?>

<!-- Manufacturer_in_category_infobox Box //-->

<tr>

<td class="boxText">

<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">

 

<?php

echo ' <div align="right" class="" style="padding:10px 20px 10px 0px;">' . tep_draw_form('filter', 'mainpage.php', 'get') . TEXT_SHOW . ' ';

 

 

$manufacturers_query_raw = "SELECT DISTINCT categories_description.categories_name,categories_description.categories_id FROM categories Inner Join categories_description ON categories.categories_id = categories_description.categories_id WHERE categories_description.language_id = '1' and categories.parent_id='36'"; //categories.category_id='19' and categories.category_id='32'

$manufacturers_query = tep_db_query($manufacturers_query_raw);

 

while ($manufacturers = tep_db_fetch_array($manufacturers_query)) {

echo '<tr><td width="100%" class="boxText"><b>';

$categories_ids=$manufacturers['categories_id'];

echo '<a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath=' . $categories_ids) . '">';

echo $manufacturers['categories_name'];

echo '</a>';

echo '</b></td></tr>';

 

 

 

 

$categories_query_raw="SELECT DISTINCT manufacturers.manufacturers_name AS manufacturer_name, manufacturers.manufacturers_id AS manufacturer_id FROM products Inner Join manufacturers ON manufacturers.manufacturers_id = products.manufacturers_id Inner Join products_to_categories ON products_to_categories.products_id = products.products_id Inner Join categories_description ON products_to_categories.categories_id = categories_description.categories_id WHERE products_to_categories.categories_id ='" . $categories_ids . "'" ;

 

$categories_query = tep_db_query($categories_query_raw);

 

//echo '<tr><td width="100%" class="boxText">   ';

 

 

//echo tep_draw_text_field('cPath',);

 

//echo tep_draw_input_field('cPath', $categories_ids);

//$options = array(array('id' => '', 'text' => 'All Brands'));

// }

 

while ($categories1 = tep_db_fetch_array($categories_query))

 

{

//while ($filterlist = tep_db_fetch_array($filterlist_query)) {sssssssssssssssssssssss

$manufacturers_id= $categories1['manufacturer_id'];

 

$cat = array_unique($categories1['manufacturer_name']);

 

$options[] = array('id' => $manufacturers_id, 'text' => $cat);

 

} }

 

//$options = array_unique($options);

 

echo tep_draw_pull_down_menu('filter_id', $options, (isset($HTTP_GET_VARS['filter_id']) ? $HTTP_GET_VARS['filter_id'] : '2'), 'onchange="this.form.submit()"');

echo tep_draw_hidden_field('sort', $HTTP_GET_VARS['sort']);

 

 

 

 

 

echo tep_hide_session_id() . '</form></div>' . "\n";

echo tep_draw_side_bottom();

 

 

 

//echo '<a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath=' . $cpath . $categories_ids) . '&filter_id='.$manufacturers_id.'">';

//echo $categories1['manufacturer_name'];

//echo '</td></tr>';

 

 

 

?>

 

 

 

</table>

</td></tr>

<!-- Manufacturer_in_category_infobox_eof //-->

 

 

 

 

 

Help me!

 

thanks!

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...