我正在尝试更改保留电子邮件,以在简介中包含订单号。
我添加了“ $ order-> get_id()”以显示订单号。不太正常。有任何想法吗?
<p><?php esc_html_e( 'Thanks for your order. Your order number is $order->get_id(). Below you can find the contents of your order.', 'woocommerce' ); ?></p>
您需要在字符串中连接订单号……您可以使用一种更好的方法,printf()
其WC_Order
方法get_order_number()
如下:
<p><?php printf( esc_html__( 'Thanks for your order. Your order number is %s. Below you can find the contents of your order.', 'woocommerce' ), $order->get_order_number() ); ?></p>
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句