Forums / Setting Up Categories, Products, Attributes / how do mass delete all products from one manufacturer?

how do mass delete all products from one manufacturer?

Views: 3,815

Results 1 to 19 of 19
14 Apr 2011, 8:57 PM
#1
alibaba99 avatar

alibaba99

New Zenner

Join Date:
Mar 2011
Location:
guernsey , uk
Posts:
39
Plugin Contributions:
0

how do mass delete all products from one manufacturer?

hi, not sure how to do this and i wanted to know if there is an easy way to have all products (which are spread across a range of my categories) from just one of my manufaturer, all delleted at the same time.

is it as simple as just deleing the manufacturer from the list?

any help please

mark

14 Apr 2011, 9:45 PM
#2
soniccc avatar

soniccc

Zen Follower

Join Date:
May 2010
Location:
Cyberspace
Posts:
387
Plugin Contributions:
0

Re: how do mass delete all products from one manufacturer?

I don't think it's actually possible to delete the way you described. If you don't want to delete manually you could try using easy populate (it'll take you some time to learn how to use it, but it'll be worth it).

http://www.zen-cart.com/forum/showthread.php?t=34970

/soniccc

14 Apr 2011, 11:17 PM
#3
alibaba99 avatar

alibaba99

New Zenner

Join Date:
Mar 2011
Location:
guernsey , uk
Posts:
39
Plugin Contributions:
0

Re: how do mass delete all products from one manufacturer?

thanks for reply. not surte where on that thread link to look for the answer as its 102 pages long.

I use easy populate to upload csv so i understand it a little, but how do i use it to manipulate deleting the producst all from one of the manufacturers?

14 Apr 2011, 11:26 PM
#4
alibaba99 avatar

alibaba99

New Zenner

Join Date:
Mar 2011
Location:
guernsey , uk
Posts:
39
Plugin Contributions:
0

Re: how do mass delete all products from one manufacturer?

I have ahd a thought? would this work.
download csv file of all products.
on excel, filter out the products wity only the manufature i want to delete.
add a dummy category for all the products to appear in.
upload all of these via csv file using easy populate, which should only update each product into the new category.
then perhaps, i can just delet ethat new category???

Would any of the old information still reside on the old categories, or linked to other categories?

would that work?

18 Apr 2011, 12:40 PM
#5
kamion avatar

kamion

New Zenner

Join Date:
Mar 2011
Posts:
93
Plugin Contributions:
0

Re: how do mass delete all products from one manufacturer?

You could try to fashion an SQL query that will delete it for you from the tables.

Is it just a general product type? Or have you got extra customised SQL tables for your products?

If it's just a general product type without extra SQL tables, then you can simply run this line (but change the "manufacturers_id" number 2 to match the one you want to delete):

DELETE FROM products WHERE manufacturers_id = '2';

You run this from the admin page Tools->Install SQL Patches.

Do make a backup of your SQL database before hand though!

Edit: Actually, that would leave the products_description entries.

18 Apr 2011, 1:19 PM
#6
ajeh avatar

ajeh

Oba-san

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

Re: how do mass delete all products from one manufacturer?

This would be a bad idea as there are many tables involved with Products ...
products
products_description
specials
featured
reviews
etc. etc. etc.

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!

18 Apr 2011, 1:25 PM
#7
kamion avatar

kamion

New Zenner

Join Date:
Mar 2011
Posts:
93
Plugin Contributions:
0

Re: how do mass delete all products from one manufacturer?

Ajeh, please remove my previous post. :) Thanks.

18 Apr 2011, 1:34 PM
#8
ajeh avatar

ajeh

Oba-san

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

Re: how do mass delete all products from one manufacturer?

Actually it is a good post to help people understand that there is more to a Product than just the products table and to not delete them in that manner or they will run into major issues ... :smile:

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!

22 Jan 2013, 2:46 PM
#9
kevin205 avatar

kevin205

Totally Zenned

Join Date:
Dec 2012
Posts:
607
Plugin Contributions:
0

Re: how do mass delete all products from one manufacturer?

So how do you mass delete old products? Do you really have to delete one at a time?

Furthermore, if you delete one by one, or possibly mass delete (let say 200 products); would the remaining record id's create a problem? When year after year you create newer and delete old products? Can the table be somehow compacted?:unsure:

Using Zen Cart 1.5.1

22 Jan 2013, 2:56 PM
#10
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: how do mass delete all products from one manufacturer?

Kevin205:

So how do you mass delete old products? Do you really have to delete one at a time?

Furthermore, if you delete one by one, or possibly mass delete (let say 200 products); would the remaining record id's create a problem? When year after year you create newer and delete old products? Can the table be somehow compacted?:unsure:
No need to "compact" anything... the ID is just an auto-increment and is a database's way of assigning a unique identifier to a record.

If you use Easy Populate, you will see a column called v_status.

There are THREE possible variables for this column:-

1 = Product is active and visible
0 = Product is inactive and hidden (such as when product is out of stock)
9 = Delete product

So if you create an Easy Populate spreadsheet of ONLY the products you want removed, and in the v_status column you put the digit - " 9 " against each product, then run that through easy populate - it will delete the products AND THEIR IMAGES...

If you want to keep the images, then make a backup off the server.

20 years a Zencart User

22 Jan 2013, 3:04 PM
#11
terragirl avatar

terragirl

Zen Follower

Join Date:
Jun 2010
Location:
Austria
Posts:
123
Plugin Contributions:
0

Re: how do mass delete all products from one manufacturer?

You can delete product via Easy Populate by setting the v_status to "9". Any product with 9 invokes the "ep_remove_product" function which in turn uses "zen_remove_product" which wipes the product from all relevant tables and will also delete the associated images from your images folder (/admin/includes/functions/general.php around line 1359). I think that's the easiest option.

The other alternative would be to write a PHP script that looks up all product IDs by manufacturer, loops through them & runs zen_remove_product on each ID. Basically always use zen_remove_product and you're fine.

Hope this helps.

PS oh schoolboy beat me to it by a few seconds :)

22 Jan 2013, 3:34 PM
#12
kevin205 avatar

kevin205

Totally Zenned

Join Date:
Dec 2012
Posts:
607
Plugin Contributions:
0

Re: how do mass delete all products from one manufacturer?

schoolboy:

No need to "compact" anything... the ID is just an auto-increment and is a database's way of assigning a unique identifier to a record.

If you use Easy Populate, you will see a column called v_status.

There are THREE possible variables for this column:-

1 = Product is active and visible
0 = Product is inactive and hidden (such as when product is out of stock)
9 = Delete product

So if you create an Easy Populate spreadsheet of ONLY the products you want removed, and in the v_status column you put the digit - " 9 " against each product, then run that through easy populate - it will delete the products AND THEIR IMAGES...

If you want to keep the images, then make a backup off the server.

terraGirl:

You can delete product via Easy Populate by setting the v_status to "9". Any product with 9 invokes the "ep_remove_product" function which in turn uses "zen_remove_product" which wipes the product from all relevant tables and will also delete the associated images from your images folder (/admin/includes/functions/general.php around line 1359). I think that's the easiest option.

The other alternative would be to write a PHP script that looks up all product IDs by manufacturer, loops through them & runs zen_remove_product on each ID. Basically always use zen_remove_product and you're fine.

Hope this helps.

PS oh schoolboy beat me to it by a few seconds :):smile:

WOW, that's pretty cool, great. Thank you.

Using Zen Cart 1.5.1

22 Jan 2013, 3:46 PM
#13
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: how do mass delete all products from one manufacturer?

If you have not installed Easy Populate, you will need EP version 4. The earlier versions are not compatible with ZC 1.5.x

20 years a Zencart User

22 Jan 2013, 3:51 PM
#14
kevin205 avatar

kevin205

Totally Zenned

Join Date:
Dec 2012
Posts:
607
Plugin Contributions:
0

Re: how do mass delete all products from one manufacturer?

I installed "EP version 4" last night, and it's amazing. Thanks again. Cheers.

Using Zen Cart 1.5.1

22 Jan 2013, 4:10 PM
#15
ajeh avatar

ajeh

Oba-san

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

Re: how do mass delete all products from one manufacturer?

NOTE: another way to delete all Products of a Manufacturer is to delete the manufacturer ...

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!

22 Jan 2013, 4:28 PM
#16
kevin205 avatar

kevin205

Totally Zenned

Join Date:
Dec 2012
Posts:
607
Plugin Contributions:
0

Re: how do mass delete all products from one manufacturer?

Ajeh:

NOTE: another way to delete all Products of a Manufacturer is to delete the manufacturer ...

This is done through "EP version 4" or admin?

And by deleting the manufacturer, all products from that manufacturer would get deleted? Thanks Linda.

Using Zen Cart 1.5.1

22 Jan 2013, 4:39 PM
#17
ajeh avatar

ajeh

Oba-san

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

Re: how do mass delete all products from one manufacturer?

Deleting the Manufacture is don in your Zen Cart Admin in the ... Catalog ... Manufacturers ... when you try to delete the Manufacturer it will ask if you want to delete all products ...

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!

16 Feb 2013, 5:15 PM
#18
kevin205 avatar

kevin205

Totally Zenned

Join Date:
Dec 2012
Posts:
607
Plugin Contributions:
0

Re: how do mass delete all products from one manufacturer?

haw many tables are effected by adding a product to the cart?

Using Zen Cart 1.5.1

17 Feb 2013, 8:36 AM
#19
simon1066 avatar

simon1066

Totally Zenned

Join Date:
Feb 2009
Location:
UK
Posts:
1,326
Plugin Contributions:
0

Re: how do mass delete all products from one manufacturer?

The way I mass delete is to use Ajeh's great 'Multi-Product Copy Utility'

You can mass select products by manufacturer, price, search terms ...

Move them to a temp category

Then delete that category

Simple!

Simon