Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove all cross-sell product links from Magento?

I want to remove all of the cross-sell product links from the store - we have around 22,000 links that was the result of an auto cross sell extension that I have since removed.

I imagine it has something to do with removing records from the table catalog_product_link?

Or is there a way to do this programmatically?

like image 971
Daniel Alexiuc Avatar asked Oct 18 '10 23:10

Daniel Alexiuc


2 Answers

You are right, removing records is the fastest way to do this. Start by looking at catalog_product_link_type and find the link_type_id for "cross_sell". It's usually "5" but there is no reason to take a chance.
Backup your database.
Delete all records from catalog_product_link with a matching link_type_id. An SQL like this should work:

DELETE FROM `catalog_product_link` WHERE `link_type_id` = 5;
like image 177
clockworkgeek Avatar answered Nov 03 '22 19:11

clockworkgeek


if you would rather not edit the database directly, you could use the free extension from TBT called Mass Product Relater. That will allow you to strip out product relationships from the Manage Products grid.

like image 20
Jonathan Day Avatar answered Nov 03 '22 21:11

Jonathan Day