Plugin Directory

Changeset 3429516


Ignore:
Timestamp:
12/30/2025 09:37:40 AM (2 months ago)
Author:
hamsalam
Message:

1.7.4

Location:
sync-basalam
Files:
358 added
32 edited

Legend:

Unmodified
Added
Removed
  • sync-basalam/trunk/JobsRunner.php

    r3426342 r3429516  
    4848
    4949        foreach ($sortedJobTypes as $jobType => $jobExecutor) {
    50             if (!$this->jobExecutor->acquireLock($jobType, 0)) {
    51                 continue;
    52             }
    53 
     50            if (!$this->jobExecutor->acquireLock($jobType, 0)) continue;
    5451            try {
    5552                $lastRun = floatval(get_option($jobType . '_last_run', 0));
  • sync-basalam/trunk/assets/js/get-category.js

    r3426342 r3429516  
    2424          ) {
    2525            var attributesData = JSON.parse(res.data.attributes);
    26             if (attributesData.length && attributesData[0].attributes.length) {
     26            if (attributesData.data && attributesData.data.length && attributesData.data[0].attributes.length) {
    2727              html += `
    2828                <div class="basalam-attributes-header">ویژگی‌های دسته‌بندی:</div>
    2929                <div class="basalam-attributes-container">
    3030              `;
    31               attributesData[0].attributes.forEach(function (attr) {
     31              attributesData.data[0].attributes.forEach(function (attr) {
    3232                html += `
    3333                  <div class="basalam-copy-attr">
  • sync-basalam/trunk/includes/Admin/Components.php

    r3428129 r3429516  
    489489    public static function renderCheckOrdersButtonTraditional()
    490490    {
     491        $screen = get_current_screen();
     492
     493        // Only show on shop order list page when HPOS is not enabled
     494        if (!$screen || $screen->id !== 'edit-shop_order') {
     495            return;
     496        }
     497
     498        // Check if HPOS is enabled - skip if it is
     499        if (
     500            function_exists('woocommerce_custom_orders_table_usage_is_enabled') &&
     501            woocommerce_custom_orders_table_usage_is_enabled()
     502        ) {
     503            return;
     504        }
     505
     506        // Check post type to ensure we're on the shop order page
     507        if (!isset($_GET['post_type']) || $_GET['post_type'] !== 'shop_order') {
     508            return;
     509        }
     510
    491511    ?>
    492512        <div class="alignleft actions custom">
  • sync-basalam/trunk/includes/Admin/Product/Category/CategoryMapping.php

    r3426342 r3429516  
    6060    {
    6161        $apiService = new ApiServiceManager();
    62         $response = $apiService->sendGetRequest('https://core.basalam.com/v3/categories');
     62        $response = $apiService->sendGetRequest('https://openapi.basalam.com/v1/categories');
    6363
    6464        if (!$response || !isset($response['body'])) throw new \Exception('خطا در دریافت دسته‌بندی‌های باسلام');
  • sync-basalam/trunk/includes/Admin/Product/Data/Services/AttributeService.php

    r3426342 r3429516  
    157157            $responseBody = json_decode($response['body'], true);
    158158
    159             foreach ($responseBody as $group) {
     159            foreach ($responseBody['data'] as $group) {
    160160                foreach ($group['attributes'] as $attribute) {
    161161                    $attributes[] = [
  • sync-basalam/trunk/includes/Admin/Product/Data/Services/VariantService.php

    r3426342 r3429516  
    3939        if (!$price) return null;
    4040
    41         return [
     41        $basalamVariantId = get_post_meta($variationId, 'sync_basalam_variation_id', true);
     42
     43        $variantData = [
    4244            'primary_price' => $price,
    4345            'stock' => $this->getVariantStock($variation),
    4446            'properties' => $this->getVariantProperties($variation, $parentProduct),
    4547        ];
     48
     49        // Add Basalam variant ID if it exists
     50        if (!empty($basalamVariantId)) {
     51            $variantData['id'] = $basalamVariantId;
     52        }
     53
     54        return $variantData;
    4655    }
    4756
  • sync-basalam/trunk/includes/Admin/Product/Services/ProductQueryService.php

    r3426342 r3429516  
    3434                ON stock.post_id = p.ID
    3535                AND stock.meta_key = '_stock_status'
     36            LEFT JOIN {$metaTable} AS price
     37                ON price.post_id = p.ID
     38                AND price.meta_key = '_price'
    3639            WHERE p.post_type = 'product'
    3740            AND p.post_status = 'publish'
     
    3942            AND basalam.post_id IS NULL
    4043            AND p.ID > %d
     44            AND price.meta_value IS NOT NULL
     45            AND CAST(price.meta_value AS DECIMAL(10,2)) > 1000
    4146            {$stockCondition}
    4247            ORDER BY p.ID ASC
     
    6570                ON basalam.post_id = p.ID
    6671                AND basalam.meta_key = 'sync_basalam_product_id'
     72            LEFT JOIN {$metaTable} AS thumb
     73                ON thumb.post_id = p.ID
     74                AND thumb.meta_key = '_thumbnail_id'
     75            LEFT JOIN {$metaTable} AS price
     76                ON price.post_id = p.ID
     77                AND price.meta_key = '_price'
    6778            WHERE p.post_type = 'product'
    6879            AND p.post_status = 'publish'
    6980            AND p.ID > %d
     81            AND thumb.meta_value IS NOT NULL
     82            AND price.meta_value IS NOT NULL
     83            AND CAST(price.meta_value AS DECIMAL(10,2)) > 1000
    7084            ORDER BY p.ID ASC
    7185            LIMIT %d
  • sync-basalam/trunk/includes/Admin/Product/Services/ProductSyncService.php

    r3426342 r3429516  
    7070    }
    7171
    72     public function enqueueBulkUpdate(): array
    73     {
    74         $this->jobManager->createJob(
    75             self::JOB_TYPE_UPDATE_BULK,
    76             'pending',
    77             json_encode(['last_updatable_product_id' => 0])
    78         );
    79 
    80         return [
    81             'success'     => true,
    82             'message'     => 'محصولات با موفقیت به صف بروزرسانی فوری افزوده شدند.',
    83             'status_code' => 200,
    84         ];
    85     }
    86 
    8772    public function enqueueSelectedForUpdate(array $productIds): void
    8873    {
  • sync-basalam/trunk/includes/Jobs/Types/BulkUpdateProductsJob.php

    r3426342 r3429516  
    4444        if (!$productIds) {
    4545            Logger::info('بروزرسانی دسته‌ای: همه محصولات بروزرسانی شدند.');
     46            $this->jobManager->deleteJob(['job_type' => 'sync_basalam_bulk_update_products']);
    4647            return;
    4748        }
  • sync-basalam/trunk/includes/Migrations/MigrationManager.php

    r3426342 r3429516  
    1111use SyncBasalam\Migrations\Versions\Migration_1_5_4;
    1212use SyncBasalam\Migrations\Versions\Migration_1_6_2;
     13use SyncBasalam\Migrations\Versions\Migration_1_7_4;
    1314
    1415defined('ABSPATH') || exit;
     
    2930            '1.5.4' => new Migration_1_5_4(),
    3031            '1.6.2' => new Migration_1_6_2(),
     32            '1.7.4' => new Migration_1_7_4(),
    3133        ];
    3234    }
  • sync-basalam/trunk/includes/Plugin.php

    r3428129 r3429516  
    1010use SyncBasalam\Registrar\ProductRegistrar;
    1111use SyncBasalam\Registrar\QueueRegistrar;
     12use SyncBasalam\Services\FetchVersionDetail;
    1213
    1314defined('ABSPATH') || exit;
     
    1516class Plugin
    1617{
    17     public const VERSION = '1.7.3';
     18    public const VERSION = '1.7.4';
    1819
    1920    private static $instance = null;
     
    3637    {
    3738        $currentVersion = \get_option('sync_basalam_version') ?: '0.0.0';
    38         $manager = new MigrationManager();
    39         $manager->runMigrations($currentVersion, self::VERSION);
     39        if (version_compare($currentVersion, self::VERSION, '<')) {
     40            $manager = new MigrationManager();
     41            $manager->runMigrations($currentVersion, self::VERSION);
     42        }
     43    }
     44
     45    static function checkForceUpdateByVersion()
     46    {
     47        $currentVersion = \get_option('sync_basalam_version') ?: '0.0.0';
     48        if (version_compare($currentVersion, self::VERSION, '<')) {
     49            $fetchVersionDetail = new FetchVersionDetail();
     50            $fetchVersionDetail->checkForceUpdate();
     51        }
    4052    }
    4153
  • sync-basalam/trunk/includes/Queue/QueueManager.php

    r3426342 r3429516  
    2121        $this->setLastRunTimestamp($timestamp);
    2222
    23         return WC()->queue()->schedule_single(
     23        return \WC()->queue()->schedule_single(
    2424            $timestamp,
    2525            $this->taskName,
     
    3131    public function scheduleRecurringTask($intervalInSeconds, $args = [])
    3232    {
     33        if (self::hasPendingTasks($this->taskName)) return false;
     34
    3335        $startTimestamp = time();
    3436
    3537        $this->setLastRunTimestamp($startTimestamp);
    3638
    37         return WC()->queue()->schedule_recurring(
     39        return \WC()->queue()->schedule_recurring(
    3840            $startTimestamp,
    3941            $intervalInSeconds,
     
    5254    {
    5355        // Search for pending tasks in queue
    54         $pendingTasks = WC()->queue()->search([
     56        $pendingTasks = \WC()->queue()->search([
    5557            'hook'   => $taskName,
    5658            'status' => 'pending',
     
    6264    public static function cancelAllTasksGroup($taskName)
    6365    {
    64         WC()->queue()->cancel_all($taskName);
     66        \WC()->queue()->cancel_all($taskName);
    6567
    6668        delete_option($taskName . '_last_run');
     
    8082    {
    8183        // Search for pending tasks with high limit
    82         $pendingTasks = WC()->queue()->search([
     84        $pendingTasks = \WC()->queue()->search([
    8385            'hook'     => $taskName,
    8486            'status'   => 'pending',
  • sync-basalam/trunk/includes/Registrar/QueueRegistrar.php

    r3428129 r3429516  
    2121        $taskClasses = [
    2222            'Debug',
     23            'DailyCheckForceUpdate'
    2324        ];
    2425
  • sync-basalam/trunk/includes/Services/Orders/FetchOrders.php

    r3426342 r3429516  
    44
    55use SyncBasalam\Services\ApiServiceManager;
    6 use SyncBasalam\Admin\Settings\SettingsConfig;
    76
    87defined('ABSPATH') || exit;
     
    1514    public function __construct()
    1615    {
    17         $this->url = "https://order-processing.basalam.com/v3/vendor-parcels";
     16        $this->url = "https://openapi.basalam.com/v1/vendor-parcels";
    1817        $this->apiservice = new ApiServiceManager();
    1918    }
  • sync-basalam/trunk/includes/Services/Orders/OrderManager.php

    r3428129 r3429516  
    360360    public static function cancelOrderWoo($invoice_id)
    361361    {
    362         return self::updateOrderStatus($invoice_id, 'bslm-rejected');
     362        return self::updateOrderStatus($invoice_id, 'bslm-rejected', 'bslm-rejected');
    363363    }
    364364
    365365    public static function completeOrderWoo($invoice_id)
    366366    {
    367         return self::updateOrderStatus($invoice_id, 'bslm-completed');
     367        return self::updateOrderStatus($invoice_id, 'bslm-completed', 'bslm-completed');
    368368    }
    369369
    370370    public static function confirmOrderWoo($invoice_id)
    371371    {
    372         return self::updateOrderStatus($invoice_id, 'bslm-preparation');
     372        return self::updateOrderStatus($invoice_id, 'bslm-preparation', 'bslm-preparation');
    373373    }
    374374
    375375    public static function shippedOrderWoo($invoice_id)
    376376    {
    377         return self::updateOrderStatus($invoice_id, 'bslm-shipping');
    378     }
    379 
    380     private static function updateOrderStatus($invoice_id, $status)
     377        return self::updateOrderStatus($invoice_id, 'bslm-shipping', 'bslm-shipping');
     378    }
     379
     380    public static function updateOrderStatus($invoice_id, $status, $job = null)
    381381    {
    382382        global $wpdb;
    383383        $table_name = $wpdb->prefix . 'sync_basalam_payments';
    384384
    385         $order_id = $wpdb->get_var(
    386             $wpdb->prepare(
    387                 "SELECT order_id FROM {$table_name} WHERE invoice_id = %d",
    388                 $invoice_id
    389             )
    390         );
     385        $order_id = $wpdb->get_var($wpdb->prepare("SELECT order_id FROM {$table_name} WHERE invoice_id = $invoice_id"));
    391386
    392387        if (!$order_id) {
    393             Logger::error("سفارشی با این شناسه فاکتور پیدا نشد: $invoice_id");
    394 
     388            Logger::error("سفارشی با این شناسه فاکتور پیدا نشد: $invoice_id . عملیات '$job' انجام نشد.");
    395389            return false;
    396390        }
    397391
    398392        $order = wc_get_order($order_id);
    399         if ($order && $order instanceof WC_Order) {
     393
     394        if ($order && $order instanceof \WC_Order) {
    400395            $order->update_status($status);
    401 
    402396            return $order_id;
    403397        }
     
    462456    }
    463457
    464     /**
    465      * تنظیم قیمت آیتم سفارش از financial_report
    466      *
    467      * @param WC_Order $order
    468      * @param int $order_item_id
    469      * @param array $item
    470      * @param int $quantity
    471      * @return void
    472      */
    473458    private static function set_item_price_from_financial_report($order, $order_item_id, $item, $quantity)
    474459    {
    475         // استخراج قیمت محصول از financial_report
    476460        $product_price = 0;
    477461        if (isset($item['financial_report']['report_items']) && is_array($item['financial_report']['report_items'])) {
     
    484468        }
    485469
    486         // اگر قیمت پیدا شد، آن را تنظیم کن
    487470        if ($product_price > 0) {
    488             // تبدیل ارز اگر لازم بود
    489471            $currency = get_woocommerce_currency();
    490472            if ($currency === 'IRT') {
     
    496478            }
    497479
    498             // گرفتن آیتم سفارش و تنظیم قیمت
    499480            $order_item = $order->get_item($order_item_id);
    500481            if ($order_item) {
  • sync-basalam/trunk/includes/Services/Products/AutoConnectProducts.php

    r3426342 r3429516  
    1111class AutoConnectProducts
    1212{
    13     private $url;
    14 
    15     public function __construct()
    16     {
    17         $vendorId = syncBasalamSettings()->getSettings(SettingsConfig::VENDOR_ID);
    18         $this->url = "https://core.basalam.com/v3/vendors/$vendorId/products";
    19     }
    20 
    2113    public function checkSameProduct($title = null, $page = 1)
    2214    {
     
    2517            if ($title) {
    2618                $title = mb_substr($title, 0, 120);
    27                 $syncBasalamProducts = $getProductData->getProductData($this->url, $title);
    28             } else $syncBasalamProducts = $getProductData->getProductData($this->url, null, $page);
     19                $syncBasalamProducts = $getProductData->getProductData($title);
     20            } else $syncBasalamProducts = $getProductData->getProductData(null, $page);
    2921
    3022            if ($title) return $syncBasalamProducts['products'];
  • sync-basalam/trunk/includes/Services/Products/CreateSingleProductService.php

    r3426812 r3429516  
    8181                                $cleanAttributeName = str_replace('attribute_', '', $attributeName);
    8282                                $value = $variation->get_attribute($cleanAttributeName);
     83
     84                                $value = urldecode($value);
     85                                $value = trim($value);
     86                                $value = mb_strtolower($value, 'UTF-8');
     87                                $value = str_replace(['ي', 'ك'], ['ی', 'ک'], $value);
     88                                $value = str_replace(['-', '_', '–', '—'], ' ', $value);
     89                                $value = preg_replace('/\s+/', ' ', $value);
     90
    8391                                if (!empty($value)) {
    8492                                    $attributeValues[] = $value;
     
    98106                        if (!empty($variant['properties'])) {
    99107                            foreach ($variant['properties'] as $property) {
    100                                 $attributeValues[] = $property['value']['value'];
     108                                $val = trim($property['value']['title']);
     109                                $val = mb_strtolower($val, 'UTF-8');
     110                                $val = str_replace(['ي', 'ك'], ['ی', 'ک'], $val);
     111                                $val = str_replace(['-', '_', '–', '—'], ' ', $val);
     112                                $val = preg_replace('/\s+/', ' ', $val);
     113                                if (!empty($val)) {
     114                                    $attributeValues[] = $val;
     115                                }
    101116                            }
    102117                        }
  • sync-basalam/trunk/includes/Services/Products/Discount/DiscountManager.php

    r3426342 r3429516  
    1515        $this->apiService = new ApiServiceManager();
    1616        $vendorId = syncBasalamSettings()->getSettings(SettingsConfig::VENDOR_ID);
    17         $this->url = "https://core.basalam.com/v3/vendors/$vendorId/discounts";
     17        $this->url = "https://openapi.basalam.com/v1/vendors/$vendorId/discounts";
    1818    }
    1919
  • sync-basalam/trunk/includes/Services/Products/FetchProductsData.php

    r3426342 r3429516  
    44
    55use SyncBasalam\Services\ApiServiceManager;
     6use SyncBasalam\Admin\Settings\SettingsConfig;
    67
    78defined('ABSPATH') || exit;
     
    910class FetchProductsData
    1011{
    11     public function getProductData($url, $title = null, $page = 1, $perPage = 100)
     12    private $url;
     13    public function __construct()
     14    {
     15        $vendorId = syncBasalamSettings()->getSettings(SettingsConfig::VENDOR_ID);
     16        $this->url = "https://openapi.basalam.com/v1/vendors/$vendorId/products";
     17    }
     18
     19    public function getProductData($title = null, $page = 1, $perPage = 100)
    1220    {
    1321        if ($title) {
    14             $url .= '?title=' . $title;
     22            $this->url .= '?title=' . $title;
    1523        } else {
    16             $url .= '?page=' . $page;
    17             $url .= '&per_page=' . $perPage;
     24            $this->url .= '?page=' . $page;
     25            $this->url .= '&per_page=' . $perPage;
    1826        }
    1927
    2028        $apiservice = new ApiServiceManager();
    21         $response = $apiservice->sendGetRequest($url);
     29        $response = $apiservice->sendGetRequest($this->url);
    2230
    2331        $products = [];
  • sync-basalam/trunk/includes/Services/Products/FetchUnsyncProducts.php

    r3426342 r3429516  
    1010{
    1111    private $getProductsService;
    12     private $url;
    13 
     12   
    1413    public function __construct()
    1514    {
    1615        $this->getProductsService = new FetchProductsData();
    17         $vendorId = syncBasalamSettings()->getSettings(SettingsConfig::VENDOR_ID);
    18         $this->url = "https://core.basalam.com/v3/vendors/$vendorId/products";
    1916    }
    2017
    2118    public function getUnsyncBasalamProducts($page)
    2219    {
    23         $productData = $this->getProductsService->getProductData($this->url, null, $page);
     20        $productData = $this->getProductsService->getProductData(null, $page);
    2421
    2522        if (empty($productData['products'])) return [];
     
    3835        }
    3936
    40         if (empty($products)) {
    41             return $this->getUnsyncBasalamProducts($page + 1);
    42         }
     37        if (empty($products)) return $this->getUnsyncBasalamProducts($page + 1);
    4338
    4439        return $products;
  • sync-basalam/trunk/includes/Services/Products/GetCategoryAttr.php

    r3426342 r3429516  
    1010    public static function getAttr($categoryId)
    1111    {
    12         $url = "https://core.basalam.com/api_v2/category/$categoryId/attributes?exclude_multi_selects=true";
     12        $url = "https://openapi.basalam.com/v1/categories/$categoryId/attributes?exclude_multi_selects=true";
    1313        $apiservice = new ApiServiceManager();
    1414        $data = $apiservice->sendGetRequest($url, []);
  • sync-basalam/trunk/includes/Services/Products/UpdateSingleProductService.php

    r3426342 r3429516  
    1717    public function updateProductInBasalam($productData, $productId)
    1818    {
    19 
    2019        if (!get_post_type($productId) === 'product') throw new \Exception('نوع post محصول نیست.');
    2120
     
    2625        $request = $this->apiservice->sendPatchRequest($url, $productData);
    2726
     27        $body = $request['body'] ?? '';
     28
     29        if (is_string($body)) $body = json_decode($body, true);
     30
    2831        if ($request['status_code'] != 200) {
    2932            if ($request['status_code'] == 403) throw new \Exception("این محصول متعلق به غرفه فعلی نیست.");
    30 
    31             $body = $request['body'] ?? '';
    32 
    33             if (is_string($body)) $body = json_decode($body, true);
    3433
    3534            if (!is_array($body)) $body = [];
     
    6564        if ($product && $product->is_type('variable')) {
    6665            $variations = $product->get_children();
    67 
    68             if (isset($request['body']['variants'])) {
     66            if (isset($body['variants'])) {
    6967                $wcVariations = [];
    7068                $attributes = $product->get_attributes();
     
    8078
    8179                            $value = urldecode($value);
    82                             $value = trim(mb_strtolower($value, 'UTF-8'));
     80                            $value = trim($value);
     81                            $value = mb_strtolower($value, 'UTF-8');
    8382                            $value = str_replace(['ي', 'ك'], ['ی', 'ک'], $value);
     83                            $value = str_replace(['-', '_', '–', '—'], ' ', $value);
     84                            $value = preg_replace('/\s+/', ' ', $value);
     85
     86                            error_log('WC normalized value: ' . $value);
    8487
    8588                            if (!empty($value)) {
     
    9699
    97100                $syncBasalamVariations = [];
    98                 foreach ($request['body']['variants'] as $variant) {
     101                foreach ($body['variants'] as $variant) {
    99102                    $attributeValues = [];
    100103                    if (!empty($variant['properties'])) {
    101104                        foreach ($variant['properties'] as $property) {
    102                             $val = trim(mb_strtolower($property['value']['value'], 'UTF-8'));
     105                            $val = $property['value']['title'];
     106
     107                            $val = trim($val);
     108                            $val = mb_strtolower($val, 'UTF-8');
    103109                            $val = str_replace(['ي', 'ك'], ['ی', 'ک'], $val);
    104                             if (!empty($val)) {
    105                                 $attributeValues[] = $val;
    106                             }
     110                            $val = str_replace(['-', '_', '–', '—'], ' ', $val);
     111                            $val = preg_replace('/\s+/', ' ', $val);
     112
     113                            if (!empty($val)) $attributeValues[] = $val;
    107114                        }
    108115                    }
  • sync-basalam/trunk/includes/Services/WebhookService.php

    r3428129 r3429516  
    7575        $header = ['Authorization' => 'Bearer ' . $this->basalamToken];
    7676
    77         $response = $this->apiService->sendGetRequest('https://webhook.basalam.com/v1/webhooks', $header);
     77        $response = $this->apiService->sendGetRequest('https://openapi.basalam.com/v1/webhooks', $header);
    7878
    7979        if ($response && $response['status_code'] == 200) return $response['body'];
     
    9595        ];
    9696
    97         $response = $this->apiService->sendPostRequest('https://webhook.basalam.com/v1/webhooks', $data, $header);
     97        $response = $this->apiService->sendPostRequest('https://openapi.basalam.com/v1/webhooks', $data, $header);
    9898
    9999        if ($response && $response['status_code'] == 200) return true;
     
    113113        ];
    114114
    115         $updateWebhookUrl = 'https://webhook.basalam.com/v1/webhooks/' . $webhookId;
     115        $updateWebhookUrl = 'https://openapi.basalam.com/v1/webhooks/' . $webhookId;
    116116
    117117        $response = $this->apiService->sendPatchRequest($updateWebhookUrl, $data, $header);
     
    123123    private function removeCurrentWebhook($webhookId)
    124124    {
    125         $deleteWebhookUrl = 'https://webhook.basalam.com/v1/webhooks/' . $webhookId;
     125        $deleteWebhookUrl = 'https://openapi.basalam.com/v1/webhooks/' . $webhookId;
    126126        $header = ['Authorization' => 'Bearer ' . $this->basalamToken];
    127127
  • sync-basalam/trunk/readme.txt

    r3428129 r3429516  
    55Tested up to: 6.8
    66Requires PHP: 7.4
    7 Stable tag: 1.7.3
     7Stable tag: 1.7.4
    88License: GPL-2.0-or-later 
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html 
  • sync-basalam/trunk/sync-basalam.php

    r3428129 r3429516  
    1111 * Plugin Name: sync basalam | ووسلام
    1212 * Description: با استفاده از پلاگین ووسلام  میتوایند تمامی محصولات ووکامرس را با یک کلیک به غرفه باسلامی خود اضافه کنید‌، همچنین تمامی سفارش باسلامی شما به سایت شما اضافه میگردد.
    13  * Version: 1.7.3
     13 * Version: 1.7.4
    1414 * Author: Woosalam Dev
    1515 * Author URI: https://wp.hamsalam.ir/
     
    3232    }
    3333});
     34
     35Plugin::checkForceUpdateByVersion();
     36
     37if (get_option('sync_basalam_force_update')) {
     38    add_action('admin_notices', function () {
     39        $template = __DIR__ . '/templates/notifications/ForceUpdateAlert.php';
     40        require_once $template;
     41    });
     42    return;
     43}
    3444
    3545add_action('init', 'syncBasalamInit');
  • sync-basalam/trunk/templates/admin/Info.php

    r3426342 r3429516  
    1919}
    2020
    21 $api_url = "https://core.basalam.com/v3/vendors/$syncBasalamVendorId";
     21$api_url = "https://openapi.basalam.com/v1/vendors/$syncBasalamVendorId";
    2222$api_service = new ApiServiceManager();
    2323$response = $api_service->sendGetRequest($api_url, ['Authorization' => 'Bearer ' . $syncBasalamToken]);
  • sync-basalam/trunk/templates/auth/Connected.php

    r3426342 r3429516  
    77global $wpdb;
    88
    9 $count_of_published_woocamerce_products = wp_count_posts('product')->publish;
     9$count_of_published_woocommerce_products = wp_count_posts('product')->publish;
    1010$count_of_synced_basalam_products = intval($wpdb->get_var("SELECT COUNT(*) FROM {$wpdb->postmeta} WHERE meta_key = 'sync_basalam_product_id'"));
    1111
  • sync-basalam/trunk/templates/products/Popups/EditProduct.php

    r3426342 r3429516  
    1616
    1717
    18                
     18
    1919                <div class="basalam-bg-light-warning-margin basalam-p">
    2020                    <div class="basalam-display-flex-gap-20">
     
    4444
    4545        <?php elseif ($quick_update_processing_job): ?>
    46             <!-- Display when quick update job (sync_basalam_bulk_update_products) is running -->
    4746            <div id="quick-update-in-progress" class="basalam-display-block-10">
    4847                <div class="basalam-bg-warning-info-margin basalam-p">
  • sync-basalam/trunk/templates/products/sections/Status.php

    r3426342 r3429516  
    99        <div class="basalam_status_data_container">
    1010            <div class="basalam_status_data_item">
    11                 <p class="basalam-p basalam-font-12 basalam-text-justify">محصولات منتشر شـده ووکامرس :</p> <?php echo '<p class="basalam_status_data_number basalam-p">' . esc_html($count_of_published_woocamerce_products) . '</p>' ?>
     11                <p class="basalam-p basalam-font-12 basalam-text-justify">محصولات منتشر شـده ووکامرس :</p> <?php echo '<p class="basalam_status_data_number basalam-p">' . esc_html($count_of_published_woocommerce_products) . '</p>' ?>
    1212            </div>
    1313            <div class="basalam_status_data_item">
  • sync-basalam/trunk/vendor/autoload.php

    r3426342 r3429516  
    1515        }
    1616    }
    17     throw new RuntimeException($err);
     17    trigger_error(
     18        $err,
     19        E_USER_ERROR
     20    );
    1821}
    1922
  • sync-basalam/trunk/vendor/composer/LICENSE

    r3426342 r3429516  
    1 
    21Copyright (c) Nils Adermann, Jordi Boggiano
    32
     
    1918OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
    2019THE SOFTWARE.
    21 
  • sync-basalam/trunk/vendor/composer/autoload_static.php

    r3426342 r3429516  
    88{
    99    public static $prefixLengthsPsr4 = array (
    10         'S' =>
     10        'S' => 
    1111        array (
    1212            'SyncBasalam\\' => 12,
     
    1515
    1616    public static $prefixDirsPsr4 = array (
    17         'SyncBasalam\\' =>
     17        'SyncBasalam\\' => 
    1818        array (
    1919            0 => __DIR__ . '/../..' . '/includes',
Note: See TracChangeset for help on using the changeset viewer.