/var/www/html/wp-content/themes/elessi-theme/includes/nasa-mini-compare.php


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
<?php
$max_compare 
= isset($nasa_opt['max_compare']) ? (int) $nasa_opt['max_compare'] : 4;
$nasa_compare_list = isset($nasa_compare_list) ? $nasa_compare_list : array();
$count_compare count($nasa_compare_list);
$image_size apply_filters('single_product_archive_thumbnail_size''woocommerce_thumbnail');
?>
<div class="nasa-compare-list">
    <div class="row">
        <div class="large-12 columns">
            <table>
                <tr>
                    <td class="nasa-td-30">
                        <h5 class="clearfix text-center mobile-text-left rtl-mobile-text-right nasa-compare-label">
                            <span class="nasa-block mobile-text-center mobile-margin-top-15 mobile-margin-bottom-5 mobile-fs-23">
                                <?php echo esc_html__('Compare Products''elessi-theme'); ?>
                            </span>
                            <span class="color-gray hide-for-mobile">
                                (<?php echo $count_compare ' ' . ($count_compare == esc_html__('Product''elessi-theme') : esc_html__('Products''elessi-theme')); ?>)
                            </span>
                        </h5>
                    </td>
                    <td class="nasa-td-40 nasa-td-products-compare">
                        <div class="row padding-side-15 nasa-flex align-start jc">
                            <?php 
                            $k 
0;
                            
$class_item $max_compare == 'large-3 small-3 columns' 'large-4 small-4 columns';
                            if (
$nasa_compare_list) :
                                foreach (
$nasa_compare_list as $product) :
                                    if (
$k $max_compare 1):
                                        break;
                                    endif;
                                    
$productId $product->get_id();
                                    
$nasa_title $product->get_name();
                                    
$nasa_href $product->get_permalink();
                                    
?>
                                    <div class="<?php echo esc_attr($class_item); ?>">
                                        <div class="nasa-compare-wrap-item">
                                            <div class="nasa-compare-item-hover">
                                                <div class="nasa-compare-item-hover-wraper">
                                                    <a href="<?php echo esc_url($nasa_href); ?>" title="<?php echo esc_attr($nasa_title); ?>">
                                                        <?php echo $product->get_image($image_size, array('alt' => esc_attr($nasa_title))); ?>
                                                        <h5 class="margin-top-10"><?php echo esc_html($nasa_title); ?></h5>
                                                    </a>
                                                </div>
                                            </div>
                                            <div class="nasa-compare-item">
                                                <a href="javascript:void(0);" class="nasa-remove-compare" data-prod="<?php echo esc_attr($productId); ?>" rel="nofollow"><svg width="19" height="19" viewBox="0 0 32 32" fill="currentColor"><path d="M10.722 9.969l-0.754 0.754 5.278 5.278-5.253 5.253 0.754 0.754 5.253-5.253 5.253 5.253 0.754-0.754-5.253-5.253 5.278-5.278-0.754-0.754-5.278 5.278z"/></svg></a>
                                                <a href="<?php echo esc_url($nasa_href); ?>" class="nasa-img-compare" title="<?php echo esc_attr($nasa_title); ?>">
                                                    <?php echo $product->get_image('thumbnail', array('alt' => esc_attr($nasa_title))); ?>
                                                </a>
                                            </div>
                                        </div>
                                    </div>
                                <?php 
                                $k
++;
                                endforeach; 
?>
                            <?php endif; ?>

                            <?php if ($k $max_compare) :
                                
$nasa_src_no_image wc_placeholder_img_src();
                                for (
$i=$k$i<$max_compare$i++): ?>
                                    <div class="<?php echo esc_attr($class_item); ?>">
                                        <div class="nasa-compare-wrap-item">
                                            <div class="nasa-compare-item">
                                                <span class="nasa-no-image">
                                                    <img src="<?php echo esc_url($nasa_src_no_image); ?>" width="65" height="65" alt="<?php echo esc_attr__("Compare Product"'elessi-theme'); ?>" />
                                                </span>
                                            </div>
                                        </div>
                                    </div>
                                <?php endfor; ?>
                            <?php endif; ?>
                        </div>
                    </td>
                    <td class="nasa-td-30">
                        <div class="ns-compare-btns nasa-compare-label<?php echo !$count_compare ' hidden-tag' ''?>">
                            <a class="nasa-compare-clear-all nasa-hover-underline color-gray" href="javascript:void(0);" title="<?php echo esc_attr__('Clear All''elessi-theme'); ?>" rel="nofollow"><?php echo esc_html__('Clear All''elessi-theme'); ?></a>
                            <a class="nasa-compare-view btn button" href="<?php echo esc_url($view_href); ?>" title="<?php echo esc_attr__("Let's Compare!"'elessi-theme'); ?>"><?php echo esc_html__("Let's Compare!"'elessi-theme'); ?></a>
                        </div>
                    </td>
                </tr>
            </table>
        </div>
    </div>
    
    <a class="nasa-close-mini-compare nasa-stclose" href="javascript:void(0)" rel="nofollow"></a>
</div>