cancel
Showing results for 
Search instead for 
Did you mean: 

How can I update image alt tag for all products via code?

How can I update image alt tag for all products via code?

I want to set the value for  image alt tag to product title via code, as I have huge number of products in catalog. 

 

I am trying to update but its not working please help.

 

Attached is the screen shot for the code i have been implementing

 

https://www.screencast.com/t/zUlLrlZrKsMY

4 REPLIES 4

Re: How can I update image alt tag for all products via code?

Hi @manpreetwebcefz,

 

What if you create a file to be improted with something like:

 

sku;website_id;additional_images;additional_image_labels
BB142;1;/1/7/1700x700x380mm-round-single-ended-bath-front-view-bb142-v5001.jpg,/1/7/1700x700x380mm-round-single-ended-bath-close-up-view-bb142-v5000.jpg,/1/7/1700x700x380mm-round-single-ended-bath-zoomed-out-view-bb142-v5001.jpg,/1/7/1700x700x380mm-round-single-ended-bath-dimensions-i2-bb142-v5000.jpg;,Test image 1,,Test image 4

(The example is from this bug report: https://github.com/magento/magento2/issues/9120 )

enable Admin notification for new user registerration and for sale

 How can enable Admin notification for new user registration and for sale

Re: How can I update image alt tag for all products via code?

@Damian Culotta  If the image save with image name like consider mobile so that image save with mobile.jpg then upload to server, whenever i google image search if keyword and name of the image are same occurred on the google page. Am i right? is it alt tag do the same thing?

Re: How can I update image alt tag for all products via code?

Hi @GTA_giri,

 

Sorry but I'm not sure if I understand your question and the relation with the CSV example.

Can you explain me with a specific example?