Custom Script

mail@pastecode.io avatar
unknown
php
2 years ago
3.1 kB
1
Indexable
Never
<?php 
add_action( 'wp_footer', function () { ?>

<script>
	// Active Tab Conatct Page
	jQuery('ul.custom li a').filter(function(){
  return this.href === location.href;
}).addClass('active');
</script>
<script>
	// SHIPPING METHOD POSITION CHANGE
	jQuery('#delivery_points').insertAfter('.websites-depot-checkout-review-shipping-table');
	jQuery('#billing_address_1_field').insertAfter('#delivery_points');
    jQuery(document).ready(function(){
    
		// SHOW HIDE SECTIONS   
	jQuery( '#billing_city' ).change( function () {
    jQuery('#customer_details').addClass('show-section');
	jQuery('#custom_heading').addClass('show-section');
		
		
});
		
		
		if(jQuery('#billing_state_id').val() !='' ) {
            jQuery('#customer_details').addClass('show-section');
			jQuery('#custom_heading').addClass('show-section');
			}
});
 </script>  
   <script>
	   <script>
jQuery(document).ready(function(){
		   // FNAME
	jQuery('input#billing_first_name').keyup(function() {
		if( jQuery(this).val() == '' ) {
		  jQuery('form.woocommerce-checkout').removeClass('success_green');
		}
		else {
		  
			// PHONE
			jQuery('input#billing_phone').keyup(function() {
			  if( jQuery(this).val() == '' ) {
				jQuery('form.woocommerce-checkout').removeClass('success_green');
			  }
			  else {
				jQuery('form.woocommerce-checkout').addClass('success_green');
			  }
			});
			// CITY
			jQuery('billing_city').change(function() {
			  if( jQuery(this).val() == '' ) {
				jQuery('form.woocommerce-checkout').removeClass('success_green');
			  }
			  else {
				jQuery('form.woocommerce-checkout').addClass('success_green');
			  }
			});
		}
	});
		   });
</script>
<script type="text/javascript">
	// Close Serach Box on Click Outside
    jQuery("body").click(function(e) {
        if (e.target.id == "search-drawer" || jQuery(e.target).parents("#search-drawer").length) {
          if(!jQuery(e.target).closest('.search-form').length) {
                jQuery('#search-drawer').removeClass('show-drawer active pop-animated');
                jQuery('body').removeClass('showing-popup-drawer-from-full');
            }
        }
    });
</script>
<script>
	// Enable/Disable One Click Buy Button
	jQuery("button.clickBuyButton").click(function(){
  jQuery("button.clickBuyButton").removeClass("single_add_to_cart_button");
		jQuery('.button.clickBuyButton').removeClass('disabled');
		jQuery('.button.clickBuyButton').removeClass('wc-variation-selection-needed');
});
	
</script>
<script>
	jQuery(document).ready(function() {
	  jQuery('.button.clickBuyButton').removeClass('disabled');
		jQuery('.button.clickBuyButton').removeClass('wc-variation-selection-needed');
		jQuery('.button.clickBuyButton').addClass('enabled');
		// Close Size Popup on click outside
		jQuery('body').click(function(e) {
    if (!jQuery(e.target).is(".kt-size-modal") === false) {
        jQuery(".kt-size-modal").removeClass('kt-modal-open');
    }
});
		
});
</script>

<?php } );