Bulk import product names

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
4 years ago
hi there
version 4.2
I accidentally imported around 300 prpducts with the wrong product image.
i exported the said products and changed the image to the correct image.
I reimported them using excel.
Products updated but the images didnt change.
any idea?
Each product only has one image, so i assumed changing this on the excel sheet would then change the site once imported.
Thanks !
4 years ago
You need to clear all the created thumbs images from wwwroot\images\thumbs directory so that the application will re-create the appropriate thumbs from the new image.
Make sure you backup the database and even the thumb directory before clearing the thumbs from the directory so that you can restore the previous version in case anything goes wrong.
4 years ago
thanks for the reply.
just clear the affected thumbs?
I have thousnads of products but only around 300 with the wrong image.
it may be quicker to go through them one by one..?
4 years ago
Yes, it will be better and less risky to clear the affected thumbs only if only few images have a problem. You can just try with 1/2 products and images and see if it works before proceeding forward with other images
4 years ago
HI AGAIN
deleted the thumbs of 4 products, reimported with new spreadsheet.
it just seems to have inserted the new image as a 2nd picture. Original image is still there!
4 years ago
Deleting thumb doesn't delete the entries in database. The reason why you are required to delete thumb is just a sort of "clear cache", because the thumb generated is essentially some kind of "cache files".

Here's how it works:
1) There's an original full size image for ever image you upload.
2) Any time there's a request for smaller size images, nopCommerce generates a thumbnail from the full size image. And this newly generated images is stored in thumb folder as cache files, so that re-generation is not required for subsequent requests of the image of the same size.

So to totally refresh the image, you have to do 2 things:
1) Remove the entries in database. This can be done manually (inefficient) or via a quick SQL script.
2) Remove the thumbnails.

Hope this explains? :)


4 years ago
Thats great, thanks for the explanation. Ive started doing it manually whicg is very slow. anyone have the sql command to do it in a more efficent way ? I have a few hundred to clear.
4 years ago
Once you upload the picture, the picture record is saved on the Picture table and then the mapping is created with the product and the record is saved on Product_Picture_Mapping. So, you would need to remove records from both the table(Will work if you remove the record only from mapping table too but there will be unused picture records on picture table).
You can use the following SQL command to remove the picture from the database.
Delete from Picture where id in (Select pictureid from Product_Picture_Mapping where ProductId in(1,2,3,4))

This code deletes the picture stored in the database. Make sure you replace the productid(1,2,3,4) with the product id whose picture you want to delete. This automatically deletes the product picture records from product_picture_mapping table too but you can run the below query to verify the record is deleted from the mapping table

Delete from Product_Picture_Mapping where ProductId in (1,2,3,4)


Make sure you backup the database before you execute the query in the production environment.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.