$66 GRAYBYTE WORDPRESS FILE MANAGER $35

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 104.21.43.35 | ADMIN IP 216.73.216.157
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : mail

/var/softaculous/sitepad/editor/site-data/plugins/kkart-pro/assets/js/frontend/

HOME
Current File : /var/softaculous/sitepad/editor/site-data/plugins/kkart-pro/assets/js/frontend//geolocation.js
/*global kkart_geolocation_params */
jQuery( function( $ ) {

	var this_page = window.location.toString();

	var $append_hashes = function() {
		if ( kkart_geolocation_params.hash ) {
			$( 'a[href^="' + kkart_geolocation_params.home_url + '"]:not(a[href*="v="]), a[href^="/"]:not(a[href*="v="])' ).each( function() {
				var $this      = $( this ),
					href       = $this.attr( 'href' ),
					href_parts = href.split( '#' );

				href = href_parts[0];

				if ( href.indexOf( '?' ) > 0 ) {
					href = href + '&v=' + kkart_geolocation_params.hash;
				} else {
					href = href + '?v=' + kkart_geolocation_params.hash;
				}

				if ( typeof href_parts[1] !== 'undefined' && href_parts[1] !== null ) {
					href = href + '#' + href_parts[1];
				}

				$this.attr( 'href', href );
			});
		}
	};

	var $geolocation_redirect = function( hash ) {
		if ( this_page.indexOf( '?v=' ) > 0 || this_page.indexOf( '&v=' ) > 0 ) {
			this_page = this_page.replace( /v=[^&]+/, 'v=' + hash );
		} else if ( this_page.indexOf( '?' ) > 0 ) {
			this_page = this_page + '&v=' + hash;
		} else {
			this_page = this_page + '?v=' + hash;
		}

		window.location = this_page;
	};

	var $geolocate_customer = {
		url: kkart_geolocation_params.kkart_ajax_url.toString().replace( '%%endpoint%%', 'get_customer_location' ),
		type: 'GET',
		success: function( response ) {
			if ( response.success && response.data.hash && response.data.hash !== kkart_geolocation_params.hash ) {
				$geolocation_redirect( response.data.hash );
			}
		}
	};

	if ( '1' === kkart_geolocation_params.is_available ) {
		$.ajax( $geolocate_customer );

		// Support form elements
		$( 'form' ).each( function() {
			var $this  = $( this );
			var method = $this.attr( 'method' );
			var hasField = $this.find('input[name="v"]').length > 0;

			if ( method && 'get' === method.toLowerCase() && !hasField ) {
				$this.append( '<input type="hidden" name="v" value="' + kkart_geolocation_params.hash + '" />' );
			} else {
				var href = $this.attr( 'action' );
				if ( href ) {
					if ( href.indexOf( '?' ) > 0 ) {
						$this.attr( 'action', href + '&v=' + kkart_geolocation_params.hash );
					} else {
						$this.attr( 'action', href + '?v=' + kkart_geolocation_params.hash );
					}
				}
			}
		});

		// Append hashes on load
		$append_hashes();
	}

	$( document.body ).on( 'added_to_cart', function() {
		$append_hashes();
	});
	
	// Enable user to trigger manual append hashes on AJAX operations
	$( document.body ).on( 'kkart_append_geo_hashes', function() {
		$append_hashes();
	});

});


Current_dir [ NOT WRITEABLE ] Document_root [ NOT WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
21 Feb 2026 2.55 AM
root / root
0755
add-payment-method.js
1.054 KB
18 Feb 2026 11.32 PM
root / root
0644
add-payment-method.min.js
0.704 KB
18 Feb 2026 11.32 PM
root / root
0644
add-to-cart-variation.js
28.076 KB
18 Feb 2026 11.32 PM
root / root
0644
add-to-cart-variation.min.js
13.881 KB
18 Feb 2026 11.32 PM
root / root
0644
add-to-cart.js
5.685 KB
18 Feb 2026 11.32 PM
root / root
0644
add-to-cart.min.js
3.001 KB
18 Feb 2026 11.32 PM
root / root
0644
address-i18n.js
4.839 KB
18 Feb 2026 11.32 PM
root / root
0644
address-i18n.min.js
2.557 KB
18 Feb 2026 11.32 PM
root / root
0644
cart-fragments.js
5.574 KB
18 Feb 2026 11.32 PM
root / root
0644
cart-fragments.min.js
2.919 KB
18 Feb 2026 11.32 PM
root / root
0644
cart.js
15.25 KB
18 Feb 2026 11.32 PM
root / root
0644
cart.min.js
7.333 KB
18 Feb 2026 11.32 PM
root / root
0644
checkout.js
24.216 KB
18 Feb 2026 11.32 PM
root / root
0644
checkout.min.js
13.55 KB
18 Feb 2026 11.32 PM
root / root
0644
country-select.js
6.042 KB
18 Feb 2026 11.32 PM
root / root
0644
country-select.min.js
3.221 KB
18 Feb 2026 11.32 PM
root / root
0644
credit-card-form.js
0.598 KB
18 Feb 2026 11.32 PM
root / root
0644
credit-card-form.min.js
0.529 KB
18 Feb 2026 11.32 PM
root / root
0644
geolocation.js
2.499 KB
18 Feb 2026 11.32 PM
root / root
0644
geolocation.min.js
1.303 KB
18 Feb 2026 11.32 PM
root / root
0644
kkart.js
3.161 KB
18 Feb 2026 11.32 PM
root / root
0644
kkart.min.js
1.917 KB
18 Feb 2026 11.32 PM
root / root
0644
lost-password.js
0.155 KB
18 Feb 2026 11.32 PM
root / root
0644
lost-password.min.js
0.129 KB
18 Feb 2026 11.32 PM
root / root
0644
password-strength-meter.js
3.718 KB
18 Feb 2026 11.32 PM
root / root
0644
password-strength-meter.min.js
1.977 KB
18 Feb 2026 11.32 PM
root / root
0644
price-slider.js
2.854 KB
18 Feb 2026 11.32 PM
root / root
0644
price-slider.min.js
1.987 KB
18 Feb 2026 11.32 PM
root / root
0644
single-product.js
10.116 KB
18 Feb 2026 11.32 PM
root / root
0644
single-product.min.js
6.125 KB
18 Feb 2026 11.32 PM
root / root
0644
tokenization-form.js
3.725 KB
18 Feb 2026 11.32 PM
root / root
0644
tokenization-form.min.js
2.175 KB
18 Feb 2026 11.32 PM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF