Forums / Setting Up Categories, Products, Attributes / Need Products by Manufacturer AND by Category

Need Products by Manufacturer AND by Category

Views: 2,901

Results 1 to 16 of 16
20 Feb 2010, 3:37 PM
#1
souljagod avatar

souljagod

New Zenner

Join Date:
Jan 2010
Posts:
17
Plugin Contributions:
0

Need Products by Manufacturer AND by Category

I enabled my Manufacturer filter/dropdown but when I use it, while inside a category, it just displays all products of that manufacturer.

Is it possible to simply filter the product listing of the current category that are also part of that manufacturer?

If I am in Hockey Sticks category, I then select CCM as the manufacturer, it shows me the gloves and other equipment not part of the Hockey Sticks category :)

Any help would be appreciated.

D

20 Feb 2010, 5:03 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Need Products by Manufacturer AND by Category

By default, when looking at a Category with mixed Manufacturers you get the dropdown for Manufacturers ...

If you pick a Manufacturer then only the Products in that Category for that Manufacturer show ...

Do you use Linked Products?

Do you import your Products?

Are you using SEO/rewrites of some sort?

If you switch to the Classic Template does this still happen?

Is there an URL that we could perhaps peek at for this? :unsure:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

20 Feb 2010, 10:50 PM
#4
souljagod avatar

souljagod

New Zenner

Join Date:
Jan 2010
Posts:
17
Plugin Contributions:
0

Re: Need Products by Manufacturer AND by Category

Ajeh:

By default, when looking at a Category with mixed Manufacturers you get the dropdown for Manufacturers ...

If you pick a Manufacturer then only the Products in that Category for that Manufacturer show ...

Do you use Linked Products?

Do you import your Products?

Are you using SEO/rewrites of some sort?

If you switch to the Classic Template does this still happen?

Is there an URL that we could perhaps peek at for this? :unsure:

I'm not sure about linked products, I don't use the manufacturer sidebox on the right-side, I actually use it inside my tpl_index_product_list.php

The site is live but the DNS is not setup, if you would kindly add to you host file 173.201.96.128 prohockeylife.com

you will be able to access the site and see it

you can click on any category - all listing pages I show a brand dropdown which is the manufacturers -

You can see the bread crumb goes from home -> CATEGORY to home -> MANUFACTURER, instead of home -> CATEGORY -> Manufacturer, for instance.

D

21 Feb 2010, 12:30 AM
#5
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Need Products by Manufacturer AND by Category

Sorry I think I am stuck on your old site ...

I will have to try later ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

21 Feb 2010, 1:50 AM
#6
souljagod avatar

souljagod

New Zenner

Join Date:
Jan 2010
Posts:
17
Plugin Contributions:
0

Re: Need Products by Manufacturer AND by Category

Ajeh:

Sorry I think I am stuck on your old site ...

I will have to try later ...

If you updated your hostfile,

simply use http://prohockeylife.com without the 'www'

should work

D

21 Feb 2010, 2:52 AM
#7
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Need Products by Manufacturer AND by Category

Sorry ... mine isn't cooperating tonight and too much running things to reset ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

21 Feb 2010, 4:06 PM
#8
souljagod avatar

souljagod

New Zenner

Join Date:
Jan 2010
Posts:
17
Plugin Contributions:
0

Re: Need Products by Manufacturer AND by Category

Ajeh:

Sorry ... mine isn't cooperating tonight and too much running things to reset ...

No problem

So you're saying by default, zencart 1.3.8's manufacturer sidebox should filter from within the category im in?

21 Feb 2010, 5:21 PM
#9
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Need Products by Manufacturer AND by Category

Yes, it should already be doing that filtering for you within the Category that you are looking at in the Listing ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

23 Feb 2010, 6:51 PM
#10
souljagod avatar

souljagod

New Zenner

Join Date:
Jan 2010
Posts:
17
Plugin Contributions:
0

Re: Need Products by Manufacturer AND by Category

Ajeh:

Yes, it should already be doing that filtering for you within the Category that you are looking at in the Listing ...

I just installed a fresh copy locally, created a few test categories/products,

and then enabled the manufacturer sidebox to the left.

After picking a manufacturer, it just brings me to a page that shows all products in that manufacturer, it doesn't keep the category im in.

Am I not seeing something?

23 Feb 2010, 7:06 PM
#11
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Need Products by Manufacturer AND by Category

The SIDEBOX shows All Products for a Manufacturer ...

If you pick a Category, with multiple Manufacturers ... in the MIDDLE of the page will be a dropdown for the manufacturers ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

23 Feb 2010, 7:12 PM
#12
souljagod avatar

souljagod

New Zenner

Join Date:
Jan 2010
Posts:
17
Plugin Contributions:
0

Re: Need Products by Manufacturer AND by Category

Ajeh:

Yes, it should already be doing that filtering for you within the Category that you are looking at in the Listing ...

I just installed a fresh copy locally, created a few test categories/products,

and then enabled the manufacturer sidebox to the left.

After picking a manufacturer, it just brings me to a page that shows all products in that manufacturer, it doesn't keep the category im in.

Am I not seeing something?

23 Feb 2010, 7:56 PM
#13
souljagod avatar

souljagod

New Zenner

Join Date:
Jan 2010
Posts:
17
Plugin Contributions:
0

Re: Need Products by Manufacturer AND by Category

Ajeh:

The SIDEBOX shows All Products for a Manufacturer ...

If you pick a Category, with multiple Manufacturers ... in the MIDDLE of the page will be a dropdown for the manufacturers ...

Oh! That's the code I need then, because I added the manufacturer dropdown manually in the middle of my product listing, but I re-used the logic found on the sidebox.

23 Feb 2010, 9:24 PM
#14
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Need Products by Manufacturer AND by Category

The code is already in the original ... if your template has deleted or commented it out, then switch to Classic Template to see if it is working correctly ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

23 Feb 2010, 9:43 PM
#15
souljagod avatar

souljagod

New Zenner

Join Date:
Jan 2010
Posts:
17
Plugin Contributions:
0

Re: Need Products by Manufacturer AND by Category

Ajeh:

The code is already in the original ... if your template has deleted or commented it out, then switch to Classic Template to see if it is working correctly ...

Perfect. You are right, I grabbed the dropdown from classic and it works amazing - I dumped in the tpl_index_product_list.

However, I also modified tpl_index_categories recently, to show products instead of subcategories [if any]

I was unable to bring the dropdownlist there. Would you know why?

Where can I look to investigate this manner.

The only difference, unless I'm wrong, between my tpl_index_product_list and tpl_index_categories is that for the latter, I check for the querystring "cPath" and modified the listing_sql to display products from all the subcategories of that parent category.

D

23 Feb 2010, 10:06 PM
#16
souljagod avatar

souljagod

New Zenner

Join Date:
Jan 2010
Posts:
17
Plugin Contributions:
0

Re: Need Products by Manufacturer AND by Category

SouljaGoD:

Perfect. You are right, I grabbed the dropdown from classic and it works amazing - I dumped in the tpl_index_product_list.

However, I also modified tpl_index_categories recently, to show products instead of subcategories [if any]

I was unable to bring the dropdownlist there. Would you know why?

Where can I look to investigate this manner.

The only difference, unless I'm wrong, between my tpl_index_product_list and tpl_index_categories is that for the latter, I check for the querystring "cPath" and modified the listing_sql to display products from all the subcategories of that parent category.

D

To clarify, $do_filter_list is not set within tpl_index_categories, but fine within tpl_index_product_list

if ($do_filter_list) {
echo zen_draw_pull_down_menu('filter_id', $options, (isset($_GET['filter_id']) ? $_GET['filter_id'] : ''), 'onchange="this.form.submit()"');
}

I just found out in the default_filter,

$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";

The reason I don't see a dropdown for manufacturers is because the above query results to 0 records.

It is because of and p2c.categories_id = '" . (int)$current_category_id . "'

$current_category_id is not associated to any products, it has a subcategory, and that subcategory is the one with products that have a manufacturer_id

How could I modify this query? Do I need to check if that $current_category_id contains subcategories, and find the list of category IDs and then execute the query for all those category IDs?

Ouch..