We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 04795a6 commit 2824ddcCopy full SHA for 2824ddc
app/code/Magento/Catalog/Model/ResourceModel/Product.php
@@ -315,8 +315,12 @@ public function delete($object)
315
*/
316
protected function _saveWebsiteIds($product)
317
{
318
- if (empty(array_diff($product->getWebsiteIds(), [0]))) {
319
- $product->setWebsiteIds([1]);
+// if (empty(array_diff($product->getWebsiteIds(), [0]))) {
+// $product->setWebsiteIds([1]);
320
+// }
321
+ if ($this->_storeManager->isSingleStoreMode()) {
322
+ $id = $this->_storeManager->getDefaultStoreView()->getWebsiteId();
323
+ $product->setWebsiteIds([$id]);
324
}
325
$websiteIds = $product->getWebsiteIds();
326
0 commit comments