File tree Expand file tree Collapse file tree 1 file changed +14
-8
lines changed
app/code/Magento/Catalog/view/frontend/templates/product/view Expand file tree Collapse file tree 1 file changed +14
-8
lines changed Original file line number Diff line number Diff line change 40
40
</form>
41
41
</div>
42
42
43
- <script type="text/x-magento-init">
44
- {
45
- "[data-role=priceBox][data-price-box=product-id-<?= $ block ->escapeHtml ($ _product ->getId ()) ?> ]": {
46
- "priceBox": {
47
- "priceConfig": <?= /* @noEscape */ $ block ->getJsonConfig () ?>
48
- }
49
- }
50
- }
43
+ <script>
44
+ require([
45
+ 'jquery',
46
+ 'priceBox'
47
+ ], function($){
48
+ var dataPriceBoxSelector = '[data-role=priceBox]',
49
+ dataProductIdSelector = '[data-product-id=<?= $ block ->escapeHtml ($ _product ->getId ()) ?> ]',
50
+ priceBoxes = $(dataPriceBoxSelector + dataProductIdSelector);
51
+
52
+ priceBoxes = priceBoxes.filter(function(index, elem){
53
+ return !$(elem).find('.price-from').length;
54
+ });
55
+ priceBoxes.priceBox({'priceConfig': <?= /* @noEscape */ $ block ->getJsonConfig () ?> });
56
+ });
51
57
</script>
You can’t perform that action at this time.
0 commit comments