Home Forums Plugins WooCommerce Email Template Customizer shortcode not work “Order Time”

shortcode not work “Order Time”

  • Author
    Posts
  • #191825

    mfgsc
    Participant

    Hello,
    I would like to use the order time in the email.
    I wrote a code for this and inserted it into functions.php:

    add_shortcode('order_time_cs', 'shortcode_order_time_cs');	// Shortcode registrieren
    function shortcode_order_time_cs() {
    	$time = "No Time";
    	if ( $order ) {
    		$time = $order->get_date_created()->format ('h:i:s'); // Uhrzeit holen
    	}
    	return $time;
    }

    In the email template I insert the shortcode with [order_time_cs].
    Unfortunately the only output I get is “No Time”

    I’m asking for your help.
    Many thanks.
    Kind regards

You must be logged in to see replies to this topic. Click here to login or register