Last active
November 22, 2021 02:55
-
-
Save somewherewarm-snippets/61b04a55380bd7f6d52a151b2d6107d4 to your computer and use it in GitHub Desktop.
Use this snippet to set a custom time (hour, minute) for delivering all gift card scheduled for delivery on a given date:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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