PluginProbe
ووسلام – همگام سازی ووکامرس و باسلام / 1.10.28
ووسلام – همگام سازی ووکامرس و باسلام v1.10.28
1.10.28 1.1.26 1.10.27 1.10.24 1.10.25 1.10.23 1.10.22 1.10.21 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 All 61 releases
← All changes | includes/Services/Products/UpdateSingleProductService.php +7 -0 1.10.22 → 1.10.28 View file →
@@ -241,8 +241,12 @@
241 241 // one-to-one mapping is unambiguous and safe in that case.
242 242 if (count($variations) === 1 && count($body['variants']) === 1 && !empty($body['variants'][0]['id'])) {
243 243 update_post_meta($variations[0], 'sync_basalam_variation_id', $body['variants'][0]['id']);
244 244 }
245 +
246 + if ($product instanceof \WC_Product_Variable) {
247 + (new VariantService())->syncExpandedVariationIds($product, $body['variants']);
248 + }
245 249 }
246 250 }
247 251
248 252 return $this->finishUpdate($productId, $body, 'فرایند بروزرسانی محصول با موفقیت انجام شد.');
@@ -314,8 +318,11 @@
314 318 // been built. If the following API request fails, the next job retries
315 319 // the safe full-product remapping path instead of the stale endpoint.
316 320 foreach ($product->get_children() as $variationId) {
317 321 delete_post_meta($variationId, 'sync_basalam_variation_id');
322 + if (get_post_meta($variationId, 'sync_basalam_variation_map', true)) {
323 + delete_post_meta($variationId, 'sync_basalam_variation_map');
324 + }
318 325 }
319 326
320 327 $productData['variants'] = $variants;
321 328