Created
April 26, 2024 04:19
-
-
Save pramodjodhani/cbb909606dba887532d36d3fc045ec04 to your computer and use it in GitHub Desktop.
MCG - Change currency when tab is changed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Multi-currency for Gravity Forms. | |
* Change currency when tab is changed. | |
*/ | |
jQuery( document ).ready( function () { | |
jQuery( document ).on( 'click', '#e-n-tabs-title-2461', function () { | |
gf_global.gf_currency_config = idea_mcg.all_currencies[ 'CAD' ]; | |
$( ".gform_wrapper input" ).trigger( 'change' ); | |
} ) | |
jQuery( document ).on( 'click', "#e-n-tabs-title-2462", function () { | |
gf_global.gf_currency_config = idea_mcg.all_currencies[ 'USD' ]; | |
$( ".gform_wrapper input" ).trigger( 'change' ); | |
} ) | |
gf_global.gf_currency_config = idea_mcg.all_currencies[ 'CAD' ]; | |
console.log( 'custom script loaded' ); | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment