Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions app/code/Magento/Catalog/Model/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,7 @@ public function getPrice()
* @see \Magento\Catalog\Model\Product\Visibility
*
* @return int
* @codeCoverageIgnoreStart
*/
public function getVisibility()
{
Expand Down Expand Up @@ -813,6 +814,9 @@ public function getStoreIds()
if (!$this->hasStoreIds()) {
$storeIds = [];
if ($websiteIds = $this->getWebsiteIds()) {
if ($this->_storeManager->isSingleStoreMode()) {
$websiteIds = array_keys($websiteIds);
}
foreach ($websiteIds as $websiteId) {
$websiteStores = $this->_storeManager->getWebsite($websiteId)->getStoreIds();
$storeIds = array_merge($storeIds, $websiteStores);
Expand Down Expand Up @@ -923,7 +927,7 @@ public function beforeSave()
*
* If value specified, it will be set.
*
* @param bool $value
* @param bool|null $value
* @return bool
*/
public function canAffectOptions($value = null)
Expand Down Expand Up @@ -1044,7 +1048,8 @@ public function reindex()
*
* Register indexing event before delete product
*
* @return \Magento\Catalog\Model\Product
* @return $this
* @throws \Magento\Framework\Exception\LocalizedException
*/
public function beforeDelete()
{
Expand Down Expand Up @@ -1718,8 +1723,6 @@ public function getIsSalable()
/**
* Check is a virtual product
*
* Data helper wrapper
*
* @return bool
*/
public function isVirtual()
Expand Down Expand Up @@ -2028,7 +2031,7 @@ public function getIsVirtual()
*
* @param string $code Option code
* @param mixed $value Value of the option
* @param int|Product $product Product ID
* @param int|Product|null $product Product ID
* @return $this
*/
public function addCustomOption($code, $value, $product = null)
Expand Down Expand Up @@ -2222,9 +2225,9 @@ public function getPreconfiguredValues()
}

/**
* Prepare product custom options.
* Prepare product custom options
*
* To be sure that all product custom options does not has ID and has product instance
* To be sure that all product custom options does not has ID and has product instance.
*
* @return \Magento\Catalog\Model\Product
*/
Expand Down Expand Up @@ -2581,10 +2584,11 @@ public function setExtensionAttributes(\Magento\Catalog\Api\Data\ProductExtensio
//@codeCoverageIgnoreEnd

/**
* Convert array to media gallery interface
* Convert Image to ProductAttributeMediaGalleryEntryInterface
*
* @param array $mediaGallery
* @return \Magento\Catalog\Api\Data\ProductAttributeMediaGalleryEntryInterface[]
* @throws \Magento\Framework\Exception\LocalizedException
*/
protected function convertToMediaGalleryInterface(array $mediaGallery)
{
Expand All @@ -2603,6 +2607,7 @@ protected function convertToMediaGalleryInterface(array $mediaGallery)
* Returns media gallery entries
*
* @return \Magento\Catalog\Api\Data\ProductAttributeMediaGalleryEntryInterface[]|null
* @throws \Magento\Framework\Exception\LocalizedException
*/
public function getMediaGalleryEntries()
{
Expand All @@ -2620,6 +2625,7 @@ public function getMediaGalleryEntries()
*
* @param ProductAttributeMediaGalleryEntryInterface[] $mediaGalleryEntries
* @return $this
* @throws \Magento\Framework\Exception\LocalizedException
*/
public function setMediaGalleryEntries(array $mediaGalleryEntries = null)
{
Expand Down