# makecommerce/3.0.11/payment/gateway/woocommerce/js/mc_paylater.js

MakeCommerce for WooCommerce, version 3.0.11. 25 lines.

- Page: https://pluginprobe.com/plugins/makecommerce/3.0.11/code/payment/gateway/woocommerce/js/mc_paylater.js
- Raw: https://pluginprobe.com/plugins/makecommerce/3.0.11/raw/payment/gateway/woocommerce/js/mc_paylater.js
- Modified: 2021-11-01T12:10:04+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/makecommerce/3.0.11/code/payment/gateway/woocommerce/js/mc_paylater.js#L10-L20`.

```javascript
jQuery(document).ready(function($) {

    if (MC_PAYLATER.type == 'variable') {

        function paylater_block_changes( variation = null )
        { 
            if ( variation != null
                && variation != undefined
                && variation != ''
                && variation != 0 ) {
                $( "#mc_paylater_parent" ).load( location.protocol + '//' + location.host + location.pathname + "?paylater_variation_id=" + variation + " #mc_paylater_parent>*", function() {
                    $( '.mc_paylater_block' ).slideDown( 'slow' );
                } );
            }
        }

        paylater_block_changes( $( '.variation_id' ).val() );

        $( '.variation_id' ).change( function() {
            $( '.mc_paylater_block' ).slideUp( 'slow' );
            paylater_block_changes( $( '.variation_id' ).val() );
        } );
    }
});

```
