fix order

This commit is contained in:
2026-07-01 16:33:15 +03:30
parent 235b835100
commit bac13af702
2 changed files with 31 additions and 6 deletions
@@ -80,12 +80,8 @@ class SingleOrderController extends Controller
$data['all_price'] = $latestPrice;
$data['price'] = $basePrice;
$data['price_id'] = $latestPrice?->id;
$feeServiceCharge = Setting::where('key', 'fee_service_charge_percentage')->first();
if (! $feeServiceCharge) {
throw new UnprocessableEntityHttpException('تنظیمات کارمزد یافت نشد.');
}
$data['difference'] = (float) (Setting::where('key', 'fee_single')->value('value') ?? config('fee.single', 0));
$data['service_charge_percentage'] = (float) $feeServiceCharge->value;
$data['difference'] = $config->orderSpreadRial();
$data['service_charge_percentage'] = $config->orderServiceChargePercentage();
$fee_free = Setting::where('key', 'fee_free')->where('is_active', true)->value('value');