Moshe, or anyone else that might know how to do this..
I’d like to add the same 3-4 products as CROSS-SELLS to all other products in the DB. But rather doing it one by one through the Admin UI, isn’t this possible to do via the DB? Could I make a custom statement that will insert the ID of the products into the cross-sell column? I’ll try to figure out the SQL syntax, but ANY help would be greatly appreciated.
Hm.. actually it looks like i’m being stuck in previous incarnation of the structure.
It is not that hard as long as you have product entity_ids.
In catalog_product_link add records with these values:
insert into (product_id, linked_product_id, link_type_id) values (@main_product_id, @cross_sell_product_id, 5);
where 5 is id for cross_sell type which is in catalog_product_link_type.
You could add optional position sort order in catalog_product_link_attribute_int, get IDs from catalog_product_link and catalog_product_link_attribute.
This should produce a little list of products where you added x-sell/related/up-sell item x on an ad-hoc basis:
SELECT *
FROM catalog_product_link where linked_product_id=x and link_type_id=y
GROUP BY product_id, linked_product_id, link_type_id
HAVING ( COUNT(product_id) > 1 )