Advertisement
Guest User

thankyou.php

a guest
Jan 4th, 2018
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.57 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.  
  24. <div class="woocommerce-order">
  25.  
  26.     <?php if ( $order ) : ?>
  27.  
  28.         <?php if ( $order->has_status( 'failed' ) ) : ?>
  29.  
  30.             <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>
  31.  
  32.             <p class="woocommerce-notice woocommerce-notice--error woocommerce-thankyou-order-failed-actions">
  33.                 <a href="<?php echo esc_url( $order->get_checkout_payment_url() ); ?>" class="button pay"><?php _e( 'Pay', 'woocommerce' ) ?></a>
  34.                 <?php if ( is_user_logged_in() ) : ?>
  35.                     <a href="<?php echo esc_url( wc_get_page_permalink( 'myaccount' ) ); ?>" class="button pay"><?php _e( 'My account', 'woocommerce' ); ?></a>
  36.                 <?php endif; ?>
  37.             </p>
  38.  
  39.         <?php else : ?>
  40.  
  41.             <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>
  42.  
  43.             <ul class="woocommerce-order-overview woocommerce-thankyou-order-details order_details">
  44.  
  45.                 <li class="woocommerce-order-overview__order order">
  46.                     <?php _e( 'Order number:', 'woocommerce' ); ?>
  47.                     <strong><?php echo $order->get_order_number(); ?></strong>
  48.                 </li>
  49.  
  50.                 <li class="woocommerce-order-overview__date date">
  51.                     <?php _e( 'Date:', 'woocommerce' ); ?>
  52.                     <strong><?php echo wc_format_datetime( $order->get_date_created() ); ?></strong>
  53.                 </li>
  54.  
  55.                 <?php if ( is_user_logged_in() && $order->get_user_id() === get_current_user_id() && $order->get_billing_email() ) : ?>
  56.                     <li class="woocommerce-order-overview__email email">
  57.                         <?php _e( 'Email:', 'woocommerce' ); ?>
  58.                         <strong><?php echo $order->get_billing_email(); ?></strong>
  59.                     </li>
  60.                 <?php endif; ?>
  61.  
  62.                 <li class="woocommerce-order-overview__total total">
  63.                     <?php _e( 'Total:', 'woocommerce' ); ?>
  64.                     <strong><?php echo $order->get_formatted_order_total(); ?></strong>
  65.                 </li>
  66.  
  67.                 <?php if ( $order->get_payment_method_title() ) : ?>
  68.                     <li class="woocommerce-order-overview__payment-method method">
  69.                         <?php _e( 'Payment method:', 'woocommerce' ); ?>
  70.                         <strong><?php echo wp_kses_post( $order->get_payment_method_title() ); ?></strong>
  71.                     </li>
  72.                 <?php endif; ?>
  73.  
  74.             </ul>
  75.  
  76.         <?php endif; ?>
  77.  
  78.         <?php do_action( 'woocommerce_thankyou_' . $order->get_payment_method(), $order->get_id() ); ?>
  79.         <?php do_action( 'woocommerce_thankyou', $order->get_id() ); ?>
  80.  
  81.     <?php else : ?>
  82.  
  83.         <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>
  84.  
  85.     <?php endif; ?>
  86.  
  87. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement