Skip to content
This repository has been archived by the owner on Oct 19, 2022. It is now read-only.

Commit

Permalink
Merge pull request #266 from ah-net/patch-1
Browse files Browse the repository at this point in the history
Check if product is set
  • Loading branch information
Hnto authored Aug 31, 2022
2 parents 3003121 + 1a4e99d commit 4241285
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Model/Autocomplete/DataProviderHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,12 @@ public function getProductItems(AutocompleteProductResponseInterface $response)
$result = [];
foreach ($response->getProductData() as $item) {
$product = $productCollection->getItemById($item['id']);
$product->setData('tweakwise_price', $item['tweakwise_price']);

if (!$product) {
continue;
}

$product->setData('tweakwise_price', $item['tweakwise_price']);

$result[] = $this->productItemFactory->create(['product' => $product]);
}
Expand Down

0 comments on commit 4241285

Please sign in to comment.