<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
$_config           = $this->helper('Sm\Themecore\Helper\Data');
$enableLadyLoading = $_config->getAdvanced('lazyload_group/enable_ladyloading');
$mediaSrc          = $_config->getMediaUrl();
if ($enableLadyLoading) {
    $imgClass = 'lazyload';
} else {
    $imgClass = '';
}
?>
<?php /** @var $block \Magento\Catalog\Block\Product\Image */ ?>

<span class="product-image-container"
      style="width:<?= /* @escapeNotVerified */ $block->getWidth() ?>px;">
    <span class="product-image-wrapper"
          style="padding-bottom: <?= /* @escapeNotVerified */ ($block->getRatio() * 100) ?>%;">
        <img class="<?= /* @escapeNotVerified */ $block->getClass() ?> <?php echo $imgClass; ?>"
            <?= /* @escapeNotVerified */ $block->getCustomAttributes() ?>
			
			<?php if ($enableLadyLoading) { ?>
				src="<?php echo $mediaSrc . 'lazyloading/blank.png'; ?>" 
				data-src="<?php /* @escapeNotVerified */ echo $block->getImageUrl(); ?>"
			<?php } else { ?>
				src="<?php /* @escapeNotVerified */  echo $block->getImageUrl(); ?>"
			<?php } ?>
			
            width="<?= /* @escapeNotVerified */ $block->getWidth() ?>"
            height="<?= /* @escapeNotVerified */ $block->getHeight() ?>"
            alt="<?= /* @escapeNotVerified */ $block->stripTags($block->getLabel(), null, true) ?>"/></span>
</span>
