Magento - How to add product image labels en-mass
In order to add product image labels on mass you need to re-import the images onto the products, which requires 3 steps:
A) Copy/export required information
- Export complete product information via "System > Import/Export > Export"
- Copy contents of /public_html/media/catalog/product into /public_html/media/import
B) Delete images from products
- Truncate
catalog_product_entity_media_gallery
and catalog_product_entity_media_gallery_value'
via PHP MyAdmin - Reindex entire site via "System > Index Management"
- Delete contents of /public_html/media/catalog/product
C) Add image descriptions to product data export
If the cusotmer wants to add their own descriptions you simply send them the export and advise them to add the description into the rows in the "_media_lable" column (Note that is NOT a typo, that is the name of the column). Advise the customer to NOT TOUCH ANYTHING ELSE.
If the images are already named correctly (I.e. image is called polo_shirt_left.jpg and they want the label to be "polo shirt left") then this can be done programmatically for them using the followign steps:
- Open the spreadsheet
- add a new column between _media_image and _media_lable
- into that column add the following formula (where [[media image]] is the cell in the _media_image column in the same row):
=IF([[media image]]<>"",[[media image]],"") - Autofill that to the end of the spreadsheet
- Highlight the entire column and copy > Paste (Values)
- Open Find & Replace and make the following replacements to this column only:
- Replace */ with blank
- Replace .jpg with blank
- replace .png with blank
- replace _ with single space
- Into the _image_lable column, enter the followign formula (where [[new column cell]] is the corresponding cell in the new column added in step 2):
=IF(ISNUMBER(SEARCH("POS-",[[new column cell]])),MID([[new column cell]],FIND(" ",[[new column cell]])+1,256),[[new column cell]]) - Autofill that to the end of the spreadsheet
- Highlight the entire column and copy > Paste (Values)
- Open Find & Replace and make the following replacements to this column only:
- Replace the word NOTHING with blank
- Delete column added in step 2
- Save changes
D) Upload spreadsheet
Absolutely no other changes are required, simply upload the saved spreadsheet via "System > Import/Export > Import"
By importing this file it will reassociate all images to the products they were associated to originally, but this time they will have labels (either provided by the customer or based off the image file name).