Skip to content

Commit

Permalink
NEXT-2636 - Fix stock indexer when a product is a closeout and no min…
Browse files Browse the repository at this point in the history
… purchase is defined
  • Loading branch information
janbuecker committed Jul 11, 2019
1 parent ccc45b5 commit 4b39ec8
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -243,11 +243,11 @@ private function updateAvailableFlag(array $ids, Context $context): void
LEFT JOIN product parent
ON parent.id = product.parent_id AND parent.version_id = product.version_id
SET product.available = (
SET product.available = IFNULL((
IFNULL(product.is_closeout, parent.is_closeout) * product.available_stock
>=
IFNULL(product.is_closeout, parent.is_closeout) * IFNULL(product.min_purchase, parent.min_purchase)
)
), 0)
WHERE product.id IN (:ids)
AND product.version_id = :version
';
Expand Down

0 comments on commit 4b39ec8

Please sign in to comment.