I want to display my new product image type in my phtml.
I use :
echo $block->getImage($product, "custom_type_image")->toHtml()
That work, but all my product didn't have an image with this type, so I would like, if no image was found, that display default image like :
echo $block->getImage($product, "product_base_image")->toHtml()
How to check ?
I can't check
if $block->getImage($product, "custom_type_image")->toHtml()
is null because, if it doesn't succeed to find my picture, it create one as custom_type_image.jpg (which doesn't exist, so the picture is broken)
$product->getCustomTypeImage();
? – Pawan Apr 15 at 16:48