Skip to content

Instantly share code, notes, and snippets.

@rajeshsingh520
Last active June 23, 2026 04:35
Show Gist options
  • Select an option

  • Save rajeshsingh520/f8e36dadd16f8773ead90163e470a024 to your computer and use it in GitHub Desktop.

Select an option

Save rajeshsingh520/f8e36dadd16f8773ead90163e470a024 to your computer and use it in GitHub Desktop.
add_action( 'wp_footer', function() {
if ( ! is_checkout() || is_order_received_page() ) {
return;
}
?>
<script>
jQuery(function($) {
function toggleDeliveryDateBlock() {
var giftValue = $('select[name="1728035537403_select_1728036013112"]').val();
if (giftValue && giftValue.toLowerCase() === 'igen') {
$('#pi_checkout_field').attr('style', 'display: none !important; visibility: hidden !important;');
$('.pisol-date-time-approx-message').attr('style', 'display: none !important; visibility: hidden !important;');
} else {
$('#pi_checkout_field').attr('style', 'display: block !important; visibility: visible !important;');
$('.pisol-date-time-approx-message').attr('style', 'display: block !important; visibility: visible !important;');
}
}
toggleDeliveryDateBlock();
var isPickup = $('input[name="pi_delivery_type"]').val().toLowerCase() === 'pickup';
if(isPickup){
$('select[name="1728035537403_select_1728036013112"]').prop('disabled',true);
}
$(document).on('change', 'select[name="1728035537403_select_1728036013112"]', function() {
toggleDeliveryDateBlock();
});
});
</script>
<?php
}, 999 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment