feat(core): implement configuration-driven logic via SystemSetting

Integrate `SystemSetting` into core services to enable dynamic
configuration of business logic and update the WordPress order form
redirection to align with the new order approval workflow.

- Update `PaymentController`, `ShipmentObserver`, and `TrackingService`
  to utilize `SystemSetting` for runtime configuration.
- Modify `ifnex-order-form.js` to redirect users to the orders list
  instead of order details upon successful submission.
This commit is contained in:
Kazem Alghasi 2026-09-10 02:25:21 +03:30
parent d6e04d53fa
commit 2737e262d7
4 changed files with 5 additions and 2 deletions

View File

@ -760,9 +760,9 @@ jQuery(document).ready(function($) {
btn.prop('disabled', false).text('✅ تأیید و ثبت سفارش'); btn.prop('disabled', false).text('✅ تأیید و ثبت سفارش');
if (res.success) { if (res.success) {
var orderId = res.data.data.id || res.data.id; var orderId = res.data.data.id || res.data.id;
// با فلوی جدید، کاربر به صفحه جزئیات سفارش هدایت می‌شود // با فلوی جدید، کاربر به لیست سفارشات هدایت می‌شود
// (چون پرداخت فقط بعد از تأیید کارمند امکان‌پذیر است) // (چون پرداخت فقط بعد از تأیید کارمند امکان‌پذیر است)
window.location.href = ifnex_ajax.orders_url + '?tab=orders'; window.location.href = ifnex_ajax.orders_url;
} else { } else {
$('#ifnex-submit-error').text(res.data || 'خطا در ثبت سفارش').show(); $('#ifnex-submit-error').text(res.data || 'خطا در ثبت سفارش').show();
} }

View File

@ -7,6 +7,7 @@ use App\Enums\TransactionStatus;
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
use App\Models\Wallet; use App\Models\Wallet;
use App\Models\WalletTransaction; use App\Models\WalletTransaction;
use App\Models\SystemSetting;
use App\Services\WalletService; use App\Services\WalletService;
use App\Services\ZarinpalService; use App\Services\ZarinpalService;
use App\Services\MockZarinpalService; use App\Services\MockZarinpalService;

View File

@ -3,6 +3,7 @@
namespace App\Observers; namespace App\Observers;
use App\Models\Shipment; use App\Models\Shipment;
use App\Models\SystemSetting;
use App\Notifications\ShipmentUpdatedNotification; use App\Notifications\ShipmentUpdatedNotification;
use App\Notifications\ShipmentApprovedSms; use App\Notifications\ShipmentApprovedSms;
use App\Notifications\ShipmentRejectedSms; use App\Notifications\ShipmentRejectedSms;

View File

@ -4,6 +4,7 @@ namespace App\Services;
use App\Models\Shipment; use App\Models\Shipment;
use App\Models\ShipmentTrackingEvent; use App\Models\ShipmentTrackingEvent;
use App\Models\SystemSetting;
class TrackingService class TrackingService
{ {