I saw This link and I want to do the same thing in magento 2. I want to associate all products to some list of websites.
1 Answer
I think I found the solution there is a method in Magento\Catalog\Model\Product
named updateWebsites($productIds, $websiteIds, 'add');