I am creating products programmatically. I am using below code to add product image.. Images are adding perfectly fine.. but image roles are not showing. Can anyone please help me to add image roles in product images programmatically.
$c_product = $ob->create('Magento\Catalog\Model\Product')->load($product->getId());
if(file_exists($image1))
$c_product->addImageToMediaGallery($image1, array('image', 'small_image', 'thumbnail'), false, false);
Best Answer