Skip to content

Commit c48f833

Browse files
authored
Update ProductRepository.php
1 parent 17504bd commit c48f833

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

app/code/Magento/Catalog/Model/ProductRepository.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -280,8 +280,7 @@ public function __construct(
280280
*/
281281
public function get($sku, $editMode = false, $storeId = null, $forceReload = false)
282282
{
283-
$storeId = $storeId === null ? null : (int) $storeId;
284-
$cacheKey = $this->getCacheKey([$editMode, $storeId]);
283+
$cacheKey = $this->getCacheKey([$editMode, $storeId === null ? $storeId : (int) $storeId]);
285284
$cachedProduct = $this->getProductFromLocalCache($sku, $cacheKey);
286285
if ($cachedProduct === null || $forceReload) {
287286
$product = $this->productFactory->create();
@@ -296,7 +295,7 @@ public function get($sku, $editMode = false, $storeId = null, $forceReload = fal
296295
$product->setData('_edit_mode', true);
297296
}
298297
if ($storeId !== null) {
299-
$product->setData('store_id', $storeId);
298+
$product->setData('store_id', (int) $storeId);
300299
}
301300
$product->load($productId);
302301
$this->cacheProduct($cacheKey, $product);

0 commit comments

Comments
 (0)