2

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.

10
$product->getWebsiteIds() 

should get you what you need.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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