How to add date/time in custom order notification

  • Posts: 40
  • Thank you received: 0
4 years 1 month 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: 82868
  • Thank you received: 13376
  • MODERATOR
4 years 1 month 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: 4 years 1 month ago by nicolas.

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

  • Posts: 40
  • Thank you received: 0
4 years 1 month ago #324614

Hi,

Thanks, it worked.

Thank you.

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

Time to create page: 0.062 seconds
Powered by Kunena Forum