PluginProbe ʕ •ᴥ•ʔ
Products Compare for WooCommerce / 3.6.2.6
Products Compare for WooCommerce v3.6.2.6
3.6.2.8 3.6.2.7 trunk 1.0.1 1.0.10 1.0.10.1 1.0.11 1.0.11.1 1.0.12 1.0.13 1.0.13.1 1.0.2 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 3.5 3.5.0.1 3.5.0.2 3.5.1 3.5.1.1 3.5.1.2 3.5.1.3 3.5.1.4 3.5.1.5 3.5.1.6 3.5.1.7 3.5.2 3.5.2.1 3.5.2.2 3.5.2.3 3.5.3 3.5.4 3.5.5 3.5.6 3.5.7 3.5.7.1 3.5.7.2 3.5.7.3 3.5.7.4 3.5.7.5 3.5.7.6 3.5.7.7 3.5.7.8 3.5.7.9 3.5.8 3.5.9 3.6.0 3.6.1 3.6.2 3.6.2.1 3.6.2.2 3.6.2.3 3.6.2.4 3.6.2.5 3.6.2.6
products-compare-for-woocommerce / templates / new-compare.php
products-compare-for-woocommerce / templates Last commit date
new-compare.php 2 months ago selected_products.php 2 months ago style_section.php 2 months ago
new-compare.php
504 lines
1 <?php
2 global $product, $post;
3 if( isset($product) ) {
4 $product_backup = $product;
5 }
6 if( isset($post) ) {
7 $post_backup = $post;
8 }
9 if( empty( $is_full_screen ) ) {
10 $is_full_screen = FALSE;
11 }
12 $BeRocket_Compare_Products = BeRocket_Compare_Products::getInstance();
13 $options_global = $BeRocket_Compare_Products->get_option();
14 $options = $options_global['general_settings'];
15 $style = $options_global['style_settings'];
16 $text = $options_global['text_settings'];
17 if( isset($_GET['compare']) && $_GET['compare'] ) {
18 $products = explode(',', $_GET['compare']);
19 } else {
20 $products = $BeRocket_Compare_Products->get_all_compare_products();
21 }
22 if( ! is_array($products) ) {
23 $products = array();
24 }
25 foreach( $products as &$product_id ) {
26 $product_id = intval($product_id);
27 }
28 if( $br_compare_apply_filters && is_array($products) && count($products) > 0 ) {
29 $query = new WP_Query(apply_filters('woocommerce_shortcode_products_query', array('post_type' => 'product', 'fields' => 'ids', 'post__in' => $products), array(), 'products'));
30 $products = $query->get_posts();
31 }
32 if ( isset( $products ) && is_array( $products ) && count( $products ) > 0 ) {
33 foreach ( $products as $i => $product ) {
34 $current_language= apply_filters( 'wpml_current_language', NULL );
35 $product = apply_filters( 'wpml_object_id', $product, 'product', true, $current_language );
36 $term = array();
37 $post_get = wc_get_product($product);
38 if( $post_get === false ) {
39 unset($products[$i]);
40 }
41 }
42 }
43 $terms = array();
44 $name = array();
45 $name['attributes'] = array();
46 $name['custom'] = array();
47 $name['acf'] = array();
48 $same = array();
49 $same['attributes'] = array();
50 $same['custom'] = array();
51 $same['acf'] = array();
52 $attr_count = array();
53 $attr_count['attributes'] = array();
54 $attr_count['custom'] = array();
55 $attr_count['acf'] = array();
56 $acf_empty = array();
57 if ( isset( $products ) && is_array( $products ) && count( $products ) > 0 ) {
58 $acf_field_list = array();
59 if( isset($options['attributes']['acf_br_fields']) && function_exists('acf_get_field_groups') ) {
60 if( is_array($options['attributes']['acf_br_fields']) ) {
61 $acf_fields = $options['attributes']['acf_br_fields'];
62 $groups = acf_get_field_groups();
63 if ( is_array( $groups ) ) {
64 foreach ( $groups as $group ) {
65 $fields = acf_get_fields($group);
66 if( is_array($fields) ) {
67 foreach($fields as $field) {
68 if( in_array($field['name'], $acf_fields) ) {
69 $acf_field_list[$field['name']] = $field;
70 }
71 }
72 }
73 }
74 }
75 }
76 unset($options['attributes']['acf_br_fields']);
77 }
78 $description_length = 0;
79 foreach ( $products as $product ) {
80 $current_language= apply_filters( 'wpml_current_language', NULL );
81 $product = apply_filters( 'wpml_object_id', $product, 'product', true, $current_language );
82 $post = get_post($product);
83 $term = array();
84 $post_get = wc_get_product($product);
85 if( $post_get === false ) {
86 continue;
87 }
88 $attributes = $post_get->get_attributes();
89 $taxonomies = get_post_taxonomies( $product );
90 $term['id'] = $product;
91 $term['title'] = $post_get->get_title();
92 $term['image'] = $post_get->get_image();
93 $term['price'] = $post_get->get_price_html();
94 $term['link'] = $post_get->get_permalink();
95 $term['short_description'] = get_the_excerpt($product);
96 $description_length = max(strlen($term['short_description']), $description_length);
97 //$term['availability'] = $post_get->stock_status;
98 $term['availability'] = $post_get->get_availability();
99 $term['is_in_stock'] = $post_get->is_in_stock();
100 $attributes_value = array();
101 $attributes_name = array();
102 foreach ( $attributes as $key => $attribute ) {
103 if ( ! is_array( $options['attributes'] ) || in_array( $key, $options['attributes'] ) || count( $options['attributes'] ) == 0 ) {
104 $attributes_value[$key] = wc_get_product_terms( $product, $key );
105 $same_check = wc_get_product_terms( $product, $key, array('fields' => 'slugs') );
106 if ( is_object( br_get_value_from_array($attributes_value, array($key, 0)) ) ) {
107 $attr_value_temp = $attributes_value[$key];
108 $attributes_value[$key] = array();
109 $same_check = array();
110 foreach( @ $attr_value_temp as $term_i => $term_data ) {
111 $attributes_value[$key][] = $term_data->name;
112 $same_check[] = $term_data->name;
113 }
114 }
115 if( isset($same['attributes'][$key]) ) {
116 $same['attributes'][$key] = array_intersect($same['attributes'][$key], $same_check);
117 } else {
118 $same['attributes'][$key] = $same_check;
119 }
120 if( empty($attr_count['attributes'][$key]) ) {
121 $attr_count['attributes'][$key] = count($attributes_value[$key]);
122 } else {
123 $attr_count['attributes'][$key] = max($attr_count['attributes'][$key], count($attributes_value[$key]));
124 }
125 $attributes_value[$key] = '<p>'.implode( '</p><p>', $attributes_value[$key] ).'</p>';
126 if ( ! isset( $name['attributes'][$key] ) ) {
127 $attributes_name[$key] = get_taxonomy( $key );
128 $taxonomy_label = $attributes_name[$key]->labels->singular_name;
129 $taxonomy_label = apply_filters('wpml_translate_single_string', $taxonomy_label, 'WordPress', sprintf( 'taxonomy singular name: %s', $taxonomy_label ) );
130 $attributes_name[$key] = $taxonomy_label;
131 }
132 if(($key_delete = array_search($key, $taxonomies)) !== false) {
133 unset($taxonomies[$key_delete]);
134 }
135 }
136 }
137 foreach($same['attributes'] as $key => $values) {
138 if( ! isset($attributes[$key]) ) {
139 $same['attributes'][$key] = array();
140 }
141 }
142 $taxonomies = array_diff($taxonomies, array('product_type', 'product_shipping_class'));
143 $term['attributes'] = $attributes_value;
144 $name['attributes'] = $name['attributes'] + $attributes_name;
145 $attributes_value = array();
146 $attributes_name = array();
147 foreach ( $taxonomies as $key ) {
148 if ( ! is_array( $options['attributes'] ) || in_array( $key, $options['attributes'] ) || count( $options['attributes'] ) == 0 ) {
149 $attributes_value[$key] = wp_get_post_terms( $product, $key );
150 $custom_result = '';
151 $same_check = array();
152 foreach( $attributes_value[$key] as $cutom_term ) {
153 $custom_result .= '<p>'.$cutom_term->name.'</p>';
154 $same_check[] = $cutom_term->slug;
155 }
156 if( isset($same['custom'][$key]) ) {
157 $same['custom'][$key] = array_intersect($same['custom'][$key], $same_check);
158 } else {
159 $same['custom'][$key] = $same_check;
160 }
161 if( ! empty($attributes_value[$key]) ) {
162 if( empty($attr_count['custom'][$key]) ) {
163 $attr_count['custom'][$key] = count($attributes_value[$key]);
164 } else {
165 $attr_count['custom'][$key] = max($attr_count['custom'][$key], count($attributes_value[$key]));
166 }
167 }
168 if ( $custom_result ) {
169 $attributes_value[$key] = $custom_result;
170 if ( ! isset( $name['custom'][$key] ) ) {
171 $attributes_name[$key] = get_taxonomy( $key );
172 $taxonomy_label = $attributes_name[$key]->labels->name;
173 $taxonomy_label = apply_filters('wpml_translate_single_string', $taxonomy_label, 'WordPress', sprintf( 'taxonomy singular name: %s', $taxonomy_label ) );
174 $attributes_name[$key] = $taxonomy_label;
175 }
176 } else {
177 unset( $attributes_value[$key] );
178 }
179 }
180 }
181 foreach($same['custom'] as $key => $values) {
182 if( ! in_array($key, $taxonomies) ) {
183 $same['custom'][$key] = array();
184 }
185 }
186 $term['custom'] = $attributes_value;
187 $name['custom'] = $name['custom'] + $attributes_name;
188 //================================================================
189 $attributes_value = array();
190 $attributes_name = array();
191 foreach ( $acf_field_list as $key => $field ) {
192 ob_start();
193 the_field($field['name'], $product, true);
194 $attributes_value[$key] = array(ob_get_clean());
195 if( empty($attributes_value[$key][0]) ) {
196 $attributes_value[$key] = array('');
197 }
198 $custom_result = '';
199 $same_check = array();
200 foreach( $attributes_value[$key] as $cutom_term ) {
201 if( is_string($cutom_term) && strlen($cutom_term) > 0 ) {
202 $custom_result .= '<p>'.$cutom_term.'</p>';
203 $same_check[] = $cutom_term;
204 }
205 }
206 if( isset($same['acf'][$key]) ) {
207 $same['acf'][$key] = array_intersect($same['acf'][$key], $same_check);
208 } else {
209 $same['acf'][$key] = $same_check;
210 }
211 if( ! empty($attributes_value[$key]) ) {
212 if( empty($attr_count['acf'][$key]) ) {
213 $attr_count['acf'][$key] = count($attributes_value[$key]);
214 } else {
215 $attr_count['acf'][$key] = max($attr_count['acf'][$key], count($attributes_value[$key]));
216 }
217 }
218 if ( $custom_result ) {
219 $attributes_value[$key] = $custom_result;
220 if ( ! isset( $name['acf'][$key] ) ) {
221 $attributes_name[$key] = $field['label'];
222 }
223 } else {
224 unset( $attributes_value[$key] );
225 }
226 }
227 foreach($same['acf'] as $key => $values) {
228 if( ! array_key_exists($key, $acf_field_list) ) {
229 $same['acf'][$key] = array();
230 }
231 }
232 $term['acf'] = $attributes_value;
233 $name['acf'] = $name['acf'] + $attributes_name;
234 //================================================================
235 $terms[] = $term;
236 }
237 $colwidth = $style['table']['colwidth'];
238 if( empty($colwidth) ) {
239 $colwidth = 200;
240 }
241 $colwidth = $colwidth - 10;
242 if( $colwidth < 0 ) {
243 $colwidth = 25;
244 }
245 $description_width = $description_length * 16;
246 $description_lines = $description_width / $colwidth;
247 $description_lines = (int)$description_lines;
248 $description_lines += 2;
249 $description_height = (20 + 20 * (empty($description_lines) ? 1 : $description_lines));
250 $have_dif = false;
251 foreach ( $same['attributes'] as $attr ) {
252 if( count($attr) > 0 ) {
253 $have_dif = true;
254 break;
255 }
256 }
257 if( ! $have_dif ) {
258 foreach ( $same['custom'] as $attr ) {
259 if( count($attr) > 0 ) {
260 $have_dif = true;
261 break;
262 }
263 }
264 }
265 if( ! $have_dif ) {
266 foreach ( $same['acf'] as $attr ) {
267 if( count($attr) > 0 ) {
268 $have_dif = true;
269 break;
270 }
271 }
272 }
273 ?>
274 <div class="br_new_compare_block_wrap">
275 <?php
276 if ( $options['use_full_screen'] || ! empty($is_full_screen) ) {
277 echo '<div class="br_new_compare_full_size br_full_size_open"><a href="#full-screen"><i class="fa fa-arrows-alt"></i></a></div>';
278 echo '<div class="br_new_compare_full_size br_full_size_close" style="display:none;"><a href="#full-screen-close"><i class="fa fa-times"></i></a></div>';
279 }
280 ?>
281 <div class="br_compare_popup_block"<?php if(! empty($berocket_element_i)) echo ' id="br_popup_'.$berocket_element_i.'"'; ?>>
282 <div class="br_new_compare_block" data-table_scroll="0" data-table_hidden_scroll="0" data-is_full_screen="<?php echo (empty($is_full_screen) ? "0" : "1"); ?>">
283 <div style="clear:both;"></div>
284 <div class="br_top_table">
285 <?php
286 if( $have_dif && ! empty($options['hide_same_button']) ) {
287 echo '<a class="br_show_compare_dif'.($options['hide_same_default'] ? ' br_hidden_same' : '').'" href="#difference">'.($options['hide_same_default']
288 ? (empty($text['show_same_button_text']) ? __( 'Show attributes with same values', 'products-compare-for-woocommerce' ) : $text['show_same_button_text'])
289 : (empty($text['hide_same_button_text']) ? __( 'Hide attributes with same values', 'products-compare-for-woocommerce' ) : $text['hide_same_button_text'])
290 ).'</a>';
291 }
292 if( ! empty($options['remove_all_compare']) ) {
293 echo '<a class="br_remove_all_compare" href="#remove_all">'.(empty($text['remove_all_compare_text']) ? __( 'Clear compare list', 'products-compare-for-woocommerce' ) : $text['remove_all_compare_text']).'</a>';
294 }
295 $top_table_html = '
296 <table>';
297 $top_table_html2 = '<td></td>';
298 $top_table_html .= '
299 <tr><td></td>';
300 foreach ( $terms as $term ) {
301 $top_table_html .= '<th><div>
302 <h3><a href="'.$term['link'].'">'.$term['title'].'</a></h3>';
303 $top_table_term2 = '';
304 if ( ! is_array( $options['attributes'] ) || in_array( 'cp_price', $options['attributes'] ) || count( $options['attributes'] ) == 0 ) {
305 $top_table_term2 .= '<p class="br_compare_price price">'.$term['price'].'</p>';
306 }
307 if ( is_array( $options['attributes'] ) && in_array( 'cp_add_to_cart', $options['attributes'] ) ) {
308 $product = wc_get_product($term['id']);
309 $post = get_post($term['id']);
310 ob_start();
311 echo '<div>';
312 woocommerce_template_loop_add_to_cart();
313 echo '</div>';
314 $top_table_term2 .= ob_get_clean();
315 }
316 if( ! empty($top_table_term2) ) {
317 $top_table_html2 .= '<th>'.$top_table_term2.'</th>';
318 }
319 $default_language= apply_filters( 'wpml_default_language', NULL );
320 $default_product = apply_filters( 'wpml_object_id', $term['id'], 'product', true, $default_language );
321 $top_table_html .= '<a href="#remove" class="br_remove_compare_product_reload" data-id="'.$default_product.'"><i class="fa fa-times"></i></a>';
322 $top_table_html .= '</div></th>';
323 }
324 $top_table_html .= '
325 </tr>';
326 if( ! empty($top_table_html2) ) {
327 $top_table_html .= '<tr>'.$top_table_html2.'</tr>';
328 }
329 $top_table_html .= '
330 </table>';
331 ?>
332 <div class="br_main_top">
333 <?php echo $top_table_html; ?>
334 </div>
335 <div class="br_opacity_top">
336 <?php echo $top_table_html; ?>
337 </div>
338 </div>
339 <div class="br_new_compare">
340 <table class="br_left_table">
341 <?php if ( ! is_array( $options['attributes'] ) || in_array( 'cp_image', $options['attributes'] ) || count( $options['attributes'] ) == 0 ) { ?>
342 <tr class="br_header_row"><td></td></tr>
343 <?php
344 }
345 if ( ! is_array( $options['attributes'] ) || in_array( 'cp_available', $options['attributes'] ) || count( $options['attributes'] ) == 0 ) {
346 echo '<tr class="br_absolute2_cp_availability"><th>'.(empty($text['availability']) ? __( 'Availability', 'products-compare-for-woocommerce' ) : $text['availability']).'</th></tr>';
347 }
348 if ( ! is_array( $options['attributes'] ) || in_array( 'cp_short_description', $options['attributes'] ) || count( $options['attributes'] ) == 0 ) { ?>
349 <tr class="br_description_row"><th><?php echo (empty($text['description']) ? __( 'Description', 'products-compare-for-woocommerce' ) : $text['description']); ?></th></tr>
350 <?php
351 }
352 if ( is_array( $name['attributes'] ) && count( $name['attributes'] ) > 0 ) {
353 echo '<tr><th class="br_lined_attribute_left">'.(empty($text['attribute']) ? __( 'Attributes', 'products-compare-for-woocommerce' ) : $text['attribute']).'</th></tr>';
354 foreach ( $name['attributes'] as $attr => $name_attr ) {
355 echo '<tr class="'.(is_array($same['attributes'][$attr]) && count($same['attributes'][$attr]) ? ' br_same_attr' : '').'" style="height:'.(15 + 20 * (empty($attr_count['attributes'][$attr]) ? '1' : $attr_count['attributes'][$attr])).'px!important;"><th>'.$name_attr.'</th></tr>';
356 }
357 }
358 if ( is_array( $name['custom'] ) && count( $name['custom'] ) > 0 ) {
359 if ( is_array( $name['custom'] ) && count( $name['custom'] ) > 0 ) {
360 echo '<tr><th class="br_lined_attribute_left">'.(empty($text['custom']) ? __( 'Other attributes', 'products-compare-for-woocommerce' ) : $text['custom']).'</th></tr>';
361 foreach ( $name['custom'] as $attr => $name_attr ) {
362 echo '<tr class="'.(is_array($same['custom'][$attr]) && count($same['custom'][$attr]) ? ' br_same_attr' : '').'" style="height:'.(15 + 20 * (empty($attr_count['custom'][$attr]) ? '1' : $attr_count['custom'][$attr])).'px!important;"><th>'.$name_attr.'</th></tr>';
363 }
364 }
365 }
366 if ( is_array( $name['acf'] ) && count( $name['acf'] ) > 0 ) {
367 foreach ( $name['acf'] as $attr => $name_attr ) {
368 echo '<tr class="'.(is_array($same['acf'][$attr]) && count($same['acf'][$attr]) ? ' br_same_attr' : '').'" style="'.apply_filters('berocket_compare_acf_product_field_height', 'height:'.(15 + 20 * (empty($attr_count['acf'][$attr]) ? '1' : $attr_count['acf'][$attr])).'px!important;', $acf_field_list[$attr]) . '"><th>'.$name_attr.'</th>';
369 }
370 }
371 ?>
372 </table>
373 <div class="br_right_table">
374 <table>
375 <?php if ( ! is_array( $options['attributes'] ) || in_array( 'cp_image', $options['attributes'] ) || count( $options['attributes'] ) == 0 ) { ?>
376 <thead>
377 <tr>
378 <td></td>
379 <?php
380 foreach ( $terms as $term ) {
381 echo '<th>';
382 echo '<a href="'.$term['link'].'">'.$term['image'].'</a>';
383 echo '</th>';
384 }
385 ?>
386 </tr>
387 </thead>
388 <?php } ?>
389 <tbody>
390 <?php
391 if ( ! is_array( $options['attributes'] ) || in_array( 'cp_available', $options['attributes'] ) || count( $options['attributes'] ) == 0 ) {
392 echo '<tr>';
393 echo '<th>'.(empty($text['availability']) ? __( 'Availability', 'products-compare-for-woocommerce' ) : $text['availability']).'</th>';
394 foreach ( $terms as $term ) {
395 $class_stock = '';
396 $text_stock = '';
397 if ( $term['availability'] && ! empty( $term['availability']['availability'] ) ) {
398 $product = wc_get_product($term['id']);
399 $post = get_post($term['id']);
400 $availability_html = empty( $term['availability']['availability'] ) ? '' : '<p class="stock ' . esc_attr( $term['availability']['class'] ) . '">' . esc_html( $term['availability']['availability'] ) . '</p>';
401 $text_stock = apply_filters( 'woocommerce_stock_html', $availability_html, $term['availability']['availability'], $product );
402 $class_stock = esc_attr( $term['availability']['class'] );
403 } else {
404 if ( $term['is_in_stock'] ) {
405 $text_stock = __( 'In stock', 'woocommerce' );
406 $class_stock = 'in-stock';
407 } else {
408 $text_stock = __( 'Out of stock', 'woocommerce' );
409 $class_stock = 'out-of-stock';
410 }
411 $text_stock = '<p class="stock '.$class_stock.'">'.$text_stock.'</p>';
412 }
413 echo '<td>';
414 echo $text_stock;
415 echo '</td>';
416 }
417 echo '</tr>';
418 }
419 if ( ! is_array( $options['attributes'] ) || in_array( 'cp_short_description', $options['attributes'] ) || count( $options['attributes'] ) == 0 ) {
420 echo '<tr class="br_description_row">';
421 echo '<th>' . (empty($text['description']) ? __( 'Description', 'products-compare-for-woocommerce' ) : $text['description']) . '</th>';
422 foreach ( $terms as $term ) {
423 echo '<td><div>';
424 echo $term['short_description'];
425 echo '</div></td>';
426 }
427 echo '</tr>';
428 }
429 if ( is_array( $name['attributes'] ) && count( $name['attributes'] ) > 0 ) {
430 echo '<tr><th class="br_lined_attribute_left">'.(empty($text['attribute']) ? __( 'Attributes', 'products-compare-for-woocommerce' ) : $text['attribute']).'</th><td class="br_lined_attribute_right" colspan="'.(count($terms)).'"></td></tr>';
431 foreach ( $name['attributes'] as $attr => $name_attr ) {
432 echo '<tr class="'.(is_array($same['attributes'][$attr]) && count($same['attributes'][$attr]) ? ' br_same_attr' : '').'" style="height:'.(15 + 20 * (empty($attr_count['attributes'][$attr]) ? '1' : $attr_count['attributes'][$attr])).'px!important;"><th>'.$name_attr.'</th>';
433 foreach ( $terms as $term ) {
434 echo '<td>'.br_get_value_from_array($term, array('attributes', $attr)).'</td>';
435 }
436 echo '</tr>';
437 }
438 }
439 if ( is_array( $name['custom'] ) && count( $name['custom'] ) > 0 ) {
440 echo '<tr><th class="br_lined_attribute_left">'.(empty($text['custom']) ? __( 'Other attributes', 'products-compare-for-woocommerce' ) : $text['custom']).'</th><td class="br_lined_attribute_right" colspan="'.(count($terms)).'"></td></tr>';
441 foreach ( $name['custom'] as $attr => $name_attr ) {
442 echo '<tr class="'.(is_array($same['custom'][$attr]) && count($same['custom'][$attr]) ? ' br_same_attr' : '').'" style="height:'.(15 + 20 * (empty($attr_count['custom'][$attr]) ? '1' : $attr_count['custom'][$attr])).'px!important;"><th>'.$name_attr.'</th>';
443 foreach ( $terms as $term ) {
444 echo '<td>'.br_get_value_from_array($term, array('custom', $attr)).'</td>';
445 }
446 echo '</tr>';
447 }
448 }
449 if ( is_array( $name['acf'] ) && count( $name['acf'] ) > 0 ) {
450 foreach ( $name['acf'] as $attr => $name_attr ) {
451 echo '<tr class="'.(is_array($same['acf'][$attr]) && count($same['acf'][$attr]) ? ' br_same_attr' : '').'" style="'.apply_filters('berocket_compare_acf_product_field_height', 'height:'.(15 + 20 * (empty($attr_count['acf'][$attr]) ? '1' : $attr_count['acf'][$attr])).'px!important;', $acf_field_list[$attr]) . '"><th>'.$name_attr.'</th>';
452 foreach ( $terms as $term ) {
453 echo '<td>'.apply_filters('berocket_compare_acf_product_field', br_get_value_from_array($term, array('acf', $attr)), $acf_field_list[$attr], $term).'</td>';
454 }
455 echo '</tr>';
456 }
457 }
458 ?>
459 </tbody>
460 </table>
461 </div>
462 <?php
463 $width_set = (empty($style['table']['colwidth']) ? 200 : $style['table']['colwidth']);
464 $width_set_full = $width_set * (count($terms) + 1);
465 $width_set = $width_set * count($terms);
466 ?>
467 <style>
468 .br_new_compare_block .br_top_table table,
469 .br_new_compare_block .br_right_table table {
470 min-width:<?php echo $width_set ?>px!important;
471 }
472 @media (max-width: 767px) {
473 .br_new_compare_block .br_top_table table,
474 .br_new_compare_block .br_right_table table {
475 min-width:<?php echo $width_set_full ?>px!important;
476 }
477 }
478 .br_new_compare .br_left_table .br_description_row,
479 .br_new_compare .br_right_table .br_description_row {
480 height:<?php echo $description_height; ?>px!important;
481 }
482 .br_new_compare .br_right_table .br_description_row td div {
483 height:<?php echo $description_height-1; ?>px!important;
484 }
485 </style>
486 <script>
487 if( typeof(berocket_popup_compare_scroll_fix) == 'function' ) {
488 berocket_popup_compare_scroll_fix();
489 }
490 </script>
491 </div>
492 </div>
493 </div>
494 </div>
495 <?php
496 }
497 if( isset($product_backup) ) {
498 $product = $product_backup;
499 }
500 if( isset($post_backup) ) {
501 $post = $post_backup;
502 }
503 ?>
504