Delete all Magento Images and Replace - image

I have a magento Installation which has had several image imports done by the client and its got wrong images in the wrong products, toasters with fridge freezers as the initial import had the wrong img names. After a further import via CSV it seems to have appended the images rather than change them.
I need to delete all product images on the site, then re-do the CORRECT import so all the images are correct.
Is there a quick way to delete all images then do a fresh import via Dataflow Profiles and re-map the correct fields?
Any help would be awesome!
Thanks in advance.

How to delete all your image associations:
Go to your database and run the following:
DELETE FROM `catalog_product_entity_media_gallery`;
(Note this won't delete the actual files on the server. For this, you will also need to go to /media and run rm -rf catalog/product/)
Then you can re-run your import.
When completed, you will need to go to System > Cache Management and flush Catalog Images cache

First:
DELETE * FROM catalog_product_entity_varchar WHERE attribute_id IN (x, y, z)
x = image
y = small_image
z = thumbnail
(you can find them in eav_attribute table)
Then:
Truncate these 2 tables:
catalog_product_entity_media_gallery
catalog_product_entity_media_gallery_value
Delete all photos in: '/media/catalog/product'
Clear cache.
Upload your fresh photos.

Related

Is it possible to manually import product images to Nopcommerce

currently the import function is not working for product images, so is it possible to FTP the images onto the site. I noticed that stock images are stored in the /wwwroot/Content/Images/Thumbs/. So if I was to add product images would they go there?
you have 2 options,
1) storing on the local drive or CDN: in this case NC should convert your images in its format and name convention. Therefore when you import 1 image (do a test on the admin panel) you can see how it is stored under Images folder.
you can see the Libraries\Nop.Services\ExportImport\ImportManager.cs, funciton is called ImportProductsFromXlsx. this function is normally reading from xlsx file and looping through each defined line. you can create your own funciton by using this which can read from your DB (get path information all you need) and let to convert each images.
2) Store as binary into picture table: this is same procedure as described above. all you have to do is the define in the settings that you want to store as binary.
The actual issue was there some sort of problem importing the images with the product details. So instead I created a path for the product images, in the products details and then manually placed all the images into the wwwroot/Content/images/Thumbs/ folder. It seemed to have worked!

Magento - update product image paths on multiple products through a csv file

I am trying to add products by duplicating them in a CSV file. It seems to work fine but when I update the product image path with the same path to multiple products it doesn't seem to update. When I export again and look at the data it has reverted to it original state. What is the problem here...?
Please review the following: http://www.magentocommerce.com/knowledge-base/entry/importing-product-images
Typical Problems:
Path
Name of File (Name does not match file name. ie: Name.jpg vs /name.jpg)
Image file does not exist on server for processing. (file is not at store/media/upload/file.jpg)
Permissions (store/media/* store/media/upload not accessible)
Reminder: When dealing with Image Modification/Upload etc, please flush (disable during trouble shooting) the cache, then re-enable after.
Uploading via Dataflow:
Assuming you have the correct basic required fields, there are two main behaviors.
If the SKU is unique, the product ID will be created in the system.
If the SKU exists, information will be replaced/updated or Appended in the system.
When you copy and paste, you will want to make sure each SKU is unique, and that there will be a correlating image that will 'live' on the server during the upload dataflow process.
In the case of Images, the Path is going to be looking for yourstoreroot/media/import/ for the images you reference in your image / small / thumbnail, if the image doesn't exist with the path described, or doesn't match exactly the name, then the data will not be added/appended in the cart as it is invalid to the import files and would not show on new exports.
To solve this problem I learned how to create an attribute, an attribute set, then a configurable product. With the configurable product I can apply the image once. Each product listing with a different size or color is listed as an associated product with all duplicate content but is not visible individually.
Here is a tutorial that got me started:
http://www.magentocommerce.com/knowledge-base/entry/tutorial-creating-a-configurable-product
Found this question via Google looking for something similar and thought I'd chime in.
The most common problem I've encountered (and its poorly documented) is that when importing using the built-in import tool, the "image" path must be relative to /media/import/. Note that by default there is no 'import' folder in /media, you'll need to make it.
That means that in your CSV under the "images" column, you should have '/somepicture.jpg', this corresponds to /media/import/somepicture.jpg during the actual import. If this is incorrect, while the import is going on you'll see a bunch of "image not found" errors scroll by, and the existing image data will not be updated.
Unfortunately it does not look like there is a way to simply update the stored image path (such as pointing a bunch of products to the same image) using the built-in importer, as it expects to be importing new images, and will dupe them up just like editing images manually does.

Magento Import cause Image missing

We simply export and amend several "item description" , import csv back
all Base/ thumbnail / small image linking are gone
in item page all photos still exist but the"key picture" show nothing
tried force save CSV on excel to UTF8 format, not a solution.
Most likely, you need to reindex and clean the cache.
Go to System -> Cache management, flush the image cache and Magento cache. Refresh all caches. Then reindex in System -> Index Management.
We have had a lot of success with Magmi: http://sourceforge.net/projects/magmi/ in terms of first time importing and updating product images.
http://sourceforge.net/apps/mediawiki/magmi/index.php?title=Image_attributes_processor

magento bulk products upload images but do not display in version greater than 1.6?

These are the steps i followed :
I created a category and added product to it in the backend of
magento
System->Import/Export-> "export" the csv file .
Removed the current values of the product already added then added
values new values to it.
Copied that csv file to media/import directory where images to be
uploaded were also present. (value = /image001.Jpg)
Went on to import and it says import successfully.
Output :
Products with the data uploaded successfully
BUT
No relevant images found, while i can see images uploaded in media/catalog/product..... folder
I have visited many many blogs forums, spent alot of hours for it but in vain. So in last i am posting it over here.
I would greatly appreciate if someone can post in the whole process in steps with sample Csv file and also tell us required fields and values for fields ib brief.
In my experience you have to make sure you put the image information in all the right places in the import CSV file. The three sets of image columns (image, image_label; small_image, small_image_label; thumbnail, thumbnail_label) are what set which image will be used for what purpose. And, they are one image per product.
However, it is the media images columns (_media_attribute, _media_image, _media_lable (yep, misspelled in Magento), _media_position, and _media_is_disabled) that actually define the image(s) for the product. These media image columns have to be completed on a one row per image basis. The _media_attribute is the id of that attribute (77 in my experience). The _media_image is that actual name of the image file in your media/import directory (case sensitive). The _media_lable is the title you want on the image. _media_position is the relative order of the images for this product. _media_is_disabled is the flag for each image that identifies whether the image is shown in the product media group or not.
I try this also pcproffitt: https://stackoverflow.com/users/1202982/pcproffitt
I have noticed that in my .csv file the columns were only (image, image_label; small_image, small_image_label; thumbnail, thumbnail_label) - that was from my Magento1.3 export but when I try to import it there is no error in importing but the Images were not seen on the site.
Then I found your Answer that in new version of Magento1.6 the column name is defferent it is (_media_attribute, _media_image, _media_lable (yep, misspelled in Magento), _media_position, and _media_is_disabled)
Whoops! I'm badly solving this. What would your suggestion though since I have 7000 plus products and images on my old site to transfer :( Is there a way to make this things gonna work out?
Thank you Sir!

Images uploading, going to the /media/tmp, but not saving in media/catalog after saving product [Magento]

As the title says, I’m having trouble saving the images for the products.
I edit a product (grouped product), go on images tab, upload an image (this wokrs fine, the image is there when I rollover and I can see its URL on the /tmp folder), choose the store views for it and proceed to save the product.
Check the frontend, no image. Check/edit the product again, no image there aswell. It just vanishes (although it stays in the /tmp folder).
Could you help me sort this out? I've set all permissions to 777 temporarily and still no luck.
Fixed: http://www.magentocommerce.com/boards/viewthread/4348/P45/#t327010
Fixed it!!!
I experienced this issue after migrating from M1 to M2. When edit any product, add/delete image does not work. It shows when it is uploaded but after save it does not save. I have applied this query to solved the issue. here media_gallery attribute id is 703.
DELETE FROM catalog_product_entity_varchar WHERE attribute_id = 703 and value = 0
DELETE FROM catalog_product_entity_varchar WHERE attribute_id = 703 and value = NULL
If anyone is still facing the same problem, it may be because of the prototype.js version.
Change the xxx.toJSON() calls in js/mage/adminhtml/product.js to Object.toJSON(xxx). For example from this:
$(this.idPrefix + 'save_attributes').value = this.attributes.toJSON();
to this:
$(this.idPrefix + 'save_attributes').value = Object.toJSON(this.attributes);
I had similar issue when I migrated from M1 to M2. After debugging I found that in eav_attribute db table originally the backend_type for attribute media_gallery in M2 is set to static but after migration it got replaced by varchar. I have changed it back to static and form me image upload and save started to work for products.
Hope this will help.

Resources