Import from Excel stops running if image is not found on server

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
7 years ago
I think it will require customization.
7 years ago
Ok it looks like I've been able to find a fix for this. Please look at Libraries\Nop.Services\ExportImport\ImportManager.cs in the ImportProductImagesUsingHash function. In there you will see the following code

foreach (var product in productPictureMetadata)
            {
                foreach (var picturePath in new[] { product.Picture1Path, product.Picture2Path, product.Picture3Path })
                {
                    if (String.IsNullOrEmpty(picturePath))
                        continue;


Change it to the following

foreach (var product in productPictureMetadata)
            {
                foreach (var picturePath in new[] { product.Picture1Path, product.Picture2Path, product.Picture3Path })
                {
                    if ((String.IsNullOrEmpty(picturePath)) || !File.Exists(picturePath))
                        continue;


You may have to make a similar change to the ImportProductImagesUsingServices function as well.

Good luck!
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.