Completed
Push — master ( 304f22...240cdb )
by
unknown
18:59
created
templates/backend/product-listing/wps_orders_product_listing_table.php 2 patches
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -1,78 +1,78 @@
 block discarded – undo
1
-<?php if ( !defined( 'ABSPATH' ) ) exit;
2
- $order_post_meta = !empty($post) ? get_post_meta( $post->ID, '_wpshop_order_status', true ) : ""; ?>
1
+<?php if (!defined('ABSPATH')) exit;
2
+ $order_post_meta = !empty($post) ? get_post_meta($post->ID, '_wpshop_order_status', true) : ""; ?>
3 3
 <div class="wps-table">
4 4
 	<div class="wps-table-header wps-table-row">
5
-		<div class="wps-table-cell"><?php _e( 'Picture', 'wpshop'); ?></div>
6
-		<div class="wps-table-cell"><?php _e( 'Product reference', 'wpshop'); ?></div>
7
-		<div class="wps-table-cell"><?php _e( 'Product name', 'wpshop'); ?></div>
8
-		<div class="wps-table-cell"><?php _e( 'Price', 'wpshop'); ?></div>
5
+		<div class="wps-table-cell"><?php _e('Picture', 'wpshop'); ?></div>
6
+		<div class="wps-table-cell"><?php _e('Product reference', 'wpshop'); ?></div>
7
+		<div class="wps-table-cell"><?php _e('Product name', 'wpshop'); ?></div>
8
+		<div class="wps-table-cell"><?php _e('Price', 'wpshop'); ?></div>
9 9
 
10
-		<?php if ( 'completed' != $order_post_meta ) : ?>
11
-			<div class="wps-table-cell"><?php _e( 'Quantity', 'wpshop'); ?></div>
12
-			<div class="wps-table-cell"><?php _e( 'Add to order', 'wpshop'); ?></div>
10
+		<?php if ('completed' != $order_post_meta) : ?>
11
+			<div class="wps-table-cell"><?php _e('Quantity', 'wpshop'); ?></div>
12
+			<div class="wps-table-cell"><?php _e('Add to order', 'wpshop'); ?></div>
13 13
 		<?php endif; ?>
14 14
 	</div>
15
-	<?php if( !empty($products) ) :
16
-		$total_products = count( $products );
15
+	<?php if (!empty($products)) :
16
+		$total_products = count($products);
17 17
 		$i = 0;
18 18
 		$elements_per_page = 20;
19
-		$paged = absint( isset( $_REQUEST['paged_order'] ) ? $_REQUEST['paged_order'] : 1 );
20
-		$paginate_links = paginate_links( array(
19
+		$paged = absint(isset($_REQUEST['paged_order']) ? $_REQUEST['paged_order'] : 1);
20
+		$paginate_links = paginate_links(array(
21 21
 			'base' => '%_%',
22 22
 			'format' => '?paged_order=%#%',
23 23
 			'current' => $paged,
24
-			'total' => ceil( $total_products / $elements_per_page )
25
-		) );
26
-		foreach ( $products as $product ) :
27
-			if( ( $elements_per_page * ( $paged - 1 ) ) > $i ) {
24
+			'total' => ceil($total_products / $elements_per_page)
25
+		));
26
+		foreach ($products as $product) :
27
+			if (($elements_per_page * ($paged - 1)) > $i) {
28 28
 				$i++;
29 29
 				continue;
30
-			} elseif ( ( $elements_per_page * $paged ) <= $i ) {
30
+			} elseif (($elements_per_page * $paged) <= $i) {
31 31
 				break;
32 32
 			}
33 33
 			$i++;
34 34
 			$pid = $product->ID;
35 35
 	?>
36
-	<?php $product_metadata = get_post_meta( $product->ID, '_wpshop_product_metadata', true ); ?>
36
+	<?php $product_metadata = get_post_meta($product->ID, '_wpshop_product_metadata', true); ?>
37 37
 	<div class="wps-table-content wps-table-row">
38
-		<div class="wps-table-cell  wps-cart-item-img"><?php echo get_the_post_thumbnail( $product->ID, 'thumbnail' ); ?></div>
39
-		<div class="wps-table-cell"><?php echo ( !empty( $product_metadata) && $product_metadata['product_reference']) ? $product_metadata['product_reference'] : ''; ?></div>
38
+		<div class="wps-table-cell  wps-cart-item-img"><?php echo get_the_post_thumbnail($product->ID, 'thumbnail'); ?></div>
39
+		<div class="wps-table-cell"><?php echo (!empty($product_metadata) && $product_metadata['product_reference']) ? $product_metadata['product_reference'] : ''; ?></div>
40 40
 		<div class="wps-table-cell"><?php echo $product->post_title; ?></div>
41 41
 		<div class="wps-table-cell">
42 42
 		<?php
43 43
 			$product = wpshop_products::get_product_data($product->ID);
44
-			echo wpshop_prices::get_product_price($product, 'price_display', array('mini_output', 'grid') );
44
+			echo wpshop_prices::get_product_price($product, 'price_display', array('mini_output', 'grid'));
45 45
 		?>
46 46
 		</div>
47
-		<?php if ( 'completed' != $order_post_meta ) : ?>
47
+		<?php if ('completed' != $order_post_meta) : ?>
48 48
 			<div class="wps-table-cell">
49
-				<a class="wps-bton-icon-minus-small wps-cart-reduce-product-qty" data-nonce="<?php echo wp_create_nonce( 'ajax_wpshop_set_qty_for_product_into_cart' ); ?>" href=""></a>
49
+				<a class="wps-bton-icon-minus-small wps-cart-reduce-product-qty" data-nonce="<?php echo wp_create_nonce('ajax_wpshop_set_qty_for_product_into_cart'); ?>" href=""></a>
50 50
 				<input id="wps-cart-product-qty-<?php echo $pid; ?>" class="wps-cart-product-qty" type="text" value="1" name="french-hens" size="3" style="text-align : center">
51
-				<a class="wps-bton-icon-plus-small wps-cart-add-product-qty" data-nonce="<?php echo wp_create_nonce( 'ajax_wpshop_set_qty_for_product_into_cart' ); ?>" href=""></a>
51
+				<a class="wps-bton-icon-plus-small wps-cart-add-product-qty" data-nonce="<?php echo wp_create_nonce('ajax_wpshop_set_qty_for_product_into_cart'); ?>" href=""></a>
52 52
 			</div>
53 53
 			<div class="wps-table-cell">
54
-				<a href="#" data-nonce="<?php echo wp_create_nonce( 'wps_add_product_to_order_admin' ); ?>" class="wps-bton-first-mini-rounded wps-order-add-product" id="wps-order-add-product-<?php echo $pid; ?>"><i class="wps-icon-basket"></i> <?php _e( 'Add to order', 'wpshop'); ?></a>
54
+				<a href="#" data-nonce="<?php echo wp_create_nonce('wps_add_product_to_order_admin'); ?>" class="wps-bton-first-mini-rounded wps-order-add-product" id="wps-order-add-product-<?php echo $pid; ?>"><i class="wps-icon-basket"></i> <?php _e('Add to order', 'wpshop'); ?></a>
55 55
 			</div>
56 56
 		<?php endif; ?>
57 57
 	</div>
58 58
 	<?php endforeach;
59 59
 	else :
60
-		if( !empty( $research ) ) : ?>
61
-		<div class="wps-alert-info"><?php printf( __( 'No products corresponds to the search <strong>"%s"</strong>', 'wpshop'), $research ); ?></div>
60
+		if (!empty($research)) : ?>
61
+		<div class="wps-alert-info"><?php printf(__('No products corresponds to the search <strong>"%s"</strong>', 'wpshop'), $research); ?></div>
62 62
 	<?php else :
63
-			$letter_display = ( strtoupper( $current_letter ) != 'ALL' ) ? $current_letter : __('ALL', 'wpshop' ); ?>
64
-			<div class="wps-alert-info"><?php printf( __( 'No products corresponds to the letter <strong>"%s"</strong> search', 'wpshop'), strtoupper( $letter_display ) ); ?></div>
63
+			$letter_display = (strtoupper($current_letter) != 'ALL') ? $current_letter : __('ALL', 'wpshop'); ?>
64
+			<div class="wps-alert-info"><?php printf(__('No products corresponds to the letter <strong>"%s"</strong> search', 'wpshop'), strtoupper($letter_display)); ?></div>
65 65
 	<?php endif;
66 66
 		endif; ?>
67 67
 </div>
68 68
 <?php
69
-if( $total_products > $elements_per_page ) :
69
+if ($total_products > $elements_per_page) :
70 70
 	echo $paginate_links;
71 71
 	?>
72 72
 	<input type="hidden" name="last_query[oid]" value="<?php echo $post->ID; ?>">
73
-	<input type="hidden" name="last_query[letter]" value="<?php echo strtoupper( $current_letter ); ?>">
73
+	<input type="hidden" name="last_query[letter]" value="<?php echo strtoupper($current_letter); ?>">
74 74
 	<input type="hidden" name="last_query[research]" value="<?php echo $research; ?>">
75
-	<input type="hidden" name="last_query[_wpnonce]" value="<?php echo wp_create_nonce( 'refresh_product_list_'.strtolower($current_letter) ); ?>">
75
+	<input type="hidden" name="last_query[_wpnonce]" value="<?php echo wp_create_nonce('refresh_product_list_' . strtolower($current_letter)); ?>">
76 76
 	<?php
77 77
 endif;
78 78
 ?>
Please login to merge, or discard this patch.
Braces   +13 added lines, -5 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
  $order_post_meta = !empty($post) ? get_post_meta( $post->ID, '_wpshop_order_status', true ) : ""; ?>
3 5
 <div class="wps-table">
4 6
 	<div class="wps-table-header wps-table-row">
@@ -56,11 +58,17 @@  discard block
 block discarded – undo
56 58
 		<?php endif; ?>
57 59
 	</div>
58 60
 	<?php endforeach;
59
-	else :
61
+	else {
62
+		:
60 63
 		if( !empty( $research ) ) : ?>
61
-		<div class="wps-alert-info"><?php printf( __( 'No products corresponds to the search <strong>"%s"</strong>', 'wpshop'), $research ); ?></div>
62
-	<?php else :
63
-			$letter_display = ( strtoupper( $current_letter ) != 'ALL' ) ? $current_letter : __('ALL', 'wpshop' ); ?>
64
+		<div class="wps-alert-info"><?php printf( __( 'No products corresponds to the search <strong>"%s"</strong>', 'wpshop'), $research );
65
+	}
66
+	?></div>
67
+	<?php else {
68
+	:
69
+			$letter_display = ( strtoupper( $current_letter ) != 'ALL' ) ? $current_letter : __('ALL', 'wpshop' );
70
+}
71
+?>
64 72
 			<div class="wps-alert-info"><?php printf( __( 'No products corresponds to the letter <strong>"%s"</strong> search', 'wpshop'), strtoupper( $letter_display ) ); ?></div>
65 73
 	<?php endif;
66 74
 		endif; ?>
Please login to merge, or discard this patch.