PluginProbe
Ever Compare – Products Compare Plugin for WooCommerce / 1.2.7
Ever Compare – Products Compare Plugin for WooCommerce v1.2.7
1.3.7 1.1.7 1.1.8 1.1.9 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 trunk 1.0.0 1.0.1 1.0.2 All 31 releases
ever-compare / includes / templates / evercompare-table.php

evercompare-table.php in Ever Compare – Products Compare Plugin for WooCommerce 1.2.7, at includes/templates/evercompare-table.php

47 lines 2.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <div class="htcompare-table">
2 <?php
3 // do_action( 'ever_compare_before_table' );
4
5 if ( ! empty( $products ) ) {
6 array_unshift( $products, array() );
7 foreach ( $fields as $field_id => $field ) {
8 if ( ! $evercompare->is_products_have_field( $field_id, $products ) ) {
9 continue;
10 }
11
12 // Generate Filed name
13 $name = $evercompare->field_name( $field );
14 if( array_key_exists( $field_id, $heading_txt ) && !empty( $heading_txt[$field_id] ) ){
15 $name = $evercompare->field_name( $heading_txt[$field_id], true );
16 }
17
18 ?>
19 <div class="htcompare-row compare-data-<?php echo esc_attr( $field_id ); ?>">
20 <?php foreach ( $products as $product_id => $product ) : ?>
21 <?php if ( ! empty( $product ) ) : ?>
22 <div class="htcompare-col htcolumn-value" data-title="<?php echo esc_attr( $name ); ?>">
23 <?php $evercompare->compare_display_field( $field_id, $product ); ?>
24 </div>
25 <?php else: ?>
26 <div class="htcompare-col htcolumn-field-name">
27 <?php echo esc_html( $name ); ?>
28 </div>
29 <?php endif; ?>
30 <?php endforeach ?>
31 </div>
32 <?php
33 }
34 echo '<div class="htcompare-table-loader"></div>';
35 } else {
36 if ( $empty_compare_text ){
37 echo '<div class="htcompare-empty-page-text">'.wp_kses_post( $empty_compare_text ).'</div>';
38 }
39
40 if( $return_shop_button ){
41 echo '<div class="htcompare-return-to-shop"><a href="'.esc_url( wc_get_page_permalink( 'shop' ) ).'" class="button">'.esc_html( $return_shop_button ).'</a></div>';
42 }
43 }
44
45 do_action( 'ever_compare_after_table' );
46 ?>
47 </div>