Skip to content

Commit

Permalink
MAGETWO-57044: [Backport] - [GITHUB] Prices of related products on PD…
Browse files Browse the repository at this point in the history
…P changes according to product custom options. #4588 - for 2.1
  • Loading branch information
Sergey Semenov committed Sep 8, 2016
1 parent fdb3182 commit dbfa7b8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,11 @@
<script>
require([
'jquery',
'Magento_Catalog/js/price-box'
'priceBox'
], function($){
var priceBoxes = $('[data-role=priceBox]');
var dataPriceBoxSelector = '[data-role=priceBox]',
dataProductIdSelector = '[data-product-id=<?php echo $block->escapeHtml($_product->getId())?>]',
priceBoxes = $(dataPriceBoxSelector + dataProductIdSelector);

priceBoxes = priceBoxes.filter(function(index, elem){
return !$(elem).find('.price-from').length;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@
?>

<?php $_options = $block->decorateArray($block->getOptions()) ?>
<?php $_productId = $block->getProduct()->getId() ?>
<?php if (count($_options)):?>
<script type="text/x-magento-init">
{
"#product_addtocart_form": {
"priceOptions": {
"optionConfig": <?php /* @escapeNotVerified */ echo $block->getJsonConfig()?>,
"controlContainer": ".field",
"priceHolderSelector": "[data-role=priceBox]"
"priceHolderSelector": "[data-product-id='<?php echo $block->escapeHtml($_productId)?>'][data-role=priceBox]"
}
}
}
Expand Down

0 comments on commit dbfa7b8

Please sign in to comment.