There is no way to add a product image description using the addImageToMediaGallery function. The following code does the job though:
1 2 3 4 5 6 |
foreach($product->getData('media_gallery') as $each){ foreach($each as $image){ $attributes = $product->getTypeInstance(true)->getSetAttributes($product); $attributes['media_gallery']->getBackend()->updateImage($product, $image['file'], array('label' => 'whatever')); } } |
Adding a product image description programmatically
You want or need help implementing this solution? Maybe you did not find what you were looking for? Contact me and I will assist you with whatever Magento problem troubles you!