add order date to commerce-order-receipt.html.twig

Created on 10 June 2024, 5 months ago
Updated 27 June 2024, 5 months ago

Describe your bug or feature request.

How do I print the order complete date in commerce-order-receipt.html.twig

If a bug, provide steps to reproduce it from a clean install.

I tried
{{ 'Order date @date'|t({'@date': order_entity.getOrderComplete}) }}

but no success

In my country the order date must be supplied with the order receipt.

Thanks

💬 Support request
Status

Fixed

Version

2.0

Component

Order

Created by

🇿🇦South Africa vlooi vlerke

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @vlooi vlerke
  • Status changed to Fixed 5 months ago
  • 🇮🇱Israel jsacksick

    The "completed" time is when the order state was set to "completed", which is likely not the case when the order is placed... You're likely looking for the order placed time instead...
    Also, this would just print a timestamp which is probably not what you want... Additionally, support requests are generally not answered from this queue.

    I think you're looking for "getPlacedTime".
    So something like...
    ({{ order_entity.getPlacedTime|format_date('html_date') }})

  • Automatically closed - issue fixed for 2 weeks with no activity.

  • 🇿🇦South Africa vlooi vlerke

    Just to confirm

    ({{ order_entity.getPlacedTime|format_date('html_date') }})

    works

    Thanks

Production build 0.71.5 2024