Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

manufacturers dropdown for all products in selected category and subcategory


krugeros

Recommended Posts

Hi there,

 

I’m looking the solution to below problem concerning manufacturers dropdown in product listing after selecting category or subcategory.

 

 

Let’s say that category tree is like this:

 

Angels

----> Figures

---> small Figures

--> big Figures

----> Cards

 

Problem description:

 

If I select category “small Figures” manufacturer box appears above product list :

 

__________________________________________

 

Show: All manufacturers

 

Angels

--> Figures

-->
small Figures

--> big Figures

 

 

__________________________________________

 

 

and I can select all manufacturers from this category.

 

But when I move to higher category – Figures ( this category has no products – only subcategories ) I can not choose manufacturer because box manufacturers is not showing.

 

I use Show All Products in Category & Subcategories V1.0 link contribution – that means if I select Angels category I see all products from subcategries listed as in product listing. But unfortunately I’m not able to select manufacturers for all product from subcategories.

 

Just to summarise:

 

- I would like to be albe to select every manufacturer from dropdown that appears in every level of category tree for all products in that category and subcategories.

- make the box manufactuers apear in all categories ( this is in the code if (tep_db_num_rows($filterlist_query) > 1) presented above )

 

I’ve searched for contribution that is doing this but with no luck.

 

Anyone who knows how to solve it please help :rolleyes: I’m struggling with this for 2 days.

 

 

During my research I’ve found a code that’s responsible for showing this box in index.php:

 

// 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";
     }
     $filterlist_query = tep_db_query($filterlist_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));
       }
       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']);
       }
       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_hide_session_id() . '</form></td>' . "\n";
     }
   }

Link to comment
Share on other sites

  • 11 months later...
  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...