# sync-basalam/1.10.19/includes/Actions/Controller/RefreshVendorStatus.php

ووسلام – همگام سازی ووکامرس و باسلام, version 1.10.19. 30 lines.

- Page: https://pluginprobe.com/plugins/sync-basalam/1.10.19/code/includes/Actions/Controller/RefreshVendorStatus.php
- Raw: https://pluginprobe.com/plugins/sync-basalam/1.10.19/raw/includes/Actions/Controller/RefreshVendorStatus.php
- Modified: 2026-09-17T09:40:56+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/sync-basalam/1.10.19/code/includes/Actions/Controller/RefreshVendorStatus.php#L10-L20`.

```php
<?php

namespace SyncBasalam\Actions\Controller;

use SyncBasalam\Services\VendorSyncPolicy;

defined('ABSPATH') || exit;

class RefreshVendorStatus extends ActionController
{
    public function __invoke()
    {
        $vendorSyncPolicy = syncBasalamContainer()->get(VendorSyncPolicy::class);
        $vendorSyncPolicy->refresh();
        $state = $vendorSyncPolicy->getFrontendState(false);

        if ($state['mode'] === VendorSyncPolicy::MODE_ACTIVE) {
            wp_send_json_success([
                'message' => 'غرفه شما فعال است و محدودیت‌های همگام‌سازی برداشته شد.',
                'state'   => $state,
            ]);
        }

        wp_send_json_success([
            'message' => 'غرفه شما هنوز در باسلام غیرفعال است.',
            'state'   => $state,
        ]);
    }
}

```
