New answers tagged

1

/** * Product media data template * * @var $block \Magento\Catalog\Block\Product\View\Gallery */ ?> <?php $images = $block->getGalleryImages()->getItems(); $mainImage = current(array_filter($images, function ($img) use ($block) { return $block->isMainImage($img); })); if (!empty($images) && empty($mainImage)) { $mainImage ...


Top 50 recent answers are included