Commit f8da0563 by halweg

fix

parent fb2c45c8
...@@ -7,7 +7,19 @@ ...@@ -7,7 +7,19 @@
<?php <?php
/** @var $block \Magento\Swatches\Block\Product\Renderer\Configurable */ /** @var $block \Magento\Swatches\Block\Product\Renderer\Configurable */
/** @var \Magento\Swatches\ViewModel\Product\Renderer\Configurable $configurableViewModel */ /** @var \Magento\Swatches\ViewModel\Product\Renderer\Configurable $configurableViewModel */
$configurableViewModel = $block->getConfigurableViewModel() $configurableViewModel = $block->getConfigurableViewModel();
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$chartBlock = $objectManager->get(\Magepow\Sizechart\Block\Product\Sizechart::class);
$sizeChart = $chartBlock->getSizeChart();
$chartTableArray = [];
if ($sizeChart != null) {
$chartTable = $sizeChart->getData('custom_size');
$chartTableArray = $chartTable;
}
$chartTableArray = json_encode($chartTableArray, true);
?> ?>
<div class="swatch-opt" data-role="swatch-options"></div> <div class="swatch-opt" data-role="swatch-options"></div>
...@@ -21,7 +33,7 @@ $configurableViewModel = $block->getConfigurableViewModel() ...@@ -21,7 +33,7 @@ $configurableViewModel = $block->getConfigurableViewModel()
"gallerySwitchStrategy": "<?= $block->escapeJs($block->getVar('gallery_switch_strategy', 'Magento_ConfigurableProduct')) ?: 'replace'; ?>", "gallerySwitchStrategy": "<?= $block->escapeJs($block->getVar('gallery_switch_strategy', 'Magento_ConfigurableProduct')) ?: 'replace'; ?>",
"jsonSwatchImageSizeConfig": <?= /* @noEscape */ $block->getJsonSwatchSizeConfig() ?>, "jsonSwatchImageSizeConfig": <?= /* @noEscape */ $block->getJsonSwatchSizeConfig() ?>,
"showTooltip": <?= $block->escapeJs($configurableViewModel->getShowSwatchTooltip()) ?>, "showTooltip": <?= $block->escapeJs($configurableViewModel->getShowSwatchTooltip()) ?>,
"sizeChartData": <?= \Magepow\Sizechart\Block\Product\Sizechart::getChartJson() ?> "sizeChartData": <?= $chartTableArray ?>
} }
}, },
"*" : { "*" : {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment