Skip to content

Commit

Permalink
Merge pull request #11 from DanielRiezebos/bugfix/NoProductFix
Browse files Browse the repository at this point in the history
Returns result if no product is found
  • Loading branch information
avstudnitz authored Jan 25, 2019
2 parents 4782b65 + 4ab34a0 commit 7f89f79
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Plugin/ProductEavDataProviderPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ public function afterSetupAttributeMeta(Eav $subject, $result)
$storeViews = $this->getStores();
$product = $this->registry->registry('current_product');

if ($product->getId() === null) {
return $result;
}

foreach ($storeViews as $storeView) {
$productByStoreCode = $this->getProductInStoreView($product->getId(), $storeView->getId());
$currentScopeValueForCode = $value = $productByStoreCode->getData($attributeCode);
Expand Down

0 comments on commit 7f89f79

Please sign in to comment.