Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
renderer.phtml
Go to the documentation of this file.
1 <?php
6 // @codingStandardsIgnoreFile
7 //"swatchRenderer": {
8 ?>
9 <?php ?>
10 <div class="swatch-opt" data-role="swatch-options"></div>
11 
12 <script type="text/x-magento-init">
13  {
14  "[data-role=swatch-options]": {
15  "Magento_Swatches/js/swatch-renderer": {
16  "jsonConfig": <?= /* @escapeNotVerified */ $swatchOptions = $block->getJsonConfig() ?>,
17  "jsonSwatchConfig": <?php /* @escapeNotVerified */
18  echo $swatchOptions = $block->getJsonSwatchConfig(); ?>,
19  "mediaCallback": "<?= /* @escapeNotVerified */ $block->getMediaCallback() ?>",
20  "gallerySwitchStrategy": "<?php /* @escapeNotVerified */ echo $block->getVar('gallery_switch_strategy',
21  'Magento_ConfigurableProduct') ?: 'replace'; ?>",
22  "jsonSwatchImageSizeConfig": <?php /* @noEscape */ echo $block->getJsonSwatchSizeConfig() ?>
23  }
24  },
25  "*" : {
26  "Magento_Swatches/js/catalog-add-to-cart": {}
27  }
28  }
29 </script>
$block
Definition: block.php:8