What code can I use to add mention of the time to a customer email?

The plugin will automatically over-ride the default WooCommerce email templates in order to include the chosen time in emails to both site owners and customers. However, if you are using some other email tool which over-rides this further, and in which this is not shown, there here is the code that you will need; you may have to ask the supplier of your chosen WooCommerce email creation tool how it can be used with their tool:

global $woocommerce_opening_hours;
$time = $order->get_meta('_openinghours_time', true);
if ($time && 'noorders' !== $woocommerce_opening_hours->get_customer_choice()) {
  echo '<strong>'.__('Time chosen', 'openinghours').':</strong> ".$woocommerce_opening_hours->get_display_time_from_meta($time);
}

 

Posted in: WooCommerce Opening Hours and Delivery Times