How to add date/time in custom order notification

  • Posts: 40
  • Thank you received: 0
3 years 5 months ago #324572

-- HikaShop version -- : 4.3.0
-- Joomla version -- : 3.9.20
-- PHP version -- : 7.3

Hi,

can you please tell me how do i add order date and time in customized order notification mail template? i am trying options here as you see in this screenshot, prntscr.com/uvn0rv but nowhere i find order date and time vars to select, so can you tell me how do i add them in html version of the part?

Thank you.

Please Log in or Create an account to join the conversation.

  • Posts: 81361
  • Thank you received: 13035
  • MODERATOR
3 years 5 months ago #324589

Hi,

The order creation date and time is stored in the order_created field.
So you can use {VAR:order.order_created}
However, this will output the raw date from the database, which should just be a number.
If you want a human readable date and time, you'll have to add PHP code like that:

<?php echo hikashop_getDate($data->cart->order_created, '%d %B %Y %H:%M'); ?>

Last edit: 3 years 5 months ago by nicolas.

Please Log in or Create an account to join the conversation.

  • Posts: 40
  • Thank you received: 0
3 years 5 months ago #324614

Hi,

Thanks, it worked.

Thank you.

Please Log in or Create an account to join the conversation.

Time to create page: 0.059 seconds
Powered by Kunena Forum