← All changes
|
includes/Services/Products/CreateSingleProductService.php
+8
-5
1.10.22
→
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); |