Related products via SQL code command

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
3 anni tempo fa
hi there
version 4.2
Is there some sql command we can use to add related products to a product in nopcommerce?
we would just group all related products within the category together
we have many thousands of products  so to log in and do this manually is not possible.
thanks for any advice !
3 anni tempo fa
RE: "...all related products within the category"
Yes, it can be done with SQL...
But I don't think there is any setting for "number of related products to show", so your product pages would show hundreds/thousands of related products (which would not perform very well).
3 anni tempo fa
thanks for answering. i only have around 10 products per category so i think it amy be ok.
any idea on the sql command i could use?
3 anni tempo fa
-- insert your related products
insert into relatedproduct(productid1,productid2, displayorder)
select a.id, b.id from product a inner join Product_Category_Mapping b on b.ProductId= a.id
where b.CategoryId = [yourcategoryid]

Kind regards,
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.