Plugin Directory

Changeset 2291998


Ignore:
Timestamp:
04/26/2020 12:01:18 PM (6 years ago)
Author:
expresscheckout
Message:

Adding version 1.0.2

Location:
wc-express-checkout
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • wc-express-checkout/tags/1.0.2/templates/woocommerce/express-checkout/order/order-details.php

    r2291991 r2291998  
    11<?php
    22/**
    3  * Thankyou page
     3 * Order details
    44 *
    5  * This template can be overridden by copying it to yourtheme/woocommerce/checkout/thankyou.php.
     5 * This template can be overridden by copying it to yourtheme/woocommerce/order/order-details.php.
    66 *
    77 * HOWEVER, on occasion WooCommerce will need to update template files and you
     
    1111 * the readme will list any important changes.
    1212 *
    13  * @see https://docs.woocommerce.com/document/template-structure/
     13 * @see     https://docs.woocommerce.com/document/template-structure/
    1414 * @package WooCommerce/Templates
    1515 * @version 3.7.0
     
    1717
    1818defined( 'ABSPATH' ) || exit;
     19
     20$order = wc_get_order( $order_id ); // phpcs:ignore WordPress.WP.GlobalVariablesOverride.OverrideProhibited
     21
     22if ( ! $order ) {
     23    return;
     24}
     25
     26$order_items           = $order->get_items( apply_filters( 'woocommerce_purchase_order_item_types', 'line_item' ) );
     27$show_purchase_note    = $order->has_status( apply_filters( 'woocommerce_purchase_note_order_statuses', array( 'completed', 'processing' ) ) );
     28// $show_customer_details = is_user_logged_in() && $order->get_user_id() === get_current_user_id();
     29$show_customer_details = 0;
     30$downloads             = $order->get_downloadable_items();
     31$show_downloads        = $order->has_downloadable_item() && $order->is_download_permitted();
     32
     33if ( $show_downloads ) {
     34    wc_get_template(
     35        'order/order-downloads.php',
     36        array(
     37            'downloads'  => $downloads,
     38            'show_title' => true,
     39        )
     40    );
     41}
    1942?>
     43    <section class="woocommerce-order-details">
     44         <?php do_action( 'woocommerce_order_details_before_order_table', $order ); ?>
    2045
    21 <div class="woocommerce-order">
     46        <div class="woocommerce-table woocommerce-table--order-details shop_table order_details">
     47              <?php
     48              do_action( 'woocommerce_order_details_before_order_table_items', $order );
     49              foreach ( $order_items as $item_id => $item ) {
     50                  $product = $item->get_product();
     51                  wc_get_template(
     52                      'order/order-details-item.php',
     53                      array(
     54                          'order'              => $order,
     55                          'item_id'            => $item_id,
     56                          'item'               => $item,
     57                          'show_purchase_note' => $show_purchase_note,
     58                          'purchase_note'      => $product ? $product->get_purchase_note() : '',
     59                          'product'            => $product,
     60                      )
     61                  );
     62              }
     63              do_action( 'woocommerce_order_details_after_order_table_items', $order );
     64              foreach ( $order->get_order_item_totals() as $key => $total ) {
     65                  if ( $key === 'order_total' ) {
     66                      continue;
     67                  }
     68                  ?>
     69                <div class="d-flex justify-content-between mb-2">
     70                    <strong><?php echo esc_html( $total['label'] ); ?></strong>
     71                    <span><?php echo ( 'payment_method' === $key ) ? esc_html( $total['value'] ) : wp_kses_post( $total['value'] ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></span>
     72                </div>
     73                  <?php
     74              }
    2275
    23     <?php if ( $order ) :
     76              if ( $order->get_customer_note() ) : ?>
     77                <div class="d-flex justify-content-between mb-2">
     78                    <strong><?php esc_html_e( 'Note:', 'woocommerce' ); ?></strong>
     79                    <span><?php echo wp_kses_post( nl2br( wptexturize( $order->get_customer_note() ) ) ); ?></span>
     80                </div>
     81              <?php endif; ?>
     82        </div>
    2483
    25         do_action( 'woocommerce_before_thankyou', $order->get_id() ); ?>
     84         <?php do_action( 'woocommerce_order_details_after_order_table', $order ); ?>
     85    </section>
    2686
    27         <?php if ( $order->has_status( 'failed' ) ) : ?>
    28 
    29         <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>
    30 
    31         <p class="woocommerce-notice woocommerce-notice--error woocommerce-thankyou-order-failed-actions">
    32             <a href="<?php echo esc_url( $order->get_checkout_payment_url() ); ?>" class="button pay"><?php esc_html_e( 'Pay', 'woocommerce' ); ?></a>
    33              <?php if ( is_user_logged_in() ) : ?>
    34                <a href="<?php echo esc_url( wc_get_page_permalink( 'myaccount' ) ); ?>" class="button pay"><?php esc_html_e( 'My account', 'woocommerce' ); ?></a>
    35              <?php endif; ?>
    36         </p>
    37 
    38     <?php else : ?>
    39 
    40         <div class="row">
    41             <div class="col-lg-7">
    42                 <div class="media align-items-center mb-4">
    43                     <i class="material-icons text-success display-3 mr-2">
    44                         check_circle_outline
    45                     </i>
    46                     <div class="media-body">
    47                         <div class="mb-1">Order #<?php echo $order->get_id(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></div>
    48                         <div class="h5">Thank you <?php echo $order->get_billing_first_name(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>!</div>
    49                     </div>
    50                 </div>
    51                 <div class="card bg-light border-0 mb-4">
    52                     <div class="card-header border-0">
    53                         <h3 class="h6 mb-0">Your order is confirmed</h3>
    54                     </div>
    55                     <div class="card-body">
    56                         <p class="card-text">We've accepted your order, and we're getting it ready. A confirmation email has been sent to <strong><?php echo $order->get_billing_email(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></strong></p>
    57                     </div>
    58                 </div>
    59                 <div class="card bg-light border-0 mb-4">
    60                     <div class="card-header border-0">
    61                         <h3 class="h6 mb-0">Customer information</h3>
    62                     </div>
    63                     <div class="card-body">
    64                         <div class="row">
    65                                  <?php $show_shipping = ! wc_ship_to_billing_address_only() && $order->needs_shipping_address(); ?>
    66                                  <?php if( $show_shipping ) { ?>
    67                                <div class="col-sm-6">
    68                                    <h4 class="h6">Shipping Address</h4>
    69                                    <p><?php echo $order->get_formatted_shipping_address(); ?></p>
    70                                </div>
    71                                <div class="col-sm-6">
    72                                    <h4 class="h6">Billing Address</h4>
    73                                    <p><?php echo $order->get_formatted_billing_address(); ?></p>
    74                                </div>
    75                                <div class="col-sm-6">
    76                                    <h4 class="h6">Shipping Method</h4>
    77                                    <p><?php echo $order->get_shipping_method(); ?></p>
    78                                </div>
    79                                <div class="col-sm-6">
    80                                    <h4 class="h6">Payment Method</h4>
    81                                    <p class="payments"><?php echo $order->get_payment_method_title(); ?></p>
    82                                </div>
    83                                  <?php } else { ?>
    84                                <div class="col-sm-6">
    85                                    <h4 class="h6">Billing Address</h4>
    86                                    <p><?php echo $order->get_formatted_billing_address(); ?></p>
    87                                </div>
    88                                <div class="col-sm-6">
    89                                    <h4 class="h6">Payment Method</h4>
    90                                    <p class="payments"><?php echo $order->get_payment_method_title(); ?></p>
    91                                </div>
    92                                  <?php } ?>
    93                         </div>
    94                     </div>
    95                 </div>
    96                 <div class="d-flex flex-wrap justify-content-between align-items-center mb-4">
    97                     <p class="mb-sm-0"><i class="material-icons align-bottom">
    98                             help_outline
    99                         </i> Need help? <a href="#">Contact us</a></p>
    100                     <a href="<?php echo get_permalink( wc_get_page_id( 'shop' ) ); ?>" class="btn btn-primary"><?php _e( 'Continue Shopping', 'wcs' ); ?></a>
    101                 </div>
    102                 <div class="d-flex flex-wrap justify-content-between align-items-center mb-4">
    103                        <?php do_action( 'woocommerce_thankyou_' . $order->get_payment_method(), $order->get_id() ); ?>
    104                        <?php do_action( 'woocommerce_thankyou', $order->get_id() ); ?>
    105                 </div>
    106             </div>
    107             <div class="col-lg-5">
    108                 <div class="card cart border-0 bg-light mb-3">
    109                     <div class="card-body py-4">
    110                             <?php woocommerce_order_details_table( $order->get_id() ); ?>
    111                     </div>
    112                     <div class="card-footer border-0">
    113                         <div class="d-flex justify-content-between align-items-center h5 mb-0">
    114                             <strong>Order Total</strong>
    115                             <span><?php echo $order->get_formatted_order_total(); ?></span>
    116                         </div>
    117                     </div>
    118                 </div>
    119                 <div class="bg-light text-center p-3">
    120                     <i class="material-icons align-bottom">lock</i> Secure Checkout
    121                 </div>
    122             </div>
    123         </div>
    124 
    125     <?php endif; ?>
    126 
    127     <?php else : ?>
    128 
    129         <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>
    130 
    131     <?php endif; ?>
    132 
    133 </div>
     87<?php
     88if ( $show_customer_details ) {
     89    wc_get_template( 'order/order-details-customer.php', array( 'order' => $order ) );
     90}
  • wc-express-checkout/trunk/templates/woocommerce/express-checkout/order/order-details.php

    r2291991 r2291998  
    11<?php
    22/**
    3  * Thankyou page
     3 * Order details
    44 *
    5  * This template can be overridden by copying it to yourtheme/woocommerce/checkout/thankyou.php.
     5 * This template can be overridden by copying it to yourtheme/woocommerce/order/order-details.php.
    66 *
    77 * HOWEVER, on occasion WooCommerce will need to update template files and you
     
    1111 * the readme will list any important changes.
    1212 *
    13  * @see https://docs.woocommerce.com/document/template-structure/
     13 * @see     https://docs.woocommerce.com/document/template-structure/
    1414 * @package WooCommerce/Templates
    1515 * @version 3.7.0
     
    1717
    1818defined( 'ABSPATH' ) || exit;
     19
     20$order = wc_get_order( $order_id ); // phpcs:ignore WordPress.WP.GlobalVariablesOverride.OverrideProhibited
     21
     22if ( ! $order ) {
     23    return;
     24}
     25
     26$order_items           = $order->get_items( apply_filters( 'woocommerce_purchase_order_item_types', 'line_item' ) );
     27$show_purchase_note    = $order->has_status( apply_filters( 'woocommerce_purchase_note_order_statuses', array( 'completed', 'processing' ) ) );
     28// $show_customer_details = is_user_logged_in() && $order->get_user_id() === get_current_user_id();
     29$show_customer_details = 0;
     30$downloads             = $order->get_downloadable_items();
     31$show_downloads        = $order->has_downloadable_item() && $order->is_download_permitted();
     32
     33if ( $show_downloads ) {
     34    wc_get_template(
     35        'order/order-downloads.php',
     36        array(
     37            'downloads'  => $downloads,
     38            'show_title' => true,
     39        )
     40    );
     41}
    1942?>
     43    <section class="woocommerce-order-details">
     44         <?php do_action( 'woocommerce_order_details_before_order_table', $order ); ?>
    2045
    21 <div class="woocommerce-order">
     46        <div class="woocommerce-table woocommerce-table--order-details shop_table order_details">
     47              <?php
     48              do_action( 'woocommerce_order_details_before_order_table_items', $order );
     49              foreach ( $order_items as $item_id => $item ) {
     50                  $product = $item->get_product();
     51                  wc_get_template(
     52                      'order/order-details-item.php',
     53                      array(
     54                          'order'              => $order,
     55                          'item_id'            => $item_id,
     56                          'item'               => $item,
     57                          'show_purchase_note' => $show_purchase_note,
     58                          'purchase_note'      => $product ? $product->get_purchase_note() : '',
     59                          'product'            => $product,
     60                      )
     61                  );
     62              }
     63              do_action( 'woocommerce_order_details_after_order_table_items', $order );
     64              foreach ( $order->get_order_item_totals() as $key => $total ) {
     65                  if ( $key === 'order_total' ) {
     66                      continue;
     67                  }
     68                  ?>
     69                <div class="d-flex justify-content-between mb-2">
     70                    <strong><?php echo esc_html( $total['label'] ); ?></strong>
     71                    <span><?php echo ( 'payment_method' === $key ) ? esc_html( $total['value'] ) : wp_kses_post( $total['value'] ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></span>
     72                </div>
     73                  <?php
     74              }
    2275
    23     <?php if ( $order ) :
     76              if ( $order->get_customer_note() ) : ?>
     77                <div class="d-flex justify-content-between mb-2">
     78                    <strong><?php esc_html_e( 'Note:', 'woocommerce' ); ?></strong>
     79                    <span><?php echo wp_kses_post( nl2br( wptexturize( $order->get_customer_note() ) ) ); ?></span>
     80                </div>
     81              <?php endif; ?>
     82        </div>
    2483
    25         do_action( 'woocommerce_before_thankyou', $order->get_id() ); ?>
     84         <?php do_action( 'woocommerce_order_details_after_order_table', $order ); ?>
     85    </section>
    2686
    27         <?php if ( $order->has_status( 'failed' ) ) : ?>
    28 
    29         <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>
    30 
    31         <p class="woocommerce-notice woocommerce-notice--error woocommerce-thankyou-order-failed-actions">
    32             <a href="<?php echo esc_url( $order->get_checkout_payment_url() ); ?>" class="button pay"><?php esc_html_e( 'Pay', 'woocommerce' ); ?></a>
    33              <?php if ( is_user_logged_in() ) : ?>
    34                <a href="<?php echo esc_url( wc_get_page_permalink( 'myaccount' ) ); ?>" class="button pay"><?php esc_html_e( 'My account', 'woocommerce' ); ?></a>
    35              <?php endif; ?>
    36         </p>
    37 
    38     <?php else : ?>
    39 
    40         <div class="row">
    41             <div class="col-lg-7">
    42                 <div class="media align-items-center mb-4">
    43                     <i class="material-icons text-success display-3 mr-2">
    44                         check_circle_outline
    45                     </i>
    46                     <div class="media-body">
    47                         <div class="mb-1">Order #<?php echo $order->get_id(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></div>
    48                         <div class="h5">Thank you <?php echo $order->get_billing_first_name(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>!</div>
    49                     </div>
    50                 </div>
    51                 <div class="card bg-light border-0 mb-4">
    52                     <div class="card-header border-0">
    53                         <h3 class="h6 mb-0">Your order is confirmed</h3>
    54                     </div>
    55                     <div class="card-body">
    56                         <p class="card-text">We've accepted your order, and we're getting it ready. A confirmation email has been sent to <strong><?php echo $order->get_billing_email(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></strong></p>
    57                     </div>
    58                 </div>
    59                 <div class="card bg-light border-0 mb-4">
    60                     <div class="card-header border-0">
    61                         <h3 class="h6 mb-0">Customer information</h3>
    62                     </div>
    63                     <div class="card-body">
    64                         <div class="row">
    65                                  <?php $show_shipping = ! wc_ship_to_billing_address_only() && $order->needs_shipping_address(); ?>
    66                                  <?php if( $show_shipping ) { ?>
    67                                <div class="col-sm-6">
    68                                    <h4 class="h6">Shipping Address</h4>
    69                                    <p><?php echo $order->get_formatted_shipping_address(); ?></p>
    70                                </div>
    71                                <div class="col-sm-6">
    72                                    <h4 class="h6">Billing Address</h4>
    73                                    <p><?php echo $order->get_formatted_billing_address(); ?></p>
    74                                </div>
    75                                <div class="col-sm-6">
    76                                    <h4 class="h6">Shipping Method</h4>
    77                                    <p><?php echo $order->get_shipping_method(); ?></p>
    78                                </div>
    79                                <div class="col-sm-6">
    80                                    <h4 class="h6">Payment Method</h4>
    81                                    <p class="payments"><?php echo $order->get_payment_method_title(); ?></p>
    82                                </div>
    83                                  <?php } else { ?>
    84                                <div class="col-sm-6">
    85                                    <h4 class="h6">Billing Address</h4>
    86                                    <p><?php echo $order->get_formatted_billing_address(); ?></p>
    87                                </div>
    88                                <div class="col-sm-6">
    89                                    <h4 class="h6">Payment Method</h4>
    90                                    <p class="payments"><?php echo $order->get_payment_method_title(); ?></p>
    91                                </div>
    92                                  <?php } ?>
    93                         </div>
    94                     </div>
    95                 </div>
    96                 <div class="d-flex flex-wrap justify-content-between align-items-center mb-4">
    97                     <p class="mb-sm-0"><i class="material-icons align-bottom">
    98                             help_outline
    99                         </i> Need help? <a href="#">Contact us</a></p>
    100                     <a href="<?php echo get_permalink( wc_get_page_id( 'shop' ) ); ?>" class="btn btn-primary"><?php _e( 'Continue Shopping', 'wcs' ); ?></a>
    101                 </div>
    102                 <div class="d-flex flex-wrap justify-content-between align-items-center mb-4">
    103                        <?php do_action( 'woocommerce_thankyou_' . $order->get_payment_method(), $order->get_id() ); ?>
    104                        <?php do_action( 'woocommerce_thankyou', $order->get_id() ); ?>
    105                 </div>
    106             </div>
    107             <div class="col-lg-5">
    108                 <div class="card cart border-0 bg-light mb-3">
    109                     <div class="card-body py-4">
    110                             <?php woocommerce_order_details_table( $order->get_id() ); ?>
    111                     </div>
    112                     <div class="card-footer border-0">
    113                         <div class="d-flex justify-content-between align-items-center h5 mb-0">
    114                             <strong>Order Total</strong>
    115                             <span><?php echo $order->get_formatted_order_total(); ?></span>
    116                         </div>
    117                     </div>
    118                 </div>
    119                 <div class="bg-light text-center p-3">
    120                     <i class="material-icons align-bottom">lock</i> Secure Checkout
    121                 </div>
    122             </div>
    123         </div>
    124 
    125     <?php endif; ?>
    126 
    127     <?php else : ?>
    128 
    129         <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>
    130 
    131     <?php endif; ?>
    132 
    133 </div>
     87<?php
     88if ( $show_customer_details ) {
     89    wc_get_template( 'order/order-details-customer.php', array( 'order' => $order ) );
     90}
Note: See TracChangeset for help on using the changeset viewer.