Magento Asked by udhayakumar on November 19, 2021
Need to Image gallery collection load to following path in magento 2.1.6 category listing page ,
vendormagentomodule-catalogviewfrontendtemplatesproductimage_with_borders.phtml
( Or )
appdesignfrontendMagento{custom-theme}Magento_Catalogtemplatesproductimage_with_borders.phtml
Anyone please review the question and let me know your suggestions.
Thank you ,
Use below code to get all gallery images on product list page:
<?php
$Om = MagentoFrameworkAppObjectManager::getInstance();
$product = $Om->create('MagentoCatalogModelProduct')->load($_product->getId());
$images = $product->getMediaGalleryImages();
foreach($images as $image) { ?>
<img src="<?php echo $image->getUrl(); ?>">
<?php } ?>
Answered by Dhiren Vasoya on November 19, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP