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