Skip to content

Commit 6b6c862

Browse files
MC-29987: [Hotfix] Price of a Bundle Product is calculated incorrectly at the product page
1 parent 35a520b commit 6b6c862

File tree

1 file changed

+14
-8
lines changed
  • app/code/Magento/Catalog/view/frontend/templates/product/view

1 file changed

+14
-8
lines changed

app/code/Magento/Catalog/view/frontend/templates/product/view/form.phtml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,18 @@
4040
</form>
4141
</div>
4242

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+
});
5157
</script>

0 commit comments

Comments
 (0)