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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
|
<?php /** * Change view Layout * Archive Products page */
if (!defined('ABSPATH')) : exit; // Exit if accessed directly endif;
$typeView = isset($nasa_opt['products_type_view']) && in_array($nasa_opt['products_type_view'],array('grid', 'list', 'list-2')) ? $nasa_opt['products_type_view'] : 'grid';
$products_per_row = isset($nasa_opt['products_per_row']) && in_array($nasa_opt['products_per_row'], array(2, 3, 4, 5, 6)) ? $nasa_opt['products_per_row'] : 4;
switch ($typeView) : case 'list' : $setup = $type_show = 'list'; break; case 'list-2' : $setup = $type_show = 'list-2'; break;
case 'grid' : default: $setup = $type_show = 'grid-' . $products_per_row; break; endswitch;
if (isset($_GET['view-layout']) && in_array($_GET['view-layout'], array('grid-2', 'grid-3', 'grid-4', 'grid-5', 'grid-6', 'list', 'list-2'))) { $type_show = $_GET['view-layout']; }
$classic = in_array($nasa_sidebar, array('left-classic', 'right-classic', 'top-push-cat')); echo $classic ? '<input type="hidden" name="nasa-data-sidebar" value="' . esc_attr($nasa_sidebar) . '" />' : '';
$col_2 = isset($nasa_opt['option_2_cols']) && $nasa_opt['option_2_cols'] ? true : false; $col_6 = isset($nasa_opt['option_6_cols']) && $nasa_opt['option_6_cols'] ? true : false;
$class_wrap = 'filter-tabs nasa-change-view'; $layout_view = isset($nasa_opt['nasa_change_layout_view']) && in_array($nasa_opt['nasa_change_layout_view'],array('number_view', 'img_view_2', 'img_view_1')) ? $nasa_opt['nasa_change_layout_view'] : 'img_view_1'; $number_view = false;
$multicheck_option_cols_display = array();
if (isset($nasa_opt['multicheck_options_cols_display'])) { if (!empty($nasa_opt['multicheck_options_cols_display'])) { foreach ($nasa_opt['multicheck_options_cols_display'] as $key => $val) { if ($val && !in_array($key, $multicheck_option_cols_display)) { $multicheck_option_cols_display[] = $key; }
if (!in_array($products_per_row . '-cols', $multicheck_option_cols_display) && $products_per_row . '-cols' === $key) { $multicheck_option_cols_display[] = $products_per_row.'-cols'; } } } else { $multicheck_option_cols_display = array("3-cols", "4-cols", "5-cols", "list"); } } else { if ($col_2) { $multicheck_option_cols_display[] = '2-cols'; } if ($col_6) { $multicheck_option_cols_display[] = '6-cols'; } }
$svg_2col = '<svg xmlns="http://www.w3.org/2000/svg" width="17" height="17" viewBox="0 0 17 18" fill="none"> <rect width="8" height="8" rx="2" fill="currentColor"/> <rect y="9" width="8" height="8" rx="2" fill="currentColor"/> <rect x="9" width="8" height="8" rx="2" fill="currentColor"/> <rect x="9" y="9" width="8" height="8" rx="2" fill="currentColor"/> </svg>';
$svg_3col = '<svg xmlns="http://www.w3.org/2000/svg" width="26" height="17" viewBox="0 0 26 18" fill="none"> <rect width="8" height="8" rx="2" fill="currentColor"/> <rect y="9" width="8" height="8" rx="2" fill="currentColor"/> <rect x="9" width="8" height="8" rx="2" fill="currentColor"/> <rect x="18" width="8" height="8" rx="2" fill="currentColor"/> <rect x="9" y="9" width="8" height="8" rx="2" fill="currentColor"/> <rect x="18" y="9" width="8" height="8" rx="2" fill="currentColor"/> </svg>';
$svg_4col = '<svg xmlns="http://www.w3.org/2000/svg" width="23" height="17" viewBox="0 0 23 18" fill="none"> <rect y="12" width="5" height="5" rx="1" fill="currentColor"/> <rect x="6" y="12" width="5" height="5" rx="1" fill="currentColor"/> <rect x="12" y="12" width="5" height="5" rx="1" fill="currentColor"/> <rect x="18" y="12" width="5" height="5" rx="1" fill="currentColor"/> <rect y="6" width="5" height="5" rx="1" fill="currentColor"/> <rect x="6" y="6" width="5" height="5" rx="1" fill="currentColor"/> <rect x="12" y="6" width="5" height="5" rx="1" fill="currentColor"/> <rect x="18" y="6" width="5" height="5" rx="1" fill="currentColor"/> <rect width="5" height="5" rx="1" fill="currentColor"/> <rect x="6" width="5" height="5" rx="1" fill="currentColor"/> <rect x="12" width="5" height="5" rx="1" fill="currentColor"/> <rect x="18" width="5" height="5" rx="1" fill="currentColor"/> </svg>';
$svg_5col = '<svg xmlns="http://www.w3.org/2000/svg" width="29" height="17" viewBox="0 0 29 18" fill="none"> <rect y="12" width="5" height="5" rx="1" fill="currentColor"/> <rect x="6" y="12" width="5" height="5" rx="1" fill="currentColor"/> <rect x="12" y="12" width="5" height="5" rx="1" fill="currentColor"/> <rect x="18" y="12" width="5" height="5" rx="1" fill="currentColor"/> <rect x="24" y="12" width="5" height="5" rx="1" fill="currentColor"/> <rect y="6" width="5" height="5" rx="1" fill="currentColor"/> <rect x="6" y="6" width="5" height="5" rx="1" fill="currentColor"/> <rect x="12" y="6" width="5" height="5" rx="1" fill="currentColor"/> <rect x="18" y="6" width="5" height="5" rx="1" fill="currentColor"/> <rect x="24" y="6" width="5" height="5" rx="1" fill="currentColor"/> <rect width="5" height="5" rx="1" fill="currentColor"/> <rect x="6" width="5" height="5" rx="1" fill="currentColor"/> <rect x="12" width="5" height="5" rx="1" fill="currentColor"/> <rect x="18" width="5" height="5" rx="1" fill="currentColor"/> <rect x="24" width="5" height="5" rx="1" fill="currentColor"/> </svg>';
$svg_6col = '<svg xmlns="http://www.w3.org/2000/svg" width="29" height="17" viewBox="0 0 29 18" fill="none"> <rect width="4" height="4" rx="1" fill="currentColor"/> <rect x="5" width="4" height="4" rx="1" fill="currentColor"/> <rect x="10" width="4" height="4" rx="1" fill="currentColor"/> <rect x="15" width="4" height="4" rx="1" fill="currentColor"/> <rect x="20" width="4" height="4" rx="1" fill="currentColor"/> <rect x="25" width="4" height="4" rx="1" fill="currentColor"/> <rect y="6.5" width="4" height="4" rx="1" fill="currentColor"/> <rect x="5" y="6.5" width="4" height="4" rx="1" fill="currentColor"/> <rect x="10" y="6.5" width="4" height="4" rx="1" fill="currentColor"/> <rect x="15" y="6.5" width="4" height="4" rx="1" fill="currentColor"/> <rect x="20" y="6.5" width="4" height="4" rx="1" fill="currentColor"/> <rect x="25" y="6.5" width="4" height="4" rx="1" fill="currentColor"/> <rect y="13" width="4" height="4" rx="1" fill="currentColor"/> <rect x="5" y="13" width="4" height="4" rx="1" fill="currentColor"/> <rect x="10" y="13" width="4" height="4" rx="1" fill="currentColor"/> <rect x="15" y="13" width="4" height="4" rx="1" fill="currentColor"/> <rect x="20" y="13" width="4" height="4" rx="1" fill="currentColor"/> <rect x="25" y="13" width="4" height="4" rx="1" fill="currentColor"/> </svg>';
$svg_list = '<svg xmlns="http://www.w3.org/2000/svg" width="21" height="17" viewBox="0 0 21 18" fill="none"> <rect x="9" y="2" width="12" height="1" rx="0.5" fill="currentColor"/> <rect x="9" y="4" width="12" height="1" rx="0.5" fill="currentColor"/> <rect width="8" height="8" rx="1.5" fill="currentColor"/> <rect x="9" y="11" width="12" height="1" rx="0.5" fill="currentColor"/> <rect x="9" y="13" width="12" height="1" rx="0.5" fill="currentColor"/> <rect y="9" width="8" height="8" rx="1.5" fill="currentColor"/> </svg>';
$svg_list2 = '<svg xmlns="http://www.w3.org/2000/svg" width="29" height="17" viewBox="0 0 29 18" fill="none"> <rect x="8" y="2" width="6" height="0.8" rx="0.4" fill="currentColor"/> <rect x="8" y="4" width="6" height="0.8" rx="0.4" fill="currentColor"/> <rect width="7" height="7" rx="1.5" fill="currentColor"/> <rect x="8" y="12" width="6" height="0.8" rx="0.4" fill="currentColor"/> <rect x="8" y="14" width="6" height="0.8" rx="0.4" fill="currentColor"/> <rect y="10" width="7" height="7" rx="1.5" fill="currentColor"/> <rect x="23" y="2" width="6" height="0.8" rx="0.4" fill="currentColor"/> <rect x="23" y="4" width="6" height="0.8" rx="0.4" fill="currentColor"/> <rect x="15" width="7" height="7" rx="1.5" fill="currentColor"/> <rect x="23" y="12" width="6" height="0.8" rx="0.4" fill="currentColor"/> <rect x="23" y="14" width="6" height="0.8" rx="0.4" fill="currentColor"/> <rect x="15" y="10" width="7" height="7" rx="1.5" fill="currentColor"/> </svg>';
switch ($layout_view): case 'number_view': $class_wrap .= ' nasa-show-number'; $number_view = true; break;
case 'img_view_2': $class_wrap .= ' nasa-change-layout-img-2'; $svg_2col = '<svg xmlns="http://www.w3.org/2000/svg" width="6" height="12" viewBox="0 0 6 12" fill="none"> <rect width="1.5" height="12" rx="0.75" transform="matrix(-1 0 0 1 1.5 0)" fill="currentColor"/> <rect width="1.5" height="12" rx="0.75" transform="matrix(-1 0 0 1 5.5 0)" fill="currentColor"/> </svg>'; $svg_3col = '<svg xmlns="http://www.w3.org/2000/svg" width="10" height="12" viewBox="0 0 10 12" fill="none"> <rect width="1.5" height="12" rx="0.75" transform="matrix(-1 0 0 1 1.5 0)" fill="currentColor"/> <rect width="1.5" height="12" rx="0.75" transform="matrix(-1 0 0 1 5.5 0)" fill="currentColor"/> <rect width="1.5" height="12" rx="0.75" transform="matrix(-1 0 0 1 9.5 0)" fill="currentColor"/> </svg>'; $svg_4col = '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="12" viewBox="0 0 14 12" fill="none"> <rect width="1.5" height="12" rx="0.75" transform="matrix(-1 0 0 1 1.5 0)" fill="currentColor"/> <rect width="1.5" height="12" rx="0.75" transform="matrix(-1 0 0 1 5.5 0)" fill="currentColor"/> <rect width="1.5" height="12" rx="0.75" transform="matrix(-1 0 0 1 9.5 0)" fill="currentColor"/> <rect width="1.5" height="12" rx="0.75" transform="matrix(-1 0 0 1 13.5 0)" fill="currentColor"/> </svg>'; $svg_5col = '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="12" viewBox="0 0 14 12" fill="none"> <rect width="1.5" height="12" rx="0.75" transform="matrix(-1 0 0 1 1.5 0)" fill="currentColor"/> <rect width="1.5" height="12" rx="0.75" transform="matrix(-1 0 0 1 4.5 0)" fill="currentColor"/> <rect width="1.5" height="12" rx="0.75" transform="matrix(-1 0 0 1 7.5 0)" fill="currentColor"/> <rect width="1.5" height="12" rx="0.75" transform="matrix(-1 0 0 1 10.5 0)" fill="currentColor"/> <rect width="1.5" height="12" rx="0.75" transform="matrix(-1 0 0 1 13.5 0)" fill="currentColor"/> </svg>'; $svg_6col = '<svg xmlns="http://www.w3.org/2000/svg" width="17" height="12" viewBox="0 0 17 12" fill="none"> <rect width="1.5" height="12" rx="0.75" transform="matrix(-1 0 0 1 1.5 0)" fill="currentColor"/> <rect width="1.5" height="12" rx="0.75" transform="matrix(-1 0 0 1 4.5 0)" fill="currentColor"/> <rect width="1.5" height="12" rx="0.75" transform="matrix(-1 0 0 1 7.5 0)" fill="currentColor"/> <rect width="1.5" height="12" rx="0.75" transform="matrix(-1 0 0 1 10.5 0)" fill="currentColor"/> <rect width="1.5" height="12" rx="0.75" transform="matrix(-1 0 0 1 13.5 0)" fill="currentColor"/> <rect width="1.5" height="12" rx="0.75" transform="matrix(-1 0 0 1 16.5 0)" fill="currentColor"/> </svg>'; $svg_list = '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 14 10" fill="none"> <rect width="1.5" height="14" rx="0.75" transform="matrix(4.37114e-08 1 1 -4.37114e-08 0 8)" fill="currentColor"/> <rect width="1.5" height="14" rx="0.75" transform="matrix(4.37114e-08 1 1 -4.37114e-08 0 4)" fill="currentColor"/> <rect width="1.5" height="14" rx="0.75" transform="matrix(4.37114e-08 1 1 -4.37114e-08 0 0)" fill="currentColor"/> </svg>'; $svg_list2 = '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 14 10" fill="none"> <rect width="1.5" height="6" rx="0.75" transform="matrix(4.37114e-08 1 1 -4.37114e-08 8 8)" fill="currentColor"/> <rect width="1.5" height="6" rx="0.75" transform="matrix(4.37114e-08 1 1 -4.37114e-08 8 4)" fill="currentColor"/> <rect width="1.5" height="6" rx="0.75" transform="matrix(4.37114e-08 1 1 -4.37114e-08 8 0)" fill="currentColor"/> <rect width="1.5" height="6" rx="0.75" transform="matrix(4.37114e-08 1 1 -4.37114e-08 0 8)" fill="currentColor"/> <rect width="1.5" height="6" rx="0.75" transform="matrix(4.37114e-08 1 1 -4.37114e-08 0 4)" fill="currentColor"/> <rect width="1.5" height="6" rx="0.75" transform="matrix(4.37114e-08 1 1 -4.37114e-08 0 0)" fill="currentColor"/> </svg>'; break; case 'img_view_1': default : $class_wrap .= ' nasa-change-layout-img-1'; break; endswitch;
$list_view = isset($nasa_opt['products_layout_style']) && $nasa_opt['products_layout_style'] == 'masonry-isotope' ? false : true; ?> <div class="<?php echo $class_wrap; ?>"> <?php if ($number_view && !empty($multicheck_option_cols_display)) : ?> <span class="nasa-label-change-view margin-right-10 rtl-margin-right-0 rtl-margin-left-10 nasa-bold-700"> <?php echo esc_html__('See', 'elessi-theme'); ?> </span> <?php endif; ?>
<?php if (in_array('2-cols', $multicheck_option_cols_display)) : ?> <a href="javascript:void(0);" class="nasa-change-layout productGrid grid-2 nasa-tip<?php echo ($type_show == 'grid-2') ? ' active' : ''; ?><?php echo ($setup == 'grid-2') ? ' df' : ''; ?>" data-tip="<?php echo esc_html__('2 Columns', 'elessi-theme'); ?>" data-columns="2" rel="nofollow"> <?php if ($number_view) : ?> <span class="nasa-text-number hidden-tag"> <?php echo esc_html__('2', 'elessi-theme'); ?> </span> <?php endif; ?>
<?php echo ($svg_2col); ?> <!-- <svg width="22" height="22" viewBox="0 0 512 512" fill="currentColor"> <path d="M333 53l0 408-67 0 0-410 67 0z m-87-2l0 410-67 0 0-410c0 0 67 0 67 0z"/> </svg> --> </a> <?php endif; ?>
<?php if (in_array('3-cols', $multicheck_option_cols_display)) : ?> <a href="javascript:void(0);" class="nasa-change-layout productGrid grid-3 nasa-tip<?php echo ($type_show == 'grid-3') ? ' active' : ''; ?><?php echo ($setup == 'grid-3') ? ' df' : ''; ?>" data-columns="3" rel="nofollow" data-tip="<?php echo esc_html__('3 Columns', 'elessi-theme'); ?>"> <?php if ($number_view) : ?> <span class="nasa-text-number hidden-tag"> <?php echo esc_html__('3', 'elessi-theme'); ?> </span> <?php endif; ?>
<?php echo ($svg_3col); ?>
<!-- <svg width="22" height="22" viewBox="0 0 512 512" fill="currentColor"> <path d="M298 53l0 408-69 0 0-410 69 0z m-87 0l0 408-69 0 0-410 69 0z m173 0l0 409-69 0 0-409z"/> </svg> --> </a> <?php endif; ?>
<?php if (in_array('4-cols', $multicheck_option_cols_display)) : ?> <a href="javascript:void(0);" class="nasa-change-layout productGrid grid-4 nasa-tip<?php echo ($type_show == 'grid-4') ? ' active' : ''; ?><?php echo ($setup == 'grid-4') ? ' df' : ''; ?>" data-columns="4" rel="nofollow" data-tip="<?php echo esc_html__('4 Columns', 'elessi-theme'); ?>"> <?php if ($number_view) : ?> <span class="nasa-text-number hidden-tag"> <?php echo esc_html__('4', 'elessi-theme'); ?> </span> <?php endif; ?>
<?php echo ($svg_4col); ?> <!-- <svg width="22" height="22" viewBox="0 0 512 512" fill="currentColor"> <path d="M250 53l0 408-69 0 0-410 69 0z m-87-2l0 410-69 0 0-410c0 0 69 0 69 0z m173 2l0 409-69 0 0-409z m86 0l0 409-68 0 0-409z"/> </svg> --> </a> <?php endif; ?>
<?php if (in_array('5-cols', $multicheck_option_cols_display)) : ?> <a href="javascript:void(0);" class="nasa-change-layout productGrid grid-5 nasa-tip<?php echo ($type_show == 'grid-5') ? ' active' : ''; ?><?php echo ($setup == 'grid-5') ? ' df' : ''; ?>" data-columns="5" rel="nofollow" data-tip="<?php echo esc_html__('5 Columns', 'elessi-theme'); ?>"> <?php if ($number_view) : ?> <span class="nasa-text-number hidden-tag"> <?php echo esc_html__('5', 'elessi-theme'); ?> </span> <?php endif; ?>
<?php echo ($svg_5col); ?>
<!-- <svg width="22" height="22" viewBox="0 0 512 512" fill="currentColor"> <path d="M203 53l0 408-67 0 0-410 67 0z m-86-2l0 410-67 0 0-410c0 0 67 0 67 0z m174 2l0 409-69 0 0-409z m87 0l0 409-69 0 0-409z m88 0l0 409-69 0 0-409z"/> </svg> --> </a> <?php endif; ?>
<?php if (in_array('6-cols', $multicheck_option_cols_display)) : ?> <a href="javascript:void(0);" class="nasa-change-layout productGrid grid-6 nasa-tip<?php echo ($type_show == 'grid-6') ? ' active' : ''; ?><?php echo ($setup == 'grid-6') ? ' df' : ''; ?>" data-columns="6" rel="nofollow" data-tip="<?php echo esc_html__('6 Columns', 'elessi-theme'); ?>"> <?php if ($number_view) : ?> <span class="nasa-text-number hidden-tag"> <?php echo esc_html__('6', 'elessi-theme'); ?> </span> <?php endif; ?>
<?php echo ($svg_6col); ?> </a> <?php endif; ?>
<?php if ($list_view && in_array('list-2cols', $multicheck_option_cols_display)) : ?> <a href="javascript:void(0);" class="nasa-change-layout productList list-2 nasa-tip<?php echo ($type_show == 'list-2') ? ' active' : ''; ?><?php echo ($setup == 'list-2') ? ' df' : ''; ?>" data-columns="list-2" rel="nofollow" data-tip="<?php echo esc_html__('List 2 Columns', 'elessi-theme'); ?>"> <?php if ($number_view) : ?> <span class="nasa-text-number hidden-tag"> <?php echo esc_html__('List 2', 'elessi-theme'); ?> </span> <?php endif; ?>
<?php echo ($svg_list2); ?> <!-- <svg width="22" height="22" viewBox="0 0 512 512" fill="currentColor"> <path d="M462 202l-300 0 0-68 302 0z m0-87l-300 0 0-67 302 0c0 0 0 67-2 67z m0 175l-300 0 0-69 300 0z m0 86l-300 0 0-69 300 0z m0 88l-300 0 0-69 300 0z m-321-262l-88 0 0-68 88 0z m0-87l-88 0 0-67 88 0c0 0 0 67 0 67z m0 175l-90 0 0-69 88 0 0 69z m0 86l-90 0 0-69 88 0 0 69z m0 88l-90 0 0-69 88 0 0 69z"/> </svg> --> </a> <?php endif; ?>
<?php if ($list_view && in_array('list', $multicheck_option_cols_display)) : ?> <a href="javascript:void(0);" class="nasa-change-layout productList list nasa-tip<?php echo ($type_show == 'list') ? ' active' : ''; ?><?php echo ($setup == 'list') ? ' df' : ''; ?>" data-columns="1" rel="nofollow" data-tip="<?php echo esc_html__('List', 'elessi-theme'); ?>"> <?php if ($number_view) : ?> <span class="nasa-text-number hidden-tag"> <?php echo esc_html__('List', 'elessi-theme'); ?> </span> <?php endif;?> <?php echo ($svg_list);?> <!-- <svg width="22" height="22" viewBox="0 0 512 512" fill="currentColor"> <path d="M462 202l-300 0 0-68 302 0z m0-87l-300 0 0-67 302 0c0 0 0 67-2 67z m0 175l-300 0 0-69 300 0z m0 86l-300 0 0-69 300 0z m0 88l-300 0 0-69 300 0z m-321-262l-88 0 0-68 88 0z m0-87l-88 0 0-67 88 0c0 0 0 67 0 67z m0 175l-90 0 0-69 88 0 0 69z m0 86l-90 0 0-69 88 0 0 69z m0 88l-90 0 0-69 88 0 0 69z"/> </svg> --> </a> <?php endif; ?> </div>
|