659 users online

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

Posted: 3 months ago Quote
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.
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: 3 months ago Quote
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 post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)