| 1 |
<?php |
| 2 |
/** |
| 3 |
* Thankyou page |
| 4 |
* |
| 5 |
* This template can be overridden by copying it to yourtheme/woocommerce/checkout/thankyou.php. |
| 6 |
* |
| 7 |
* HOWEVER, on occasion WooCommerce will need to update template files and you |
| 8 |
* (the theme developer) will need to copy the new files to your theme to |
| 9 |
* maintain compatibility. We try to do this as little as possible, but it does |
| 10 |
* happen. When this occurs the version of the template file will be bumped and |
| 11 |
* the readme will list any important changes. |
| 12 |
* |
| 13 |
* @see https://docs.woocommerce.com/document/template-structure/ |
| 14 |
* @package WooCommerce\Templates |
| 15 |
* @version 3.7.0 |
| 16 |
*/ |
| 17 |
|
| 18 |
defined( 'ABSPATH' ) || exit; |
| 19 |
|
| 20 |
$thankyou_id = wcf()->flow->get_thankyou_page_id( $order ); |
| 21 |
$thankyou_layout = wcf()->options->get_thankyou_meta_value( $thankyou_id, 'wcf-tq-layout' ); |
| 22 |
?> |
| 23 |
|
| 24 |
<div class="woocommerce-order wcf-<?php echo esc_attr( $thankyou_layout ); ?>"> |
| 25 |
|
| 26 |
<?php |
| 27 |
if ( $order ) : |
| 28 |
|
| 29 |
do_action( 'woocommerce_before_thankyou', $order->get_id() ); |
| 30 |
?> |
| 31 |
|
| 32 |
<?php if ( $order->has_status( 'failed' ) ) : ?> |
| 33 |
|
| 34 |
<p class="woocommerce-notice woocommerce-notice--error woocommerce-thankyou-order-failed"><?php esc_html_e( 'Unfortunately your order cannot be processed as the originating bank/merchant has declined your transaction. Please attempt your purchase again.', 'woocommerce' ); ?></p> |
| 35 |
|
| 36 |
<p class="woocommerce-notice woocommerce-notice--error woocommerce-thankyou-order-failed-actions"> |
| 37 |
<a href="<?php echo esc_url( $order->get_checkout_payment_url() ); ?>" class="button pay"><?php esc_html_e( 'Pay', 'woocommerce' ); ?></a> |
| 38 |
<?php if ( is_user_logged_in() ) : ?> |
| 39 |
<a href="<?php echo esc_url( wc_get_page_permalink( 'myaccount' ) ); ?>" class="button pay"><?php esc_html_e( 'My account', 'woocommerce' ); ?></a> |
| 40 |
<?php endif; ?> |
| 41 |
</p> |
| 42 |
|
| 43 |
<?php else : |
| 44 |
if ( 'legacy-tq-layout' === $thankyou_layout) { |
| 45 |
?> |
| 46 |
<p class="woocommerce-notice woocommerce-notice--success woocommerce-thankyou-order-received"><?php echo apply_filters( 'woocommerce_thankyou_order_received_text', esc_html__( 'Thank you. Your order has been received.', 'woocommerce' ), $order ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></p> |
| 47 |
<?php |
| 48 |
} |
| 49 |
if ( $order->has_status( 'cancelled' ) ) : |
| 50 |
do_action( 'cartflows_woocommerce_order_overview_cancelled', $order ); |
| 51 |
endif; ?> |
| 52 |
<ul class="woocommerce-order-overview woocommerce-thankyou-order-details order_details"> |
| 53 |
|
| 54 |
<li class="woocommerce-order-overview__order order"> |
| 55 |
<?php esc_html_e( 'Order number:', 'woocommerce' ); ?> |
| 56 |
<strong><?php echo $order->get_order_number(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></strong> |
| 57 |
</li> |
| 58 |
<li class="woocommerce-order-overview__date date"> |
| 59 |
<?php |
| 60 |
if ( 'modern-tq-layout' === $thankyou_layout ) { |
| 61 |
esc_html_e( 'Order Date:', 'woocommerce' ); ?> |
| 62 |
<p><?php echo wc_format_datetime( $order->get_date_created() ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></p> |
| 63 |
<?php |
| 64 |
} elseif ( 'tq-layout-3' === $thankyou_layout ) { |
| 65 |
?> |
| 66 |
<strong><?php esc_html_e( 'Order Date:', 'woocommerce' ); ?></strong> |
| 67 |
<p><?php echo wc_format_datetime( $order->get_date_created() ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></p> |
| 68 |
<?php |
| 69 |
} else { |
| 70 |
esc_html_e( 'Date:', 'woocommerce' ); ?> |
| 71 |
<strong><?php echo wc_format_datetime( $order->get_date_created() ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></strong> |
| 72 |
<?php |
| 73 |
} |
| 74 |
?> |
| 75 |
</li> |
| 76 |
<?php if ( is_user_logged_in() && $order->get_user_id() === get_current_user_id() && $order->get_billing_email() ) : ?> |
| 77 |
<li class="woocommerce-order-overview__email email"> |
| 78 |
<?php esc_html_e( 'Email:', 'woocommerce' ); ?> |
| 79 |
<strong><?php echo $order->get_billing_email(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></strong> |
| 80 |
</li> |
| 81 |
<?php endif; ?> |
| 82 |
|
| 83 |
<li class="woocommerce-order-overview__total total"> |
| 84 |
<?php esc_html_e( 'Total:', 'woocommerce' ); ?> |
| 85 |
<strong><?php echo $order->get_formatted_order_total(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></strong> |
| 86 |
</li> |
| 87 |
|
| 88 |
<?php if ( $order->get_payment_method_title() ) : ?> |
| 89 |
<li class="woocommerce-order-overview__payment-method method"> |
| 90 |
<?php if ( 'modern-tq-layout' === $thankyou_layout ) { ?> |
| 91 |
|
| 92 |
<?php esc_html_e( 'Payment method:', 'woocommerce' ); ?> |
| 93 |
<p><?php echo wp_kses_post( $order->get_payment_method_title() ); ?></p> |
| 94 |
|
| 95 |
<?php } elseif ( 'tq-layout-3' === $thankyou_layout ) { ?> |
| 96 |
|
| 97 |
<strong><?php esc_html_e( 'Payment method:', 'woocommerce' ); ?></strong> |
| 98 |
<p><?php echo wp_kses_post( $order->get_payment_method_title() ); ?></p> |
| 99 |
|
| 100 |
<?php } else { ?> |
| 101 |
|
| 102 |
<?php esc_html_e( 'Payment method:', 'woocommerce' ); ?> |
| 103 |
<strong><?php echo wp_kses_post( $order->get_payment_method_title() ); ?></strong> |
| 104 |
|
| 105 |
<?php } ?> |
| 106 |
</li> |
| 107 |
<?php endif; ?> |
| 108 |
|
| 109 |
</ul> |
| 110 |
|
| 111 |
<?php endif; ?> |
| 112 |
<?php |
| 113 |
if('legacy-tq-layout' === $thankyou_layout) { |
| 114 |
do_action( 'woocommerce_thankyou_' . $order->get_payment_method(), $order->get_id() ); |
| 115 |
} |
| 116 |
?> |
| 117 |
<?php do_action( 'woocommerce_thankyou', $order->get_id() ); ?> |
| 118 |
|
| 119 |
<?php else : ?> |
| 120 |
|
| 121 |
<p class="woocommerce-notice woocommerce-notice--success woocommerce-thankyou-order-received"><?php echo apply_filters( 'woocommerce_thankyou_order_received_text', esc_html__( 'Thank you. Your order has been received.', 'woocommerce' ), null ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></p> |
| 122 |
|
| 123 |
<?php endif; ?> |
| 124 |
|
| 125 |
</div> |
| 126 |
|