Completed
Push — master ( f5c725...601be3 )
by
unknown
28:22
created
includes/librairies/purchase/orders.class.php 1 patch
Braces   +14 added lines, -23 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@  discard block
 block discarded – undo
1
-<?php if ( !defined( 'ABSPATH' ) ) exit;
1
+<?php if ( !defined( 'ABSPATH' ) ) {
2
+	exit;
3
+}
2 4
 /**
3 5
  * Products management method file
4 6
  *
@@ -132,8 +134,7 @@  discard block
 block discarded – undo
132 134
 		$order_main_info .= '<div class="wps-product-section">';
133 135
 		if(empty($order_postmeta['order_date']) || (empty($order_postmeta['order_key']) && empty($order_postmeta['order_temporary_key']) && empty($order_postmeta['order_invoice_ref']))){
134 136
 			$order_main_info .=  '<span class="dashicons dashicons-arrow-right"></span> <strong>'.__('Temporary quotation reference','wpshop').': </strong>'.self::get_new_pre_order_reference(false).'<br/>';
135
-		}
136
-		else{
137
+		} else{
137 138
 			if(!empty($order_postmeta['order_key'])){
138 139
 				$order_main_info .=  '<span class="dashicons dashicons-arrow-right"></span> <strong>'.__('Order reference','wpshop').' : </strong>'.$order_postmeta['order_key'].'<br/>';
139 140
 			}
@@ -149,8 +150,7 @@  discard block
 block discarded – undo
149 150
 				$sub_tpl_component['ADMIN_ORDER_INVOICE_DOWNLOAD_LINK'] = admin_url( 'admin-post.php?action=wps_invoice&order_id=' . $order->ID );
150 151
 				$order_invoice_download = wpshop_display::display_template_element('wpshop_admin_order_payment_received_invoice_download_links', $sub_tpl_component, array(), 'admin');
151 152
 				$order_main_info .= '<span class="dashicons dashicons-arrow-right"></span> <strong>'. __('Invoice number','wpshop').': </strong>'.$order_postmeta['order_invoice_ref'].'<br/>' . $order_invoice_download . '';
152
-			}
153
-			else {
153
+			} else {
154 154
 				$order_main_info .= wpshop_display::display_template_element('wpshop_admin_order_generate_invoice_button', array(), array(), 'admin');
155 155
 			}
156 156
 		}
@@ -197,8 +197,7 @@  discard block
 block discarded – undo
197 197
 			if ( empty($credit_meta) ) {
198 198
 				if( $order_postmeta['order_status'] == 'refunded') {
199 199
 					$tpl_component['ADMIN_ORDER_ACTIONS_LIST'] .= '<div class="wps-product-section wps_markAsRefunded_container">' .__('Credit Slip number', 'wpshop'). ' : <strong>'. ( (!empty($order_postmeta) && !empty($order_postmeta['order_payment']) && !empty($order_postmeta['order_payment']['refunded_action']) && !empty($order_postmeta['order_payment']['refunded_action']['credit_slip_ref']) ) ? '<a href="' .admin_url( 'admin-post.php?action=wps_invoice&order_id=' .$order->ID. '&amp;invoice_ref=' .$order_postmeta['order_payment']['refunded_action']['credit_slip_ref'].'&credit_slip=ok' ). '" target="_blank">'.$order_postmeta['order_payment']['refunded_action']['credit_slip_ref'].'</a>' : '') .'</strong></div>';
200
-				}
201
-				else {
200
+				} else {
202 201
 					$tpl_component['ADMIN_ORDER_ACTIONS_LIST'] .= '<div class="wps-product-section wps_markAsRefunded_container" ><button class="wps-bton-second-mini-rounded markAsRefunded order_' .$order->ID. '">' .__('Refund this order', 'wpshop'). '</button><input type="hidden" id="markasrefunded_order_hidden_indicator" name="markasrefunded_order_hidden_indicator" /></div>';
203 202
 				}
204 203
 			}
@@ -278,8 +277,7 @@  discard block
 block discarded – undo
278 277
 
279 278
 		$order_current_number = get_option('wpshop_order_current_number', false);
280 279
 		/* If the counter doesn't exist, we initiate it */
281
-		if(!$order_current_number) { $order_current_number = 1; }
282
-		else { $order_current_number++; }
280
+		if(!$order_current_number) { $order_current_number = 1; } else { $order_current_number++; }
283 281
 		update_option('wpshop_order_current_number', $order_current_number);
284 282
 
285 283
 		$order_ref = (string)sprintf('%0'.$number_figures.'d', $order_current_number);
@@ -299,8 +297,7 @@  discard block
 block discarded – undo
299 297
 
300 298
 		$order_current_number = get_option('wpshop_preorder_current_number', false);
301 299
 		/* If the counter doesn't exist, we initiate it */
302
-		if(!$order_current_number) { $order_current_number = 1; }
303
-		else { $order_current_number++; }
300
+		if(!$order_current_number) { $order_current_number = 1; } else { $order_current_number++; }
304 301
 		if($save){
305 302
 			update_option('wpshop_preorder_current_number', $order_current_number);
306 303
 		}
@@ -334,8 +331,7 @@  discard block
 block discarded – undo
334 331
 					$shipping_info['address'] = get_post_meta( $address_id, '_'.WPSHOP_NEWTYPE_IDENTIFIER_ADDRESS.'_metadata', true);
335 332
 				}
336 333
 			}
337
-		}
338
-		else {
334
+		} else {
339 335
 			$shipping_info['id'] = get_post_meta($shipping_address_id, WPSHOP_ADDRESS_ATTRIBUTE_SET_ID_META_KEY, true);
340 336
 			$shipping_info['address'] = get_post_meta($shipping_address_id, '_'.WPSHOP_NEWTYPE_IDENTIFIER_ADDRESS.'_metadata', true);
341 337
 			$shipping_info['address_id'] = ( !empty($_SESSION['shipping_address']) ) ? intval( $_SESSION['shipping_address'] ) : '';
@@ -398,8 +394,7 @@  discard block
 block discarded – undo
398 394
 				case "order_billing":
399 395
 					if ( !empty($addresses['billing']) && !empty($addresses['billing']['address']) && is_array($addresses['billing']['address']) ) {
400 396
 						$billing = $addresses['billing']['address'];
401
-					}
402
-					else if ( !empty($addresses['billing']) ) {
397
+					} else if ( !empty($addresses['billing']) ) {
403 398
 						$billing = $addresses['billing'];
404 399
 					}
405 400
 					if ( !empty($billing) ) {
@@ -408,8 +403,7 @@  discard block
 block discarded – undo
408 403
 						echo (!empty($billing['address']) ? $billing['address'] : null).'<br />';
409 404
 						echo (!empty($billing['postcode']) ? $billing['postcode'] : null).' '.(!empty($billing['city']) ? $billing['city'] : null).', '.(!empty($billing['country']) ? $billing['country'] : null);
410 405
 						echo (!empty($billing['phone']) ? '<br />' . $billing['phone'] : '');
411
-					}
412
-					else {
406
+					} else {
413 407
 						echo __('No information available for user billing', 'wpshop');
414 408
 					}
415 409
 				break;
@@ -417,8 +411,7 @@  discard block
 block discarded – undo
417 411
 				case "order_shipping":
418 412
 					if ( !empty($addresses['shipping']) && !empty($addresses['shipping']['address']) && is_array($addresses['shipping']['address']) ) {
419 413
 						$shipping = $addresses['shipping']['address'];
420
-					}
421
-					else if ( !empty($addresses['shipping']) ) {
414
+					} else if ( !empty($addresses['shipping']) ) {
422 415
 						$shipping = $addresses['shipping'];
423 416
 					}
424 417
 					if ( !empty($shipping) ) {
@@ -426,8 +419,7 @@  discard block
 block discarded – undo
426 419
 						echo empty($shipping['company'])?'<br />':', <i>'.$shipping['company'].'</i><br />';
427 420
 						echo (!empty($shipping['address']) ? $shipping['address'] : null).'<br />';
428 421
 						echo (!empty($shipping['postcode']) ? $shipping['postcode'] : null).' '.(!empty($shipping['city']) ? $shipping['city'] : null).', '.(!empty($shipping['country']) ? $shipping['country'] : null);
429
-					}
430
-					else{
422
+					} else{
431 423
 						echo __('No information available for user shipping', 'wpshop');
432 424
 					}
433 425
 				break;
@@ -440,8 +432,7 @@  discard block
 block discarded – undo
440 432
 						// Marquer comme envoy�
441 433
 						if (!empty($order_postmeta['order_status']) && ($order_postmeta['order_status'] == 'completed')) {
442 434
 							$buttons .= '<a data-id="' . $post_id . '" class="wps-bton-second-mini-rounded markAsShipped order_'.$post_id.' wps-bton-loader">'.__('Mark as shipped', 'wpshop').'</a> ';
443
-						}
444
-						else if (!empty($order_postmeta['order_status']) && ($order_postmeta['order_status'] == 'awaiting_payment' )) {
435
+						} else if (!empty($order_postmeta['order_status']) && ($order_postmeta['order_status'] == 'awaiting_payment' )) {
445 436
 							//		$buttons .= '<a class="button markAsCompleted order_'.$post_id.' alignleft" >'.__('Payment received', 'wpshop').'</a>' . wpshop_payment::display_payment_receiver_interface($post_id) . ' ';
446 437
 						}
447 438
 						$buttons .= '</p>';
Please login to merge, or discard this patch.