laravel-woocommerce
laravel-woocommerce copied to clipboard
[woocommerce_product_image_upload_error]
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,
];
}
+1 for the same issue
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
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