Skip to content

Commit

Permalink
Issue Fixed[bagisto#7104]
Browse files Browse the repository at this point in the history
  • Loading branch information
papnoisanjeev committed Nov 21, 2022
1 parent a202f6e commit dfc045f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/Webkul/Product/src/Helpers/Indexers/Flat.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,15 @@ public function updateOrCreate($product, $parentProduct = null)
}
} else {
if (request()->route()?->getName() == 'admin.catalog.products.update') {
$productFlat = $this->productFlatRepository->findOneWhere([
$productFlat = $this->productFlatRepository->findWhere([
'product_id' => $product->id,
'channel' => $channel->code,
]);

if ($productFlat) {
$this->productFlatRepository->delete($productFlat->id);
foreach ($productFlat as $productFlatByChannelLocale) {
$this->productFlatRepository->delete($productFlatByChannelLocale->id);
}
}
}
}
Expand Down

0 comments on commit dfc045f

Please sign in to comment.