PluginProbe
ووسلام – همگام سازی ووکامرس و باسلام / 1.10.19
ووسلام – همگام سازی ووکامرس و باسلام v1.10.19
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
← All changes | includes/Admin/Product/ProductOperations.php +2 -15 1.10.41.10.19 View file →
@@ -7,9 +7,9 @@
7 7 use SyncBasalam\Admin\Product\Operations\ArchiveProduct;
8 8 use SyncBasalam\Admin\Product\Operations\RestoreProduct;
9 9 use SyncBasalam\Jobs\Exceptions\RetryableException;
10 10 use SyncBasalam\Jobs\Exceptions\NonRetryableException;
11 -use SyncBasalam\Utilities\ProductMetaKey;
11 +use SyncBasalam\Services\Products\ProductConnection;
12 12
13 13 defined('ABSPATH') || exit;
14 14
15 15 class ProductOperations
@@ -87,22 +87,9 @@
87 87 public static function disconnectProduct($product_id)
88 88 {
89 89 do_action('sync_basalam_before_disconnect_product', $product_id);
90 90
91 - $metaKeysToRemove = ProductMetaKey::basalamProductMetaKeys();
92 -
93 - foreach ($metaKeysToRemove as $metaKey) {
94 - delete_post_meta($product_id, $metaKey);
95 - }
96 -
97 - $product = wc_get_product($product_id);
98 -
99 - if ($product && $product->is_type('variable')) {
100 - $variationIds = $product->get_children();
101 - foreach ($variationIds as $variationId) {
102 - delete_post_meta($variationId, 'sync_basalam_variation_id');
103 - }
104 - }
91 + ProductConnection::purge($product_id);
105 92
106 93 $result = [
107 94 'success' => true,
108 95 'message' => 'اتصال محصولات با موفقیت حذف شد.',