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/CreateSingleProductService.php +8 -5 1.10.23 → 1.10.28 View file →
@@ -1,9 +1,10 @@
1 1 <?php
2 2
3 3 namespace SyncBasalam\Services\Products;
4 4
5 -use SyncBasalam\Admin\Product\Data\Validators\CreateProductDataValidator;
5 +use SyncBasalam\Admin\Product\Data\Validators\CreateProductDataValidator;
6 +use SyncBasalam\Admin\Product\Data\Services\VariantService;
6 7 use SyncBasalam\Admin\Settings\SettingsConfig;
7 8 use SyncBasalam\Config\Endpoints;
8 9 use SyncBasalam\Services\ApiServiceManager;
9 10 use SyncBasalam\Jobs\Exceptions\RetryableException;
@@ -173,15 +174,17 @@
173 174 }
174 175 }
175 176
176 177 $variationMapping = [];
177 - foreach ($wcVariations as $key => $wcVarId) {
178 + foreach ($wcVariations as $key => $wcVarId) {
178 179 if (isset($syncBasalamVariations[$key])) {
179 180 $variationMapping[$wcVarId] = $syncBasalamVariations[$key];
180 181 update_post_meta($wcVarId, 'sync_basalam_variation_id', $syncBasalamVariations[$key]);
181 - }
182 - }
183 - }
182 + }
183 + }
184 +
185 + (new VariantService())->syncExpandedVariationIds($product, $responseData['variants']);
186 + }
184 187 }
185 188
186 189 update_post_meta($productId, ProductMetaKey::basalamProductId(), $responseData['id']);
187 190 update_post_meta($productId, ProductMetaKey::basalamProductStatus(), 2976);