WooCommerce商城前端订单显示完整的日期时间

在使用WooCommerce的时候,用户提交的订单在前端用户中心中只显示日期不显示日期,下面就说下如何显示完整的日期时间

操作步骤

先从插件目录【woocommerce\templates\myaccount】目录中找到【orders.php】文件打开他并在大概第55行找到如下代码

  1. <timexa0datetime="<?phpxa0echoxa0esc_attr(xa0$order->get_date_created()->date(xa0'c'xa0)xa0);xa0?>"><?phpxa0echoxa0esc_html(xa0wc_format_datetime(xa0$order->get_date_created())xa0);xa0?></time>

将其改为

  1. <timexa0datetime="<?phpxa0echoxa0esc_attr(xa0$order->get_date_created()->date(xa0'c'xa0)xa0);xa0?>"><?phpxa0echoxa0esc_html(xa0wc_format_datetime(xa0$order->get_date_created()xa0xa0,'Y年n月j日G时i分s秒')xa0);xa0?></time>

WordPress基础
喜欢就支持以下吧
  • 本文由 倾尘SEO 发表于 2018年5月9日
  • 转载请务必保留本文链接:https://www.qcwlseo.com/order-display-complete-date-time.html

评论

   0   访客  0
  • 波浪
  • 波浪
  • 波浪
  • 波浪