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