I can set the website ids against a product by adding 'websites' => array(1,2) to an array and saving the product. The problem is this overwrites all websites so if I only want to add a product to a website (without touching the rest) then I need to know which websites the product is associated with.

I tried $product->getWebsites() but websites isn't in the _data var of the product object so returns null.

1 Answer 1


should get you what you need.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.