I want to use the first and the second image of a product, I'm now able to use the first one. But how can I reach the second image?
$_product->getMediaGallery('images') exists in Magento 2?
If not how can I reach the same goal?
I tried to use this:
foreach ($product->getMediaGalleryImages() as $product_img) : echo $product_img; endforeach;
And i recived the following error "Error filtering template: Warning: Invalid argument supplied for foreach() in /var/www/html/magento2/app/design/frontend/XXX/xxx/Magento_Theme/templates/xxxx.phtml on line 27"