Product relations are stored in the catalog_product_link
table, where upsells are distinguished with link_type_id=4
. You can look up the link types in catalog_product_link_type
:
mysql> select * from catalog_product_link_type;
+--------------+------------+
| link_type_id | code |
+--------------+------------+
| 1 | relation |
| 3 | super |
| 4 | up_sell |
| 5 | cross_sell |
+--------------+------------+
The linked product, i.e. the product in the upsell list is determined by linked_product_id
.
To list the products, join the tablt to product collection using this column.
To be more specific, I'm getting a list of products with a specific
attribute; I need to remove those products from the Up-Sells list
across all the products in the Database
But it's good that you were more specific because this is much simpler. I assume it is a one time thing, so you can do it right away in MySQL:
DELETE FROM catalog_product_link WHERE linked_product_id IN ( [LIST] );
[LIST]
can either be a comma separated list of product ids or a subquery in the form SELECT entity_id FROM catalog_product_entity [JOIN] [WHERE]
.