Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save rajeshsingh520/8299dcbc50ceeee3dc4a55c3431a18e8 to your computer and use it in GitHub Desktop.
Save rajeshsingh520/8299dcbc50ceeee3dc4a55c3431a18e8 to your computer and use it in GitHub Desktop.
This code cleard the date value when you are using the plugin https://wordpress.org/plugins/woo-save-abandoned-carts/ so retained sate is not maintained for date
<?php
/*
Make sure auto selection of date and time is disabled
https://wordpress.org/plugins/woo-save-abandoned-carts/
*/
add_action('wp_enqueue_scripts', 'pisol_clearValue');
function pisol_clearValue(){
 if(is_checkout()){
 $js = 'jQuery(function ($) {
            setTimeout(\'jQuery("#pi_delivery_date").val("")\',100);
        });';
  wp_add_inline_script( 'jquery', $js, 'after' );
 }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment