0

A product can be enabled in several Magento websites. How can I get a list of these websites based on a product SKU?

Obviously, there is no $product->getWebsites().

Looks like this information is in the table catalog_product_website, but I'd prefer solving this without direct SQL.

mysql> select * from catalog_product_website;
+------------+------------+
| product_id | website_id |
+------------+------------+
|          1 |          3 |
|          2 |          3 |
|          3 |          3 |
|          1 |          4 |
|          2 |          4 |
2
  • 1
    Have you tried $product->getWebsiteIds() ? Commented Apr 7, 2017 at 6:53
  • Yeah, that seems to do the trick! Commented Apr 7, 2017 at 8:07

0

Your Answer

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

Browse other questions tagged or ask your own question.