update: add inventory limit

This commit is contained in:
tokumeikoi
2022-06-30 03:22:17 +08:00
parent aa65440556
commit e086586e8e
3 changed files with 8 additions and 2 deletions

View File

@ -85,6 +85,10 @@ class OrderController extends Controller
abort(500, __('Subscription plan does not exist'));
}
if ($plan->inventory_limit !== NULL && !$plan->inventory_limit) {
abort(500, __('Current product is sold out'));
}
if ($plan[$request->input('period')] === NULL) {
abort(500, __('This payment period cannot be purchased, please choose another period'));
}