<?php
/**
 * Maho
 *
 * @category    design
 * @package     rwd_default
 * @copyright   Copyright (c) 2006-2020 Magento, Inc. (https://magento.com)
 * @copyright   Copyright (c) 2021-2024 The OpenMage Contributors (https://openmage.org)
 * @copyright   Copyright (c) 2024 Maho (https://mahocommerce.com)
 * @license     https://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */
?>
<?php
    /** @var Mage_ConfigurableSwatches_Block_Catalog_Media_Js_Abstract $this */
?>

<script type="text/javascript">
    ConfigurableMediaImages.init('<?= $this->getImageType() ?>');
    <?php foreach ($this->getProductImageFallbacks() as $imageFallback): ?>
    ConfigurableMediaImages.setImageFallback(<?= $imageFallback['product']->getId() ?>, JSON.parse('<?= $imageFallback['image_fallback'] ?>'));
    <?php endforeach ?>
    document.dispatchEvent(new Event('configurable-media-images-init'));
</script>
