-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathti-wishlist-original.php
More file actions
177 lines (169 loc) · 8.46 KB
/
ti-wishlist-original.php
File metadata and controls
177 lines (169 loc) · 8.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
<?php
/**
* The Template for displaying wishlist if a current user is owner.
*
* @version 1.9.0
* @package TInvWishlist\Template
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
wp_enqueue_script( 'tinvwl' );
?>
<div class="tinv-wishlist woocommerce tinv-wishlist-clear">
<?php do_action( 'tinvwl_before_wishlist', $wishlist ); ?>
<?php if ( function_exists( 'wc_print_notices' ) ) {
wc_print_notices();
} ?>
<form action="<?php echo esc_url( tinv_url_wishlist() ); ?>" method="post" autocomplete="off">
<?php do_action( 'tinvwl_before_wishlist_table', $wishlist ); ?>
<table class="tinvwl-table-manage-list">
<thead>
<tr>
<?php if ( isset( $wishlist_table['colm_checkbox'] ) && $wishlist_table['colm_checkbox'] ) { ?>
<th class="product-cb"><input type="checkbox" class="global-cb"
title="<?php _e( 'Select all for bulk action', 'ti-woocommerce-wishlist' ) ?>">
</th>
<?php } ?>
<th class="product-remove"></th>
<th class="product-thumbnail"> </th>
<th class="product-name"><span
class="tinvwl-full"><?php esc_html_e( 'Product Name', 'ti-woocommerce-wishlist' ); ?></span><span
class="tinvwl-mobile"><?php esc_html_e( 'Product', 'ti-woocommerce-wishlist' ); ?></span></th>
<?php if ( isset( $wishlist_table_row['colm_price'] ) && $wishlist_table_row['colm_price'] ) { ?>
<th class="product-price"><?php esc_html_e( 'Unit Price', 'ti-woocommerce-wishlist' ); ?></th>
<?php } ?>
<?php if ( isset( $wishlist_table_row['colm_date'] ) && $wishlist_table_row['colm_date'] ) { ?>
<th class="product-date"><?php esc_html_e( 'Date Added', 'ti-woocommerce-wishlist' ); ?></th>
<?php } ?>
<?php if ( isset( $wishlist_table_row['colm_stock'] ) && $wishlist_table_row['colm_stock'] ) { ?>
<th class="product-stock"><?php esc_html_e( 'Stock Status', 'ti-woocommerce-wishlist' ); ?></th>
<?php } ?>
<?php if ( isset( $wishlist_table_row['add_to_cart'] ) && $wishlist_table_row['add_to_cart'] ) { ?>
<th class="product-action"> </th>
<?php } ?>
</tr>
</thead>
<tbody>
<?php do_action( 'tinvwl_wishlist_contents_before' ); ?>
<?php
foreach ( $products as $wl_product ) {
$product = apply_filters( 'tinvwl_wishlist_item', $wl_product['data'] );
unset( $wl_product['data'] );
$paged = get_query_var( 'wl_paged', 1 );
echo $paged;
if ( $wl_product['quantity'] > 0 && apply_filters( 'tinvwl_wishlist_item_visible', true, $wl_product, $product ) ) {
$product_url = apply_filters( 'tinvwl_wishlist_item_url', $product->get_permalink(), $wl_product, $product );
do_action( 'tinvwl_wishlist_row_before', $wl_product, $product );
?>
<tr class="<?php echo esc_attr( apply_filters( 'tinvwl_wishlist_item_class', 'wishlist_item', $wl_product, $product ) ); ?>">
<?php if ( isset( $wishlist_table['colm_checkbox'] ) && $wishlist_table['colm_checkbox'] ) { ?>
<td class="product-cb">
<?php
echo apply_filters( 'tinvwl_wishlist_item_cb', sprintf( // WPCS: xss ok.
'<input type="checkbox" name="wishlist_pr[]" value="%d" title="%s">', esc_attr( $wl_product['ID'] ), __( 'Select for bulk action', 'ti-woocommerce-wishlist' )
), $wl_product, $product );
?>
</td>
<?php } ?>
<td class="product-remove-wishlist">
<button type="submit" name="tinvwl-remove"
value="<?php echo esc_attr( $wl_product['ID'] ); ?>"
title="<?php _e( 'Remove', 'ti-woocommerce-wishlist' ) ?>"><i
class="ftinvwl ftinvwl-times"></i>
</button>
</td>
<td class="product-thumbnail-wishlist">
<?php
$thumbnail = apply_filters( 'tinvwl_wishlist_item_thumbnail', $product->get_image(), $wl_product, $product );
if ( ! $product->is_visible() ) {
echo $thumbnail; // WPCS: xss ok.
} else {
printf( '<a href="%s">%s</a>', esc_url( $product_url ), $thumbnail ); // WPCS: xss ok.
}
?>
</td>
<td class="product-set-wishlist product-name-wishlist">
<div class="content-name-wishlist">Name</div>
<?php
if ( ! $product->is_visible() ) {
echo apply_filters( 'tinvwl_wishlist_item_name', $product->get_title(), $wl_product, $product ) . ' '; // WPCS: xss ok.
} else {
echo apply_filters( 'tinvwl_wishlist_item_name', sprintf( '<a href="%s">%s</a>', esc_url( $product_url ), $product->get_title() ), $wl_product, $product ); // WPCS: xss ok.
}
echo apply_filters( 'tinvwl_wishlist_item_meta_data', tinv_wishlist_get_item_data( $product, $wl_product ), $wl_product, $product ); // WPCS: xss ok.
?>
</td>
<?php if ( isset( $wishlist_table_row['colm_price'] ) && $wishlist_table_row['colm_price'] ) { ?>
<td class="product-set-wishlist product-price-wishlist">
<div class="content-name-wishlist">Price</div>
<?php
echo apply_filters( 'tinvwl_wishlist_item_price', $product->get_price_html(), $wl_product, $product ); // WPCS: xss ok.
?>
</td>
<?php } ?>
<?php if ( isset( $wishlist_table_row['colm_date'] ) && $wishlist_table_row['colm_date'] ) { ?>
<td class="product-set-wishlist product-date-wishlist">
<div class="content-name-wishlist">Date</div>
<?php
echo apply_filters( 'tinvwl_wishlist_item_date', sprintf( // WPCS: xss ok.
'<time class="entry-date" datetime="%1$s">%2$s</time>', $wl_product['date'], mysql2date( get_option( 'date_format' ), $wl_product['date'] )
), $wl_product, $product );
?>
</td>
<?php } ?>
<?php if ( isset( $wishlist_table_row['colm_stock'] ) && $wishlist_table_row['colm_stock'] ) { ?>
<td class="product-set-wishlist product-stock-wishlist">
<div class="content-name-wishlist">Stock status</div>
<?php
$availability = (array) $product->get_availability();
if ( ! array_key_exists( 'availability', $availability ) ) {
$availability['availability'] = '';
}
if ( ! array_key_exists( 'class', $availability ) ) {
$availability['class'] = '';
}
$availability_html = empty( $availability['availability'] ) ? '<p class="stock ' . esc_attr( $availability['class'] ) . '"><span><i class="ftinvwl ftinvwl-check"></i></span><span class="tinvwl-txt">' . esc_html__( 'In stock', 'ti-woocommerce-wishlist' ) . '</span></p>' : '<p class="stock ' . esc_attr( $availability['class'] ) . '"><span><i class="ftinvwl ftinvwl-' . ( ( 'out-of-stock' === esc_attr( $availability['class'] ) ? 'times' : 'check' ) ) . '"></i></span><span>' . esc_html( $availability['availability'] ) . '</span></p>';
echo apply_filters( 'tinvwl_wishlist_item_status', $availability_html, $availability['availability'], $wl_product, $product ); // WPCS: xss ok.
?>
</td>
<?php } ?>
<?php if ( isset( $wishlist_table_row['add_to_cart'] ) && $wishlist_table_row['add_to_cart'] ) { ?>
<td class="product-set-wishlist product-action">
<div class="content-name-wishlist">Action</div>
<?php
if ( apply_filters( 'tinvwl_wishlist_item_action_add_to_cart', $wishlist_table_row['add_to_cart'], $wl_product, $product ) ) {
?>
<button class="button alt add_cart_for_wishlist" name="tinvwl-add-to-cart"
value="<?php echo esc_attr( $wl_product['ID'] ); ?>"
title="<?php echo esc_html( apply_filters( 'tinvwl_wishlist_item_add_to_cart', $wishlist_table_row['text_add_to_cart'], $wl_product, $product ) ); ?>">
<i
class="ftinvwl ftinvwl-shopping-cart"></i><span
class="tinvwl-txt"><?php echo esc_html( apply_filters( 'tinvwl_wishlist_item_add_to_cart', $wishlist_table_row['text_add_to_cart'], $wl_product, $product ) ); ?></span>
</button>
<?php } ?>
</td>
<?php } ?>
</tr>
<?php
do_action( 'tinvwl_wishlist_row_after', $wl_product, $product );
} // End if().
} // End foreach().
?>
<?php do_action( 'tinvwl_wishlist_contents_after' ); ?>
</tbody>
<tfoot>
<tr>
<td colspan="100">
<?php do_action( 'tinvwl_after_wishlist_table', $wishlist ); ?>
<?php wp_nonce_field( 'tinvwl_wishlist_owner', 'wishlist_nonce' ); ?>
</td>
</tr>
</tfoot>
</table>
</form>
<?php do_action( 'tinvwl_after_wishlist', $wishlist ); ?>
<div class="tinv-lists-nav tinv-wishlist-clear">
<?php do_action( 'tinvwl_pagenation_wishlist', $wishlist ); ?>
</div>
</div>