Quick Easy SQL Script Needed to Convert ProductVariant DisplayOrder to CatMapping DisplayOrder

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 years ago
I am presently in the process of upgrading our site from 1.6 to 2.3, previously we were using the ProductVariant DisplayOrder but now we want to use the CatMapping display order since it is easier to administer in the admin screens.

I don't really want to have to do this manually since we have 820+ products!

Any help would be greatly appreciated...

Thanks.
D.
12 years ago
Never mind, I have figgured it out, in case anyone was interested, here is the script:

update  
Product_Category_Mapping
set Product_Category_Mapping.DisplayOrder = pv.DisplayOrder
from Product_Category_Mapping as pcm
inner join ProductVariant as pv
on pcm.ProductId = pv.ProductId

And here is how to verify it has done it (recommend you run it before the update and again after to check the difference)

select pcm.ProductId, pcm.CategoryId, pcm.DisplayOrder, pv.DisplayOrder
from Product_Category_Mapping as pcm
inner join ProductVariant as pv
on pcm.ProductId = pv.ProductId
where pcm.ProductId = pv.ProductId
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.