I needed this too and it wasn’t showing for me either. I looked in the plugin and it should be adding it, but for some reason it’s checking against a setting that isn’t available. I’m guessing it’s only in the Pro version. Anyway you can overwrite this by adding this snippet to your child theme functions.php:
add_action('woocommerce_before_add_to_cart_form', 'show_preorder_date', 12);
function show_preorder_date() {
global $post,$product;
if ($product !== null) {
if ('yes' == get_post_meta($post->ID, '_is_pre_order', true) && strtotime(get_post_meta($post->ID, '_pre_order_date', true)) > time()) {
$timeFormat = date_i18n(get_option('date_format'), strtotime(get_post_meta($post->ID, '_pre_order_date', true))) ;
$string = get_option('wc_preorders_avaiable_date_text');
$text = str_replace('{date_format}', $timeFormat, $string);
echo $text;
}
}
}
You can also add this hook to display the date in the shop loop:
add_action('woocommerce_after_shop_loop_item_title', 'show_preorder_date', 12);
-
This reply was modified 3 years, 5 months ago by Andrew.