Update price when change select Subsciption

$('body').on('change', 'input[name="subscribe-to-action-input"], select.wcsatt-options-product-dropdown', function () {
    update_price_on_pdp_subscribe();
});
function update_price_on_pdp_subscribe(){
    var value_option = $('input[name="subscribe-to-action-input"]:checked').val();
    if(value_option == "yes"){
        var del_price = $('.wcsatt-options-product li.subscription-option input[type="radio"]:checked').next('.subscription-option-details').find('del')[0].outerHTML;
        var ins_price = $('.wcsatt-options-product li.subscription-option input[type="radio"]:checked').next('.subscription-option-details').find('ins')[0].outerHTML;
        var price_select = del_price+ins_price;
        $('.product-info .price.product-page-price').html(price_select);
    }
    else{
        $('.product-info .price.product-page-price').html(price_default);
    }
}

Leave a Reply

Your email address will not be published. Required fields are marked *