@@ -20,47 +20,47 @@ discard block |
||
| 20 | 20 | |
| 21 | 21 | <?php lsx_content_top(); ?> |
| 22 | 22 | |
| 23 | - <?php if ( have_posts() ) : ?> |
|
| 23 | + <?php if (have_posts()) : ?> |
|
| 24 | 24 | |
| 25 | - <?php while ( have_posts() ) : the_post(); ?> |
|
| 25 | + <?php while (have_posts()) : the_post(); ?> |
|
| 26 | 26 | |
| 27 | 27 | <?php |
| 28 | 28 | WC()->payment_gateways()->payment_gateways; |
| 29 | - $order_key = isset( $_GET['key'] ) ? wc_clean( $_GET['key'] ) : ''; |
|
| 30 | - $order_id = absint( $wp->query_vars['order-received'] ); |
|
| 31 | - $order = wc_get_order( $order_id ); |
|
| 29 | + $order_key = isset($_GET['key']) ? wc_clean($_GET['key']) : ''; |
|
| 30 | + $order_id = absint($wp->query_vars['order-received']); |
|
| 31 | + $order = wc_get_order($order_id); |
|
| 32 | 32 | ?> |
| 33 | 33 | |
| 34 | - <?php if ( $order && $order->get_id() === $order_id && $order->get_order_key() === $order_key ) : ?> |
|
| 34 | + <?php if ($order && $order->get_id() === $order_id && $order->get_order_key() === $order_key) : ?> |
|
| 35 | 35 | |
| 36 | 36 | <?php // @codingStandardsIgnoreStart ?> |
| 37 | 37 | |
| 38 | - <div class="alert alert-success"><?php echo apply_filters( 'woocommerce_thankyou_order_received_text', esc_html__( 'Thank you. Your order has been received.', 'lsx' ), $order ); ?></div> |
|
| 38 | + <div class="alert alert-success"><?php echo apply_filters('woocommerce_thankyou_order_received_text', esc_html__('Thank you. Your order has been received.', 'lsx'), $order); ?></div> |
|
| 39 | 39 | |
| 40 | 40 | <div class="row"> |
| 41 | 41 | <div class="col-xs-12 col-sm-6"> |
| 42 | - <h2><?php esc_html_e( 'Order Details', 'lsx' ); ?></h2> |
|
| 42 | + <h2><?php esc_html_e('Order Details', 'lsx'); ?></h2> |
|
| 43 | 43 | |
| 44 | 44 | <table class="table"> |
| 45 | 45 | <tbody> |
| 46 | 46 | <tr> |
| 47 | - <th><?php esc_html_e( 'Order:', 'lsx' ); ?></th> |
|
| 47 | + <th><?php esc_html_e('Order:', 'lsx'); ?></th> |
|
| 48 | 48 | <td><?php echo $order->get_order_number(); ?></td> |
| 49 | 49 | </tr> |
| 50 | 50 | |
| 51 | 51 | <tr> |
| 52 | - <th><?php esc_html_e( 'Date:', 'lsx' ); ?></th> |
|
| 53 | - <td><?php echo date_i18n( get_option( 'date_format' ), strtotime( $order->order_date ) ); ?></td> |
|
| 52 | + <th><?php esc_html_e('Date:', 'lsx'); ?></th> |
|
| 53 | + <td><?php echo date_i18n(get_option('date_format'), strtotime($order->order_date)); ?></td> |
|
| 54 | 54 | </tr> |
| 55 | 55 | |
| 56 | 56 | <tr> |
| 57 | - <th><?php esc_html_e( 'Total:', 'lsx' ); ?></th> |
|
| 57 | + <th><?php esc_html_e('Total:', 'lsx'); ?></th> |
|
| 58 | 58 | <td><?php echo $order->get_formatted_order_total(); ?></td> |
| 59 | 59 | </tr> |
| 60 | 60 | |
| 61 | - <?php if ( $order->payment_method_title ) : ?> |
|
| 61 | + <?php if ($order->payment_method_title) : ?> |
|
| 62 | 62 | <tr> |
| 63 | - <th><?php esc_html_e( 'Payment method:', 'lsx' ); ?></th> |
|
| 63 | + <th><?php esc_html_e('Payment method:', 'lsx'); ?></th> |
|
| 64 | 64 | <td><?php echo $order->payment_method_title; ?></td> |
| 65 | 65 | </tr> |
| 66 | 66 | <?php endif; ?> |
@@ -69,48 +69,48 @@ discard block |
||
| 69 | 69 | |
| 70 | 70 | <?php // do_action( 'woocommerce_order_details_after_order_table', $order ); ?> |
| 71 | 71 | |
| 72 | - <h2><?php esc_html_e( 'Customer details', 'lsx' ); ?></h2> |
|
| 72 | + <h2><?php esc_html_e('Customer details', 'lsx'); ?></h2> |
|
| 73 | 73 | |
| 74 | 74 | <dl class="customer_details"> |
| 75 | 75 | <?php |
| 76 | - if ( $order->billing_email ) echo '<dt>' . esc_html__( 'Email:', 'lsx' ) . '</dt><dd>' . $order->billing_email . '</dd>'; |
|
| 77 | - if ( $order->billing_phone ) echo '<dt>' . esc_html__( 'Telephone:', 'lsx' ) . '</dt><dd>' . $order->billing_phone . '</dd>'; |
|
| 76 | + if ($order->billing_email) echo '<dt>' . esc_html__('Email:', 'lsx') . '</dt><dd>' . $order->billing_email . '</dd>'; |
|
| 77 | + if ($order->billing_phone) echo '<dt>' . esc_html__('Telephone:', 'lsx') . '</dt><dd>' . $order->billing_phone . '</dd>'; |
|
| 78 | 78 | |
| 79 | 79 | // Additional customer details hook |
| 80 | - do_action( 'woocommerce_order_details_after_customer_details', $order ); |
|
| 80 | + do_action('woocommerce_order_details_after_customer_details', $order); |
|
| 81 | 81 | ?> |
| 82 | 82 | </dl> |
| 83 | 83 | |
| 84 | - <?php if ( ! wc_ship_to_billing_address_only() && $order->needs_shipping_address() && get_option( 'woocommerce_calc_shipping' ) !== 'no' ) : ?> |
|
| 84 | + <?php if ( ! wc_ship_to_billing_address_only() && $order->needs_shipping_address() && get_option('woocommerce_calc_shipping') !== 'no') : ?> |
|
| 85 | 85 | |
| 86 | 86 | <div class="row"> |
| 87 | 87 | <div class="col-xs-12 col-sm-6"> |
| 88 | 88 | |
| 89 | 89 | <?php endif; ?> |
| 90 | 90 | |
| 91 | - <h3><?php esc_html_e( 'Billing Address', 'lsx' ); ?></h3> |
|
| 91 | + <h3><?php esc_html_e('Billing Address', 'lsx'); ?></h3> |
|
| 92 | 92 | |
| 93 | 93 | <address> |
| 94 | 94 | <?php |
| 95 | - if ( ! $order->get_formatted_billing_address() ) { |
|
| 96 | - esc_html_e( 'N/A', 'lsx' ); |
|
| 95 | + if ( ! $order->get_formatted_billing_address()) { |
|
| 96 | + esc_html_e('N/A', 'lsx'); |
|
| 97 | 97 | } else { |
| 98 | 98 | echo $order->get_formatted_billing_address(); |
| 99 | 99 | } |
| 100 | 100 | ?> |
| 101 | 101 | </address> |
| 102 | 102 | |
| 103 | - <?php if ( ! wc_ship_to_billing_address_only() && $order->needs_shipping_address() && get_option( 'woocommerce_calc_shipping' ) !== 'no' ) : ?> |
|
| 103 | + <?php if ( ! wc_ship_to_billing_address_only() && $order->needs_shipping_address() && get_option('woocommerce_calc_shipping') !== 'no') : ?> |
|
| 104 | 104 | |
| 105 | 105 | </div> |
| 106 | 106 | |
| 107 | 107 | <div class="col-xs-12 col-sm-6"> |
| 108 | - <h3><?php esc_html_e( 'Shipping Address', 'lsx' ); ?></h3> |
|
| 108 | + <h3><?php esc_html_e('Shipping Address', 'lsx'); ?></h3> |
|
| 109 | 109 | |
| 110 | 110 | <address> |
| 111 | 111 | <?php |
| 112 | - if ( ! $order->get_formatted_shipping_address() ) { |
|
| 113 | - esc_html_e( 'N/A', 'lsx' ); |
|
| 112 | + if ( ! $order->get_formatted_shipping_address()) { |
|
| 113 | + esc_html_e('N/A', 'lsx'); |
|
| 114 | 114 | } else { |
| 115 | 115 | echo $order->get_formatted_shipping_address(); |
| 116 | 116 | } |
@@ -123,68 +123,68 @@ discard block |
||
| 123 | 123 | </div> |
| 124 | 124 | |
| 125 | 125 | <div class="col-xs-12 col-sm-6"> |
| 126 | - <h2><?php esc_html_e( 'Products details', 'lsx' ); ?></h2> |
|
| 126 | + <h2><?php esc_html_e('Products details', 'lsx'); ?></h2> |
|
| 127 | 127 | |
| 128 | 128 | <table class="table"> |
| 129 | 129 | <thead> |
| 130 | 130 | <tr> |
| 131 | - <th><?php esc_html_e( 'Product', 'lsx' ); ?></th> |
|
| 132 | - <th><?php esc_html_e( 'Total', 'lsx' ); ?></th> |
|
| 131 | + <th><?php esc_html_e('Product', 'lsx'); ?></th> |
|
| 132 | + <th><?php esc_html_e('Total', 'lsx'); ?></th> |
|
| 133 | 133 | </tr> |
| 134 | 134 | </thead> |
| 135 | 135 | |
| 136 | 136 | <tbody> |
| 137 | 137 | <?php |
| 138 | - if ( sizeof( $order->get_items() ) > 0 ) : |
|
| 139 | - foreach( $order->get_items() as $item ) : |
|
| 140 | - $_product = apply_filters( 'woocommerce_order_item_product', $order->get_product_from_item( $item ), $item ); |
|
| 141 | - $item_meta = new WC_Order_Item_Meta( $item['item_meta'], $_product ); |
|
| 138 | + if (sizeof($order->get_items()) > 0) : |
|
| 139 | + foreach ($order->get_items() as $item) : |
|
| 140 | + $_product = apply_filters('woocommerce_order_item_product', $order->get_product_from_item($item), $item); |
|
| 141 | + $item_meta = new WC_Order_Item_Meta($item['item_meta'], $_product); |
|
| 142 | 142 | ?> |
| 143 | 143 | |
| 144 | 144 | <tr> |
| 145 | 145 | <td> |
| 146 | 146 | <?php |
| 147 | - if ( $_product && ! $_product->is_visible() ) { |
|
| 148 | - echo apply_filters( 'woocommerce_order_item_name', $item['name'], $item ); |
|
| 147 | + if ($_product && ! $_product->is_visible()) { |
|
| 148 | + echo apply_filters('woocommerce_order_item_name', $item['name'], $item); |
|
| 149 | 149 | } else { |
| 150 | - echo apply_filters( 'woocommerce_order_item_name', sprintf( '<a href="%s">%s</a>', get_permalink( $item['product_id'] ), $item['name'] ), $item ); |
|
| 150 | + echo apply_filters('woocommerce_order_item_name', sprintf('<a href="%s">%s</a>', get_permalink($item['product_id']), $item['name']), $item); |
|
| 151 | 151 | } |
| 152 | 152 | |
| 153 | - echo apply_filters( 'woocommerce_order_item_quantity_html', ' <strong class="product-quantity">' . sprintf( '× %s', $item['qty'] ) . '</strong>', $item ); |
|
| 153 | + echo apply_filters('woocommerce_order_item_quantity_html', ' <strong class="product-quantity">' . sprintf('× %s', $item['qty']) . '</strong>', $item); |
|
| 154 | 154 | |
| 155 | 155 | ob_start(); |
| 156 | 156 | $item_meta->display(); |
| 157 | 157 | $_item_meta = ob_get_clean(); |
| 158 | 158 | |
| 159 | - if ( ! empty( $_item_meta ) ) { |
|
| 159 | + if ( ! empty($_item_meta)) { |
|
| 160 | 160 | echo $_item_meta; |
| 161 | 161 | } else { |
| 162 | 162 | echo '<br>'; |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | - if ( $_product && $_product->exists() && $_product->is_downloadable() && $order->is_download_permitted() ) { |
|
| 166 | - $download_files = $order->get_item_downloads( $item ); |
|
| 165 | + if ($_product && $_product->exists() && $_product->is_downloadable() && $order->is_download_permitted()) { |
|
| 166 | + $download_files = $order->get_item_downloads($item); |
|
| 167 | 167 | $i = 0; |
| 168 | 168 | $links = array(); |
| 169 | 169 | |
| 170 | - if ( empty( $download_files ) ) { |
|
| 170 | + if (empty($download_files)) { |
|
| 171 | 171 | $download_files = $_product->get_files(); |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | - foreach ( $download_files as $download_id => $file ) { |
|
| 174 | + foreach ($download_files as $download_id => $file) { |
|
| 175 | 175 | $i++; |
| 176 | 176 | |
| 177 | - if ( $i > 1 ) { |
|
| 177 | + if ($i > 1) { |
|
| 178 | 178 | echo '<br>'; |
| 179 | 179 | } |
| 180 | 180 | |
| 181 | - if ( ! empty( $_item_meta ) ) { |
|
| 181 | + if ( ! empty($_item_meta)) { |
|
| 182 | 182 | echo '<span style="margin-top: -2.4rem; display: block;">'; |
| 183 | 183 | } else { |
| 184 | 184 | echo '<span>'; |
| 185 | 185 | } |
| 186 | 186 | |
| 187 | - echo '<a href="' . esc_url( $file['download_url'] ? $file['download_url'] : $file['file'] ) . '">' . sprintf( esc_html__( 'Download file%s', 'lsx' ), ( count( $download_files ) > 1 ? ' ' . $i . ': ' : ': ' ) ) . esc_html( $file['name'] ) . '</a>'; |
|
| 187 | + echo '<a href="' . esc_url($file['download_url'] ? $file['download_url'] : $file['file']) . '">' . sprintf(esc_html__('Download file%s', 'lsx'), (count($download_files) > 1 ? ' ' . $i . ': ' : ': ')) . esc_html($file['name']) . '</a>'; |
|
| 188 | 188 | echo '</span>'; |
| 189 | 189 | } |
| 190 | 190 | } |
@@ -192,15 +192,15 @@ discard block |
||
| 192 | 192 | </td> |
| 193 | 193 | |
| 194 | 194 | <td> |
| 195 | - <?php echo $order->get_formatted_line_subtotal( $item ); ?> |
|
| 195 | + <?php echo $order->get_formatted_line_subtotal($item); ?> |
|
| 196 | 196 | </td> |
| 197 | 197 | </tr> |
| 198 | 198 | |
| 199 | 199 | <?php |
| 200 | - if ( $order->has_status( array( 'completed', 'processing' ) ) && ( $purchase_note = get_post_meta( $_product->id, '_purchase_note', true ) ) ) { |
|
| 200 | + if ($order->has_status(array('completed', 'processing')) && ($purchase_note = get_post_meta($_product->id, '_purchase_note', true))) { |
|
| 201 | 201 | ?> |
| 202 | 202 | <tr class="product-purchase-note"> |
| 203 | - <td colspan="3"><?php echo wpautop( do_shortcode( wp_kses_post( $purchase_note ) ) ); ?></td> |
|
| 203 | + <td colspan="3"><?php echo wpautop(do_shortcode(wp_kses_post($purchase_note))); ?></td> |
|
| 204 | 204 | </tr> |
| 205 | 205 | <?php |
| 206 | 206 | } |
@@ -213,8 +213,8 @@ discard block |
||
| 213 | 213 | |
| 214 | 214 | <tfoot> |
| 215 | 215 | <?php |
| 216 | - if ( $totals = $order->get_order_item_totals() ) : |
|
| 217 | - foreach ( $totals as $total ) : |
|
| 216 | + if ($totals = $order->get_order_item_totals()) : |
|
| 217 | + foreach ($totals as $total) : |
|
| 218 | 218 | ?> |
| 219 | 219 | <tr> |
| 220 | 220 | <th scope="row"><?php echo $total['label']; ?></th> |
@@ -227,9 +227,9 @@ discard block |
||
| 227 | 227 | </tfoot> |
| 228 | 228 | </table> |
| 229 | 229 | |
| 230 | - <?php if ( 'bacs' === $order->get_payment_method() ) { ?> |
|
| 231 | - <h2><?php esc_html_e( 'Bank Details', 'lsx' ); ?></h2> |
|
| 232 | - <?php do_action( 'woocommerce_thankyou_' . $order->get_payment_method(), $order->get_id() ); ?> |
|
| 230 | + <?php if ('bacs' === $order->get_payment_method()) { ?> |
|
| 231 | + <h2><?php esc_html_e('Bank Details', 'lsx'); ?></h2> |
|
| 232 | + <?php do_action('woocommerce_thankyou_' . $order->get_payment_method(), $order->get_id()); ?> |
|
| 233 | 233 | <?php } ?> |
| 234 | 234 | </div> |
| 235 | 235 | </div> |
@@ -238,7 +238,7 @@ discard block |
||
| 238 | 238 | |
| 239 | 239 | <?php else : ?> |
| 240 | 240 | |
| 241 | - <div class="alert alert-danger"><?php esc_html_e( 'Invalid order.', 'lsx' ); ?></div> |
|
| 241 | + <div class="alert alert-danger"><?php esc_html_e('Invalid order.', 'lsx'); ?></div> |
|
| 242 | 242 | |
| 243 | 243 | <?php endif; ?> |
| 244 | 244 | |