Skip to content

Instantly share code, notes, and snippets.

@yeriepiscesa
Last active April 22, 2020 15:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yeriepiscesa/23c6acd227575451e64d480e7a88f024 to your computer and use it in GitHub Desktop.
Save yeriepiscesa/23c6acd227575451e64d480e7a88f024 to your computer and use it in GitHub Desktop.
<?php
add_action( 'wp_enqueue_scripts', 'solusipress_jquery_number' );
function solusipress_jquery_number() {
if( is_page( 'forminator-test' ) ) {
wp_enqueue_script( 'jquery-number', 'https://businessprofile.solusipress.com/wp-content/uploads/custom-css-js/18.js' );
}
}
add_action( 'wp_footer', 'solusipress_forminator_format_number' );
function solusipress_forminator_format_number() {
if( is_page( 'forminator-test' ) ) { ?>
<script type="text/javascript">
( function($){
$( '#calculation-1-field' ).hide();
$( '#calculation-1-field' ).parent().append( '<div id="total_html" style="font-weight:600;font-size:22px"></div>' );
set_total();
$( '#calculation-1-field' ).on( 'change', function(){
set_total();
} );
function set_total() {
var tot = $('#calculation-1-field').val();
$( '#total_html' ).html( 'Rp' + $.number( tot, 0, ',', '.' ) );
}
} )( jQuery );
</script><?php
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment