Is there a way to swap cross-sells and up-sells easily?
-
12-12-2019 - |
Question
I'm the guy that does the data entry for our cross-sells and up-sells on our store page. Unfortunately, the marketing person would like all cross-sells and up-sells to be swapped. Is this possible? Failing that, is there a better way to gather product ID's for copy and paste purposes?
Solution
Up-sells and cross-sells relations are both kept in the same table: catalog_product_link
.
the only difference between the 2 relations it the link_type_id
column.
For up-sells the value is 4 and for cross-sells it is 5.
so you can swap them through a single query:
UPDATE
`catalog_product_link`
SET
`link_type_id` = 9 - `link_type_id`
WHERE
`link_type_id` IN (4,5)
But back up the table first.
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange