| 1 |
<?php |
| 2 |
get_header(); ?> |
| 3 |
<?php |
| 4 |
if ($_GET['order_id']) { |
| 5 |
global $wpcommerce; |
| 6 |
$order = wc_get_order($_GET['order_id']); |
| 7 |
} |
| 8 |
?> |
| 9 |
<script> |
| 10 |
jQuery(function ($) { |
| 11 |
$(".wpchatbot-wpcommerce-order").parents("body").addClass("wpchatbot-app-order-confirmation"); |
| 12 |
}) |
| 13 |
</script> |
| 14 |
<div class="wpchatbot-wpcommerce-order"> |
| 15 |
<?php if ($order) : ?> |
| 16 |
<?php if ($order->has_status('failed')) : ?> |
| 17 |
<p class="wpcommerce-notice wpcommerce-notice--error wpcommerce-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.', 'wpcommerce'); ?></p> |
| 18 |
<p class="wpcommerce-notice wpcommerce-notice--error wpcommerce-thankyou-order-failed-actions"> |
| 19 |
<a href="<?php echo esc_url($order->get_checkout_payment_url()); ?>" |
| 20 |
class="button pay"><?php esc_html_e('Pay', 'wpcommerce') ?></a> |
| 21 |
<?php if (is_user_logged_in()) : ?> |
| 22 |
<a href="<?php echo esc_url(wc_get_page_permalink('myaccount')); ?>" |
| 23 |
class="button pay"><?php esc_html_e('My account', 'wpcommerce'); ?></a> |
| 24 |
<?php endif; ?> |
| 25 |
</p> |
| 26 |
<?php else : ?> |
| 27 |
<p class="wpcommerce-notice wpcommerce-notice--success wpcommerce-thankyou-order-received"><?php echo apply_filters('wpcommerce_thankyou_order_received_text', __('Thank you. Your order has been received.', 'wpcommerce'), $order); ?></p> |
| 28 |
<ul class="wpcommerce-order-overview wpcommerce-thankyou-order-details order_details"> |
| 29 |
<li class="wpcommerce-order-overview__order order"> |
| 30 |
<?php esc_html_e('Order number:', 'wpcommerce'); ?> |
| 31 |
<strong><?php echo $order->get_order_number(); ?></strong> |
| 32 |
</li> |
| 33 |
<li class="wpcommerce-order-overview__date date"> |
| 34 |
<?php esc_html_e('Date:', 'wpcommerce'); ?> |
| 35 |
<strong><?php echo wc_format_datetime($order->get_date_created()); ?></strong> |
| 36 |
</li> |
| 37 |
<li class="wpcommerce-order-overview__total total"> |
| 38 |
<?php esc_html_e('Total:', 'wpcommerce'); ?> |
| 39 |
<strong><?php echo $order->get_formatted_order_total(); ?></strong> |
| 40 |
</li> |
| 41 |
<?php if ($order->get_payment_method_title()) : ?> |
| 42 |
<li class="wpcommerce-order-overview__payment-method method"> |
| 43 |
<?php esc_html_e('Payment method:', 'wpcommerce'); ?> |
| 44 |
<strong><?php echo wp_kses_post($order->get_payment_method_title()); ?></strong> |
| 45 |
</li> |
| 46 |
<?php endif; ?> |
| 47 |
</ul> |
| 48 |
<?php endif; ?> |
| 49 |
<?php do_action('wpcommerce_thankyou_' . $order->get_payment_method(), $order->get_id()); ?> |
| 50 |
<?php do_action('wpcommerce_thankyou', $order->get_id()); ?> |
| 51 |
<?php else : ?> |
| 52 |
<p class="wpcommerce-notice wpcommerce-notice--success wpcommerce-thankyou-order-received"><?php echo apply_filters('wpcommerce_thankyou_order_received_text', __('Thank you. Your order has been received.', 'wpcommerce'), null); ?></p> |
| 53 |
<?php endif; ?> |
| 54 |
<button class="wpchatbot-app-home-back"><?php esc_html_e('Tap on logo to go home', 'wpchatbot'); ?></button> |
| 55 |
</div> |
| 56 |
<?php |
| 57 |
get_footer(); |