diff --git a/packages/Sarga/API/Http/Controllers/SellerProduct.php b/packages/Sarga/API/Http/Controllers/SellerProduct.php index 241cab2..99805a6 100644 --- a/packages/Sarga/API/Http/Controllers/SellerProduct.php +++ b/packages/Sarga/API/Http/Controllers/SellerProduct.php @@ -90,16 +90,6 @@ class SellerProduct extends SellerProductController ]); } - - // $sellerProduct = $this->sellerProduct->create([ - // 'price' => 0, - // 'description' => '', - // 'is_approved' => 0, - // 'is_owner' => 0, - // 'product_id' => $product->id, - // 'marketplace_seller_id' => $request->get('marketplace_seller_id') - // ]); - $sellerProduct = new SellerProductModel; $sellerProduct->price = 0; $sellerProduct->description = ""; @@ -179,33 +169,11 @@ class SellerProduct extends SellerProductController "locale" => 'tm', "channel" => 'Nurgul', "short_description" => $request->get('short_description'), - "images" => [$request->get('images')], + "images" => $request['images'], ); $product = $this->productRepository->update($data, $prodId, 'id'); - // if ($product) { - // $product->status = $request->get('status'); - // $product->product_number = $request->get('product_number'); - // $product->name = $request->get('name'); - // $product->description = $request->get('description'); - // // $product->url_key = Str::slug($request->get('name')); - // $product->new = $request->get('new'); - // $product->featured = $request->get('featured'); - // $product->status = $request->get('status'); - // $product->price = $request->get('price'); - // $product->special_price = $request->get('special_price'); - // $product->weight = 0; - // $product->locale = 'tm'; - // $product->channel = 'Nurgul'; - // $product->short_description = $request->get('short_description'); - // $product->save(); - // } else { - // return response([ - // 'status' => 500, - // 'message' => 'cant find product' - // ]); - // } $productInventory = ProductInventory::where('product_id', $prodId)->first(); if ($productInventory) { diff --git a/packages/Webkul/Product/src/Repositories/ProductMediaRepository.php b/packages/Webkul/Product/src/Repositories/ProductMediaRepository.php index 189b799..9d7f8ca 100644 --- a/packages/Webkul/Product/src/Repositories/ProductMediaRepository.php +++ b/packages/Webkul/Product/src/Repositories/ProductMediaRepository.php @@ -51,8 +51,11 @@ class ProductMediaRepository extends Repository $previousIds = $this->resolveFileTypeQueryBuilder($product, $uploadFileType)->pluck('id'); if (isset($data[$uploadFileType]['files']) && $data[$uploadFileType]['files']) { + + foreach ($data[$uploadFileType]['files'] as $indexOrModelId => $file) { if ($file instanceof UploadedFile) { + \Log::info("messageq: ".$file); $this->create([ 'type' => $uploadFileType, 'path' => $file->store($this->getProductDirectory($product)), diff --git a/public/storage b/public/storage new file mode 120000 index 0000000..2be32c6 --- /dev/null +++ b/public/storage @@ -0,0 +1 @@ +/Users/tmstore/Desktop/projects old/new folder/nurGul/nurgul_backend/storage/app/public \ No newline at end of file