PluginProbe
ووسلام – همگام سازی ووکامرس و باسلام / 1.8.8
ووسلام – همگام سازی ووکامرس و باسلام v1.8.8
1.10.19 1.10.20 1.10.18 1.10.17 1.10.15 1.10.14 1.10.13 1.10.12 1.10.10 1.10.9 1.10.8 1.10.7 1.10.6 1.10.5 1.10.4 1.10.3 1.10.2 1.10.1 1.10.0 1.9.2 1.9.1 1.9.0 1.8.8 1.8.5 1.8.6 All 53 releases
sync-basalam / templates / admin / main / Connected.php

Connected.php in ووسلام – همگام سازی ووکامرس و باسلام 1.8.8, at templates/admin/main/Connected.php

59 lines 3.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 use SyncBasalam\JobManager;
4 use SyncBasalam\Utilities\ProductMetaKey;
5
6 defined('ABSPATH') || exit;
7
8 global $wpdb;
9
10 $count_of_published_woocommerce_products = wp_count_posts('product')->publish;
11 $productIdMetaKey = ProductMetaKey::basalamProductId();
12 $count_of_synced_basalam_products = intval($wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM {$wpdb->postmeta} WHERE meta_key = %s", $productIdMetaKey)));
13
14 $job_manager = new JobManager();
15
16 $quick_update_processing_job = $job_manager->getJob(['job_type' => 'sync_basalam_bulk_update_products', 'status' => 'processing'])
17 ?: $job_manager->getJob(['job_type' => 'sync_basalam_bulk_update_products', 'status' => 'pending']);
18
19 $full_update_job = $job_manager->getJob(['job_type' => 'sync_basalam_update_all_products', 'status' => 'pending']);
20 $full_update_processing_job = $job_manager->getJob(['job_type' => 'sync_basalam_update_all_products', 'status' => 'processing']);
21
22 $single_update_count = $job_manager->getCountJobs(['job_type' => 'sync_basalam_update_single_product', 'status' => ['pending', 'processing']]);
23
24 $has_active_update_jobs = ($quick_update_processing_job || $full_update_job || $full_update_processing_job || $single_update_count > 0);
25 $active_update_type = '';
26 if ($quick_update_processing_job) {
27 $active_update_type = 'quick';
28 } elseif ($full_update_job || $full_update_processing_job || $single_update_count > 0) {
29 $active_update_type = 'full';
30 }
31
32 $create_products_job = $job_manager->getJob(['job_type' => 'sync_basalam_create_all_products', 'status' => 'pending']);
33 $create_products_processing_job = $job_manager->getJob(['job_type' => 'sync_basalam_create_all_products', 'status' => 'processing']);
34
35 $single_create_count = $job_manager->getCountJobs(['job_type' => 'sync_basalam_create_single_product', 'status' => ['pending', 'processing']]);
36
37 $has_active_create_jobs = ($create_products_job || $create_products_processing_job || $single_create_count > 0);
38
39 $auto_connect_page_job = $job_manager->getJob(['job_type' => 'sync_basalam_auto_connect_products', 'status' => 'pending']) ?: $job_manager->getJob(['job_type' => 'sync_basalam_auto_connect_products', 'status' => 'processing']);
40
41 $auto_connect_product_job_exist = $auto_connect_page_job ? 'not-allowed' : '';
42 ?>
43
44 <div class="basalam-dashboard">
45 <?php
46 require_once(syncBasalamPlugin()->templatePath("products/Popups/AddProduct.php"));
47 require_once(syncBasalamPlugin()->templatePath("products/Popups/EditProduct.php"));
48 require_once(syncBasalamPlugin()->templatePath("products/Popups/AutoConnect.php"));
49 require_once(syncBasalamPlugin()->templatePath("products/sections/Status.php"));
50 ?>
51 <div class="basalam-action-cards">
52 <?php
53 require_once(syncBasalamPlugin()->templatePath("products/sections/ProductList.php"));
54 require_once(syncBasalamPlugin()->templatePath("orders/sections/OrderManagement.php"));
55 require_once(syncBasalamPlugin()->templatePath("products/sections/Settings.php"));
56 ?>
57 </div>
58 </div>
59