Skip to content

Commit 442adc7

Browse files
authoredJun 17, 2016
Rename $websiteId to $scopeId
This is a definition of the "\Magento\CatalogInventory\Model\Spi\StockRegistryProviderInterface::getStockStatus" method: /** * @param int $productId * @param int $scopeId * @return \Magento\CatalogInventory\Api\Data\StockStatusInterface */ public function getStockStatus($productId, $scopeId); Wrong variable name was used for this data in the file Stock.php
1 parent 3561b66 commit 442adc7

File tree

1 file changed

+4
-4
lines changed
  • app/code/Magento/CatalogInventory/Helper

1 file changed

+4
-4
lines changed
 

‎app/code/Magento/CatalogInventory/Helper/Stock.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ public function __construct(
8282
public function assignStatusToProduct(Product $product, $status = null)
8383
{
8484
if ($status === null) {
85-
$websiteId = $this->getStockConfiguration()->getDefaultScopeId();
86-
$stockStatus = $this->stockRegistryProvider->getStockStatus($product->getId(), $websiteId);
85+
$scopeId = $this->getStockConfiguration()->getDefaultScopeId();
86+
$stockStatus = $this->stockRegistryProvider->getStockStatus($product->getId(), $scopeId);
8787
$status = $stockStatus->getStockStatus();
8888
}
8989
$product->setIsSalable($status);
@@ -98,10 +98,10 @@ public function assignStatusToProduct(Product $product, $status = null)
9898
*/
9999
public function addStockStatusToProducts(AbstractCollection $productCollection)
100100
{
101-
$websiteId = $this->getStockConfiguration()->getDefaultScopeId();
101+
$scopeId = $this->getStockConfiguration()->getDefaultScopeId();
102102
foreach ($productCollection as $product) {
103103
$productId = $product->getId();
104-
$stockStatus = $this->stockRegistryProvider->getStockStatus($productId, $websiteId);
104+
$stockStatus = $this->stockRegistryProvider->getStockStatus($productId, $scopeId);
105105
$status = $stockStatus->getStockStatus();
106106
$product->setIsSalable($status);
107107
}

0 commit comments

Comments
 (0)
Please sign in to comment.