Skip to content

Commit f2737c7

Browse files
author
Denys Rul
committed
MAGETWO-33937: Configurable scripts to eliminate (1 script)
1 parent 9251ed4 commit f2737c7

File tree

1 file changed

+7
-5
lines changed
  • app/code/Magento/ConfigurableProduct/view/frontend/templates/product/view/type/options

1 file changed

+7
-5
lines changed

app/code/Magento/ConfigurableProduct/view/frontend/templates/product/view/type/options/configurable.phtml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,11 @@ $_attributes = $block->decorateArray($block->getAllowAttributes());
2929
</div>
3030
</div>
3131
<?php endforeach; ?>
32-
<script>
33-
require(["jquery", "Magento_ConfigurableProduct/js/configurable"], function($){
34-
$('#product_addtocart_form').configurable({"spConfig":<?php echo $block->getJsonConfig() ?>});
35-
});
36-
</script>
32+
<script type="text/x-magento-init">
33+
"#product_addtocart_form": {
34+
"configurable": {
35+
"spConfig": <?php echo $block->getJsonConfig() ?>
36+
}
37+
}
38+
</script>
3739
<?php endif;?>

0 commit comments

Comments
 (0)