SHELL BYPASS 403 |
Modern UI. Responsive. Powerful.

Faizzz-Chin Shell

Uname\Kernel: Linux server.kxo.bgz.mybluehostin.me 3.10.0-1160.119.1.el7.tuxcare.els19.x86_64 #1 SMP Mon Mar 31 17:29:00 UTC 2025 x86_64
Server: Apache
PHP Version: 8.2.29 [ PHP INFO ]
Operating System: Linux
Server Ip: 162.240.163.222
Your Ip: 216.73.216.145
Date Time: 2025-07-12 05:43:31
User: dilseshaadi (1027) | Group: dilseshaadi (1027)
Safe Mode: OFF
Disable Function: exec,passthru,shell_exec,system

name : meta-boxes-coupon.js
/* global kkart_admin_meta_boxes_coupon */
jQuery(function( $ ) {

	/**
	 * Coupon actions
	 */
	var kkart_meta_boxes_coupon_actions = {

		/**
		 * Initialize variations actions
		 */
		init: function() {
			$( 'select#discount_type' )
				.on( 'change', this.type_options )
				.change();

            this.insert_generate_coupon_code_button();
			$( '.button.generate-coupon-code' ).on( 'click', this.generate_coupon_code );
		},

		/**
		 * Show/hide fields by coupon type options
		 */
		type_options: function() {
			// Get value
			var select_val = $( this ).val();

			if ( 'percent' === select_val ) {
				$( '#coupon_amount' ).removeClass( 'kkart_input_price' ).addClass( 'kkart_input_decimal' );
			} else {
				$( '#coupon_amount' ).removeClass( 'kkart_input_decimal' ).addClass( 'kkart_input_price' );
			}

			if ( select_val !== 'fixed_cart' ) {
				$( '.limit_usage_to_x_items_field' ).show();
			} else {
				$( '.limit_usage_to_x_items_field' ).hide();
			}
        },

        /**
         * Insert generate coupon code buttom HTML.
         */
        insert_generate_coupon_code_button: function() {
			$( '.post-type-shop_coupon' ).find( '#title' ).after(
				'<a href="#" class="button generate-coupon-code">' + kkart_admin_meta_boxes_coupon.generate_button_text + '</a>'
			);
        },

		/**
		 * Generate a random coupon code
		 */
		generate_coupon_code: function( e ) {
			e.preventDefault();
			var $coupon_code_field = $( '#title' ),
				$coupon_code_label = $( '#title-prompt-text' ),
			    $result = '';
			for ( var i = 0; i < kkart_admin_meta_boxes_coupon.char_length; i++ ) {
				$result += kkart_admin_meta_boxes_coupon.characters.charAt(
					Math.floor( Math.random() * kkart_admin_meta_boxes_coupon.characters.length )
				);
			}
			$result = kkart_admin_meta_boxes_coupon.prefix + $result + kkart_admin_meta_boxes_coupon.suffix;
			$coupon_code_field.focus().val( $result );
			$coupon_code_label.addClass( 'screen-reader-text' );
		}
	};

	kkart_meta_boxes_coupon_actions.init();
});
© 2025 Faizzz-Chin