Codexshaper / laravel-woocommerce

WooCommerce Rest API for Laravel
MIT License
189 stars 59 forks source link

[woocommerce_product_image_upload_error] #108

Open Awais-Koder opened 7 months ago

Awais-Koder commented 7 months ago

Exception Error: Error getting remote image http://127.0.0.1:8000/storage/product_images/dfZoriBLsS8uLMbv6sDDZj5R9maHXo7e2YRWap8z.png. Error: A valid URL was not provided. [woocommerce_product_image_upload_error] http://127.0.0.1:8000/admin/store/new/product

below is my code

foreach ($imagePaths as $imagePath) { $fullPath = public_path($imagePath);

        if (file_exists($fullPath)) {
            echo "Image exists: $fullPath\n";
        } else {
            echo "Image does not exist: $fullPath\n";
        }

        $absoluteUrl = asset('storage/' . $imagePath);
        $absoluteUrl = str_replace('/storage//', '/', $absoluteUrl);
        $absoluteUrl = trim($absoluteUrl);
        $imagesData[] = [
            'src' => $absoluteUrl,
        ];
    }
tjhunkin-inhance commented 6 months ago

+1 for the same issue

tjhunkin-inhance commented 6 months ago

for me this is intermittent, it creates the product and image, but returns the error and the product and image is not linked on woocommerce

Codexshaper commented 4 months ago

Dear @Awais-Koder ,

Please make sure the path is correct. If you still facing the same issues please share more details so that we can check on your behalf.

Thanks