Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Use this snippet to set a custom time (hour, minute) for delivering all gift card scheduled for delivery on a given date:
<?php
/**
* Plugin Name: WooCommerce Gift Cards - Send scheduled gift cards at a fixed time
* Plugin URI: https://woocommerce.com/products/gift-cards/
* Description: Use this snippet to set a custom time (hour, minute) for delivering all gift card scheduled for delivery on a given date.
* Version: 1.0
* Author: WooCommerce
* Author URI: https://woocommerce.com/
* Developer: Jason Kytros
*
*
* Copyright: © 2021 Automattic
* License: GNU General Public License v3.0
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
*/
add_filter( 'woocommerce_gc_scheduled_delivery_hour', 'sw_gc_set_scheduled_delivery_hour' );
add_filter( 'woocommerce_gc_scheduled_delivery_minute', 'sw_gc_set_scheduled_delivery_minute' );
function sw_gc_set_scheduled_delivery_hour( $hour ) {
$hour = 0; // 0 - 23
return $hour;
}
function sw_gc_set_scheduled_delivery_minute( $minute ) {
$minute = 0; // 0 - 59
return $minute;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment