cancel
Showing results for 
Search instead for 
Did you mean: 

can any one explain the price login ? Magento 2

can any one explain the price login ? Magento 2

Hi guys, actually am trying to apply the price logic to product description  to get the child description when am going to click a swatch. For that  i need to understand the below code 

can any one explain it ?

 

<script>
require([
'jquery',
'priceBox'
], function($){
var dataPriceBoxSelector = '[data-role=priceBox]',
dataProductIdSelector = '[data-product-id=<?= $block->escapeHtml($_product->getId()) ?>]',
priceBoxes = $(dataPriceBoxSelector + dataProductIdSelector);
priceBoxes = priceBoxes.filter(function(index, elem){
return !$(elem).find('.price-from').length;
});
priceBoxes.priceBox({'priceConfig': <?= /* @escapeNotVerified */ $block->getJsonConfig() ?>});
});
</script>