1

I have simple and configurable products in Product Listing page. When I click on product it opens a modal and show product related information. In modal, For configurable products i have 3 configuration, small, medium and large. All of 3 configurations have different prices. I can add products to cart using ajax in modal.

But on changing configurations product price is not getting changed.

Can anyone tell me how can I achieve this?

I have used this script but it is not working in this case

<script>
require([
    'jquery',
    'priceBox'
], function($){
    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;
    });

    priceBoxes.priceBox({'priceConfig': <?php /* @escapeNotVerified */ echo $block->getJsonConfig() ?>});
});

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.