fix ehraz

This commit is contained in:
2026-07-16 11:36:57 +03:30
parent d5168dadb2
commit 41c2a20fd0
7 changed files with 82 additions and 10 deletions
@@ -55,6 +55,10 @@ class SingleOrderController extends Controller
$data['first_buy'] = auth('customer')->id() && $customer && $customer->first_buy_order !== 1;
if (auth('customer')->id()) {
if (!$customer || !$customer->trade_active) {
throw new UnprocessableEntityHttpException('امکان سفارش برای شما غیرفعال است.');
}
$data['customer_id'] = auth('customer')->id();
$orderProductId = (int) ($data['abshode_id'] ?? $data['product_id'] ?? $config->mainProductId() ?? 0);