Change delivery time for scheduled gift cards

To view the scheduled times for your WP Cron events, we recommend installing the free WP Crontrol plugin:

https://wordpress.org/plugins/wp-crontrol/

After installing WP Crontrol, go to Tools > Cron Events > Search for “pw_gift_cards_delivery” and see the schedule.

Perform the following steps to change the schedule start time for this job.

1. Download the free Code Snippets plugin: https://wordpress.org/plugins/code-snippets/
2. Create a new Snippet with the following code (or add to your Child Theme’s functions.php if you prefer):

function custom_pwgc_scheduled_email_start_time( $timestamp ) {
    //
    // By default, gift cards are scheduled for midnight based on the timezone
    // configured in WordPress found under Settings -> General -> Timezone.
    //
    // For example, to run at 3pm each day:
    //
    $timestamp = pwgc_strtotime( 'tomorrow 3:00pm' );

    return $timestamp;
}
add_filter( 'pwgc_scheduled_email_start_time', 'custom_pwgc_scheduled_email_start_time' );

3. IMPORTANT – The job is already scheduled so you must deactivate the plugin to clear the job. Click on Plugins -> Installed Plugins -> Scroll down to PW WooCommerce Gift Cards and click “Deactivate”.
4. After it has been deactivated, click on “Activate” to start it back up and schedule the job using your new settings.

For more information about this timestamp, see the WordPress Codex: https://developer.wordpress.org/reference/functions/wp_schedule_event/

 

Skip to content