Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Remove Unused Manufacturers

Remove Unused Manufacturers

Locked

Views: 1,269

Results 1 to 8 of 8
This thread is locked. New replies are disabled.
12 Nov 2007, 10:05 PM
#1
benn600 avatar

benn600

Zen Follower

Join Date:
Nov 2007
Posts:
124
Plugin Contributions:
0

Remove Unused Manufacturers

I'm using this:

SELECT * FROM manufacturers LEFT JOIN products ON manufacturers.manufacturers_id = products.manufacturers_id WHERE products.manufacturers_id IS NULL

How can I delete the records returned?

Photography Equipment at Unbelievable Prices!!
http://www.thriftydigitalcamera.com/

28 Jan 2008, 11:17 PM
#2
lou avatar

lou

New Zenner

Join Date:
Dec 2007
Posts:
21
Plugin Contributions:
0

Re: Remove Unused Manufacturers

What about ONLY retrieving those you want?

I'm using the manufacturerestabmod from here and have changed the query in manufacturers_tabs.php from

$manufacturers_tab_query = "select m.manufacturers_id, m.manufacturers_name from " .TABLE_MANUFACTURERS . " m, " . TABLE_MANUFACTURERS_INFO . " md where m.manufacturers_id=md.manufacturers_id and md.languages_id=" . (int)$_SESSION['languages_id']. $order_by;

to

$manufacturers_tab_query = 
"select distinct m.manufacturers_id, m.manufacturers_name 
from " .TABLE_MANUFACTURERS . " m, " .TABLE_PRODUCTS . " p, " . TABLE_MANUFACTURERS_INFO . " md 
where m.manufacturers_id=md.manufacturers_id 
and p.manufacturers_id=m.manufacturers_id
and md.languages_id=" . (int)$_SESSION['languages_id']. $order_by;

I haven't thoroughly tested it yet but it seems to be working fine so far.

28 Jan 2008, 11:34 PM
#3
solarflare avatar

solarflare

Zen Follower

Join Date:
Sep 2006
Posts:
81
Plugin Contributions:
0

Re: Remove Unused Manufacturers

You know there's an admin option to only display Manufacturers with (active) products right?

Personalized candy favors and gifts: http://www.westcoastfavors.com

The Sea Crew: http://www.theseacrew.com/shop/

28 Jan 2008, 11:35 PM
#4
benn600 avatar

benn600

Zen Follower

Join Date:
Nov 2007
Posts:
124
Plugin Contributions:
0

Re: Remove Unused Manufacturers

Yes but it is VERY slow with hundreds of manufacturers and several thousand products. I think we're in better shape now.

Photography Equipment at Unbelievable Prices!!
http://www.thriftydigitalcamera.com/

29 Jan 2008, 1:44 AM
#5
lou avatar

lou

New Zenner

Join Date:
Dec 2007
Posts:
21
Plugin Contributions:
0

Re: Remove Unused Manufacturers

solarflare:

You know there's an admin option to only display Manufacturers with (active) products right?

I thought I'd seen it somewhere but I cannot find it again.........

29 Jan 2008, 1:55 AM
#6
solarflare avatar

solarflare

Zen Follower

Join Date:
Sep 2006
Posts:
81
Plugin Contributions:
0

Re: Remove Unused Manufacturers

Configuration->Maximum Values->Manufacturers List - Verify Product Exist

Lou:

I thought I'd seen it somewhere but I cannot find it again.........

Personalized candy favors and gifts: http://www.westcoastfavors.com

The Sea Crew: http://www.theseacrew.com/shop/

29 Jan 2008, 2:20 AM
#7
lou avatar

lou

New Zenner

Join Date:
Dec 2007
Posts:
21
Plugin Contributions:
0

Re: Remove Unused Manufacturers

Thanks, doesn't work for me because I'm using the manufacturerestabmod but it's good to know!

7 Jan 2010, 11:36 AM
#8
orange_juice avatar

orange_juice

Zen Follower

Join Date:
Apr 2009
Location:
Athens, Europe
Posts:
125
Plugin Contributions:
0

Re: Remove Unused Manufacturers

Hallo, happy new year!

benn600:

I'm using this:

How can I delete the records returned?

Did you find an answer?

http://www.dodeca.eu/
Zen Cart is simply Jamming