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 = $...


0

The 'roles' are specific attributes: image (for Base role), small_image (for Small), swatch_image (for Swatch) and thumbnail. You can find the IDs of these attributes by checking the eav_attribute table and according to their backend_type, you will find the values associated per product in the catalog_product_entity_varchar table. The records will look like ...


Top 50 recent answers are included