Skip to content

Commit

Permalink
Allow checkout of available components down to zero stock (fixes snip…
Browse files Browse the repository at this point in the history
  • Loading branch information
koelle25 committed Apr 17, 2023
1 parent 144a6f2 commit 0c16d97
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ public function store(Request $request, $componentId)

$max_to_checkout = $component->numRemaining();

// Make sure there is at least one available to checkout
if ($max_to_checkout <= $request->get('assigned_qty')) {
// Make sure there are at least the requested number of components available to checkout
if ($max_to_checkout < $request->get('assigned_qty')) {
return redirect()->back()->withInput()->with('error', trans('admin/components/message.checkout.unavailable', ['remaining' => $max_to_checkout, 'requested' => $request->get('assigned_qty')]));
}

Expand Down

0 comments on commit 0c16d97

Please sign in to comment.