snave07

thankyou.php

Oct 13th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.88 KB | None | 0 0
  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. * @author WooThemes
  15. * @package WooCommerce/Templates
  16. * @version 3.2.0
  17. */
  18.  
  19. if ( ! defined( 'ABSPATH' ) ) {
  20. exit;
  21. }
  22.  
  23. wp_enqueue_script('thegem-woocommerce');
  24. ?>
  25.  
  26. <div class="woocommerce-order">
  27.  
  28. <?php if ( $order ) : ?>
  29.  
  30. <?php if ( $order->has_status( 'failed' ) ) : ?>
  31.  
  32. <p class="woocommerce-notice woocommerce-notice--error woocommerce-thankyou-order-failed"><?php _e( 'Unfortunately your order cannot be processed as the originating bank/merchant has declined your transaction. Please attempt your purchase again.', 'woocommerce' ); ?></p>
  33.  
  34. <p class="woocommerce-notice woocommerce-notice--error woocommerce-thankyou-order-failed-actions">
  35. <a href="<?php echo esc_url( $order->get_checkout_payment_url() ); ?>" class="button pay"><?php _e( 'Pay', 'woocommerce' ) ?></a>
  36. <?php if ( is_user_logged_in() ) : ?>
  37. <a href="<?php echo esc_url( wc_get_page_permalink( 'myaccount' ) ); ?>" class="button pay"><?php _e( 'My account', 'woocommerce' ); ?></a>
  38. <?php endif; ?>
  39. </p>
  40.  
  41. <?php else : ?>
  42.  
  43. <p class="woocommerce-notice woocommerce-notice--success woocommerce-thankyou-order-received"><?php echo apply_filters( 'woocommerce_thankyou_order_received_text', __( 'Thank you. Your order has been received.', 'woocommerce' ), $order ); ?></p>
  44.  
  45. <ul class="woocommerce-order-overview woocommerce-thankyou-order-details order_details">
  46.  
  47. <li class="woocommerce-order-overview__order order">
  48. <?php _e( 'Order number:', 'woocommerce' ); ?>
  49. <strong><?php echo $order->get_order_number(); ?></strong>
  50. </li>
  51.  
  52. <li class="woocommerce-order-overview__date date">
  53. <?php _e( 'Date:', 'woocommerce' ); ?>
  54. <strong><?php echo wc_format_datetime( $order->get_date_created() ); ?></strong>
  55. </li>
  56.  
  57. <?php if ( is_user_logged_in() && $order->get_user_id() === get_current_user_id() && $order->get_billing_email() ) : ?>
  58. <li class="woocommerce-order-overview__email email">
  59. <?php _e( 'Email:', 'woocommerce' ); ?>
  60. <strong><?php echo $order->get_billing_email(); ?></strong>
  61. </li>
  62. <?php endif; ?>
  63.  
  64. <li class="woocommerce-order-overview__total total">
  65. <?php _e( 'Total:', 'woocommerce' ); ?>
  66. <strong><?php echo $order->get_formatted_order_total(); ?></strong>
  67. </li>
  68.  
  69. <?php if ( $order->get_payment_method_title() ) : ?>
  70. <li class="woocommerce-order-overview__payment-method method">
  71. <?php _e( 'Payment method:', 'woocommerce' ); ?>
  72. <strong><?php echo wp_kses_post( $order->get_payment_method_title() ); ?></strong>
  73. </li>
  74. <?php endif; ?>
  75.  
  76. </ul>
  77.  
  78. <?php endif; ?>
  79.  
  80. <?php do_action( 'woocommerce_thankyou_' . $order->get_payment_method(), $order->get_id() ); ?>
  81. <?php do_action( 'woocommerce_thankyou', $order->get_id() ); ?>
  82.  
  83. <?php else : ?>
  84.  
  85. <p class="woocommerce-notice woocommerce-notice--success woocommerce-thankyou-order-received"><?php echo apply_filters( 'woocommerce_thankyou_order_received_text', __( 'Thank you. Your order has been received.', 'woocommerce' ), null ); ?></p>
  86.  
  87. <?php endif; ?>
  88.  
  89. </div>
  90.  
  91. <script type="text/javascript">
  92. (function($) {
  93. $('.woocommerce h1, .woocommerce h2, .woocommerce h3, .woocommerce h4').each(function() {
  94. if ($('.light', this).length != 0) {
  95. return;
  96. }
  97. $(this).wrapInner('<span class="light"></span>');
  98. });
  99. })(jQuery);
  100. </script>
Advertisement
Add Comment
Please, Sign In to add comment