Passed
Push — master ( f9da99...8c108b )
by Warwick
02:29
created
page-templates/template-wc-thank-you.php 1 patch
Spacing   +59 added lines, -59 removed lines patch added patch discarded remove patch
@@ -22,71 +22,71 @@  discard block
 block discarded – undo
22 22
 			<ul class="lsx-wc-checkout-steps-items">
23 23
 					<li class="lsx-wc-checkout-steps-item lsx-wc-checkout-steps-item-done">
24 24
 						<i class="fa fa-check-circle" aria-hidden="true"></i>
25
-						<span><span><?php esc_html_e( 'Choose your product', 'lsx' ); ?></span></span>
25
+						<span><span><?php esc_html_e('Choose your product', 'lsx'); ?></span></span>
26 26
 						<i class="fa fa-angle-right" aria-hidden="true"></i>
27 27
 					</li>
28 28
 
29 29
 					<li class="lsx-wc-checkout-steps-item lsx-wc-checkout-steps-item-done lsx-wc-checkout-steps-item-cart">
30 30
 						<i class="fa fa-check-circle" aria-hidden="true"></i>
31
-						<span><span><?php esc_html_e( 'My Cart', 'lsx' ); ?></span></span>
31
+						<span><span><?php esc_html_e('My Cart', 'lsx'); ?></span></span>
32 32
 					</li>
33 33
 
34 34
 					<li class="lsx-wc-checkout-steps-item lsx-wc-checkout-steps-item-done lsx-wc-checkout-steps-item-payment">
35 35
 					<i class="fa fa-check-circle" aria-hidden="true"></i>
36
-						<span><span><?php esc_html_e( 'Payment details', 'lsx' ); ?></span></span>
36
+						<span><span><?php esc_html_e('Payment details', 'lsx'); ?></span></span>
37 37
 						<i class="fa fa-angle-right" aria-hidden="true"></i>
38 38
 					</li>
39 39
 
40 40
 					<li class="lsx-wc-checkout-steps-item lsx-wc-checkout-steps-item-current lsx-wc-checkout-steps-item-thankyou">
41
-						<i class="lsx-wc-checkout-steps-counter" aria-hidden="true"><?php esc_html_e( '4', 'lsx' ); ?></i>
42
-						<span><span><?php esc_html_e( 'Thank you!', 'lsx' ); ?></span></span>
41
+						<i class="lsx-wc-checkout-steps-counter" aria-hidden="true"><?php esc_html_e('4', 'lsx'); ?></i>
42
+						<span><span><?php esc_html_e('Thank you!', 'lsx'); ?></span></span>
43 43
 					</li>
44 44
 			</ul>
45 45
 		</div>
46 46
 
47 47
 		<?php lsx_content_top(); ?>
48 48
 
49
-		<?php if ( have_posts() ) : ?>
49
+		<?php if (have_posts()) : ?>
50 50
 
51
-			<?php while ( have_posts() ) : the_post(); ?>
51
+			<?php while (have_posts()) : the_post(); ?>
52 52
 
53 53
 				<?php
54 54
 					WC()->payment_gateways()->payment_gateways;
55
-					$order_key = isset( $_GET['key'] ) ? wc_clean( $_GET['key'] ) : '';
56
-					$order_id  = absint( $wp->query_vars['order-received'] );
57
-					$order = wc_get_order( $order_id );
55
+					$order_key = isset($_GET['key']) ? wc_clean($_GET['key']) : '';
56
+					$order_id  = absint($wp->query_vars['order-received']);
57
+					$order = wc_get_order($order_id);
58 58
 				?>
59 59
 
60
-				<?php if ( $order && $order->get_id() === $order_id && $order->get_order_key() === $order_key ) : ?>
60
+				<?php if ($order && $order->get_id() === $order_id && $order->get_order_key() === $order_key) : ?>
61 61
 
62 62
 					<?php // @codingStandardsIgnoreStart ?>
63 63
 
64
-					<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>
64
+					<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>
65 65
 
66 66
 					<div class="row">
67 67
 						<div class="col-xs-12 col-sm-6">
68
-							<h2><?php esc_html_e( 'Order Details', 'lsx' ); ?></h2>
68
+							<h2><?php esc_html_e('Order Details', 'lsx'); ?></h2>
69 69
 
70 70
 							<table class="table">
71 71
 								<tbody>
72 72
 									<tr>
73
-										<th><?php esc_html_e( 'Order:', 'lsx' ); ?></th>
73
+										<th><?php esc_html_e('Order:', 'lsx'); ?></th>
74 74
 										<td><?php echo $order->get_order_number(); ?></td>
75 75
 									</tr>
76 76
 
77 77
 									<tr>
78
-										<th><?php esc_html_e( 'Date:', 'lsx' ); ?></th>
79
-										<td><?php echo date_i18n( get_option( 'date_format' ), strtotime( $order->order_date ) ); ?></td>
78
+										<th><?php esc_html_e('Date:', 'lsx'); ?></th>
79
+										<td><?php echo date_i18n(get_option('date_format'), strtotime($order->order_date)); ?></td>
80 80
 									</tr>
81 81
 
82 82
 									<tr>
83
-										<th><?php esc_html_e( 'Total:', 'lsx' ); ?></th>
83
+										<th><?php esc_html_e('Total:', 'lsx'); ?></th>
84 84
 										<td><?php echo $order->get_formatted_order_total(); ?></td>
85 85
 									</tr>
86 86
 
87
-									<?php if ( $order->payment_method_title ) : ?>
87
+									<?php if ($order->payment_method_title) : ?>
88 88
 										<tr>
89
-											<th><?php esc_html_e( 'Payment method:', 'lsx' ); ?></th>
89
+											<th><?php esc_html_e('Payment method:', 'lsx'); ?></th>
90 90
 											<td><?php echo $order->payment_method_title; ?></td>
91 91
 										</tr>
92 92
 									<?php endif; ?>
@@ -95,48 +95,48 @@  discard block
 block discarded – undo
95 95
 
96 96
 							<?php // do_action( 'woocommerce_order_details_after_order_table', $order ); ?>
97 97
 
98
-							<h2><?php esc_html_e( 'Customer details', 'lsx' ); ?></h2>
98
+							<h2><?php esc_html_e('Customer details', 'lsx'); ?></h2>
99 99
 
100 100
 							<dl class="customer_details">
101 101
 								<?php
102
-									if ( $order->billing_email ) echo '<dt>' . esc_html__( 'Email:', 'lsx' ) . '</dt><dd>' . $order->billing_email . '</dd>';
103
-									if ( $order->billing_phone ) echo '<dt>' . esc_html__( 'Telephone:', 'lsx' ) . '</dt><dd>' . $order->billing_phone . '</dd>';
102
+									if ($order->billing_email) echo '<dt>' . esc_html__('Email:', 'lsx') . '</dt><dd>' . $order->billing_email . '</dd>';
103
+									if ($order->billing_phone) echo '<dt>' . esc_html__('Telephone:', 'lsx') . '</dt><dd>' . $order->billing_phone . '</dd>';
104 104
 
105 105
 									// Additional customer details hook
106
-									do_action( 'woocommerce_order_details_after_customer_details', $order );
106
+									do_action('woocommerce_order_details_after_customer_details', $order);
107 107
 								?>
108 108
 							</dl>
109 109
 
110
-							<?php if ( ! wc_ship_to_billing_address_only() && $order->needs_shipping_address() && get_option( 'woocommerce_calc_shipping' ) !== 'no' ) : ?>
110
+							<?php if ( ! wc_ship_to_billing_address_only() && $order->needs_shipping_address() && get_option('woocommerce_calc_shipping') !== 'no') : ?>
111 111
 
112 112
 								<div class="row">
113 113
 									<div class="col-xs-12 col-sm-6">
114 114
 
115 115
 							<?php endif; ?>
116 116
 
117
-										<h3><?php esc_html_e( 'Billing Address', 'lsx' ); ?></h3>
117
+										<h3><?php esc_html_e('Billing Address', 'lsx'); ?></h3>
118 118
 
119 119
 										<address>
120 120
 											<?php
121
-												if ( ! $order->get_formatted_billing_address() ) {
122
-													esc_html_e( 'N/A', 'lsx' );
121
+												if ( ! $order->get_formatted_billing_address()) {
122
+													esc_html_e('N/A', 'lsx');
123 123
 												} else {
124 124
 													echo $order->get_formatted_billing_address();
125 125
 												}
126 126
 											?>
127 127
 										</address>
128 128
 
129
-							<?php if ( ! wc_ship_to_billing_address_only() && $order->needs_shipping_address() && get_option( 'woocommerce_calc_shipping' ) !== 'no' ) : ?>
129
+							<?php if ( ! wc_ship_to_billing_address_only() && $order->needs_shipping_address() && get_option('woocommerce_calc_shipping') !== 'no') : ?>
130 130
 
131 131
 									</div>
132 132
 
133 133
 									<div class="col-xs-12 col-sm-6">
134
-										<h3><?php esc_html_e( 'Shipping Address', 'lsx' ); ?></h3>
134
+										<h3><?php esc_html_e('Shipping Address', 'lsx'); ?></h3>
135 135
 
136 136
 										<address>
137 137
 											<?php
138
-												if ( ! $order->get_formatted_shipping_address() ) {
139
-													esc_html_e( 'N/A', 'lsx' );
138
+												if ( ! $order->get_formatted_shipping_address()) {
139
+													esc_html_e('N/A', 'lsx');
140 140
 												} else {
141 141
 													echo $order->get_formatted_shipping_address();
142 142
 												}
@@ -149,68 +149,68 @@  discard block
 block discarded – undo
149 149
 						</div>
150 150
 
151 151
 						<div class="col-xs-12 col-sm-6">
152
-							<h2><?php esc_html_e( 'Products details', 'lsx' ); ?></h2>
152
+							<h2><?php esc_html_e('Products details', 'lsx'); ?></h2>
153 153
 
154 154
 							<table class="table">
155 155
 								<thead>
156 156
 									<tr>
157
-										<th><?php esc_html_e( 'Product', 'lsx' ); ?></th>
158
-										<th><?php esc_html_e( 'Total', 'lsx' ); ?></th>
157
+										<th><?php esc_html_e('Product', 'lsx'); ?></th>
158
+										<th><?php esc_html_e('Total', 'lsx'); ?></th>
159 159
 									</tr>
160 160
 								</thead>
161 161
 
162 162
 								<tbody>
163 163
 									<?php
164
-										if ( sizeof( $order->get_items() ) > 0 ) :
165
-											foreach( $order->get_items() as $item ) :
166
-												$_product = apply_filters( 'woocommerce_order_item_product', $order->get_product_from_item( $item ), $item );
167
-												$item_meta = new WC_Order_Item_Meta( $item['item_meta'], $_product );
164
+										if (sizeof($order->get_items()) > 0) :
165
+											foreach ($order->get_items() as $item) :
166
+												$_product = apply_filters('woocommerce_order_item_product', $order->get_product_from_item($item), $item);
167
+												$item_meta = new WC_Order_Item_Meta($item['item_meta'], $_product);
168 168
 											?>
169 169
 
170 170
 											<tr>
171 171
 												<td>
172 172
 													<?php
173
-														if ( $_product && ! $_product->is_visible() ) {
174
-															echo apply_filters( 'woocommerce_order_item_name', $item['name'], $item );
173
+														if ($_product && ! $_product->is_visible()) {
174
+															echo apply_filters('woocommerce_order_item_name', $item['name'], $item);
175 175
 														} else {
176
-															echo apply_filters( 'woocommerce_order_item_name', sprintf( '<a href="%s">%s</a>', get_permalink( $item['product_id'] ), $item['name'] ), $item );
176
+															echo apply_filters('woocommerce_order_item_name', sprintf('<a href="%s">%s</a>', get_permalink($item['product_id']), $item['name']), $item);
177 177
 														}
178 178
 
179
-														echo apply_filters( 'woocommerce_order_item_quantity_html', ' <strong class="product-quantity">' . sprintf( '&times; %s', $item['qty'] ) . '</strong>', $item );
179
+														echo apply_filters('woocommerce_order_item_quantity_html', ' <strong class="product-quantity">' . sprintf('&times; %s', $item['qty']) . '</strong>', $item);
180 180
 
181 181
 														ob_start();
182 182
 														$item_meta->display();
183 183
 														$_item_meta = ob_get_clean();
184 184
 
185
-														if ( ! empty( $_item_meta ) ) {
185
+														if ( ! empty($_item_meta)) {
186 186
 															echo $_item_meta;
187 187
 														} else {
188 188
 															echo '<br>';
189 189
 														}
190 190
 
191
-														if ( $_product && $_product->exists() && $_product->is_downloadable() && $order->is_download_permitted() ) {
192
-															$download_files = $order->get_item_downloads( $item );
191
+														if ($_product && $_product->exists() && $_product->is_downloadable() && $order->is_download_permitted()) {
192
+															$download_files = $order->get_item_downloads($item);
193 193
 															$i = 0;
194 194
 															$links = array();
195 195
 
196
-															if ( empty( $download_files ) ) {
196
+															if (empty($download_files)) {
197 197
 																$download_files = $_product->get_files();
198 198
 															}
199 199
 
200
-															foreach ( $download_files as $download_id => $file ) {
200
+															foreach ($download_files as $download_id => $file) {
201 201
 																$i++;
202 202
 
203
-																if ( $i > 1 ) {
203
+																if ($i > 1) {
204 204
 																	echo '<br>';
205 205
 																}
206 206
 
207
-																if ( ! empty( $_item_meta ) ) {
207
+																if ( ! empty($_item_meta)) {
208 208
 																	echo '<span style="margin-top: -2.4rem; display: block;">';
209 209
 																} else {
210 210
 																	echo '<span>';
211 211
 																}
212 212
 
213
-																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>';
213
+																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>';
214 214
 																echo '</span>';
215 215
 															}
216 216
 														}
@@ -218,15 +218,15 @@  discard block
 block discarded – undo
218 218
 												</td>
219 219
 
220 220
 												<td>
221
-													<?php echo $order->get_formatted_line_subtotal( $item ); ?>
221
+													<?php echo $order->get_formatted_line_subtotal($item); ?>
222 222
 												</td>
223 223
 											</tr>
224 224
 
225 225
 											<?php
226
-												if ( $order->has_status( array( 'completed', 'processing' ) ) && ( $purchase_note = get_post_meta( $_product->id, '_purchase_note', true ) ) ) {
226
+												if ($order->has_status(array('completed', 'processing')) && ($purchase_note = get_post_meta($_product->id, '_purchase_note', true))) {
227 227
 													?>
228 228
 													<tr class="product-purchase-note">
229
-														<td colspan="3"><?php echo wpautop( do_shortcode( wp_kses_post( $purchase_note ) ) ); ?></td>
229
+														<td colspan="3"><?php echo wpautop(do_shortcode(wp_kses_post($purchase_note))); ?></td>
230 230
 													</tr>
231 231
 													<?php
232 232
 												}
@@ -239,8 +239,8 @@  discard block
 block discarded – undo
239 239
 
240 240
 								<tfoot>
241 241
 									<?php
242
-										if ( $totals = $order->get_order_item_totals() ) :
243
-											foreach ( $totals as $total ) :
242
+										if ($totals = $order->get_order_item_totals()) :
243
+											foreach ($totals as $total) :
244 244
 												?>
245 245
 												<tr>
246 246
 													<th scope="row"><?php echo $total['label']; ?></th>
@@ -253,9 +253,9 @@  discard block
 block discarded – undo
253 253
 								</tfoot>
254 254
 							</table>
255 255
 
256
-							<?php if ( 'bacs' === $order->get_payment_method() ) { ?>
257
-								<h2><?php esc_html_e( 'Bank Details', 'lsx' ); ?></h2>
258
-								<?php do_action( 'woocommerce_thankyou_' . $order->get_payment_method(), $order->get_id() ); ?>
256
+							<?php if ('bacs' === $order->get_payment_method()) { ?>
257
+								<h2><?php esc_html_e('Bank Details', 'lsx'); ?></h2>
258
+								<?php do_action('woocommerce_thankyou_' . $order->get_payment_method(), $order->get_id()); ?>
259 259
 							<?php } ?>
260 260
 						</div>
261 261
 					</div>
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
 
265 265
 				<?php else : ?>
266 266
 
267
-					<div class="alert alert-danger"><?php esc_html_e( 'Invalid order.', 'lsx' ); ?></div>
267
+					<div class="alert alert-danger"><?php esc_html_e('Invalid order.', 'lsx'); ?></div>
268 268
 
269 269
 				<?php endif; ?>
270 270
 
Please login to merge, or discard this patch.