File tree 1 file changed +7
-3
lines changed
app/code/Magento/Swatches/view/frontend/templates/product/listing
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 5
5
*/
6
6
?>
7
7
<?php /** @var $block \Magento\Swatches\Block\Product\Renderer\Configurable */ ?>
8
- <?php $ jsonConfig = $ block ->getJsonConfig (); ?>
9
8
<div class="swatch-opt-<?php /* @escapeNotVerified */ echo $ block ->getProduct ()->getId () ?> "></div>
10
9
<script>
11
10
require([
15
14
'Magento_Swatches/js/catalog-add-to-cart',
16
15
'priceBox'
17
16
], function ($) {
17
+ var jsonConfig = <?php /* @escapeNotVerified */ echo $ block ->getJsonConfig (); ?> ;
18
+
18
19
$('.swatch-opt-<?php /* @escapeNotVerified */ echo $ block ->getProduct ()->getId () ?> ').SwatchRenderer({
19
20
selectorProduct: '.product-item-details',
20
21
onlySwatches: true,
21
22
enableControlLabel: false,
22
23
numberToShow: <?php /* @escapeNotVerified */ echo $ block ->getNumberSwatchesPerProduct (); ?> ,
23
- jsonConfig: <?php /* @escapeNotVerified */ echo $ jsonConfig; ?> ,
24
+ jsonConfig: jsonConfig,
24
25
jsonSwatchConfig: <?php /* @escapeNotVerified */ echo $ block ->getJsonSwatchConfig (); ?> ,
25
26
mediaCallback: '<?php /* @escapeNotVerified */ echo $ block ->getMediaCallback () ?> '
26
27
});
30
31
priceBoxes = $(dataPriceBoxSelector + dataProductIdSelector);
31
32
32
33
priceBoxes.priceBox({
33
- 'priceConfig': <?php /* @escapeNotVerified */ echo $ jsonConfig ; ?>
34
+ 'priceConfig': {
35
+ priceFormat: jsonConfig.priceFormat,
36
+ prices: jsonConfig.prices
37
+ }
34
38
});
35
39
});
36
40
</script>
You can’t perform that action at this time.
0 commit comments