var ajax_price_req; var wc_gforms_current_variation; //See the gravity forms documentation for this function. function gform_product_total(formId, total) { var product_id = jQuery("input[name=product_id]").val(); if (wc_gravityforms_params.use_ajax[product_id]) { return update_dynamic_price_ajax(total, formId); } else { return update_dynamic_price(total, formId); } } function get_gravity_forms_price(formId) { if (!_gformPriceFields[formId]) return; var price = 0; _anyProductSelected = false; //Will be used by gformCalculateProductPrice(). for (var i = 0; i < _gformPriceFields[formId].length; i++) { price += gformCalculateProductPrice(formId, _gformPriceFields[formId][i]); } //add shipping price if a product has been selected if (_anyProductSelected) { //shipping price var shipping = gformGetShippingPrice(formId) price += shipping; } //gform_product_total filter. Allows uers to perform custom price calculation if (window["gform_product_total"]) { price = window["gform_product_total"](formId, price); } price = gform.applyFilters('gform_product_total', price, formId); return price; } function update_dynamic_price(gform_total) { // Function moved in delay so that variation prices are updated - Vidish - 16-10-2017 setTimeout(function () { var product_id = jQuery("input[name=product_id]").val(); var variation_id = jQuery("input[name=variation_id]").val();