Skip to content

Commit a7a44d9

Browse files
committed
Fixed #4320: inventory batch update only refreshing stock cache for first purchasable
1 parent 154ad6f commit a7a44d9

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

src/services/Inventory.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -422,9 +422,8 @@ public function executeUpdateInventoryLevels(UpdateInventoryLevelCollection $upd
422422

423423
// TODO: Potentially move this to a job in the queue
424424
// Update all purchasables stock
425-
$purchasables = $updateInventoryLevels->getPurchasables();
426-
if ($purchasables) {
427-
Plugin::getInstance()->getPurchasables()->updateStoreStockCache($purchasables[0], true);
425+
foreach ($updateInventoryLevels->getPurchasables() as $purchasable) {
426+
Plugin::getInstance()->getPurchasables()->updateStoreStockCache($purchasable, true);
428427
}
429428

430429
// Trigger event for each successful update

0 commit comments

Comments
 (0)