Dispatch Countdown
Specify a time to show (and start) the count down, and an end time to count down to. Ideal for displaying a message such as “For same day dispatch, order within 1h 37m”.
Specify a time to show (and start) the count down, and an end time to count down to.
Ideal for displaying a message such as “For same day dispatch, order within 1h 37m”.
Screenshots & previews.
This section describes how to install the plugin and get it working.
- 01Upload the plugin files to the /wp-content/plugins/dispatch-countdown directory, or install the plugin through the WordPress plugins screen directly.
- 02Activate the plugin through the ‘Plugins’ screen in WordPress
- 03Use the WooCommerce->Settings->Product Settings->Dispatch Countdown screen to configure the plugin
Frequently asked questions.
How do I move the countdown?
The countdown must be called at a point where global $product is available, so make sure to call this plugin after WooCommerce has loaded. To move the countdown, you can remove the action and then add it back wherever you want:
/** * Move dispatch countdown */ function your_theme_move_dispatch_countdown() { // Check the class exists if ( ! class_exists( 'Dispatch_Countdown' ) ) { return; } // Get the current instance $dispatch_countdown = Dispatch_Countdown::get_public_instance(); // Remove the action remove_action( 'woocommerce_before_single_product', array( $dispatch_countdown, 'display_countdown' ) ); // Add the action back where you like add_action( 'your_theme_before_main_container', array( $dispatch_countdown, 'display_countdown' ) ); } add_action( 'init', 'your_theme_move_dispatch_countdown' );
Replacing your_theme_before_main_container with whichever hook you wish
How do I change the HTML output?
There are a few filters available to override certain parts of the output. The main filter is dispatch_countdown_content and can be used as follows: