Skip to content

Commit

Permalink
Don't expose negative stock values (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jade-GG authored Jan 21, 2025
1 parent 312b819 commit a9ba327
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Model/Resolver/Quote/Backorder.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value
return 0;
}

$difference = $cartItem->getQty() - $stockItem->getQty();
$difference = $cartItem->getQty() - max($stockItem->getQty(), 0);
if ($difference <= 0) {
return 0;
}
Expand Down

0 comments on commit a9ba327

Please sign in to comment.