From 287da9b2f81a1c1d792aeecf929352aa6e1fd710 Mon Sep 17 00:00:00 2001 From: merdan Date: Tue, 28 Jun 2022 16:10:57 +0500 Subject: [PATCH] order to manat --- .../Sarga/API/Http/Controllers/IntegrationController.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/Sarga/API/Http/Controllers/IntegrationController.php b/packages/Sarga/API/Http/Controllers/IntegrationController.php index 4a3abbd23..b830e5a1b 100644 --- a/packages/Sarga/API/Http/Controllers/IntegrationController.php +++ b/packages/Sarga/API/Http/Controllers/IntegrationController.php @@ -68,7 +68,7 @@ class IntegrationController extends Controller if($product = $this->productRepository->findOneByField('sku',$data['product_group_id'])) {//product_group_id - Log::info($data); +// Log::info($data); $this->updateVariants($product,$data); return response()->json(['success'=>true,'product_id' => $product->id]); } @@ -217,14 +217,15 @@ class IntegrationController extends Controller private function updateAttribute($product,$data){ if(isset($data['sellable']) && $data['sellable']===false){ - Log::info($data); + //$attribute = $this->attributeRepository->findOneByField('code', 'status'); status id = 8 - $this->attributeValueRepository->updateOrCreate(['product_id'=>$product->id,'attribute_id'=>8],['boolean_value'=>1]); + $this->attributeValueRepository->updateOrCreate(['product_id'=>$product->id,'attribute_id'=>8],['boolean_value'=>0]); }else{ + Log::info($data); $originalPrice = Arr::get($data, 'price.originalPrice.value'); $discountedPrice = Arr::get($data, 'price.discountedPrice.value'); - $this->attributeValueRepository->updateOrCreate(['product_id'=>$product->id,'attribute_id'=>8],['boolean_value'=>0]); + $this->attributeValueRepository->updateOrCreate(['product_id'=>$product->id,'attribute_id'=>8],['boolean_value'=>1]); if($discountedPrice >= $originalPrice){ $this->attributeValueRepository->updateOrCreate(['product_id'=>$product->id,'attribute_id'=>11],['float_value'=>$discountedPrice]);// price id 11 $this->attributeValueRepository->updateOrCreate(['product_id'=>$product->id,'attribute_id'=>13],['float_value'=>null]);//special price id 13