Merge branch 'pr/16036'

This commit is contained in:
Mike Jolley 2017-08-09 10:11:20 +01:00
commit 30a85e9f8d
2 changed files with 51 additions and 29 deletions

View File

@ -157,34 +157,7 @@ class WC_Shortcode_Checkout {
if ( $order->needs_payment() ) { if ( $order->needs_payment() ) {
?> wc_get_template( 'checkout/order-receipt.php', array( 'order' => $order ) );
<ul class="order_details">
<li class="order">
<?php _e( 'Order number:', 'woocommerce' ); ?>
<strong><?php echo $order->get_order_number(); ?></strong>
</li>
<li class="date">
<?php _e( 'Date:', 'woocommerce' ); ?>
<strong><?php echo wc_format_datetime( $order->get_date_created() ); ?></strong>
</li>
<li class="total">
<?php _e( 'Total:', 'woocommerce' ); ?>
<strong><?php echo $order->get_formatted_order_total(); ?></strong>
</li>
<?php if ( $order->get_payment_method_title() ) : ?>
<li class="method">
<?php _e( 'Payment method:', 'woocommerce' ); ?>
<strong><?php
echo wp_kses_post( $order->get_payment_method_title() );
?></strong>
</li>
<?php endif; ?>
</ul>
<?php do_action( 'woocommerce_receipt_' . $order->get_payment_method(), $order_id ); ?>
<div class="clear"></div>
<?php
} else { } else {
wc_add_notice( sprintf( __( 'This order&rsquo;s status is &ldquo;%s&rdquo;&mdash;it cannot be paid for. Please contact us if you need assistance.', 'woocommerce' ), wc_get_order_status_name( $order->get_status() ) ), 'error' ); wc_add_notice( sprintf( __( 'This order&rsquo;s status is &ldquo;%s&rdquo;&mdash;it cannot be paid for. Please contact us if you need assistance.', 'woocommerce' ), wc_get_order_status_name( $order->get_status() ) ), 'error' );

View File

@ -0,0 +1,49 @@
<?php
/**
* Checkout Order Receipt Template
*
* This template can be overridden by copying it to yourtheme/woocommerce/checkout/order-receipt.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* @see https://docs.woocommerce.com/document/template-structure/
* @author WooThemes
* @package WooCommerce/Templates
* @version 3.2.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
?>
<ul class="order_details">
<li class="order">
<?php esc_html_e( 'Order number:', 'woocommerce' ); ?>
<strong><?php echo esc_html( $order->get_order_number() ); ?></strong>
</li>
<li class="date">
<?php esc_html_e( 'Date:', 'woocommerce' ); ?>
<strong><?php echo esc_html( wc_format_datetime( $order->get_date_created() ) ); ?></strong>
</li>
<li class="total">
<?php esc_html_e( 'Total:', 'woocommerce' ); ?>
<strong><?php echo wp_kses_post( $order->get_formatted_order_total() ); ?></strong>
</li>
<?php if ( $order->get_payment_method_title() ) : ?>
<li class="method">
<?php esc_html_e( 'Payment method:', 'woocommerce' ); ?>
<strong><?php
echo wp_kses_post( $order->get_payment_method_title() );
?></strong>
</li>
<?php endif; ?>
</ul>
<?php do_action( 'woocommerce_receipt_' . $order->get_payment_method(), $order_id ); ?>
<div class="clear"></div>