• Resolved bashy

    (@bashy)


    Hi

    Hoe to echo field value delivery date within thankyou.php template?

    I’m using

    <li class=”order”>

    <p>Delivery date: <?php echo get_post_meta(get_the_ID(), ‘Field Label’, true); ?></p>

    But it’s not working.
    Any help would be greatly appreciated!
    Thanks

    • This topic was modified 4 years, 7 months ago by bashy.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support chetnapatel

    (@chetnapatel)

    Hi @bashy,

    In the above code, please change ‘Field Label’ to the text of the delivery date field which is set in the Date Field label of the Appearance tab. Attaching the screenshot for your reference: https://prnt.sc/rxbbf9

    Also, please check if you are getting the order id with get_the_ID() function. As you can fetch the delivery date for each order.

    Do let me know if you need any further information.

    Regards,
    Chetna Bhutka

    Thread Starter bashy

    (@bashy)

    Hi Chetna,

    Thanks for your response.
    The text ‘Field Label’ in the code was an example! the actual text im using is ‘Chosen date’ which is set in the Date Field label under the Appearance tab as you mentioned above.

    It seems the problem is with fetching the delivery date for each order.
    So how to get the order id for each order with get_the_ID() function?

    I would be highly appreciated if you could guide me.

    Regards,
    Bashy

    Plugin Support chetnapatel

    (@chetnapatel)

    Hi Bashy,

    You can use $order->get_id() to get the order id.

    Regards,
    Chetna Bhutka

    Thread Starter bashy

    (@bashy)

    It works!
    Thanks a lot Chetna for your support, i appreciate it!

    
    <li class="order">
    			Delivery date: <strong><?php echo get_post_meta($order->get_id(), 'Delivery date', true); ?></strong>
    			</li>
    
    Plugin Support chetnapatel

    (@chetnapatel)

    That’s nice Bashy.

    Thank you for giving us the review.

    Regards,
    Chetna Bhutka

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Displaying delivery date on thank you page’ is closed to new replies.