HEX
Server: Apache/2.4.57 (Debian)
System: Linux web-server-k8s-e92jnr3j-6f99bff6b6-rp2wg 6.1.0-22-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.94-1 (2024-06-21) x86_64
User: apache (48)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
Upload Files
File: /var/www/sites/1250.info/wp-content/themes/savoy/assets/js/dev/nm-shop-checkout.js
(function($) {
	
	'use strict';
	
	// Extend core script
	$.extend($.nmTheme, {
		
		/**
		 *	Initialize checkout scripts
		 */
		checkout_init: function() {
            var self = this;
            
            
            /* Bind: Login link */
            $('.showlogin').on('click.nmShowForm', function(e) {
                e.preventDefault();
                self.loginCouponShowForm('#nm-checkout-login-form', 'nm-login-popup');
            });
            
            
            /* Bind: Coupon link */
            $('.showcoupon').on('click.nmShowForm', function(e) {
                e.preventDefault();
                self.loginCouponShowForm('#nm-coupon-login-form', 'nm-coupon-popup');
            });
            
            
            /* Bind: Payment methods input/radio-button */
            var paymentsAnim = false;
            self.$document.on('change', '.wc_payment_methods li > .input-radio', function(e) {
                var $this = $(this).parent('li'),
                    $active = $this.parent('.wc_payment_methods').children('.active');
                
                $active.removeClass('active');
                $this.addClass('active');
                
                if (!paymentsAnim) {
                    $active.children('.payment_box').hide();
                    $this.children('.payment_box').show();
                }
            });
            
            
            /* T&C link: Bind */
            if (nm_wp_vars.checkoutTacLightbox !== '0') {
                self.$document.on('click', '.woocommerce-terms-and-conditions-link', function(e) {
                    e.preventDefault();
                    
                    var $popupContent = $('.woocommerce-terms-and-conditions');
                    $popupContent.addClass('entry-content'); // Add class for content styling
                    
                    $.magnificPopup.open({
                        mainClass: 'nm-checkout-tac-popup nm-mfp-fade-in',
                        closeMarkup: '<a class="mfp-close nm-font nm-font-close2"></a>',
                        removalDelay: 180,
                        items: {
                            src: $popupContent,
                            type: 'inline'
                        }
                    });
                });
            }
		},
        
        
        /**
		 *    Login/Coupon: Show popup form
		 */
		loginCouponShowForm: function($formContainer, containerClass) {
            $.magnificPopup.open({
                mainClass: containerClass + ' nm-mfp-fade-in',
                alignTop: true,
                closeMarkup: '<a class="mfp-close nm-font nm-font-close2"></a>',
                removalDelay: 180,
                items: {
                    src: $formContainer,
                    type: 'inline'
                }
            });
        }
		
	});
	
    
	// Add extension so it can be called from $.nmThemeExtensions
	$.nmThemeExtensions.checkout = $.nmTheme.checkout_init;
	
    
    // jQuery doc ready
    $(function() {
        /*
         * T&C link: Unbind - Default WooCommerce "click" event
         *
         * Note: Bound inside jQuery doc ready by WooCommerce
         */
        if (nm_wp_vars.checkoutTacLightbox !== '0') {
            $(document.body).off('click', 'a.woocommerce-terms-and-conditions-link');
        }
    });
    
})(jQuery);