• Resolved bundelmedia

    (@bundelmedia)


    Hi,

    what action / filter do I need to use to be able to add pickup time on thank you page?
    I have tried this:

    add_action( 'woocommerce_thankyou', 'wc_checkout_add_order_pickup_time');
    function wc_checkout_add_order_pickup_time($order) {
        $pickup_time = $order->get_meta( '_local_pickup_time_select');
        echo '<p>'.__("Pickup time") . ': ' . $pickup_time . '</p>';
    }

    unfortunately it did not work (got blank page)

    • This topic was modified 6 years, 1 month ago by bundelmedia.
Viewing 1 replies (of 1 total)
  • Thread Starter bundelmedia

    (@bundelmedia)

    ah, nevermind….
    I finally got it right

    add_action( 'woocommerce_thankyou', 'wc_checkout_add_order_pickup_time');
    function wc_checkout_add_order_pickup_time($order_id) {
    	
    	// Get the order from the id & the info we need
    	$order = wc_get_order($order_id);
    	$pickup_time = date_i18n( date( "H:i", $order->get_meta( '_local_pickup_time_select', true) ) );
    	
    	echo '<h2>' . __( 'Pickup Time', 'woocommerce-local-pickup-time' ) . '</h2> <span class="wc_thankyou_pickup_time">' . $pickup_time . '</span>';
    }
Viewing 1 replies (of 1 total)
  • The topic ‘Pickup time on thank you page’ is closed to new replies.