Version Description
- Enhancement - Template optimizations
Download this release
Release Info
Developer | RazyRx |
Plugin | Advanced AJAX Product Filters |
Version | 1.4.0.3 |
Comparing to | |
See all releases |
Code changes from version 1.4.0.2 to 1.4.0.3
- css/widget.css +1 -0
- readme.txt +4 -1
- templates/checkbox.php +49 -48
- templates/color.php +40 -41
- templates/radio.php +42 -39
- templates/select.php +35 -37
- woocommerce-filters.php +2 -2
css/widget.css
CHANGED
@@ -528,6 +528,7 @@ ul.berocket_aapf_widget li > span label:hover{
|
|
528 |
position: relative;
|
529 |
top: 40%;
|
530 |
width: 430px;
|
|
|
531 |
height: 200px;
|
532 |
margin: auto;
|
533 |
z-index: 10000;
|
528 |
position: relative;
|
529 |
top: 40%;
|
530 |
width: 430px;
|
531 |
+
max-width: 100%;
|
532 |
height: 200px;
|
533 |
margin: auto;
|
534 |
z-index: 10000;
|
readme.txt
CHANGED
@@ -5,7 +5,7 @@ Donate link: https://berocket.com/product/woocommerce-ajax-products-filter?utm_s
|
|
5 |
Tags: filters, product filters, ajax product filters, ajax filter, ajax filter widget, color filter, size filter, product onsale filter, product preview, product category filter, product reset filter, product sort by filter, stock filter, product tag filter, price range filter, price box filter, advanced product filters, woocommerce filters, woocommerce product filters, woocommerce products filter, woocommerce ajax product filters, widget, plugin, woocommerce item filters, filters plugin, ajax filters plugin, filter woocommerce products, filter woocommerce products plugin, wc filters, wc filters products, wc products filters, wc ajax products filters, wc product filters, wc advanced product filters, woocommerce layered nav, woocommerce layered navigation, ajax filtered nav, ajax filtered navigation, price filter, ajax price filter, woocommerce product sorting, sidebar filter, sidebar ajax filter, taxonomy filter, category filter, attribute filter, attributes filter, woocommerce product sort, ajax products filter plugin for woocommerce, rocket, berocket, berocket woocommerce ajax products filter
|
6 |
Requires at least: 4.0
|
7 |
Tested up to: 5.2.4
|
8 |
-
Stable tag: 1.4.0.
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
@@ -184,6 +184,9 @@ You can try this plugin's admin side [here](https://berocket.com/product/woocomm
|
|
184 |
|
185 |
== Changelog ==
|
186 |
|
|
|
|
|
|
|
187 |
= 1.4.0.2 =
|
188 |
* Enhancement - Additional table generation withour WP-Cron
|
189 |
* Enhancement - Option to disable AJAX Pagination
|
5 |
Tags: filters, product filters, ajax product filters, ajax filter, ajax filter widget, color filter, size filter, product onsale filter, product preview, product category filter, product reset filter, product sort by filter, stock filter, product tag filter, price range filter, price box filter, advanced product filters, woocommerce filters, woocommerce product filters, woocommerce products filter, woocommerce ajax product filters, widget, plugin, woocommerce item filters, filters plugin, ajax filters plugin, filter woocommerce products, filter woocommerce products plugin, wc filters, wc filters products, wc products filters, wc ajax products filters, wc product filters, wc advanced product filters, woocommerce layered nav, woocommerce layered navigation, ajax filtered nav, ajax filtered navigation, price filter, ajax price filter, woocommerce product sorting, sidebar filter, sidebar ajax filter, taxonomy filter, category filter, attribute filter, attributes filter, woocommerce product sort, ajax products filter plugin for woocommerce, rocket, berocket, berocket woocommerce ajax products filter
|
6 |
Requires at least: 4.0
|
7 |
Tested up to: 5.2.4
|
8 |
+
Stable tag: 1.4.0.3
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
184 |
|
185 |
== Changelog ==
|
186 |
|
187 |
+
= 1.4.0.3 =
|
188 |
+
* Enhancement - Template optimizations
|
189 |
+
|
190 |
= 1.4.0.2 =
|
191 |
* Enhancement - Additional table generation withour WP-Cron
|
192 |
* Enhancement - Option to disable AJAX Pagination
|
templates/checkbox.php
CHANGED
@@ -2,14 +2,13 @@
|
|
2 |
/**
|
3 |
* The template for displaying checkbox filters
|
4 |
*
|
5 |
-
* Override this template by copying it to yourtheme/woocommerce-
|
6 |
*
|
7 |
* @author BeRocket
|
8 |
* @package WooCommerce-Filters/Templates
|
9 |
* @version 1.0.1
|
10 |
*/
|
11 |
-
|
12 |
-
<?php
|
13 |
extract($berocket_query_var_title);
|
14 |
global $berocket_unique_value;
|
15 |
$berocket_unique_value++;
|
@@ -25,6 +24,7 @@ if ( $child_parent == 'parent' ) {
|
|
25 |
$added_categories = array();
|
26 |
$item_i = 0;
|
27 |
if ( ! empty($terms) ):
|
|
|
28 |
foreach( $terms as $term ):
|
29 |
$is_first = ($term->term_id == 'R__term_id__R');
|
30 |
$term_taxonomy_echo = berocket_isset($term, 'wpml_taxonomy');
|
@@ -42,10 +42,25 @@ if ( ! empty($terms) ):
|
|
42 |
$parent_count = $term->depth;
|
43 |
}
|
44 |
$added_categories[] = berocket_isset($term, 'term_id');
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
echo ' berocket_hide_o_value'; $hiden_value = true;
|
50 |
}
|
51 |
if( ! empty($hide_sel_value) && br_is_term_selected( $term, true, $is_child_parent_or, $child_parent_depth ) != '' ) {
|
@@ -63,48 +78,35 @@ if ( ! empty($terms) ):
|
|
63 |
}
|
64 |
if( ! empty($hide_child_attributes) && in_array(berocket_isset($term, 'parent'), $added_categories) ) {
|
65 |
echo ' berocket_hide_child_attributes';
|
66 |
-
} ?>"
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
data-filter_type='<?php echo berocket_isset($filter_type) ?>' <?php if( ! empty($term->term_id) ) { ?>data-term_id='<?php echo $term->term_id ?>'<?php } ?> data-operator='<?php echo $operator ?>'
|
75 |
-
data-term_ranges='<?php echo str_replace ( '*' , '-' , berocket_isset($term, 'term_id')) ?>'
|
76 |
-
data-taxonomy='<?php echo $term_taxonomy_echo ?>'
|
77 |
-
data-term_count='<?php echo berocket_isset($term, 'count') ?>'
|
78 |
-
<?php echo br_is_term_selected( $term, true, $is_child_parent_or, $child_parent_depth ); ?>
|
79 |
-
<?php echo ( ! empty( $disable_multiple_ranges ) ? ' name="radio_' . $term_taxonomy_echo . '_' . $x . '_' . $random_name . '"' : '' )?> />
|
80 |
-
<label data-for='checkbox_<?php echo str_replace ( '*' , '-' , berocket_isset($term, 'term_id')), str_replace ( '*' , '-' , $term_taxonomy_echo) ?>' style="<?php echo ( empty($uo['style']['label']) ? '' : $uo['style']['label'] )?>"
|
81 |
-
class="berocket_label_widgets<?php if( br_is_term_selected( $term, true, $is_child_parent_or, $child_parent_depth ) != '') echo ' berocket_checked'; ?>">
|
82 |
-
<?php
|
83 |
echo apply_filters( 'berocket_check_radio_color_filter_term_text', ( ( ! empty($icon_before_value) ? ( ( substr( $icon_before_value, 0, 3) == 'fa-' ) ? '<i class="fa '.$icon_before_value.'"></i>' : '<i class="fa"><img class="berocket_widget_icon" src="'.$icon_before_value.'" alt=""></i>' ) : '' ) .
|
84 |
apply_filters('berocket_radio_filter_term_name', berocket_isset($term, 'name'), $term) .
|
85 |
( ! empty($icon_after_value) ? ( ( substr( $icon_after_value, 0, 3) == 'fa-' ) ? '<i class="fa '.$icon_after_value.'"></i>' : '<i class="fa"><img class="berocket_widget_icon" src="'.$icon_after_value.'" alt=""></i>' ) : '' ) ), $term, $operator, ( ! empty( $disable_multiple_ranges ) ? $term->slug : false ) );
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
<span data-term_id='<?php echo str_replace ( '*' , '-' , berocket_isset($term, 'term_id')) ?>' class="br_child_toggle br_child_toggle_<?php echo str_replace ( '*' , '-' , berocket_isset($term, 'term_id')); ?>"><i class="fa fa-plus" aria-hidden="true"></i></span>
|
90 |
-
<?php } ?>
|
91 |
-
</span>
|
92 |
-
</li>
|
93 |
-
<?php
|
94 |
if( ! empty($hide_child_attributes) && in_array(berocket_isset($term, 'parent'), $added_categories) ) {
|
95 |
-
|
96 |
-
<style>
|
97 |
-
.br_child_toggle.br_child_toggle_<?php echo str_replace ( '*' , '-' , berocket_isset($term, 'parent')); ?> {
|
98 |
-
display: inline-block;
|
99 |
-
}
|
100 |
-
</style>
|
101 |
-
<?php
|
102 |
}
|
103 |
if ( $is_child_parent && $is_first ) {
|
104 |
?></ul></li><?php
|
105 |
}
|
106 |
-
endforeach
|
107 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
108 |
if ( $is_child_parent && is_array( berocket_isset( $terms ) ) && count( $terms ) == 1 ) {
|
109 |
if ( BeRocket_AAPF_Widget::is_parent_selected( $attribute, $child_parent_depth - 1 ) ) {
|
110 |
echo '<li>' . $child_parent_no_values . '</li>';
|
@@ -114,8 +116,7 @@ if ( ! empty($terms) ):
|
|
114 |
} else {
|
115 |
if ( $child_parent_no_values ) {
|
116 |
if ( ! $child_parent_depth ) $child_parent_depth = '0';
|
117 |
-
|
118 |
-
<script>
|
119 |
if ( typeof(child_parent_depth) == 'undefined' || child_parent_depth < <?php echo $child_parent_depth; ?> ) {
|
120 |
|
121 |
child_parent_depth = <?php echo (int) $child_parent_depth; ?>;
|
@@ -125,8 +126,7 @@ if ( ! empty($terms) ):
|
|
125 |
jQuery('.woocommerce-info').text('<?php echo $child_parent_no_values; ?>');
|
126 |
}
|
127 |
});
|
128 |
-
</script
|
129 |
-
<?php
|
130 |
}
|
131 |
}
|
132 |
if( ! empty($attribute_count_show_hide) ) {
|
@@ -136,6 +136,7 @@ if ( ! empty($terms) ):
|
|
136 |
$hide_button_value = false;
|
137 |
}
|
138 |
}
|
139 |
-
if( empty($hide_button_value) ) {
|
140 |
-
|
141 |
-
|
|
2 |
/**
|
3 |
* The template for displaying checkbox filters
|
4 |
*
|
5 |
+
* Override this template by copying it to yourtheme/woocommerce-ajax_filters/checkbox.php
|
6 |
*
|
7 |
* @author BeRocket
|
8 |
* @package WooCommerce-Filters/Templates
|
9 |
* @version 1.0.1
|
10 |
*/
|
11 |
+
|
|
|
12 |
extract($berocket_query_var_title);
|
13 |
global $berocket_unique_value;
|
14 |
$berocket_unique_value++;
|
24 |
$added_categories = array();
|
25 |
$item_i = 0;
|
26 |
if ( ! empty($terms) ):
|
27 |
+
$display_inline_classes = array();
|
28 |
foreach( $terms as $term ):
|
29 |
$is_first = ($term->term_id == 'R__term_id__R');
|
30 |
$term_taxonomy_echo = berocket_isset($term, 'wpml_taxonomy');
|
42 |
$parent_count = $term->depth;
|
43 |
}
|
44 |
$added_categories[] = berocket_isset($term, 'term_id');
|
45 |
+
$data_jquery_arr = array(
|
46 |
+
'term_slug' => urldecode(berocket_isset($term, 'slug')),
|
47 |
+
'term_name' => ( ! empty($icon_before_value) ? ( ( substr( $icon_before_value, 0, 3) == 'fa-' ) ? '<i class="fa '.$icon_before_value.'"></i>' : '<i class="fa"><img class="berocket_widget_icon" src="'.$icon_before_value.'" alt=""></i>' ) : '' ) . htmlentities(berocket_isset($term, 'name'), ENT_QUOTES) . ( ! empty($icon_after_value) ? ( ( substr( $icon_after_value, 0, 3) == 'fa-' ) ? '<i class="fa '.$icon_after_value.'"></i>' : '<i class="fa"><img class="berocket_widget_icon" src="'.$icon_after_value.'" alt=""></i>' ) : '' ),
|
48 |
+
'filter_type' => berocket_isset($filter_type) ,
|
49 |
+
'term_id' => berocket_isset($term, 'term_id'),
|
50 |
+
'operator' => $operator,
|
51 |
+
'term_ranges' => str_replace ( '*' , '-' , berocket_isset($term, 'term_id')),
|
52 |
+
'taxonomy' => $term_taxonomy_echo,
|
53 |
+
'term_count' => berocket_isset($term, 'count'),
|
54 |
+
);
|
55 |
+
$data_jquery = array();
|
56 |
+
foreach($data_jquery_arr as $data_jquery_name => $data_jquery_string) {
|
57 |
+
if( $data_jquery_string !== '' ) {
|
58 |
+
$data_jquery[] = 'data-'.$data_jquery_name."='".$data_jquery_string."'";
|
59 |
+
}
|
60 |
+
}
|
61 |
+
$data_jquery = implode(' ', $data_jquery);
|
62 |
+
?><li class="berocket_term_parent_<?php echo ( property_exists($term, 'parent') ? $term->parent : '' ); ?> berocket_term_depth_<?php echo $parent_count; ?> <?php echo "brw-" . preg_replace( "#^(pa)?_#", "", $attribute ) . "-" . preg_replace( "#^(pa)?_#", "", berocket_isset($term, 'slug') ); ?> <?php if ( $is_child_parent ) echo 'R__class__R ';
|
63 |
+
if( ! empty($hide_o_value) && isset($term->count) && $term->count == 0 && ( !$is_child_parent || !$is_first ) ) {
|
64 |
echo ' berocket_hide_o_value'; $hiden_value = true;
|
65 |
}
|
66 |
if( ! empty($hide_sel_value) && br_is_term_selected( $term, true, $is_child_parent_or, $child_parent_depth ) != '' ) {
|
78 |
}
|
79 |
if( ! empty($hide_child_attributes) && in_array(berocket_isset($term, 'parent'), $added_categories) ) {
|
80 |
echo ' berocket_hide_child_attributes';
|
81 |
+
} ?>"><span><input id='checkbox_<?php echo str_replace ( '*' , '-' , berocket_isset($term, 'term_id')), str_replace ( '*' , '-' , $term_taxonomy_echo) ?>_<?php echo berocket_isset($random_name);
|
82 |
+
?>' class="<?php echo ( empty($uo['class']['checkbox_radio']) ? '' : $uo['class']['checkbox_radio'] ) ?> checkbox_<?php echo str_replace ( '*' , '-' , berocket_isset($term, 'term_id')), str_replace ( '*' , '-' , $term_taxonomy_echo) ?>" type='<?php echo ( ! empty( $disable_multiple_ranges ) ? 'radio' : 'checkbox' );
|
83 |
+
?>' autocomplete="off"<?php
|
84 |
+
echo ( empty($uo['style']['checkbox_radio']) ? '' : ' style="' . $uo['style']['checkbox_radio'] . '"' );
|
85 |
+
echo br_is_term_selected( $term, true, $is_child_parent_or, $child_parent_depth ) . ( ! empty( $disable_multiple_ranges ) ? ' name="radio_' . $term_taxonomy_echo . '_' . $x . '_' . $random_name . '"' : '' );
|
86 |
+
echo ' '.$data_jquery;
|
87 |
+
?>/><label data-for='checkbox_<?php echo str_replace ( '*' , '-' , berocket_isset($term, 'term_id')), str_replace ( '*' , '-' , $term_taxonomy_echo) ?>'<?php echo ( empty($uo['style']['label']) ? '' : ' style="' . $uo['style']['label'] . '"' );
|
88 |
+
?> class="berocket_label_widgets<?php if( br_is_term_selected( $term, true, $is_child_parent_or, $child_parent_depth ) != '') echo ' berocket_checked'; ?>"><?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
89 |
echo apply_filters( 'berocket_check_radio_color_filter_term_text', ( ( ! empty($icon_before_value) ? ( ( substr( $icon_before_value, 0, 3) == 'fa-' ) ? '<i class="fa '.$icon_before_value.'"></i>' : '<i class="fa"><img class="berocket_widget_icon" src="'.$icon_before_value.'" alt=""></i>' ) : '' ) .
|
90 |
apply_filters('berocket_radio_filter_term_name', berocket_isset($term, 'name'), $term) .
|
91 |
( ! empty($icon_after_value) ? ( ( substr( $icon_after_value, 0, 3) == 'fa-' ) ? '<i class="fa '.$icon_after_value.'"></i>' : '<i class="fa"><img class="berocket_widget_icon" src="'.$icon_after_value.'" alt=""></i>' ) : '' ) ), $term, $operator, ( ! empty( $disable_multiple_ranges ) ? $term->slug : false ) );
|
92 |
+
?></label><?php if( ! empty($hide_child_attributes) ) {
|
93 |
+
?><span data-term_id='<?php echo str_replace ( '*' , '-' , berocket_isset($term, 'term_id')) ?>' class="br_child_toggle br_child_toggle_<?php echo str_replace ( '*' , '-' , berocket_isset($term, 'term_id')); ?>"><i class="fa fa-plus" aria-hidden="true"></i></span><?php
|
94 |
+
} ?></span></li><?php
|
|
|
|
|
|
|
|
|
|
|
95 |
if( ! empty($hide_child_attributes) && in_array(berocket_isset($term, 'parent'), $added_categories) ) {
|
96 |
+
$display_inline_classes[] = '.br_child_toggle.br_child_toggle_'.str_replace ( '*' , '-' , berocket_isset($term, 'parent'));
|
|
|
|
|
|
|
|
|
|
|
|
|
97 |
}
|
98 |
if ( $is_child_parent && $is_first ) {
|
99 |
?></ul></li><?php
|
100 |
}
|
101 |
+
endforeach;
|
102 |
+
$display_inline_classes = array_unique($display_inline_classes);
|
103 |
+
if( count($display_inline_classes) ) {
|
104 |
+
echo '<style>
|
105 |
+
'.implode(',', $display_inline_classes).' {
|
106 |
+
display: inline-block;
|
107 |
+
}
|
108 |
+
</style>';
|
109 |
+
}
|
110 |
if ( $is_child_parent && is_array( berocket_isset( $terms ) ) && count( $terms ) == 1 ) {
|
111 |
if ( BeRocket_AAPF_Widget::is_parent_selected( $attribute, $child_parent_depth - 1 ) ) {
|
112 |
echo '<li>' . $child_parent_no_values . '</li>';
|
116 |
} else {
|
117 |
if ( $child_parent_no_values ) {
|
118 |
if ( ! $child_parent_depth ) $child_parent_depth = '0';
|
119 |
+
?><script>
|
|
|
120 |
if ( typeof(child_parent_depth) == 'undefined' || child_parent_depth < <?php echo $child_parent_depth; ?> ) {
|
121 |
|
122 |
child_parent_depth = <?php echo (int) $child_parent_depth; ?>;
|
126 |
jQuery('.woocommerce-info').text('<?php echo $child_parent_no_values; ?>');
|
127 |
}
|
128 |
});
|
129 |
+
</script><?php
|
|
|
130 |
}
|
131 |
}
|
132 |
if( ! empty($attribute_count_show_hide) ) {
|
136 |
$hide_button_value = false;
|
137 |
}
|
138 |
}
|
139 |
+
if( empty($hide_button_value) ) {
|
140 |
+
?><li class="berocket_widget_show_values"<?php if( !$hiden_value ) echo 'style="display: none;"' ?>><?php _e('Show value(s)', 'BeRocket_AJAX_domain') ?><span class="show_button"></span></li><?php
|
141 |
+
}
|
142 |
+
endif;
|
templates/color.php
CHANGED
@@ -81,9 +81,7 @@ if ( is_array(berocket_isset($terms)) ) {
|
|
81 |
if( $type == 'color' ) {
|
82 |
$meta_color = array($meta_color);
|
83 |
}
|
84 |
-
|
85 |
-
<li class="berocket_child_parent_sample"><ul>
|
86 |
-
<?php
|
87 |
}
|
88 |
$meta_color = apply_filters('berocket_aapf_meta_color_values', $meta_color, $term, $variables_for_hooks);
|
89 |
$meta_color_init = $meta_color;
|
@@ -107,10 +105,25 @@ if ( is_array(berocket_isset($terms)) ) {
|
|
107 |
$meta_class = '';
|
108 |
}
|
109 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
110 |
list($meta_class, $meta_after, $meta_color) = apply_filters('berocket_widget_color_image_temp_meta_ready', array($meta_class, $meta_after, $meta_color), $term, $meta_color_init, $variables_for_hooks);
|
111 |
-
|
112 |
-
|
113 |
-
<li class="berocket_term_parent_<?php echo berocket_isset($term, 'parent');
|
114 |
if ( $is_child_parent ) echo ' R__class__R';
|
115 |
echo " brw-" . preg_replace( "#^(pa)?_#", "", $attribute ) . "-" . preg_replace( "#^(pa)?_#", "", berocket_isset($term, 'slug') );
|
116 |
if( ! empty($hide_o_value) && berocket_isset($term, 'count') == 0 && ( !$is_child_parent || !$is_first ) ) {
|
@@ -141,39 +154,27 @@ if ( is_array(berocket_isset($terms)) ) {
|
|
141 |
} else {
|
142 |
echo ' '.(empty($color_image_checked) ? 'brchecked_default' : $color_image_checked);
|
143 |
}
|
144 |
-
?> berocket_checkbox_color<?php echo ( ! empty($use_value_with_color) ? ' berocket_color_with_value' : ' berocket_color_without_value' )
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
data-term_count='<?php echo berocket_isset($term, 'count') ?>'
|
156 |
-
<?php echo br_is_term_selected( $term, true, $is_child_parent_or, $child_parent_depth ); ?>
|
157 |
-
<?php echo ( ! empty( $disable_multiple ) ? ' name="radio_' . $term_taxonomy_echo . '_' . $x . '_' . $random_name . '"' : '' )?> />
|
158 |
-
<label data-for='checkbox_<?php echo str_replace ( '*' , '-' , berocket_isset($term, 'term_id')), str_replace ( '*' , '-' , $term_taxonomy_echo) ?>'
|
159 |
-
class="berocket_label_widgets<?php if( br_is_term_selected( $term, true, $is_child_parent_or, $child_parent_depth ) != '') echo ' berocket_checked'; ?>">
|
160 |
-
<?php
|
161 |
echo apply_filters( 'berocket_check_radio_color_filter_term_text', ( '<span class="'. apply_filters('berocket_widget_color_image_temp_span_class', 'berocket_color_span_block', array($meta_class, $meta_after, $meta_color), $term) . '"
|
162 |
style="' . $meta_color . '">' . $meta_class . '</span>' .
|
163 |
( ! empty($use_value_with_color) ? '<span class="berocket_color_text">' . ( ! empty($icon_before_value) ? ( ( substr( $icon_before_value, 0, 3) == 'fa-' ) ? '<i class="fa '.$icon_before_value.'"></i>' : '<i class="fa"><img class="berocket_widget_icon" src="'.$icon_before_value.'" alt=""></i>' ) : '' ) . $term->name . ( ! empty($icon_after_value) ? ( ( substr( $icon_after_value, 0, 3) == 'fa-' ) ? '<i class="fa '.$icon_after_value.'"></i>' : '<i class="fa"><img class="berocket_widget_icon" src="'.$icon_after_value.'" alt=""></i>' ) : '' ) . '</span>' : '' ) .
|
164 |
berocket_isset($meta_after) ), $term, $operator, FALSE );
|
165 |
-
|
166 |
-
</label>
|
167 |
-
</span>
|
168 |
-
</li>
|
169 |
-
<?php
|
170 |
if ( $is_child_parent && $is_first ) {
|
171 |
-
|
172 |
-
</ul></li>
|
173 |
-
<?php
|
174 |
}
|
175 |
-
}
|
176 |
-
|
177 |
if( BeRocket_AAPF_Widget::is_parent_selected($attribute, $child_parent_depth - 1) ) {
|
178 |
echo '<li>'.$child_parent_no_values.'</li>';
|
179 |
} else {
|
@@ -182,8 +183,7 @@ if ( is_array(berocket_isset($terms)) ) {
|
|
182 |
} else {
|
183 |
if( $child_parent_no_values ) {
|
184 |
if ( ! $child_parent_depth ) $child_parent_depth = '0';
|
185 |
-
|
186 |
-
<script>
|
187 |
if ( typeof(child_parent_depth) == 'undefined' || child_parent_depth < <?php echo $child_parent_depth; ?> ) {
|
188 |
child_parent_depth = <?php echo $child_parent_depth; ?>;
|
189 |
}
|
@@ -192,8 +192,7 @@ if ( is_array(berocket_isset($terms)) ) {
|
|
192 |
jQuery('.woocommerce-info').text('<?php echo $child_parent_no_values; ?>');
|
193 |
}
|
194 |
});
|
195 |
-
</script
|
196 |
-
<?php
|
197 |
}
|
198 |
}
|
199 |
if( ! empty($attribute_count_show_hide) ) {
|
@@ -203,7 +202,7 @@ if ( is_array(berocket_isset($terms)) ) {
|
|
203 |
$hide_button_value = false;
|
204 |
}
|
205 |
}
|
206 |
-
if( empty($hide_button_value) ) {
|
207 |
-
|
208 |
-
<div style="clear: both;"></div
|
209 |
-
|
81 |
if( $type == 'color' ) {
|
82 |
$meta_color = array($meta_color);
|
83 |
}
|
84 |
+
?><li class="berocket_child_parent_sample"><ul><?php
|
|
|
|
|
85 |
}
|
86 |
$meta_color = apply_filters('berocket_aapf_meta_color_values', $meta_color, $term, $variables_for_hooks);
|
87 |
$meta_color_init = $meta_color;
|
105 |
$meta_class = '';
|
106 |
}
|
107 |
}
|
108 |
+
$data_jquery_arr = array(
|
109 |
+
'term_slug' => urldecode(berocket_isset($term, 'slug')),
|
110 |
+
'term_name' => ( ! empty($icon_before_value) ? ( ( substr( $icon_before_value, 0, 3) == 'fa-' ) ? '<i class="fa '.$icon_before_value.'"></i>' : '<i class="fa"><img class="berocket_widget_icon" src="'.$icon_before_value.'" alt=""></i>' ) : '' ) . htmlentities(berocket_isset($term, 'name'), ENT_QUOTES) . ( ! empty($icon_after_value) ? ( ( substr( $icon_after_value, 0, 3) == 'fa-' ) ? '<i class="fa '.$icon_after_value.'"></i>' : '<i class="fa"><img class="berocket_widget_icon" src="'.$icon_after_value.'" alt=""></i>' ) : '' ),
|
111 |
+
'filter_type' => berocket_isset($filter_type) ,
|
112 |
+
'term_id' => berocket_isset($term, 'term_id'),
|
113 |
+
'operator' => $operator,
|
114 |
+
'term_ranges' => str_replace ( '*' , '-' , berocket_isset($term, 'term_id')),
|
115 |
+
'taxonomy' => $term_taxonomy_echo,
|
116 |
+
'term_count' => berocket_isset($term, 'count'),
|
117 |
+
);
|
118 |
+
$data_jquery = array();
|
119 |
+
foreach($data_jquery_arr as $data_jquery_name => $data_jquery_string) {
|
120 |
+
if( $data_jquery_string !== '' ) {
|
121 |
+
$data_jquery[] = 'data-'.$data_jquery_name."='".$data_jquery_string."'";
|
122 |
+
}
|
123 |
+
}
|
124 |
+
$data_jquery = implode(' ', $data_jquery);
|
125 |
list($meta_class, $meta_after, $meta_color) = apply_filters('berocket_widget_color_image_temp_meta_ready', array($meta_class, $meta_after, $meta_color), $term, $meta_color_init, $variables_for_hooks);
|
126 |
+
?><li class="berocket_term_parent_<?php echo berocket_isset($term, 'parent');
|
|
|
|
|
127 |
if ( $is_child_parent ) echo ' R__class__R';
|
128 |
echo " brw-" . preg_replace( "#^(pa)?_#", "", $attribute ) . "-" . preg_replace( "#^(pa)?_#", "", berocket_isset($term, 'slug') );
|
129 |
if( ! empty($hide_o_value) && berocket_isset($term, 'count') == 0 && ( !$is_child_parent || !$is_first ) ) {
|
154 |
} else {
|
155 |
echo ' '.(empty($color_image_checked) ? 'brchecked_default' : $color_image_checked);
|
156 |
}
|
157 |
+
?> berocket_checkbox_color<?php echo ( ! empty($use_value_with_color) ? ' berocket_color_with_value' : ' berocket_color_without_value' );
|
158 |
+
?>"><span><input id='checkbox_<?php echo str_replace ( '*' , '-' , berocket_isset($term, 'term_id')), str_replace ( '*' , '-' , $term_taxonomy_echo) ?>_<?php echo berocket_isset($random_name);
|
159 |
+
?>' class="<?php echo ( empty($uo['class']['checkbox_radio']) ? '' : $uo['class']['checkbox_radio'] ) ?> checkbox_<?php echo str_replace ( '*' , '-' , berocket_isset($term, 'term_id')), str_replace ( '*' , '-' , $term_taxonomy_echo);
|
160 |
+
?>" type='<?php echo ( ! empty( $disable_multiple ) ? 'radio' : 'checkbox' )
|
161 |
+
?>' autocomplete="off" <?php
|
162 |
+
echo ( empty($uo['style']['checkbox_radio']) ? '' : 'style="' . $uo['style']['checkbox_radio'] . '"' );
|
163 |
+
echo br_is_term_selected( $term, true, $is_child_parent_or, $child_parent_depth );
|
164 |
+
echo ( ! empty( $disable_multiple ) ? ' name="radio_' . $term_taxonomy_echo . '_' . $x . '_' . $random_name . '"' : '' );
|
165 |
+
echo ' '.$data_jquery;
|
166 |
+
?>/><label data-for='checkbox_<?php echo str_replace ( '*' , '-' , berocket_isset($term, 'term_id')), str_replace ( '*' , '-' , $term_taxonomy_echo);
|
167 |
+
?>' class="berocket_label_widgets<?php if( br_is_term_selected( $term, true, $is_child_parent_or, $child_parent_depth ) != '') echo ' berocket_checked'; ?>"><?php
|
|
|
|
|
|
|
|
|
|
|
|
|
168 |
echo apply_filters( 'berocket_check_radio_color_filter_term_text', ( '<span class="'. apply_filters('berocket_widget_color_image_temp_span_class', 'berocket_color_span_block', array($meta_class, $meta_after, $meta_color), $term) . '"
|
169 |
style="' . $meta_color . '">' . $meta_class . '</span>' .
|
170 |
( ! empty($use_value_with_color) ? '<span class="berocket_color_text">' . ( ! empty($icon_before_value) ? ( ( substr( $icon_before_value, 0, 3) == 'fa-' ) ? '<i class="fa '.$icon_before_value.'"></i>' : '<i class="fa"><img class="berocket_widget_icon" src="'.$icon_before_value.'" alt=""></i>' ) : '' ) . $term->name . ( ! empty($icon_after_value) ? ( ( substr( $icon_after_value, 0, 3) == 'fa-' ) ? '<i class="fa '.$icon_after_value.'"></i>' : '<i class="fa"><img class="berocket_widget_icon" src="'.$icon_after_value.'" alt=""></i>' ) : '' ) . '</span>' : '' ) .
|
171 |
berocket_isset($meta_after) ), $term, $operator, FALSE );
|
172 |
+
?></label></span></li><?php
|
|
|
|
|
|
|
|
|
173 |
if ( $is_child_parent && $is_first ) {
|
174 |
+
?></ul></li><?php
|
|
|
|
|
175 |
}
|
176 |
+
}
|
177 |
+
if( $is_child_parent && is_array(berocket_isset($terms)) && count($terms) == 1 ) {
|
178 |
if( BeRocket_AAPF_Widget::is_parent_selected($attribute, $child_parent_depth - 1) ) {
|
179 |
echo '<li>'.$child_parent_no_values.'</li>';
|
180 |
} else {
|
183 |
} else {
|
184 |
if( $child_parent_no_values ) {
|
185 |
if ( ! $child_parent_depth ) $child_parent_depth = '0';
|
186 |
+
?><script>
|
|
|
187 |
if ( typeof(child_parent_depth) == 'undefined' || child_parent_depth < <?php echo $child_parent_depth; ?> ) {
|
188 |
child_parent_depth = <?php echo $child_parent_depth; ?>;
|
189 |
}
|
192 |
jQuery('.woocommerce-info').text('<?php echo $child_parent_no_values; ?>');
|
193 |
}
|
194 |
});
|
195 |
+
</script><?php
|
|
|
196 |
}
|
197 |
}
|
198 |
if( ! empty($attribute_count_show_hide) ) {
|
202 |
$hide_button_value = false;
|
203 |
}
|
204 |
}
|
205 |
+
if( empty($hide_button_value) ) {
|
206 |
+
?><li class="berocket_widget_show_values"<?php if( !$hiden_value ) echo 'style="display: none;"' ?>><?php _e('Show value(s)', 'BeRocket_AJAX_domain') ?><span class="show_button"></span></li>
|
207 |
+
<div style="clear: both;"></div><?php
|
208 |
+
} }
|
templates/radio.php
CHANGED
@@ -27,10 +27,26 @@ if ( is_array(berocket_isset($terms)) ) {
|
|
27 |
$parent_count = count($parent_count);
|
28 |
}
|
29 |
$added_categories[] = $term->term_id;
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
echo 'berocket_hide_o_value ';
|
35 |
$hiden_value = true;
|
36 |
}
|
@@ -51,41 +67,30 @@ if ( is_array(berocket_isset($terms)) ) {
|
|
51 |
}
|
52 |
if( $hide_child_attributes && berocket_isset($term, 'parent') && in_array(berocket_isset($term, 'parent'), $added_categories) ) {
|
53 |
echo ' berocket_hide_child_attributes ';
|
54 |
-
} ?>"
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
data-term_count='<?php echo berocket_isset($term, 'count') ?>'
|
65 |
-
<?php echo br_is_term_selected( $term, true, $is_child_parent_or, $child_parent_depth ); ?> />
|
66 |
-
<label data-for='radio_<?php echo berocket_isset($term, 'term_id') ?>_<?php echo $term_taxonomy_echo ?>' style="<?php echo br_get_value_from_array($uo, array('style', 'label')) ?>"
|
67 |
-
class="berocket_label_widgets<?php
|
68 |
-
if( br_is_term_selected( $term, true, $is_child_parent_or, $child_parent_depth ) != '') echo ' berocket_checked';
|
69 |
-
?>">
|
70 |
-
<?php
|
71 |
echo apply_filters( 'berocket_check_radio_color_filter_term_text', ( ( ! empty($icon_before_value) ? ( ( substr( $icon_before_value, 0, 3) == 'fa-' ) ? '<i class="fa '.$icon_before_value.'"></i>' : '<i class="fa"><img class="berocket_widget_icon" src="'.$icon_before_value.'" alt=""></i>' ) : '' ) .
|
72 |
apply_filters('berocket_radio_filter_term_name', berocket_isset($term, 'name'), $term) .
|
73 |
( ! empty($icon_after_value) ? ( ( substr( $icon_after_value, 0, 3) == 'fa-' ) ? '<i class="fa '.$icon_after_value.'"></i>' : '<i class="fa"><img class="berocket_widget_icon" src="'.$icon_after_value.'" alt=""></i>' ) : '' ) ), $term, $operator, TRUE );
|
74 |
-
?></label
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
</li>
|
80 |
-
<?php
|
81 |
if( ! empty($hide_child_attributes) && ! empty($term->parent) && in_array($term->parent, $added_categories) ) {
|
82 |
-
|
83 |
-
<style>
|
84 |
.br_child_toggle.br_child_toggle_<?php echo str_replace ( '*' , '-' , $term->parent); ?> {
|
85 |
display: inline-block;
|
86 |
}
|
87 |
-
</style
|
88 |
-
<?php
|
89 |
}
|
90 |
if ( $is_child_parent && $is_first ) {
|
91 |
?></ul></li><?php
|
@@ -100,8 +105,7 @@ if ( is_array(berocket_isset($terms)) ) {
|
|
100 |
} else {
|
101 |
if( $child_parent_no_values ) {
|
102 |
if ( ! $child_parent_depth ) $child_parent_depth = '0';
|
103 |
-
|
104 |
-
<script>
|
105 |
if ( typeof(child_parent_depth) == 'undefined' || child_parent_depth < <?php echo $child_parent_depth; ?> ) {
|
106 |
child_parent_depth = <?php echo $child_parent_depth; ?>;
|
107 |
}
|
@@ -110,8 +114,7 @@ if ( is_array(berocket_isset($terms)) ) {
|
|
110 |
jQuery('.woocommerce-info').text('<?php echo $child_parent_no_values; ?>');
|
111 |
}
|
112 |
});
|
113 |
-
</script
|
114 |
-
<?php
|
115 |
}
|
116 |
}
|
117 |
if( ! empty($attribute_count_show_hide) ) {
|
@@ -121,6 +124,6 @@ if ( is_array(berocket_isset($terms)) ) {
|
|
121 |
$hide_button_value = false;
|
122 |
}
|
123 |
}
|
124 |
-
if( empty($hide_button_value) ) {
|
125 |
-
|
126 |
-
|
27 |
$parent_count = count($parent_count);
|
28 |
}
|
29 |
$added_categories[] = $term->term_id;
|
30 |
+
$data_jquery_arr = array(
|
31 |
+
'term_slug' => urldecode(berocket_isset($term, 'slug')),
|
32 |
+
'term_name' => ( ! empty($icon_before_value) ? ( ( substr( $icon_before_value, 0, 3) == 'fa-' ) ? '<i class="fa '.$icon_before_value.'"></i>' : '<i class="fa"><img class="berocket_widget_icon" src="'.$icon_before_value.'" alt=""></i>' ) : '' ) . htmlentities(berocket_isset($term, 'name'), ENT_QUOTES) . ( ! empty($icon_after_value) ? ( ( substr( $icon_after_value, 0, 3) == 'fa-' ) ? '<i class="fa '.$icon_after_value.'"></i>' : '<i class="fa"><img class="berocket_widget_icon" src="'.$icon_after_value.'" alt=""></i>' ) : '' ),
|
33 |
+
'filter_type' => berocket_isset($filter_type) ,
|
34 |
+
'term_id' => berocket_isset($term, 'term_id'),
|
35 |
+
'operator' => $operator,
|
36 |
+
'term_ranges' => str_replace ( '*' , '-' , berocket_isset($term, 'term_id')),
|
37 |
+
'taxonomy' => $term_taxonomy_echo,
|
38 |
+
'term_count' => berocket_isset($term, 'count'),
|
39 |
+
);
|
40 |
+
$data_jquery = array();
|
41 |
+
foreach($data_jquery_arr as $data_jquery_name => $data_jquery_string) {
|
42 |
+
if( $data_jquery_string !== '' ) {
|
43 |
+
$data_jquery[] = 'data-'.$data_jquery_name."='".$data_jquery_string."'";
|
44 |
+
}
|
45 |
+
}
|
46 |
+
$data_jquery = implode(' ', $data_jquery);
|
47 |
+
?><li class="berocket_term_parent_<?php echo berocket_isset($term, 'parent'); ?> berocket_term_depth_<?php
|
48 |
+
echo $parent_count;
|
49 |
+
if( ! empty($hide_o_value) && berocket_isset($term, 'count') == 0 && ( !$is_child_parent || !$is_first ) ) {
|
50 |
echo 'berocket_hide_o_value ';
|
51 |
$hiden_value = true;
|
52 |
}
|
67 |
}
|
68 |
if( $hide_child_attributes && berocket_isset($term, 'parent') && in_array(berocket_isset($term, 'parent'), $added_categories) ) {
|
69 |
echo ' berocket_hide_child_attributes ';
|
70 |
+
} ?>"><span><input class="<?php echo br_get_value_from_array($uo, array('class', 'checkbox_radio')); ?> radio_<?php echo berocket_isset($term, 'term_id') ?>_<?php echo $term_taxonomy_echo;
|
71 |
+
?>" type='radio' id='radio_<?php echo berocket_isset($term, 'term_id') ?>_<?php echo $random_name
|
72 |
+
?>' style="<?php echo br_get_value_from_array($uo, array('style', 'checkbox_radio'));
|
73 |
+
?>" name='radio_<?php echo $term_taxonomy_echo ?>_<?php echo $x ?>_<?php echo $random_name
|
74 |
+
?>' <?php echo br_is_term_selected( $term, true, $is_child_parent_or, $child_parent_depth );
|
75 |
+
echo ' '.$data_jquery;
|
76 |
+
?>/><label data-for='radio_<?php echo berocket_isset($term, 'term_id') ?>_<?php echo $term_taxonomy_echo ?>' style="<?php echo br_get_value_from_array($uo, array('style', 'label'));
|
77 |
+
?>" class="berocket_label_widgets<?php
|
78 |
+
if( br_is_term_selected( $term, true, $is_child_parent_or, $child_parent_depth ) != '') echo ' berocket_checked';
|
79 |
+
?>"><?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
80 |
echo apply_filters( 'berocket_check_radio_color_filter_term_text', ( ( ! empty($icon_before_value) ? ( ( substr( $icon_before_value, 0, 3) == 'fa-' ) ? '<i class="fa '.$icon_before_value.'"></i>' : '<i class="fa"><img class="berocket_widget_icon" src="'.$icon_before_value.'" alt=""></i>' ) : '' ) .
|
81 |
apply_filters('berocket_radio_filter_term_name', berocket_isset($term, 'name'), $term) .
|
82 |
( ! empty($icon_after_value) ? ( ( substr( $icon_after_value, 0, 3) == 'fa-' ) ? '<i class="fa '.$icon_after_value.'"></i>' : '<i class="fa"><img class="berocket_widget_icon" src="'.$icon_after_value.'" alt=""></i>' ) : '' ) ), $term, $operator, TRUE );
|
83 |
+
?></label><?php
|
84 |
+
if( ! empty($hide_child_attributes) ) {
|
85 |
+
?><span data-term_id='<?php echo str_replace ( '*' , '-' , berocket_isset($term, 'term_id')) ?>' class="br_child_toggle br_child_toggle_<?php echo str_replace ( '*' , '-' , berocket_isset($term, 'term_id')); ?>"><i class="fa fa-plus" aria-hidden="true"></i></span><?php
|
86 |
+
}
|
87 |
+
?></span></li><?php
|
|
|
|
|
88 |
if( ! empty($hide_child_attributes) && ! empty($term->parent) && in_array($term->parent, $added_categories) ) {
|
89 |
+
?><style>
|
|
|
90 |
.br_child_toggle.br_child_toggle_<?php echo str_replace ( '*' , '-' , $term->parent); ?> {
|
91 |
display: inline-block;
|
92 |
}
|
93 |
+
</style><?php
|
|
|
94 |
}
|
95 |
if ( $is_child_parent && $is_first ) {
|
96 |
?></ul></li><?php
|
105 |
} else {
|
106 |
if( $child_parent_no_values ) {
|
107 |
if ( ! $child_parent_depth ) $child_parent_depth = '0';
|
108 |
+
?><script>
|
|
|
109 |
if ( typeof(child_parent_depth) == 'undefined' || child_parent_depth < <?php echo $child_parent_depth; ?> ) {
|
110 |
child_parent_depth = <?php echo $child_parent_depth; ?>;
|
111 |
}
|
114 |
jQuery('.woocommerce-info').text('<?php echo $child_parent_no_values; ?>');
|
115 |
}
|
116 |
});
|
117 |
+
</script><?php
|
|
|
118 |
}
|
119 |
}
|
120 |
if( ! empty($attribute_count_show_hide) ) {
|
124 |
$hide_button_value = false;
|
125 |
}
|
126 |
}
|
127 |
+
if( empty($hide_button_value) ) {
|
128 |
+
?><li class="berocket_widget_show_values"<?php if( !$hiden_value ) echo 'style="display: none;"' ?>><?php _e('Show value(s)', BeRocket_AJAX_domain) ?><span class="show_button"></span></li><?php
|
129 |
+
} }
|
templates/select.php
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* The template for displaying
|
4 |
*
|
5 |
-
* Override this template by copying it to yourtheme/woocommerce-
|
6 |
*
|
7 |
* @author BeRocket
|
8 |
* @package WooCommerce-Filters/Templates
|
@@ -74,39 +74,37 @@ $term_taxonomy_echo = berocket_isset($terms[0], 'wpml_taxonomy');
|
|
74 |
if( empty($term_taxonomy_echo) ) {
|
75 |
$term_taxonomy_echo = berocket_isset($terms[0], 'taxonomy');
|
76 |
}
|
77 |
-
?>
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
$parent_count =
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
|
|
|
|
|
|
|
|
|
|
96 |
}
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
<?php echo br_is_term_selected( $term, false, $is_child_parent_or, $child_parent_depth ); ?>
|
107 |
-
><?php for($i=0;$i<$parent_count;$i++){echo apply_filters('berocket_aapf_select_term_child_prefix', '- ');}echo apply_filters('berocket_select_filter_term_name', berocket_isset($term, 'name'), $term) ?></option>
|
108 |
-
<?php endforeach; ?>
|
109 |
-
</select>
|
110 |
-
</span>
|
111 |
-
</li>
|
112 |
-
<?php } ?>
|
1 |
<?php
|
2 |
/**
|
3 |
+
* The template for displaying select filters
|
4 |
*
|
5 |
+
* Override this template by copying it to yourtheme/woocommerce-ajax_filters/select.php
|
6 |
*
|
7 |
* @author BeRocket
|
8 |
* @package WooCommerce-Filters/Templates
|
74 |
if( empty($term_taxonomy_echo) ) {
|
75 |
$term_taxonomy_echo = berocket_isset($terms[0], 'taxonomy');
|
76 |
}
|
77 |
+
?><li><span><select<?php if( ! empty($select_multiple) ) echo ' multiple="multiple" data-placeholder="'.$select_first_element_text.'"'?> id='checkbox_<?php echo berocket_isset($terms[0], 'term_id') ?>_<?php echo berocket_isset($random_name);
|
78 |
+
?>' autocomplete="off" class="<?php echo br_get_value_from_array($uo, array('class', 'selectbox')) ?> <?php echo $term_taxonomy_echo;
|
79 |
+
?>" data-taxonomy='<?php echo $term_taxonomy_echo ?>'><?php
|
80 |
+
if( empty($select_multiple) ) {
|
81 |
+
?><option class="<?php echo "brw-" . preg_replace( "#^(pa)?_#", "", $attribute ) . "-" . ((berocket_isset($term, 'slug')) ? preg_replace( "#^(pa)?_#", "", berocket_isset($term, 'slug') ) : 'default' ) ?>" data-taxonomy='<?php echo $term_taxonomy_echo ?>' value=''><?php echo $select_first_element_text; ?></option><?php
|
82 |
+
} foreach ( $terms as $term ):
|
83 |
+
$term_taxonomy_echo = berocket_isset($term, 'wpml_taxonomy');
|
84 |
+
if( empty($term_taxonomy_echo) ) {
|
85 |
+
$term_taxonomy_echo = berocket_isset($term, 'taxonomy');
|
86 |
+
}
|
87 |
+
$parent_count = 0;
|
88 |
+
if(isset($term->parent) && $term->parent != 0) {
|
89 |
+
$parent_count = get_ancestors( $term->term_id, $term->taxonomy );
|
90 |
+
$parent_count = count($parent_count);
|
91 |
+
} elseif( isset($term->depth) ) {
|
92 |
+
$parent_count = $term->depth;
|
93 |
+
}
|
94 |
+
?><option value='<?php echo berocket_isset($term, 'term_id') ?>' data-term_id='<?php echo berocket_isset($term, 'term_id');
|
95 |
+
?>' data-taxonomy='<?php echo $term_taxonomy_echo ?>' data-term_count='<?php echo berocket_isset($term, 'count');
|
96 |
+
?>' data-term_slug='<?php echo urldecode(berocket_isset($term, 'slug')) ?>' data-filter_type='<?php echo berocket_isset($filter_type);
|
97 |
+
?>' data-term_name='<?php echo berocket_isset($term, 'name') ?>' class="select_<?php echo berocket_isset($term, 'term_id');
|
98 |
+
if( ! $is_child_parent_or && ! empty($hide_o_value) && berocket_isset($term, 'count') == 0 ) {
|
99 |
+
echo ' berocket_hide_o_value';
|
100 |
+
$hiden_value = true;
|
101 |
}
|
102 |
+
echo " brw-" . preg_replace( "#^(pa)?_#", "", $attribute ) . "-" . preg_replace( "#^(pa)?_#", "", berocket_isset($term, 'slug') )
|
103 |
+
?>" data-operator='<?php echo berocket_isset($operator) ?>'<?php
|
104 |
+
if( ! $is_child_parent_or && ! empty($hide_o_value) && berocket_isset($term, 'count') == 0 ) {
|
105 |
+
echo ' hidden disabled'; $hiden_value = true;
|
106 |
+
} echo ' ' . br_is_term_selected( $term, false, $is_child_parent_or, $child_parent_depth );
|
107 |
+
?>><?php for($i=0;$i<$parent_count;$i++){echo apply_filters('berocket_aapf_select_term_child_prefix', '- ');}echo apply_filters('berocket_select_filter_term_name', berocket_isset($term, 'name'), $term) ?></option><?php
|
108 |
+
endforeach;
|
109 |
+
?></select></span></li><?php
|
110 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
woocommerce-filters.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: Advanced AJAX Product Filters for WooCommerce
|
4 |
* Plugin URI: https://wordpress.org/plugins/woocommerce-ajax-filters/?utm_source=free_plugin&utm_medium=plugins&utm_campaign=ajax_filters
|
5 |
* Description: Unlimited AJAX products filters to make your shop perfect
|
6 |
-
* Version: 1.4.0.
|
7 |
* Author: BeRocket
|
8 |
* Requires at least: 4.0
|
9 |
* Author URI: https://berocket.com?utm_source=free_plugin&utm_medium=plugins&utm_campaign=ajax_filters
|
@@ -11,6 +11,6 @@
|
|
11 |
* Domain Path: /languages/
|
12 |
* WC tested up to: 3.7.1
|
13 |
*/
|
14 |
-
define( "BeRocket_AJAX_filters_version", '1.4.0.
|
15 |
define( "BeRocket_AJAX_filters_file", __FILE__ );
|
16 |
include_once('main.php');
|
3 |
* Plugin Name: Advanced AJAX Product Filters for WooCommerce
|
4 |
* Plugin URI: https://wordpress.org/plugins/woocommerce-ajax-filters/?utm_source=free_plugin&utm_medium=plugins&utm_campaign=ajax_filters
|
5 |
* Description: Unlimited AJAX products filters to make your shop perfect
|
6 |
+
* Version: 1.4.0.3
|
7 |
* Author: BeRocket
|
8 |
* Requires at least: 4.0
|
9 |
* Author URI: https://berocket.com?utm_source=free_plugin&utm_medium=plugins&utm_campaign=ajax_filters
|
11 |
* Domain Path: /languages/
|
12 |
* WC tested up to: 3.7.1
|
13 |
*/
|
14 |
+
define( "BeRocket_AJAX_filters_version", '1.4.0.3' );
|
15 |
define( "BeRocket_AJAX_filters_file", __FILE__ );
|
16 |
include_once('main.php');
|