Version Description
Download this release
Release Info
Developer | RazyRx |
Plugin | Advanced AJAX Product Filters |
Version | 1.6beta |
Comparing to | |
See all releases |
Code changes from version 1.5.6 to 1.6beta
- addons/additional_tables/add_table.php +161 -81
- addons/additional_tables/additional_tables.php +122 -36
- addons/deprecated_compat/deprecated_compat.php +0 -2
- addons/deprecated_filters/admin.js +0 -902
- addons/deprecated_filters/deprecated_filters.php +0 -658
- addons/deprecated_filters/display_filter/reset_button.php +0 -28
- addons/deprecated_filters/display_filter/selected_area.php +0 -37
- addons/deprecated_filters/display_filter/update_button.php +0 -29
- addons/deprecated_filters/display_widget.php +0 -687
- addons/deprecated_filters/filter_post.php +0 -724
- addons/deprecated_filters/images/ajax-loader.gif +0 -0
- addons/deprecated_filters/j.doe.cloud.min.js +0 -320
- addons/deprecated_filters/settings/design.php +0 -773
- addons/deprecated_filters/widget.css +0 -1413
- addons/deprecated_filters/widget.min.js +0 -2362
- addons/separate_link/separate_vars.php +131 -388
- assets/frontend/css/fullmain.min.css +1 -1
- assets/frontend/css/main.css +7 -0
- assets/frontend/css/main.min.css +1 -1
- includes/addons/new-woocommerce-variation.php +310 -0
- includes/addons/seo_meta_title.php +90 -57
- includes/addons/woocommerce-variation.php +0 -379
- includes/admin/admin_bar.php +1 -1
- includes/compatibility/bodycommerce.php +1 -4
- includes/compatibility/jet_smart_filters.php +1 -2
- includes/compatibility/product-table.php +1 -2
- includes/compatibility/relevanssi.php +34 -19
- includes/display_filter/reset_button.php +7 -0
- includes/faster_recount.php +122 -135
- includes/filters/display_widget.php +12 -3
- includes/filters/dynamic_data_template.php +0 -50
- includes/filters/get_terms.php +7 -11
- includes/functions.php +33 -1040
- includes/shortcode_apply_filters.php +66 -0
- includes/url-parse.php +1267 -0
- includes/url-parse/price.php +145 -0
- includes/visual-composer.php +50 -48
- includes/widget_functions.php +63 -791
- libraries/link_parser.php +14 -112
- main.php +18 -685
- readme.txt +1 -1
- templates/disabled/checkbox.php +0 -131
- templates/disabled/color.php +0 -199
- templates/disabled/image.php +0 -1
- templates/disabled/radio.php +0 -116
- templates/disabled/select.php +0 -99
- templates/disabled/slider.php +0 -92
- templates/disabled/tag_cloud.php +0 -65
- templates/old_templates/checkbox.php +0 -142
- templates/old_templates/color.php +0 -188
addons/additional_tables/add_table.php
CHANGED
@@ -1,8 +1,10 @@
|
|
1 |
<?php
|
2 |
class BeRocket_aapf_variations_tables {
|
|
|
3 |
function __construct() {
|
4 |
-
add_filter('berocket_aapf_wcvariation_filtering_total_query', array($this, 'wcvariation_filtering_total_query'), 10,
|
5 |
-
add_filter('berocket_aapf_wcvariation_filtering_main_query', array($this, 'wcvariation_filtering_main_query'), 10,
|
|
|
6 |
add_action( 'woocommerce_variation_set_stock_status', array($this, 'set_stock_status'), 10, 3 );
|
7 |
add_action( 'woocommerce_product_set_stock_status', array($this, 'set_stock_status'), 10, 3 );
|
8 |
add_action( 'delete_post', array($this, 'delete_post'), 10, 1 );
|
@@ -10,97 +12,103 @@ class BeRocket_aapf_variations_tables {
|
|
10 |
//hierarhical recount custom table
|
11 |
add_action('berocket_aapf_recount_terms_initialized', array($this, 'recount_terms_initialized'), 10, 1);
|
12 |
add_filter('berocket_aapf_recount_stock_status_query', array($this, 'recount_stock_status'), 10, 1);
|
|
|
|
|
|
|
|
|
|
|
13 |
}
|
14 |
-
function
|
15 |
-
$
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
}
|
21 |
-
}
|
22 |
}
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
|
|
|
|
|
|
|
|
33 |
}
|
34 |
}
|
35 |
}
|
36 |
global $wpdb;
|
37 |
$table_name = $wpdb->prefix . 'braapf_product_variation_attributes';
|
38 |
$query = array(
|
39 |
-
'select' => 'SELECT '.$table_name.'.post_id as var_id, '.$table_name.'.parent_id as ID, COUNT('.$table_name.'.post_id) as meta_count',
|
40 |
'from' => 'FROM '.$table_name,
|
41 |
'where' => 'WHERE '.$table_name.'.meta_value_id IN ('.implode(',', $current_terms).')',
|
42 |
'group' => 'GROUP BY '.$table_name.'.post_id'
|
43 |
);
|
44 |
return $query;
|
45 |
}
|
46 |
-
function
|
47 |
-
$
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
|
|
52 |
}
|
53 |
}
|
54 |
}
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
}
|
60 |
}
|
61 |
}
|
62 |
$current_attributes = array_unique($current_attributes);
|
63 |
global $wpdb;
|
64 |
-
$query_custom = array(
|
65 |
-
'select' => "SELECT {$wpdb->prefix}braapf_product_stock_status_parent.post_id as id, IF({$wpdb->prefix}braapf_product_stock_status_parent.stock_status = 1, 0, 1) as out_of_stock_init",
|
66 |
-
'from' => "FROM {$wpdb->prefix}braapf_product_stock_status_parent",
|
67 |
-
);
|
68 |
$query['subquery']['subquery_2'] = array(
|
69 |
'select' => 'SELECT post_id as ID, COUNT(post_id) as max_meta_count',
|
70 |
-
'from' => "FROM {$wpdb->prefix}
|
71 |
-
'where' => "WHERE
|
72 |
'group' => 'GROUP BY post_id',
|
73 |
);
|
74 |
-
|
75 |
-
$query['subquery']['select'] = 'SELECT filtered_post
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
$max
|
86 |
-
);
|
87 |
-
} else {
|
88 |
-
$price_ranges = array();
|
89 |
-
foreach ( $_POST['price_ranges'] as $range ) {
|
90 |
-
$range = explode( '*', $range );
|
91 |
-
$min = isset( $range[0] ) ? floatval( ($range[0] - 1) ) : 0;
|
92 |
-
$max = isset( $range[1] ) ? floatval( $range[1] ) : 0;
|
93 |
-
$price_ranges[] = $wpdb->prepare(
|
94 |
-
'wc_product_meta_lookup.min_price < %f AND wc_product_meta_lookup.max_price > %f ',
|
95 |
-
$min,
|
96 |
-
$max
|
97 |
-
);
|
98 |
-
}
|
99 |
-
$query_custom['where_1'] = implode(' AND ', $price_ranges);
|
100 |
-
}
|
101 |
-
}*/
|
102 |
-
$query_custom['group'] = 'GROUP BY id';
|
103 |
-
$query['subquery']['subquery_3'] = $query_custom;
|
104 |
return $query;
|
105 |
}
|
106 |
function delete_post($product_id) {
|
@@ -113,7 +121,7 @@ class BeRocket_aapf_variations_tables {
|
|
113 |
$wpdb->query($sql);
|
114 |
$sql = "DELETE FROM {$wpdb->prefix}braapf_product_variation_attributes WHERE parent_id={$product_id};";
|
115 |
$wpdb->query($sql);
|
116 |
-
$sql = "DELETE FROM {$wpdb->prefix}
|
117 |
$wpdb->query($sql);
|
118 |
}
|
119 |
function set_stock_status($product_id, $stock_status, $product) {
|
@@ -150,6 +158,7 @@ class BeRocket_aapf_variations_tables {
|
|
150 |
$parent_id = $product->get_parent_id();
|
151 |
$product_attributes = $product->get_variation_attributes();
|
152 |
$parent_product = wc_get_product($parent_id);
|
|
|
153 |
$sql = "DELETE FROM {$wpdb->prefix}braapf_product_variation_attributes WHERE post_id={$product_id};";
|
154 |
$wpdb->query($sql);
|
155 |
foreach($product_attributes as $taxonomy => $attributes) {
|
@@ -167,16 +176,16 @@ class BeRocket_aapf_variations_tables {
|
|
167 |
foreach($attributes as $attribute) {
|
168 |
$term = get_term_by('slug', $attribute, $taxonomy);
|
169 |
if( $term !== false ) {
|
170 |
-
$sql = "INSERT IGNORE INTO {$wpdb->prefix}braapf_product_variation_attributes (post_id, parent_id, meta_key, meta_value_id) VALUES({$product_id}, {$parent_id}, '{$taxonomy}', {$term->term_id})";
|
171 |
$wpdb->query($sql);
|
172 |
}
|
173 |
}
|
174 |
}
|
175 |
} elseif( $product_type == 'variable' ) {
|
176 |
$child_ids = $product->get_children();
|
|
|
|
|
177 |
if( is_array($child_ids) && count($child_ids) > 0 ) {
|
178 |
-
$sql = "DELETE FROM {$wpdb->prefix}braapf_product_variation_attributes WHERE post_id IN (".implode(',', $child_ids).");";
|
179 |
-
$wpdb->query($sql);
|
180 |
$insert_values = array();
|
181 |
$terms_cache = array();
|
182 |
$parent_attributes = $product->get_variation_attributes(false);
|
@@ -202,8 +211,13 @@ class BeRocket_aapf_variations_tables {
|
|
202 |
}
|
203 |
foreach($child_ids as $child_id) {
|
204 |
$time_post = microtime(true);
|
|
|
|
|
|
|
|
|
|
|
|
|
205 |
if( empty($child_attributes[$child_id]) ) {
|
206 |
-
$variation = wc_get_product( $child_id );
|
207 |
if( empty($variation) ) {
|
208 |
$product_attributes = array();
|
209 |
} else {
|
@@ -230,25 +244,50 @@ class BeRocket_aapf_variations_tables {
|
|
230 |
}
|
231 |
$term = $terms_cache[$taxonomy][$attribute];
|
232 |
if( $term !== false ) {
|
233 |
-
$insert_values[] = "({$child_id}, {$product_id}, '{$taxonomy}', {$term->term_id})";
|
234 |
}
|
235 |
}
|
236 |
}
|
237 |
}
|
238 |
if( count($insert_values) > 0 ) {
|
239 |
-
$sql = "INSERT IGNORE INTO {$wpdb->prefix}braapf_product_variation_attributes (post_id, parent_id, meta_key, meta_value_id)
|
240 |
VALUES ".implode(',', $insert_values);
|
241 |
$wpdb->query($sql);
|
242 |
}
|
243 |
}
|
244 |
-
$sql = "DELETE FROM {$wpdb->prefix}braapf_variation_attributes WHERE post_id={$product_id};";
|
245 |
-
$wpdb->query($sql);
|
246 |
-
$sql = "INSERT IGNORE INTO {$wpdb->prefix}braapf_variation_attributes
|
247 |
-
SELECT parent_id as post_id, meta_key as taxonomy
|
248 |
-
FROM {$wpdb->prefix}braapf_product_variation_attributes
|
249 |
-
WHERE parent_id={$product_id}
|
250 |
-
GROUP BY meta_key, parent_id";
|
251 |
$wpdb->query($sql);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
252 |
}
|
253 |
if ( defined( 'ICL_SITEPRESS_VERSION' ) && ! ICL_PLUGIN_INACTIVE && class_exists( 'SitePress' ) ) {
|
254 |
do_action( 'wpml_switch_language', $current_language );
|
@@ -258,6 +297,7 @@ class BeRocket_aapf_variations_tables {
|
|
258 |
remove_filter('berocket_aapf_recount_terms_query', array($recount_object, 'child_include'), 50, 3);
|
259 |
add_filter('berocket_aapf_recount_terms_query', array($this, 'child_include'), 50, 3);
|
260 |
}
|
|
|
261 |
function child_include($query, $taxonomy_data, $terms) {
|
262 |
global $wpdb;
|
263 |
extract($taxonomy_data);
|
@@ -275,6 +315,7 @@ class BeRocket_aapf_variations_tables {
|
|
275 |
return $query;
|
276 |
}
|
277 |
function set_hierarhical_data_to_table($taxonomy) {
|
|
|
278 |
global $wpdb;
|
279 |
$wpdb->query("SET SESSION group_concat_max_len = 1000000");
|
280 |
$newmd5 = $wpdb->get_var(
|
@@ -331,6 +372,7 @@ class BeRocket_aapf_variations_tables {
|
|
331 |
}
|
332 |
update_option(apply_filters('br_aapf_md5_cache_text', 'br_custom_table_hierarhical_'.$taxonomy), $newmd5);
|
333 |
}
|
|
|
334 |
}
|
335 |
function taxonomy_hierarchical_get($taxonomy) {
|
336 |
$terms = $this->get_terms_all(array(
|
@@ -397,5 +439,43 @@ class BeRocket_aapf_variations_tables {
|
|
397 |
ON {$wpdb->posts}.ID = term_relationships.object_id";
|
398 |
return $join_query;
|
399 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
400 |
}
|
401 |
new BeRocket_aapf_variations_tables();
|
1 |
<?php
|
2 |
class BeRocket_aapf_variations_tables {
|
3 |
+
public $variation_attributes = FALSE;
|
4 |
function __construct() {
|
5 |
+
add_filter('berocket_aapf_wcvariation_filtering_total_query', array($this, 'wcvariation_filtering_total_query'), 10, 3);
|
6 |
+
add_filter('berocket_aapf_wcvariation_filtering_main_query', array($this, 'wcvariation_filtering_main_query'), 10, 2);
|
7 |
+
add_filter('berocket_aapf_wcvariation_filtering_single_attribute', array($this, 'wcvariation_filtering_single_attribute'), 10, 2);
|
8 |
add_action( 'woocommerce_variation_set_stock_status', array($this, 'set_stock_status'), 10, 3 );
|
9 |
add_action( 'woocommerce_product_set_stock_status', array($this, 'set_stock_status'), 10, 3 );
|
10 |
add_action( 'delete_post', array($this, 'delete_post'), 10, 1 );
|
12 |
//hierarhical recount custom table
|
13 |
add_action('berocket_aapf_recount_terms_initialized', array($this, 'recount_terms_initialized'), 10, 1);
|
14 |
add_filter('berocket_aapf_recount_stock_status_query', array($this, 'recount_stock_status'), 10, 1);
|
15 |
+
//Stock status modify
|
16 |
+
add_filter('bapf_uparse_generate_tax_query_each', array($this, 'stock_status_tax_query'), 110, 4);
|
17 |
+
add_filter('bapf_uparse_generate_custom_query_each', array($this, 'stock_status_custom_query'), 110, 6);
|
18 |
+
|
19 |
+
add_filter('bapf_wcvariation_check_is_taxonomy_variable', array($this, 'check_is_taxonomy_variable'), 10, 2);
|
20 |
}
|
21 |
+
function get_current_variation_attributes() {
|
22 |
+
if( $this->variation_attributes !== FALSE ) return $this->variation_attributes;
|
23 |
+
global $wpdb;
|
24 |
+
$result = $wpdb->get_col("SELECT attribute FROM {$wpdb->prefix}braapf_variable_attributes GROUP BY attribute");
|
25 |
+
if( ! is_array($result) ) {
|
26 |
+
$result = array();
|
|
|
|
|
27 |
}
|
28 |
+
$this->variation_attributes = $result;
|
29 |
+
return $result;
|
30 |
+
}
|
31 |
+
function check_is_taxonomy_variable($is_var, $taxonomy) {
|
32 |
+
$attributes = $this->get_current_variation_attributes();
|
33 |
+
return in_array($taxonomy, $attributes);
|
34 |
+
}
|
35 |
+
function wcvariation_filtering_main_query($query, $data) {
|
36 |
+
$current_terms = array(0);
|
37 |
+
|
38 |
+
foreach($data['filters'] as $filter) {
|
39 |
+
if( substr( $filter['taxonomy'], 0, 3 ) == 'pa_' && ! empty($filter['terms']) ) {
|
40 |
+
foreach($filter['terms'] as $term) {
|
41 |
+
$current_terms[] = $term->term_id;
|
42 |
}
|
43 |
}
|
44 |
}
|
45 |
global $wpdb;
|
46 |
$table_name = $wpdb->prefix . 'braapf_product_variation_attributes';
|
47 |
$query = array(
|
48 |
+
'select' => 'SELECT '.$table_name.'.post_id as var_id, '.$table_name.'.parent_id as ID, COUNT('.$table_name.'.post_id) as meta_count, max('.$table_name.'.stock_status) as stock_status',
|
49 |
'from' => 'FROM '.$table_name,
|
50 |
'where' => 'WHERE '.$table_name.'.meta_value_id IN ('.implode(',', $current_terms).')',
|
51 |
'group' => 'GROUP BY '.$table_name.'.post_id'
|
52 |
);
|
53 |
return $query;
|
54 |
}
|
55 |
+
function wcvariation_filtering_single_attribute($query, $data) {
|
56 |
+
$current_terms = array(0);
|
57 |
+
|
58 |
+
foreach($data['filters'] as $filter) {
|
59 |
+
if( $this->check_is_taxonomy_variable(false, $filter['taxonomy']) && ! empty($filter['terms']) ) {
|
60 |
+
foreach($filter['terms'] as $term) {
|
61 |
+
$current_terms[] = $term->term_id;
|
62 |
}
|
63 |
}
|
64 |
}
|
65 |
+
global $wpdb;
|
66 |
+
$table_name = $wpdb->prefix . 'braapf_product_variation_attributes';
|
67 |
+
$return_query = array(
|
68 |
+
'select' => 'SELECT '.$table_name.'.parent_id as ID, '.$wpdb->term_taxonomy.'.term_taxonomy_id as term_id, MIN(out_of_stock_var.out_of_stock) AS out_of_stock',
|
69 |
+
'from' => 'FROM '.$table_name,
|
70 |
+
'join_start' => $query['join3_start'],
|
71 |
+
'join_select' => $query['join3_select'],
|
72 |
+
'join_end' => ') AS out_of_stock_var ON '.$table_name.'.post_id = out_of_stock_var.var_id',
|
73 |
+
'join2' => "INNER JOIN {$wpdb->term_taxonomy} on {$table_name}.meta_value_id = {$wpdb->term_taxonomy}.term_id",
|
74 |
+
'where' => 'WHERE '.$table_name.'.meta_value_id IN ('.implode(',', $current_terms).')',
|
75 |
+
'group' => 'GROUP BY ID, term_id',
|
76 |
+
'having' => 'HAVING out_of_stock = 1'
|
77 |
+
);
|
78 |
+
return $return_query;
|
79 |
+
}
|
80 |
+
function wcvariation_filtering_total_query($query, $data) {
|
81 |
+
$current_attributes = array();
|
82 |
+
$current_terms = array(0);
|
83 |
+
foreach($data['filters'] as $filter) {
|
84 |
+
if( $this->check_is_taxonomy_variable(false, $filter['taxonomy']) ) {
|
85 |
+
$current_attributes[] = sanitize_title($filter['taxonomy']);
|
86 |
+
if( ! empty($filter['terms']) ) {
|
87 |
+
foreach($filter['terms'] as $term) {
|
88 |
+
$current_terms[] = $term->term_id;
|
89 |
+
}
|
90 |
}
|
91 |
}
|
92 |
}
|
93 |
$current_attributes = array_unique($current_attributes);
|
94 |
global $wpdb;
|
|
|
|
|
|
|
|
|
95 |
$query['subquery']['subquery_2'] = array(
|
96 |
'select' => 'SELECT post_id as ID, COUNT(post_id) as max_meta_count',
|
97 |
+
'from' => "FROM {$wpdb->prefix}braapf_variable_attributes",
|
98 |
+
'where' => "WHERE attribute IN ('".implode("','", $current_attributes)."')",
|
99 |
'group' => 'GROUP BY post_id',
|
100 |
);
|
101 |
+
|
102 |
+
$query['subquery']['select'] = 'SELECT filtered_post.post_id as var_id, filtered_post.parent_id as ID, COUNT(filtered_post.post_id) as meta_count,
|
103 |
+
max(filtered_post.stock_status) as stock_status, max_filtered_post.max_meta_count,
|
104 |
+
IF(max_filtered_post.max_meta_count != COUNT(filtered_post.post_id) OR max(filtered_post.stock_status) = 0, 1, 0) as out_of_stock';
|
105 |
+
|
106 |
+
$query['subquery']['from_open'] = "FROM {$wpdb->prefix}braapf_product_variation_attributes as filtered_post";
|
107 |
+
$query['subquery']['join_close_1'] = ') as max_filtered_post ON max_filtered_post.ID = filtered_post.parent_id';
|
108 |
+
unset($query['subquery']['group']);
|
109 |
+
$query['subquery']['where'] = 'WHERE filtered_post.meta_value_id IN ('.implode(',', $current_terms).')';
|
110 |
+
$query['subquery']['group'] = 'GROUP BY filtered_post.post_id';
|
111 |
+
unset($query['subquery']['subquery_1'], $query['subquery']['from_close'], $query['subquery']['join_open_2'], $query['subquery']['subquery_3'], $query['subquery']['join_close_2']);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
112 |
return $query;
|
113 |
}
|
114 |
function delete_post($product_id) {
|
121 |
$wpdb->query($sql);
|
122 |
$sql = "DELETE FROM {$wpdb->prefix}braapf_product_variation_attributes WHERE parent_id={$product_id};";
|
123 |
$wpdb->query($sql);
|
124 |
+
$sql = "DELETE FROM {$wpdb->prefix}braapf_variable_attributes WHERE post_id={$product_id};";
|
125 |
$wpdb->query($sql);
|
126 |
}
|
127 |
function set_stock_status($product_id, $stock_status, $product) {
|
158 |
$parent_id = $product->get_parent_id();
|
159 |
$product_attributes = $product->get_variation_attributes();
|
160 |
$parent_product = wc_get_product($parent_id);
|
161 |
+
$stock_status = ($product->is_in_stock() ? '1' : '0');
|
162 |
$sql = "DELETE FROM {$wpdb->prefix}braapf_product_variation_attributes WHERE post_id={$product_id};";
|
163 |
$wpdb->query($sql);
|
164 |
foreach($product_attributes as $taxonomy => $attributes) {
|
176 |
foreach($attributes as $attribute) {
|
177 |
$term = get_term_by('slug', $attribute, $taxonomy);
|
178 |
if( $term !== false ) {
|
179 |
+
$sql = "INSERT IGNORE INTO {$wpdb->prefix}braapf_product_variation_attributes (post_id, parent_id, meta_key, meta_value_id, stock_status) VALUES({$product_id}, {$parent_id}, '{$taxonomy}', {$term->term_id}, '{$stock_status}')";
|
180 |
$wpdb->query($sql);
|
181 |
}
|
182 |
}
|
183 |
}
|
184 |
} elseif( $product_type == 'variable' ) {
|
185 |
$child_ids = $product->get_children();
|
186 |
+
$sql = "DELETE FROM {$wpdb->prefix}braapf_product_variation_attributes WHERE parent_id = {$product_id};";
|
187 |
+
$wpdb->query($sql);
|
188 |
if( is_array($child_ids) && count($child_ids) > 0 ) {
|
|
|
|
|
189 |
$insert_values = array();
|
190 |
$terms_cache = array();
|
191 |
$parent_attributes = $product->get_variation_attributes(false);
|
211 |
}
|
212 |
foreach($child_ids as $child_id) {
|
213 |
$time_post = microtime(true);
|
214 |
+
$variation = wc_get_product( $child_id );
|
215 |
+
if( ! empty($variation) ) {
|
216 |
+
$stock_status = ($variation->is_in_stock() ? '1' : '0');
|
217 |
+
} else {
|
218 |
+
$stock_status = ($product->is_in_stock() ? '1' : '0');
|
219 |
+
}
|
220 |
if( empty($child_attributes[$child_id]) ) {
|
|
|
221 |
if( empty($variation) ) {
|
222 |
$product_attributes = array();
|
223 |
} else {
|
244 |
}
|
245 |
$term = $terms_cache[$taxonomy][$attribute];
|
246 |
if( $term !== false ) {
|
247 |
+
$insert_values[] = "({$child_id}, {$product_id}, '{$taxonomy}', {$term->term_id}, '{$stock_status}')";
|
248 |
}
|
249 |
}
|
250 |
}
|
251 |
}
|
252 |
if( count($insert_values) > 0 ) {
|
253 |
+
$sql = "INSERT IGNORE INTO {$wpdb->prefix}braapf_product_variation_attributes (post_id, parent_id, meta_key, meta_value_id, stock_status)
|
254 |
VALUES ".implode(',', $insert_values);
|
255 |
$wpdb->query($sql);
|
256 |
}
|
257 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
258 |
$wpdb->query($sql);
|
259 |
+
$sql = "DELETE FROM {$wpdb->prefix}braapf_variable_attributes WHERE post_id={$product_id};";
|
260 |
+
$product_attribute = get_post_meta($product_id, '_product_attributes', true);
|
261 |
+
$insert_values = array();
|
262 |
+
if( is_array($product_attribute) ) {
|
263 |
+
foreach($product_attribute as $attribute) {
|
264 |
+
if( ! empty($attribute['is_variation']) ) {
|
265 |
+
$insert_values[] = "({$product_id}, '".$attribute['name']."')";
|
266 |
+
}
|
267 |
+
}
|
268 |
+
}
|
269 |
+
if( ! empty($insert_values) ) {
|
270 |
+
$sql = "INSERT IGNORE INTO {$wpdb->prefix}braapf_variable_attributes (post_id, attribute)
|
271 |
+
VALUES ".implode(',', $insert_values);
|
272 |
+
$wpdb->query($sql);
|
273 |
+
}
|
274 |
+
$table_name = $wpdb->prefix . 'braapf_variable_attributes';
|
275 |
+
$sql_select = "SELECT {$table_name}.post_id as post_id,
|
276 |
+
{$table_name}.post_id as parent_id,
|
277 |
+
{$table_name}.attribute as meta_key,
|
278 |
+
{$wpdb->term_taxonomy}.term_id as meta_value_id,
|
279 |
+
0 as stock_status
|
280 |
+
FROM {$table_name}
|
281 |
+
JOIN {$wpdb->term_relationships} ON {$table_name}.post_id = {$wpdb->term_relationships}.object_id
|
282 |
+
JOIN {$wpdb->term_taxonomy} ON {$wpdb->term_relationships}.term_taxonomy_id = {$wpdb->term_taxonomy}.term_taxonomy_id AND {$wpdb->term_taxonomy}.taxonomy = {$table_name}.attribute
|
283 |
+
LEFT JOIN {$wpdb->prefix}braapf_product_variation_attributes ON {$wpdb->prefix}braapf_product_variation_attributes.parent_id = {$table_name}.post_id AND {$wpdb->prefix}braapf_product_variation_attributes.meta_value_id = {$wpdb->term_taxonomy}.term_id
|
284 |
+
WHERE {$wpdb->prefix}braapf_product_variation_attributes.meta_value_id IS NULL
|
285 |
+
AND {$table_name}.post_id = {$product_id}";
|
286 |
+
$test_row = $wpdb->get_row($sql_select);
|
287 |
+
if( ! empty($test_row) ) {
|
288 |
+
$sql = "INSERT IGNORE INTO {$wpdb->prefix}braapf_product_variation_attributes {$sql_select}";
|
289 |
+
$query_status = $wpdb->query($sql);
|
290 |
+
}
|
291 |
}
|
292 |
if ( defined( 'ICL_SITEPRESS_VERSION' ) && ! ICL_PLUGIN_INACTIVE && class_exists( 'SitePress' ) ) {
|
293 |
do_action( 'wpml_switch_language', $current_language );
|
297 |
remove_filter('berocket_aapf_recount_terms_query', array($recount_object, 'child_include'), 50, 3);
|
298 |
add_filter('berocket_aapf_recount_terms_query', array($this, 'child_include'), 50, 3);
|
299 |
}
|
300 |
+
public $hierarhical_data_to_table_ready = array();
|
301 |
function child_include($query, $taxonomy_data, $terms) {
|
302 |
global $wpdb;
|
303 |
extract($taxonomy_data);
|
315 |
return $query;
|
316 |
}
|
317 |
function set_hierarhical_data_to_table($taxonomy) {
|
318 |
+
if( in_array($taxonomy, $this->hierarhical_data_to_table_ready) ) return;
|
319 |
global $wpdb;
|
320 |
$wpdb->query("SET SESSION group_concat_max_len = 1000000");
|
321 |
$newmd5 = $wpdb->get_var(
|
372 |
}
|
373 |
update_option(apply_filters('br_aapf_md5_cache_text', 'br_custom_table_hierarhical_'.$taxonomy), $newmd5);
|
374 |
}
|
375 |
+
$this->hierarhical_data_to_table_ready[] = $taxonomy;
|
376 |
}
|
377 |
function taxonomy_hierarchical_get($taxonomy) {
|
378 |
$terms = $this->get_terms_all(array(
|
439 |
ON {$wpdb->posts}.ID = term_relationships.object_id";
|
440 |
return $join_query;
|
441 |
}
|
442 |
+
function stock_status_tax_query($result, $instance, $filter, $data) {
|
443 |
+
if( $result !== null && isset($filter['type']) && $filter['type'] == 'stock_status' ) {
|
444 |
+
$result = null;
|
445 |
+
}
|
446 |
+
return $result;
|
447 |
+
}
|
448 |
+
function stock_status_custom_query($result, $instance, $filter, $data) {
|
449 |
+
if( $result === null && isset($filter['type']) && $filter['type'] == 'stock_status' ) {
|
450 |
+
$status = 'none';
|
451 |
+
foreach($filter['terms'] as $filter_term) {
|
452 |
+
if($status == 'none' ) {
|
453 |
+
$status = $filter_term->slug;
|
454 |
+
} else {
|
455 |
+
$status = 'both';
|
456 |
+
}
|
457 |
+
}
|
458 |
+
if( $status != 'both' && $status != 'none' ) {
|
459 |
+
$result = $filter;
|
460 |
+
$result['custom_query'] = array($this, 'stock_status_post_clauses');
|
461 |
+
$result['custom_query_line'] = 'stock_status:' . $status;
|
462 |
+
}
|
463 |
+
}
|
464 |
+
return $result;
|
465 |
+
}
|
466 |
+
function stock_status_post_clauses($args, $filter) {
|
467 |
+
global $wpdb;
|
468 |
+
$status = 'none';
|
469 |
+
foreach($filter['terms'] as $filter_term) {
|
470 |
+
if($status == 'none' ) {
|
471 |
+
$status = $filter_term->slug;
|
472 |
+
} else {
|
473 |
+
$status = 'both';
|
474 |
+
}
|
475 |
+
}
|
476 |
+
$args['join'] .= " INNER JOIN {$wpdb->prefix}braapf_product_stock_status_parent ON {$wpdb->posts}.ID = {$wpdb->prefix}braapf_product_stock_status_parent.post_id";
|
477 |
+
$args['where'] .= " AND {$wpdb->prefix}braapf_product_stock_status_parent.stock_status = ".($status == 'instock' ? '1' : '0').' ';
|
478 |
+
return $args;
|
479 |
+
}
|
480 |
}
|
481 |
new BeRocket_aapf_variations_tables();
|
addons/additional_tables/additional_tables.php
CHANGED
@@ -12,13 +12,13 @@ class BeRocket_aapf_variations_tables_addon extends BeRocket_framework_addon_lib
|
|
12 |
'percentage' => 13
|
13 |
),
|
14 |
3 => array(
|
15 |
-
'percentage' =>
|
16 |
),
|
17 |
4 => array(
|
18 |
-
'percentage' =>
|
19 |
),
|
20 |
5 => array(
|
21 |
-
'percentage' =>
|
22 |
),
|
23 |
6 => array(
|
24 |
'percentage' => 0
|
@@ -108,7 +108,7 @@ class BeRocket_aapf_variations_tables_addon extends BeRocket_framework_addon_lib
|
|
108 |
} elseif( $current_position == 3 && $brajax ) {
|
109 |
$this->insert_table_braapf_product_variation_attributes();
|
110 |
} elseif( $current_position == 4 && $brajax ) {
|
111 |
-
$this->
|
112 |
} elseif( $current_position == 5 ) {
|
113 |
if( class_exists('berocket_information_notices') ) {
|
114 |
new berocket_information_notices(array(
|
@@ -124,6 +124,10 @@ class BeRocket_aapf_variations_tables_addon extends BeRocket_framework_addon_lib
|
|
124 |
}
|
125 |
$this->set_current_create_position(6);
|
126 |
wp_clear_scheduled_hook('braapf_additional_table_cron');
|
|
|
|
|
|
|
|
|
127 |
}
|
128 |
if( empty($current_position) || $current_position < 5 ) {
|
129 |
wp_schedule_single_event(time(), 'braapf_additional_table_cron');
|
@@ -258,8 +262,8 @@ class BeRocket_aapf_variations_tables_addon extends BeRocket_framework_addon_lib
|
|
258 |
));
|
259 |
$this->create_table_braapf_term_taxonomy_hierarchical();
|
260 |
$this->create_table_braapf_product_stock_status_parent();
|
|
|
261 |
$this->create_table_braapf_product_variation_attributes();
|
262 |
-
$this->create_table_braapf_variation_attributes();
|
263 |
|
264 |
$sql = "SELECT MIN({$wpdb->prefix}wc_product_meta_lookup.product_id) as min, MAX({$wpdb->prefix}wc_product_meta_lookup.product_id) as max FROM {$wpdb->prefix}wc_product_meta_lookup";
|
265 |
$product_data = $wpdb->get_row($sql);
|
@@ -286,10 +290,15 @@ class BeRocket_aapf_variations_tables_addon extends BeRocket_framework_addon_lib
|
|
286 |
'max_id' => $postmeta_data->max
|
287 |
));
|
288 |
} else {
|
|
|
|
|
289 |
$this->set_current_create_position(4);
|
290 |
$this->set_current_create_position_data(array(
|
291 |
'status' => 0,
|
292 |
'run' => false,
|
|
|
|
|
|
|
293 |
));
|
294 |
}
|
295 |
}
|
@@ -332,39 +341,40 @@ class BeRocket_aapf_variations_tables_addon extends BeRocket_framework_addon_lib
|
|
332 |
$query_status = dbDelta( $sql );
|
333 |
$this->save_query_error($sql, $query_status);
|
334 |
}
|
335 |
-
function
|
336 |
global $wpdb;
|
337 |
$charset_collate = $wpdb->get_charset_collate();
|
338 |
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
|
339 |
-
$table_name = $wpdb->prefix . '
|
340 |
$sql = "DROP TABLE IF EXISTS {$table_name};";
|
341 |
$wpdb->query($sql);
|
342 |
$sql = "CREATE TABLE $table_name (
|
343 |
post_id bigint(20) NOT NULL,
|
344 |
-
|
345 |
-
meta_key varchar(32) NOT NULL,
|
346 |
-
meta_value_id bigint(20) NOT NULL,
|
347 |
INDEX post_id (post_id),
|
348 |
-
INDEX
|
349 |
-
|
350 |
-
UNIQUE uniqueid (post_id, meta_key, meta_value_id)
|
351 |
) $charset_collate;";
|
352 |
$query_status = dbDelta( $sql );
|
353 |
$this->save_query_error($sql, $query_status);
|
354 |
}
|
355 |
-
function
|
356 |
global $wpdb;
|
357 |
$charset_collate = $wpdb->get_charset_collate();
|
358 |
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
|
359 |
-
$table_name = $wpdb->prefix . '
|
360 |
$sql = "DROP TABLE IF EXISTS {$table_name};";
|
361 |
$wpdb->query($sql);
|
362 |
$sql = "CREATE TABLE $table_name (
|
363 |
post_id bigint(20) NOT NULL,
|
364 |
-
|
|
|
|
|
|
|
365 |
INDEX post_id (post_id),
|
366 |
-
INDEX
|
367 |
-
|
|
|
368 |
) $charset_collate;";
|
369 |
$query_status = dbDelta( $sql );
|
370 |
$this->save_query_error($sql, $query_status);
|
@@ -428,10 +438,15 @@ class BeRocket_aapf_variations_tables_addon extends BeRocket_framework_addon_lib
|
|
428 |
'max_id' => $postmeta_data->max
|
429 |
));
|
430 |
} else {
|
|
|
|
|
431 |
$this->set_current_create_position(4);
|
432 |
$this->set_current_create_position_data(array(
|
433 |
'status' => 0,
|
434 |
'run' => false,
|
|
|
|
|
|
|
435 |
));
|
436 |
}
|
437 |
}
|
@@ -451,10 +466,17 @@ class BeRocket_aapf_variations_tables_addon extends BeRocket_framework_addon_lib
|
|
451 |
$table_name = $wpdb->prefix . 'braapf_product_variation_attributes';
|
452 |
$charset_collate = $wpdb->get_charset_collate();
|
453 |
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
|
454 |
-
$sql_select = "SELECT
|
|
|
|
|
|
|
|
|
|
|
|
|
455 |
JOIN {$wpdb->term_taxonomy} ON CONCAT('attribute_', {$wpdb->term_taxonomy}.taxonomy) = {$wpdb->postmeta}.meta_key
|
456 |
JOIN {$wpdb->terms} ON {$wpdb->terms}.term_id = {$wpdb->term_taxonomy}.term_id AND {$wpdb->postmeta}.meta_value = {$wpdb->terms}.slug
|
457 |
JOIN {$wpdb->posts} ON {$wpdb->postmeta}.post_id = {$wpdb->posts}.ID
|
|
|
458 |
WHERE {$wpdb->postmeta}.meta_id >= {$start_id} AND {$wpdb->postmeta}.meta_id < {$end_id}
|
459 |
AND {$wpdb->postmeta}.meta_key LIKE 'attribute_pa_%'";
|
460 |
$test_row = $wpdb->get_row($sql_select);
|
@@ -465,11 +487,17 @@ class BeRocket_aapf_variations_tables_addon extends BeRocket_framework_addon_lib
|
|
465 |
$this->save_query_error($sql);
|
466 |
}
|
467 |
}
|
468 |
-
$sql_select = "SELECT
|
|
|
|
|
|
|
|
|
|
|
469 |
FROM {$wpdb->postmeta}
|
470 |
JOIN {$wpdb->posts} ON {$wpdb->postmeta}.post_id = {$wpdb->posts}.ID
|
471 |
JOIN {$wpdb->term_relationships} ON {$wpdb->posts}.post_parent = {$wpdb->term_relationships}.object_id
|
472 |
JOIN {$wpdb->term_taxonomy} ON {$wpdb->term_relationships}.term_taxonomy_id = {$wpdb->term_taxonomy}.term_taxonomy_id
|
|
|
473 |
AND CONCAT('attribute_', {$wpdb->term_taxonomy}.taxonomy) = {$wpdb->postmeta}.meta_key
|
474 |
WHERE {$wpdb->postmeta}.meta_id >= {$start_id} AND {$wpdb->postmeta}.meta_id < {$end_id}
|
475 |
AND {$wpdb->postmeta}.meta_key LIKE 'attribute_pa_%' AND {$wpdb->postmeta}.meta_value = ''";
|
@@ -491,42 +519,99 @@ class BeRocket_aapf_variations_tables_addon extends BeRocket_framework_addon_lib
|
|
491 |
'max_id' => $max_id
|
492 |
));
|
493 |
} else {
|
|
|
|
|
494 |
$this->set_current_create_position(4);
|
495 |
$this->set_current_create_position_data(array(
|
496 |
'status' => 0,
|
497 |
-
'run' => false
|
|
|
|
|
|
|
498 |
));
|
499 |
}
|
500 |
}
|
501 |
-
function
|
502 |
$run_data = $this->get_current_create_position_data();
|
503 |
-
if(
|
504 |
return false;
|
505 |
}
|
506 |
-
$
|
507 |
-
|
508 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
509 |
));
|
510 |
global $wpdb;
|
511 |
-
$table_name = $wpdb->prefix . '
|
512 |
$charset_collate = $wpdb->get_charset_collate();
|
513 |
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
|
514 |
-
$sql_select = "SELECT
|
515 |
-
|
516 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
517 |
$test_row = $wpdb->get_row($sql_select);
|
518 |
if( ! empty($test_row) ) {
|
519 |
-
$sql = "INSERT IGNORE INTO {$
|
520 |
$query_status = $wpdb->query($sql);
|
521 |
if( $query_status === FALSE ) {
|
522 |
$this->save_query_error($sql);
|
523 |
}
|
524 |
}
|
525 |
-
$
|
526 |
-
$
|
527 |
-
|
528 |
-
|
529 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
530 |
}
|
531 |
function deactivate() {
|
532 |
global $wpdb;
|
@@ -534,6 +619,7 @@ class BeRocket_aapf_variations_tables_addon extends BeRocket_framework_addon_lib
|
|
534 |
'braapf_product_stock_status_parent',
|
535 |
'braapf_product_variation_attributes',
|
536 |
'braapf_variation_attributes',
|
|
|
537 |
'braapf_term_taxonomy_hierarchical'
|
538 |
);
|
539 |
foreach($tables_drop as $table_drop) {
|
12 |
'percentage' => 13
|
13 |
),
|
14 |
3 => array(
|
15 |
+
'percentage' => 70
|
16 |
),
|
17 |
4 => array(
|
18 |
+
'percentage' => 3
|
19 |
),
|
20 |
5 => array(
|
21 |
+
'percentage' => 10
|
22 |
),
|
23 |
6 => array(
|
24 |
'percentage' => 0
|
108 |
} elseif( $current_position == 3 && $brajax ) {
|
109 |
$this->insert_table_braapf_product_variation_attributes();
|
110 |
} elseif( $current_position == 4 && $brajax ) {
|
111 |
+
$this->insert_table_braapf_variable_attributes();
|
112 |
} elseif( $current_position == 5 ) {
|
113 |
if( class_exists('berocket_information_notices') ) {
|
114 |
new berocket_information_notices(array(
|
124 |
}
|
125 |
$this->set_current_create_position(6);
|
126 |
wp_clear_scheduled_hook('braapf_additional_table_cron');
|
127 |
+
$BeRocket_AAPF = BeRocket_AAPF::getInstance();
|
128 |
+
$options = $BeRocket_AAPF->get_option();
|
129 |
+
$options['purge_cache_time'] = time();
|
130 |
+
update_option( 'br_filters_options', $options );
|
131 |
}
|
132 |
if( empty($current_position) || $current_position < 5 ) {
|
133 |
wp_schedule_single_event(time(), 'braapf_additional_table_cron');
|
262 |
));
|
263 |
$this->create_table_braapf_term_taxonomy_hierarchical();
|
264 |
$this->create_table_braapf_product_stock_status_parent();
|
265 |
+
$this->create_table_braapf_variable_attributes();
|
266 |
$this->create_table_braapf_product_variation_attributes();
|
|
|
267 |
|
268 |
$sql = "SELECT MIN({$wpdb->prefix}wc_product_meta_lookup.product_id) as min, MAX({$wpdb->prefix}wc_product_meta_lookup.product_id) as max FROM {$wpdb->prefix}wc_product_meta_lookup";
|
269 |
$product_data = $wpdb->get_row($sql);
|
290 |
'max_id' => $postmeta_data->max
|
291 |
));
|
292 |
} else {
|
293 |
+
$sql = "SELECT MIN({$wpdb->posts}.ID) as min, MAX({$wpdb->posts}.ID) as max FROM {$wpdb->posts}";
|
294 |
+
$postmeta_data = $wpdb->get_row($sql);
|
295 |
$this->set_current_create_position(4);
|
296 |
$this->set_current_create_position_data(array(
|
297 |
'status' => 0,
|
298 |
'run' => false,
|
299 |
+
'start_id' => $postmeta_data->min,
|
300 |
+
'min_id' => $postmeta_data->min,
|
301 |
+
'max_id' => $postmeta_data->max
|
302 |
));
|
303 |
}
|
304 |
}
|
341 |
$query_status = dbDelta( $sql );
|
342 |
$this->save_query_error($sql, $query_status);
|
343 |
}
|
344 |
+
function create_table_braapf_variable_attributes() {
|
345 |
global $wpdb;
|
346 |
$charset_collate = $wpdb->get_charset_collate();
|
347 |
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
|
348 |
+
$table_name = $wpdb->prefix . 'braapf_variable_attributes';
|
349 |
$sql = "DROP TABLE IF EXISTS {$table_name};";
|
350 |
$wpdb->query($sql);
|
351 |
$sql = "CREATE TABLE $table_name (
|
352 |
post_id bigint(20) NOT NULL,
|
353 |
+
attribute varchar(32) NOT NULL,
|
|
|
|
|
354 |
INDEX post_id (post_id),
|
355 |
+
INDEX attribute (attribute),
|
356 |
+
UNIQUE uniqueid (post_id, attribute)
|
|
|
357 |
) $charset_collate;";
|
358 |
$query_status = dbDelta( $sql );
|
359 |
$this->save_query_error($sql, $query_status);
|
360 |
}
|
361 |
+
function create_table_braapf_product_variation_attributes() {
|
362 |
global $wpdb;
|
363 |
$charset_collate = $wpdb->get_charset_collate();
|
364 |
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
|
365 |
+
$table_name = $wpdb->prefix . 'braapf_product_variation_attributes';
|
366 |
$sql = "DROP TABLE IF EXISTS {$table_name};";
|
367 |
$wpdb->query($sql);
|
368 |
$sql = "CREATE TABLE $table_name (
|
369 |
post_id bigint(20) NOT NULL,
|
370 |
+
parent_id bigint(20) NOT NULL,
|
371 |
+
meta_key varchar(32) NOT NULL,
|
372 |
+
meta_value_id bigint(20) NOT NULL,
|
373 |
+
stock_status tinyint(2),
|
374 |
INDEX post_id (post_id),
|
375 |
+
INDEX meta_key (meta_key),
|
376 |
+
INDEX meta_value_id (meta_value_id),
|
377 |
+
UNIQUE uniqueid (post_id, meta_key, meta_value_id)
|
378 |
) $charset_collate;";
|
379 |
$query_status = dbDelta( $sql );
|
380 |
$this->save_query_error($sql, $query_status);
|
438 |
'max_id' => $postmeta_data->max
|
439 |
));
|
440 |
} else {
|
441 |
+
$sql = "SELECT MIN({$wpdb->posts}.ID) as min, MAX({$wpdb->posts}.ID) as max FROM {$wpdb->posts}";
|
442 |
+
$postmeta_data = $wpdb->get_row($sql);
|
443 |
$this->set_current_create_position(4);
|
444 |
$this->set_current_create_position_data(array(
|
445 |
'status' => 0,
|
446 |
'run' => false,
|
447 |
+
'start_id' => $postmeta_data->min,
|
448 |
+
'min_id' => $postmeta_data->min,
|
449 |
+
'max_id' => $postmeta_data->max
|
450 |
));
|
451 |
}
|
452 |
}
|
466 |
$table_name = $wpdb->prefix . 'braapf_product_variation_attributes';
|
467 |
$charset_collate = $wpdb->get_charset_collate();
|
468 |
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
|
469 |
+
$sql_select = "SELECT
|
470 |
+
{$wpdb->postmeta}.post_id as post_id,
|
471 |
+
{$wpdb->posts}.post_parent as parent_id,
|
472 |
+
{$wpdb->term_taxonomy}.taxonomy as meta_key,
|
473 |
+
{$wpdb->terms}.term_id as meta_value_id,
|
474 |
+
IF({$wpdb->wc_product_meta_lookup}.stock_status = 'instock' OR {$wpdb->wc_product_meta_lookup}.stock_status = 'onbackorder', 1, 0) as stock_status
|
475 |
+
FROM {$wpdb->postmeta}
|
476 |
JOIN {$wpdb->term_taxonomy} ON CONCAT('attribute_', {$wpdb->term_taxonomy}.taxonomy) = {$wpdb->postmeta}.meta_key
|
477 |
JOIN {$wpdb->terms} ON {$wpdb->terms}.term_id = {$wpdb->term_taxonomy}.term_id AND {$wpdb->postmeta}.meta_value = {$wpdb->terms}.slug
|
478 |
JOIN {$wpdb->posts} ON {$wpdb->postmeta}.post_id = {$wpdb->posts}.ID
|
479 |
+
JOIN {$wpdb->wc_product_meta_lookup} ON wp_posts.ID = {$wpdb->wc_product_meta_lookup}.product_id
|
480 |
WHERE {$wpdb->postmeta}.meta_id >= {$start_id} AND {$wpdb->postmeta}.meta_id < {$end_id}
|
481 |
AND {$wpdb->postmeta}.meta_key LIKE 'attribute_pa_%'";
|
482 |
$test_row = $wpdb->get_row($sql_select);
|
487 |
$this->save_query_error($sql);
|
488 |
}
|
489 |
}
|
490 |
+
$sql_select = "SELECT
|
491 |
+
{$wpdb->posts}.ID as post_id,
|
492 |
+
{$wpdb->posts}.post_parent as parent_id,
|
493 |
+
{$wpdb->term_taxonomy}.taxonomy as meta_key,
|
494 |
+
{$wpdb->term_taxonomy}.term_id as meta_value_id,
|
495 |
+
IF({$wpdb->wc_product_meta_lookup}.stock_status = 'instock' OR {$wpdb->wc_product_meta_lookup}.stock_status = 'onbackorder', 1, 0) as stock_status
|
496 |
FROM {$wpdb->postmeta}
|
497 |
JOIN {$wpdb->posts} ON {$wpdb->postmeta}.post_id = {$wpdb->posts}.ID
|
498 |
JOIN {$wpdb->term_relationships} ON {$wpdb->posts}.post_parent = {$wpdb->term_relationships}.object_id
|
499 |
JOIN {$wpdb->term_taxonomy} ON {$wpdb->term_relationships}.term_taxonomy_id = {$wpdb->term_taxonomy}.term_taxonomy_id
|
500 |
+
JOIN {$wpdb->wc_product_meta_lookup} ON wp_posts.ID = {$wpdb->wc_product_meta_lookup}.product_id
|
501 |
AND CONCAT('attribute_', {$wpdb->term_taxonomy}.taxonomy) = {$wpdb->postmeta}.meta_key
|
502 |
WHERE {$wpdb->postmeta}.meta_id >= {$start_id} AND {$wpdb->postmeta}.meta_id < {$end_id}
|
503 |
AND {$wpdb->postmeta}.meta_key LIKE 'attribute_pa_%' AND {$wpdb->postmeta}.meta_value = ''";
|
519 |
'max_id' => $max_id
|
520 |
));
|
521 |
} else {
|
522 |
+
$sql = "SELECT MIN({$wpdb->posts}.ID) as min, MAX({$wpdb->posts}.ID) as max FROM {$wpdb->posts}";
|
523 |
+
$postmeta_data = $wpdb->get_row($sql);
|
524 |
$this->set_current_create_position(4);
|
525 |
$this->set_current_create_position_data(array(
|
526 |
'status' => 0,
|
527 |
+
'run' => false,
|
528 |
+
'start_id' => $postmeta_data->min,
|
529 |
+
'min_id' => $postmeta_data->min,
|
530 |
+
'max_id' => $postmeta_data->max
|
531 |
));
|
532 |
}
|
533 |
}
|
534 |
+
function insert_table_braapf_variable_attributes() {
|
535 |
$run_data = $this->get_current_create_position_data();
|
536 |
+
if( empty($run_data) || ! empty($run_data['run']) ) {
|
537 |
return false;
|
538 |
}
|
539 |
+
$run_data['run'] = true;
|
540 |
+
$variable_taxonomy = get_term_by('slug', 'variable', 'product_type');
|
541 |
+
$this->set_current_create_position_data($run_data);
|
542 |
+
$start_id = intval($run_data['start_id']);
|
543 |
+
$min_id = intval($run_data['min_id']);
|
544 |
+
$max_id = intval($run_data['max_id']);
|
545 |
+
$end_id = $start_id + apply_filters('berocket_insert_table_braapf_variable_attributes_end', 2000);
|
546 |
+
BeRocket_error_notices::add_plugin_error(1, 'insert_table_braapf_variable_attributes', array(
|
547 |
+
'start_id' => $start_id,
|
548 |
+
'end_id' => $end_id,
|
549 |
));
|
550 |
global $wpdb;
|
551 |
+
$table_name = $wpdb->prefix . 'braapf_variable_attributes';
|
552 |
$charset_collate = $wpdb->get_charset_collate();
|
553 |
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
|
554 |
+
$sql_select = "SELECT {$wpdb->posts}.ID as id, {$wpdb->postmeta}.meta_value as value FROM {$wpdb->posts}
|
555 |
+
JOIN {$wpdb->postmeta} ON {$wpdb->posts}.ID = {$wpdb->postmeta}.post_id
|
556 |
+
JOIN {$wpdb->term_relationships} ON {$wpdb->posts}.ID = {$wpdb->term_relationships}.object_id
|
557 |
+
WHERE {$wpdb->posts}.ID >= {$start_id} AND {$wpdb->posts}.ID < {$end_id} AND {$wpdb->postmeta}.meta_key = '_product_attributes' AND {$wpdb->term_relationships}.term_taxonomy_id = {$variable_taxonomy->term_taxonomy_id}";
|
558 |
+
$results = $wpdb->get_results($sql_select);
|
559 |
+
if( ! empty($results) && is_array($results) ) {
|
560 |
+
$insert_values = array();
|
561 |
+
foreach($results as $product) {
|
562 |
+
$product_attribute = maybe_unserialize($product->value);
|
563 |
+
if( is_array($product_attribute) ) {
|
564 |
+
foreach($product_attribute as $attribute) {
|
565 |
+
if( ! empty($attribute['is_variation']) ) {
|
566 |
+
$insert_values[] = "({$product->id}, '".$attribute['name']."')";
|
567 |
+
}
|
568 |
+
}
|
569 |
+
}
|
570 |
+
}
|
571 |
+
if( ! empty($insert_values) ) {
|
572 |
+
$sql = "INSERT IGNORE INTO {$table_name} (post_id, attribute)
|
573 |
+
VALUES ".implode(',', $insert_values);
|
574 |
+
$query_status = $wpdb->query($sql);
|
575 |
+
if( $query_status === FALSE ) {
|
576 |
+
$this->save_query_error($sql);
|
577 |
+
}
|
578 |
+
}
|
579 |
+
}
|
580 |
+
$sql_select = "SELECT {$table_name}.post_id as post_id,
|
581 |
+
{$table_name}.post_id as parent_id,
|
582 |
+
{$table_name}.attribute as meta_key,
|
583 |
+
{$wpdb->term_taxonomy}.term_id as meta_value_id,
|
584 |
+
0 as stock_status
|
585 |
+
FROM {$table_name}
|
586 |
+
JOIN {$wpdb->term_relationships} ON {$table_name}.post_id = {$wpdb->term_relationships}.object_id
|
587 |
+
JOIN {$wpdb->term_taxonomy} ON {$wpdb->term_relationships}.term_taxonomy_id = {$wpdb->term_taxonomy}.term_taxonomy_id AND {$wpdb->term_taxonomy}.taxonomy = {$table_name}.attribute
|
588 |
+
LEFT JOIN {$wpdb->prefix}braapf_product_variation_attributes ON {$wpdb->prefix}braapf_product_variation_attributes.parent_id = {$table_name}.post_id AND {$wpdb->prefix}braapf_product_variation_attributes.meta_value_id = {$wpdb->term_taxonomy}.term_id
|
589 |
+
WHERE {$wpdb->prefix}braapf_product_variation_attributes.meta_value_id IS NULL
|
590 |
+
AND {$table_name}.post_id >= {$start_id} AND {$table_name}.post_id";
|
591 |
$test_row = $wpdb->get_row($sql_select);
|
592 |
if( ! empty($test_row) ) {
|
593 |
+
$sql = "INSERT IGNORE INTO {$wpdb->prefix}braapf_product_variation_attributes {$sql_select}";
|
594 |
$query_status = $wpdb->query($sql);
|
595 |
if( $query_status === FALSE ) {
|
596 |
$this->save_query_error($sql);
|
597 |
}
|
598 |
}
|
599 |
+
$status = max(0, min(100, (($end_id - $min_id) / (($max_id - $min_id) == 0 ? 1 : ($max_id - $min_id)) * 100)));
|
600 |
+
if( $end_id <= $max_id ) {
|
601 |
+
$this->set_current_create_position_data(array(
|
602 |
+
'status' => $status,
|
603 |
+
'run' => false,
|
604 |
+
'start_id' => $end_id,
|
605 |
+
'min_id' => $min_id,
|
606 |
+
'max_id' => $max_id
|
607 |
+
));
|
608 |
+
} else {
|
609 |
+
$this->set_current_create_position(5);
|
610 |
+
$this->set_current_create_position_data(array(
|
611 |
+
'status' => 0,
|
612 |
+
'run' => false,
|
613 |
+
));
|
614 |
+
}
|
615 |
}
|
616 |
function deactivate() {
|
617 |
global $wpdb;
|
619 |
'braapf_product_stock_status_parent',
|
620 |
'braapf_product_variation_attributes',
|
621 |
'braapf_variation_attributes',
|
622 |
+
'braapf_variable_attributes',
|
623 |
'braapf_term_taxonomy_hierarchical'
|
624 |
);
|
625 |
foreach($tables_drop as $table_drop) {
|
addons/deprecated_compat/deprecated_compat.php
DELETED
@@ -1,2 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
//fix fatal errors for replace method
|
|
|
|
addons/deprecated_filters/admin.js
DELETED
@@ -1,902 +0,0 @@
|
|
1 |
-
var berocket_admin_filter_types = {
|
2 |
-
tag:['checkbox','radio','select','color','image','tag_cloud'],
|
3 |
-
product_cat:['checkbox','radio','select','color','image'],
|
4 |
-
sale:['checkbox','radio','select'],
|
5 |
-
custom_taxonomy:['checkbox','radio','select','color','image'],
|
6 |
-
attribute:['checkbox','radio','select','color','image'],
|
7 |
-
price:['slider'],
|
8 |
-
filter_by:['checkbox','radio','select','color','image']
|
9 |
-
};
|
10 |
-
var berocket_admin_filter_types_by_attr = {
|
11 |
-
checkbox:'<option value="checkbox">'+aapf_admin_text.checkbox_text+'</option>',
|
12 |
-
radio:'<option value="radio">'+aapf_admin_text.radio_text+'</option>',
|
13 |
-
select:'<option value="select">'+aapf_admin_text.select_text+'</option>',
|
14 |
-
color:'<option value="color">'+aapf_admin_text.color_text+'</option>',
|
15 |
-
image:'<option value="image">'+aapf_admin_text.image_text+'</option>',
|
16 |
-
slider:'<option value="slider">'+aapf_admin_text.slider_text+'</option>',
|
17 |
-
tag_cloud:'<option value="tag_cloud">'+aapf_admin_text.tag_cloud_text+'</option>'
|
18 |
-
};
|
19 |
-
|
20 |
-
(function ($) {
|
21 |
-
$(document).ready(function () {
|
22 |
-
|
23 |
-
$('.get_shortcode').click( function ( event ) {
|
24 |
-
event.preventDefault();
|
25 |
-
$form = $(this).parents('form');
|
26 |
-
var params = $( '.br_colorpicker_field_input, .berocket_image_value' );
|
27 |
-
var attr = $( '#berocket_sc_attribute' );
|
28 |
-
var type = $( '#berocket_sc_type' );
|
29 |
-
if ( params.length > 0 ) {
|
30 |
-
params = params.serialize();
|
31 |
-
params = params+'&action=aapf_color_set&type='+type.val()+'&tax_color_name='+attr.val();
|
32 |
-
$.post(ajaxurl, params, function (data) {});
|
33 |
-
}
|
34 |
-
create_shortcode( $form );
|
35 |
-
});
|
36 |
-
$(document).on('change', '.berocket_aapf_widget_sc, .berocket_aapf_style_sb_sc, .berocket_aapf_sb_attributes_sc, .berocket_aapf_childs_sc, .berocket_aapf_include_list_sc', function() {
|
37 |
-
$(this).data('sc_change', '1');
|
38 |
-
});
|
39 |
-
function create_shortcode( $form ) {
|
40 |
-
var shortcode = {
|
41 |
-
key: [],
|
42 |
-
value: [],
|
43 |
-
};
|
44 |
-
var widget_type = $form.find('.berocket_aapf_widget_admin_widget_type_select').val();
|
45 |
-
$form.find('.berocket_aapf_widget_sc').each( function ( i, o ) {
|
46 |
-
if( $(o).data('sc_change') ) {
|
47 |
-
if ( $(o).is('[type=checkbox]') ) {
|
48 |
-
if( shortcode.key.indexOf( $(o).data('sc') ) == -1 ) {
|
49 |
-
shortcode.key.push($(o).data('sc'));
|
50 |
-
if ( $(o).prop('checked') ) {
|
51 |
-
shortcode.value.push($(o).val());
|
52 |
-
} else {
|
53 |
-
shortcode.value.push('');
|
54 |
-
}
|
55 |
-
} else {
|
56 |
-
index = shortcode.key.indexOf( $(o).data('sc') );
|
57 |
-
if ( $(o).prop('checked') ) {
|
58 |
-
if ( ! Array.isArray( shortcode.value[index] ) ) {
|
59 |
-
firstvalue = shortcode.value[index];
|
60 |
-
shortcode.value[index] = [];
|
61 |
-
if( firstvalue != '' ) {
|
62 |
-
shortcode.value[index].push(firstvalue);
|
63 |
-
}
|
64 |
-
}
|
65 |
-
shortcode.value[index].push($(o).val());
|
66 |
-
}
|
67 |
-
}
|
68 |
-
} else if ( $(o).is('[type=radio]') ) {
|
69 |
-
if ( $(o).prop('checked') ) {
|
70 |
-
shortcode.key.push($(o).data('sc'));
|
71 |
-
shortcode.value.push($(o).val());
|
72 |
-
}
|
73 |
-
} else {
|
74 |
-
if( shortcode.key.indexOf( $(o).data('sc') ) == -1 ) {
|
75 |
-
shortcode.key.push($(o).data('sc'));
|
76 |
-
shortcode.value.push($(o).val());
|
77 |
-
} else {
|
78 |
-
if( $(o).val() != '' ) {
|
79 |
-
index = shortcode.key.indexOf( $(o).data('sc') );
|
80 |
-
if ( ! Array.isArray( shortcode.value[index] ) ) {
|
81 |
-
firstvalue = shortcode.value[index];
|
82 |
-
shortcode.value[index] = [];
|
83 |
-
if( firstvalue != '' ) {
|
84 |
-
shortcode.value[index].push(firstvalue);
|
85 |
-
}
|
86 |
-
}
|
87 |
-
shortcode.value[index].push($(o).val());
|
88 |
-
}
|
89 |
-
}
|
90 |
-
}
|
91 |
-
}
|
92 |
-
});
|
93 |
-
if( widget_type == 'search_box' ) {
|
94 |
-
var search_box_count = $form.find('.br_search_box_count').val();
|
95 |
-
var search_box_style = {};
|
96 |
-
var search_box_style_exist = false;
|
97 |
-
$form.find('.berocket_aapf_style_sb_sc').each( function ( i, o ) {
|
98 |
-
if( $(o).data('sc_change') ) {
|
99 |
-
search_box_style[$(o).data('sc')] = $(o).val();
|
100 |
-
search_box_style_exist = true;
|
101 |
-
}
|
102 |
-
});
|
103 |
-
if( search_box_style_exist ) {
|
104 |
-
shortcode.key.push('search_box_style');
|
105 |
-
shortcode.value.push(JSON.stringify(search_box_style));
|
106 |
-
}
|
107 |
-
|
108 |
-
var search_box_attributes = {};
|
109 |
-
var search_box_attributes_exist = false;
|
110 |
-
for( var i = 1; i <= search_box_count; i++ ) {
|
111 |
-
var $attribute_block = $form.find('.berocket_search_box_attribute_'+i);
|
112 |
-
|
113 |
-
var current_attr = {};
|
114 |
-
var current_attr_exist = false;
|
115 |
-
$attribute_block.find('.berocket_aapf_sb_attributes_sc').each( function ( i, o ) {
|
116 |
-
if( $(o).data('sc_change') ) {
|
117 |
-
current_attr[$(o).data('sc')] = $(o).val();
|
118 |
-
current_attr_exist = true;
|
119 |
-
}
|
120 |
-
});
|
121 |
-
if( current_attr_exist ) {
|
122 |
-
search_box_attributes[i] = current_attr;
|
123 |
-
search_box_attributes_exist = true;
|
124 |
-
}
|
125 |
-
}
|
126 |
-
if( search_box_attributes_exist ) {
|
127 |
-
shortcode.key.push('search_box_attributes');
|
128 |
-
shortcode.value.push(JSON.stringify(search_box_attributes));
|
129 |
-
}
|
130 |
-
}
|
131 |
-
var child_type = $form.find('.berocket_aapf_widget_child_parent_select').val();
|
132 |
-
if( widget_type == 'filter' && child_type == 'depth' ) {
|
133 |
-
var child_count = $form.find('.br_onew_child_count_select').val();
|
134 |
-
|
135 |
-
var child_onew_childs = {};
|
136 |
-
var child_onew_childs_exist = false;
|
137 |
-
for( var i = 1; i <= child_count; i++ ) {
|
138 |
-
var $child_block = $form.find('.child_onew_childs_'+i);
|
139 |
-
|
140 |
-
var current_child = {};
|
141 |
-
var current_child_exist = false;
|
142 |
-
$child_block.find('.berocket_aapf_childs_sc').each( function ( i, o ) {
|
143 |
-
if( $(o).data('sc_change') ) {
|
144 |
-
current_child[$(o).data('sc')] = $(o).val();
|
145 |
-
current_child_exist = true;
|
146 |
-
}
|
147 |
-
});
|
148 |
-
if( current_child_exist ) {
|
149 |
-
child_onew_childs[i] = current_child;
|
150 |
-
child_onew_childs_exist = true;
|
151 |
-
}
|
152 |
-
}
|
153 |
-
if( child_onew_childs_exist ) {
|
154 |
-
shortcode.key.push('child_onew_childs');
|
155 |
-
shortcode.value.push(JSON.stringify(child_onew_childs));
|
156 |
-
}
|
157 |
-
}
|
158 |
-
var br_filters = '[br_filters';
|
159 |
-
for( var i = 0; i < shortcode.key.length; i++ ) {
|
160 |
-
br_filters += ' '+shortcode.key[i]+'=\'';
|
161 |
-
if ( Array.isArray( shortcode.value[i] ) ) {
|
162 |
-
for( var j = 0; j < shortcode.value[i].length; j++ ) {
|
163 |
-
if ( j != 0 ) {
|
164 |
-
br_filters += '|';
|
165 |
-
}
|
166 |
-
br_filters += shortcode.value[i][j];
|
167 |
-
}
|
168 |
-
} else {
|
169 |
-
br_filters += shortcode.value[i];
|
170 |
-
}
|
171 |
-
br_filters += '\'';
|
172 |
-
}
|
173 |
-
br_filters += ']';
|
174 |
-
window.prompt('Shortcode',br_filters);
|
175 |
-
}
|
176 |
-
|
177 |
-
function berocket_aapf_show_hide($block, is_hide) {
|
178 |
-
if( is_hide ) {
|
179 |
-
$block.hide(0);
|
180 |
-
} else {
|
181 |
-
$block.show(0);
|
182 |
-
}
|
183 |
-
}
|
184 |
-
function berocket_aapf_hide_blocks ( $parent, args ) {
|
185 |
-
if( args.changed != undefined ) {
|
186 |
-
changed = args.changed;
|
187 |
-
} else {
|
188 |
-
changed = 'none';
|
189 |
-
}
|
190 |
-
product_cat_current = $('.berocket_aapf_product_sub_cat_current_input', $parent).prop('checked');
|
191 |
-
filter_type = $('.berocket_aapf_widget_admin_filter_type_select', $parent).val();
|
192 |
-
filter_type_data = $('.berocket_aapf_widget_admin_filter_type_select', $parent).find('option:selected').data();
|
193 |
-
attribute = $('.berocket_aapf_widget_admin_filter_type_attribute_select', $parent).val();
|
194 |
-
custom_taxonomy = $('.berocket_aapf_widget_admin_filter_type_custom_taxonomy_select', $parent).val();
|
195 |
-
|
196 |
-
berocket_aapf_show_hide( $('.berocket_aapf_widget_admin_filter_type_', $parent),
|
197 |
-
true );
|
198 |
-
if ( $('.berocket_aapf_widget_admin_filter_type_'+filter_type, $parent).hasClass('berocket_aapf_widget_admin_filter_type_'+filter_type) ) {
|
199 |
-
$('.berocket_aapf_widget_admin_filter_type_'+filter_type, $parent).show();
|
200 |
-
}
|
201 |
-
if( filter_type_data.sameas ) {
|
202 |
-
filter_type = filter_type_data.sameas;
|
203 |
-
if( filter_type_data.attribute ) {
|
204 |
-
if( filter_type_data.sameas == 'custom_taxonomy' ) {
|
205 |
-
custom_taxonomy = filter_type_data.attribute;
|
206 |
-
} else if( filter_type_data.sameas == 'attribute' ) {
|
207 |
-
attribute = filter_type_data.attribute;
|
208 |
-
}
|
209 |
-
}
|
210 |
-
}
|
211 |
-
|
212 |
-
if ( changed != 'type' && changed != 'child_parent' ) {
|
213 |
-
var select_options = '';
|
214 |
-
var select_options_variants = [];
|
215 |
-
if ( filter_type == 'tag' ) {
|
216 |
-
select_options_variants = berocket_admin_filter_types.tag;
|
217 |
-
} else if ( filter_type == 'product_cat' || ( filter_type == 'custom_taxonomy' && ( custom_taxonomy == 'product_tag' || custom_taxonomy == 'product_cat' ) ) ) {
|
218 |
-
select_options_variants = berocket_admin_filter_types.product_cat;
|
219 |
-
} else if ( filter_type == '_sale' || filter_type == '_stock_status' || filter_type == '_rating' ) {
|
220 |
-
select_options_variants = berocket_admin_filter_types.sale;
|
221 |
-
} else if ( filter_type == 'custom_taxonomy' ) {
|
222 |
-
select_options_variants = berocket_admin_filter_types.custom_taxonomy;
|
223 |
-
} else if ( filter_type == 'attribute' ) {
|
224 |
-
if ( attribute == 'price' ) {
|
225 |
-
select_options_variants = berocket_admin_filter_types.price;
|
226 |
-
} else {
|
227 |
-
select_options_variants = berocket_admin_filter_types.attribute;
|
228 |
-
}
|
229 |
-
} else if ( filter_type == 'filter_by' ) {
|
230 |
-
select_options_variants = berocket_admin_filter_types.filter_by;
|
231 |
-
}
|
232 |
-
select_options_variants.forEach(function(element) {
|
233 |
-
select_options = select_options + berocket_admin_filter_types_by_attr[element];
|
234 |
-
});
|
235 |
-
$('.berocket_aapf_widget_admin_type_select', $parent).html(select_options);
|
236 |
-
$('.berocket_aapf_widget_admin_type_select', $parent).data('sc_change', '1');
|
237 |
-
}
|
238 |
-
type = $('.berocket_aapf_widget_admin_type_select', $parent).val();
|
239 |
-
child_parent = $('.berocket_aapf_widget_child_parent_select', $parent).val();
|
240 |
-
|
241 |
-
berocket_aapf_show_hide( $('.berocket_aapf_widget_admin_operator_select', $parent).parent(),
|
242 |
-
( ( filter_type == 'attribute'
|
243 |
-
&& ( attribute == 'price' ) )
|
244 |
-
|| type == 'slider'
|
245 |
-
|| filter_type == 'date'
|
246 |
-
|| filter_type == '_sale'
|
247 |
-
|| filter_type == '_rating' ) );
|
248 |
-
berocket_aapf_show_hide( $('.br_aapf_child_parent_selector', $parent),
|
249 |
-
( ( filter_type == 'attribute'
|
250 |
-
&& attribute == 'price' )
|
251 |
-
|| filter_type == 'product_cat'
|
252 |
-
|| filter_type == '_stock_status'
|
253 |
-
|| filter_type == 'tag'
|
254 |
-
|| type == 'slider'
|
255 |
-
|| filter_type == 'date'
|
256 |
-
|| filter_type == '_sale'
|
257 |
-
|| filter_type == '_rating' ) );
|
258 |
-
berocket_aapf_show_hide( $('.berocket_ranges_block', $parent),
|
259 |
-
( filter_type != 'attribute'
|
260 |
-
|| attribute != 'price'
|
261 |
-
|| type != 'ranges' ) );
|
262 |
-
berocket_aapf_show_hide( $('.berocket_aapf_widget_admin_values_per_row', $parent).parent(),
|
263 |
-
( ( filter_type == 'attribute'
|
264 |
-
&& ( attribute == 'price' || attribute == 'product_cat' ) )
|
265 |
-
|| type == 'slider'
|
266 |
-
|| type == 'select'
|
267 |
-
|| type == 'tag_cloud'
|
268 |
-
|| filter_type == 'product_cat'
|
269 |
-
|| filter_type == 'custom_taxonomy' && custom_taxonomy == 'product_cat' ) );
|
270 |
-
berocket_aapf_show_hide( $('.berocket_aapf_widget_admin_non_price_tag_cloud', $parent),
|
271 |
-
( filter_type == 'date'
|
272 |
-
|| ( filter_type != 'date'
|
273 |
-
&& ( type == 'tag_cloud'
|
274 |
-
|| type == 'slider' ) ) ) );
|
275 |
-
berocket_aapf_show_hide( $('.berocket_aapf_widget_admin_non_price_tag_cloud_select', $parent),
|
276 |
-
( filter_type == 'date'
|
277 |
-
|| ( filter_type != 'date'
|
278 |
-
&& ( type == 'tag_cloud'
|
279 |
-
|| type == 'slider'
|
280 |
-
|| type == 'select' ) ) ) );
|
281 |
-
berocket_aapf_show_hide( $('.berocket_aapf_widget_admin_ranges_hide', $parent),
|
282 |
-
( type == 'ranges' ) );
|
283 |
-
berocket_aapf_show_hide( $('.berocket_aapf_widget_admin_price_attribute', $parent),
|
284 |
-
( filter_type != 'attribute'
|
285 |
-
|| attribute != 'price'
|
286 |
-
|| type != 'slider' ) );
|
287 |
-
berocket_aapf_show_hide( $('.berocket_aapf_advanced_color_pick_settings', $parent),
|
288 |
-
( type != 'color' && type != 'image' ) );
|
289 |
-
berocket_aapf_show_hide( $('.berocket_aapf_product_sub_cat_current', $parent),
|
290 |
-
( filter_type != 'product_cat' ) );
|
291 |
-
berocket_aapf_show_hide( $('.berocket_aapf_product_sub_cat_div', $parent),
|
292 |
-
( filter_type != 'product_cat' || product_cat_current ) );
|
293 |
-
berocket_aapf_show_hide( $('.berocket_aapf_widget_admin_tag_cloud_block', $parent),
|
294 |
-
( type != 'tag_cloud' ) );
|
295 |
-
berocket_aapf_show_hide( $('.berocket_aapf_icons_select_block', $parent),
|
296 |
-
( type == 'select' ) );
|
297 |
-
berocket_aapf_show_hide( $('.berocket_aapf_widget_child_parent_depth_block', $parent),
|
298 |
-
( child_parent != 'child' ) );
|
299 |
-
berocket_aapf_show_hide( $('.berocket_aapf_widget_child_parent_one_widget', $parent),
|
300 |
-
( child_parent != 'depth' ) );
|
301 |
-
berocket_aapf_show_hide( $('.berocket_aapf_order_values_by', $parent),
|
302 |
-
( filter_type == '_stock_status'
|
303 |
-
|| filter_type == 'attribute' && attribute == 'price'
|
304 |
-
|| filter_type == 'date'
|
305 |
-
|| filter_type == '_sale'
|
306 |
-
|| filter_type == '_rating' ) );
|
307 |
-
berocket_aapf_show_hide( $('.berocket_aapf_order_values_type', $parent),
|
308 |
-
( ( filter_type != 'attribute'
|
309 |
-
&& filter_type != 'custom_taxonomy' )
|
310 |
-
|| type == 'ranges')
|
311 |
-
&& filter_type != 'tag'
|
312 |
-
&& filter_type != '_rating' );
|
313 |
-
berocket_aapf_show_hide( $('.berocket_attributes_slider_data', $parent),
|
314 |
-
! ( ( (filter_type == 'attribute' && attribute != 'price' )
|
315 |
-
|| filter_type == 'custom_taxonomy' )
|
316 |
-
&& type == 'slider' ) );
|
317 |
-
berocket_aapf_show_hide( $('.berocket_attributes_checkbox_radio_data', $parent),
|
318 |
-
! ( ( filter_type == 'attribute' || filter_type == 'custom_taxonomy' )
|
319 |
-
&& ( type == 'checkbox' || type == 'radio' || type == 'color' || type == 'image' ) ) );
|
320 |
-
berocket_aapf_show_hide( $('.berocket_attributes_number_style_data', $parent),
|
321 |
-
! ( ( filter_type == 'attribute'
|
322 |
-
|| filter_type == 'custom_taxonomy' )
|
323 |
-
&& type == 'slider' ) );
|
324 |
-
berocket_aapf_show_hide( $('.br_type_select_block', $parent),
|
325 |
-
( filter_type == 'date' ) );
|
326 |
-
berocket_aapf_show_hide( $('.berocket_options_for_select', $parent),
|
327 |
-
( ( filter_type != 'attribute'
|
328 |
-
&& filter_type != 'custom_taxonomy'
|
329 |
-
&& filter_type != 'product_cat'
|
330 |
-
&& filter_type != 'tag' )
|
331 |
-
|| type != 'select' ) );
|
332 |
-
berocket_aapf_show_hide( $('.br_aapf_date_style_select', $parent),
|
333 |
-
( filter_type != 'date' ) );
|
334 |
-
if ( type == 'color' || type == 'image' ) {
|
335 |
-
var tax_color_name;
|
336 |
-
if ( filter_type == 'attribute' ) {
|
337 |
-
tax_color_name = attribute;
|
338 |
-
} else if ( filter_type == 'custom_taxonomy' ) {
|
339 |
-
tax_color_name = custom_taxonomy;
|
340 |
-
} else if( filter_type == 'tag' ) {
|
341 |
-
tax_color_name = 'product_tag';
|
342 |
-
} else if( filter_type == 'product_cat' ) {
|
343 |
-
tax_color_name = 'product_cat';
|
344 |
-
}
|
345 |
-
var data = {
|
346 |
-
'action': 'berocket_aapf_color_listener',
|
347 |
-
'tax_color_name': tax_color_name,
|
348 |
-
'type': type
|
349 |
-
};
|
350 |
-
$.post(ajaxurl, data, function(data) {
|
351 |
-
$('.berocket_widget_color_pick', $parent).html(data);
|
352 |
-
$('.berocket_aapf_advanced_color_pick_settings', $parent).show(0);
|
353 |
-
});
|
354 |
-
} else {
|
355 |
-
$('.berocket_widget_color_pick', $parent).text("");
|
356 |
-
}
|
357 |
-
if( args.changed == 'filter_type' || args.changed == 'attribute' || args.changed == 'custom_taxonomy' || args.changed == 'type' ) {
|
358 |
-
var taxonomy_name = false;
|
359 |
-
if( filter_type == 'product_cat' ) {
|
360 |
-
taxonomy_name = 'product_cat';
|
361 |
-
} else if( filter_type == 'tag' ) {
|
362 |
-
taxonomy_name = 'product_tag';
|
363 |
-
} else if( filter_type == 'attribute' && attribute != 'price' ) {
|
364 |
-
taxonomy_name = attribute;
|
365 |
-
} else if ( filter_type == 'custom_taxonomy' ) {
|
366 |
-
taxonomy_name = custom_taxonomy;
|
367 |
-
}
|
368 |
-
var exclude_include_name = $('.include_exclude_list', $parent).data('name');
|
369 |
-
if( taxonomy_name === false ) {
|
370 |
-
$('.include_exclude_list', $parent).text("");
|
371 |
-
$('.include_exclude_select', $parent).hide();
|
372 |
-
} else {
|
373 |
-
if( $('.include_exclude_list', $parent).length ) {
|
374 |
-
$('.include_exclude_select', $parent).show();
|
375 |
-
var data = {
|
376 |
-
'action': 'br_include_exclude_list',
|
377 |
-
'taxonomy_name': taxonomy_name,
|
378 |
-
};
|
379 |
-
$.post(ajaxurl, data, function(data) {
|
380 |
-
if( data ) {
|
381 |
-
var replace_str = /%field_name%/g;
|
382 |
-
data = data.replace(replace_str, exclude_include_name);
|
383 |
-
$('.include_exclude_list', $parent).html(data);
|
384 |
-
} else {
|
385 |
-
$('.include_exclude_list', $parent).text("");
|
386 |
-
}
|
387 |
-
});
|
388 |
-
}
|
389 |
-
}
|
390 |
-
} else {
|
391 |
-
$('.include_exclude_list', $parent).text("");
|
392 |
-
$('.include_exclude_select', $parent).hide();
|
393 |
-
}
|
394 |
-
brjsf($('.berocket_aapf_widget_admin_type_select', $parent));
|
395 |
-
}
|
396 |
-
$(document).on('change', '.berocket_aapf_widget_admin_filter_type_select', function () {
|
397 |
-
$parent = $(this).parents('.customize-control.customize-control-widget_form.widget-rendered');
|
398 |
-
if( $parent.length == 0 ) {
|
399 |
-
$parent = $(this).parents('form');
|
400 |
-
}
|
401 |
-
berocket_aapf_hide_blocks ( $parent, { changed:'filter_type' } );
|
402 |
-
});
|
403 |
-
|
404 |
-
$(document).on('change', '.berocket_aapf_widget_admin_filter_type_attribute_select', function () {
|
405 |
-
$parent = $(this).parents('.customize-control.customize-control-widget_form.widget-rendered');
|
406 |
-
if( $parent.length == 0 ) {
|
407 |
-
$parent = $(this).parents('form');
|
408 |
-
}
|
409 |
-
berocket_aapf_hide_blocks ( $parent, { changed:'attribute' } );
|
410 |
-
});
|
411 |
-
|
412 |
-
$(document).on('change', '.berocket_aapf_widget_admin_type_select', function () {
|
413 |
-
$parent = $(this).parents('.customize-control.customize-control-widget_form.widget-rendered');
|
414 |
-
if( $parent.length == 0 ) {
|
415 |
-
$parent = $(this).parents('form');
|
416 |
-
}
|
417 |
-
berocket_aapf_hide_blocks ( $parent, { changed:'type' } );
|
418 |
-
});
|
419 |
-
|
420 |
-
$(document).on('change', '.berocket_aapf_widget_admin_filter_type_custom_taxonomy_select', function () {
|
421 |
-
$parent = $(this).parents('.customize-control.customize-control-widget_form.widget-rendered');
|
422 |
-
if( $parent.length == 0 ) {
|
423 |
-
$parent = $(this).parents('form');
|
424 |
-
}
|
425 |
-
berocket_aapf_hide_blocks ( $parent, { changed:'custom_taxonomy' } );
|
426 |
-
});
|
427 |
-
|
428 |
-
$(document).on('change', '.berocket_aapf_widget_child_parent_select', function () {
|
429 |
-
$parent = $(this).parents('.customize-control.customize-control-widget_form.widget-rendered');
|
430 |
-
if( $parent.length == 0 ) {
|
431 |
-
$parent = $(this).parents('form');
|
432 |
-
}
|
433 |
-
berocket_aapf_hide_blocks ( $parent, { changed:'child_parent' } );
|
434 |
-
});
|
435 |
-
|
436 |
-
$(document).on('change', '.berocket_aapf_product_sub_cat_current_input', function () {
|
437 |
-
$parent = $(this).parents('.customize-control.customize-control-widget_form.widget-rendered');
|
438 |
-
if( $parent.length == 0 ) {
|
439 |
-
$parent = $(this).parents('form');
|
440 |
-
}
|
441 |
-
berocket_aapf_hide_blocks ( $parent, { changed:'product_cat_current' } );
|
442 |
-
});
|
443 |
-
|
444 |
-
$(document).on('change', '.berocket_aapf_checked_show_next', function () {
|
445 |
-
if($(this).find('input[type=checkbox]').attr('checked') == 'checked') {
|
446 |
-
$(this).next().show(0);
|
447 |
-
} else {
|
448 |
-
$(this).next().hide(0);
|
449 |
-
}
|
450 |
-
});
|
451 |
-
|
452 |
-
$(document).on('change', '.include_exclude_select select', function() {
|
453 |
-
if( $(this).val() ) {
|
454 |
-
$('.include_exclude_list').show();
|
455 |
-
} else {
|
456 |
-
$('.include_exclude_list').hide();
|
457 |
-
}
|
458 |
-
});
|
459 |
-
|
460 |
-
$(document).on('click', '.berocket_aapf_advanced_settings_pointer', function (event) {
|
461 |
-
event.preventDefault();
|
462 |
-
$next = $(this).parent().next();
|
463 |
-
if ( $next.is(':visible') ) {
|
464 |
-
$next.slideUp(300);
|
465 |
-
} else {
|
466 |
-
$next.slideDown(300);
|
467 |
-
}
|
468 |
-
});
|
469 |
-
|
470 |
-
$(document).on('click', '.berocket_aapf_output_limitations_pointer', function (event) {
|
471 |
-
event.preventDefault();
|
472 |
-
$next = $(this).parent().next();
|
473 |
-
if ( $next.is(':visible') ) {
|
474 |
-
$next.slideUp(300);
|
475 |
-
} else {
|
476 |
-
$next.slideDown(300);
|
477 |
-
}
|
478 |
-
});
|
479 |
-
|
480 |
-
$('.br_colorpicker_field').each(function (i,o){
|
481 |
-
if( typeof($(o).colpick) != 'undefined' ) {
|
482 |
-
$(o).css('backgroundColor', '#'+$(o).data('color'));
|
483 |
-
$(o).colpick({
|
484 |
-
layout: 'hex',
|
485 |
-
submit: 0,
|
486 |
-
color: '#'+$(o).data('color'),
|
487 |
-
onChange: function(hsb,hex,rgb,el,bySetColor) {
|
488 |
-
$(el).removeClass('colorpicker_removed');
|
489 |
-
$(el).css('backgroundColor', '#'+hex).next().val(hex).trigger('change');
|
490 |
-
}
|
491 |
-
})
|
492 |
-
}
|
493 |
-
});
|
494 |
-
|
495 |
-
$(document).on('click', '.theme_default', function (event) {
|
496 |
-
event.preventDefault();
|
497 |
-
$(this).prev().prev().css('backgroundColor', '#000000').colpickSetColor('#000000');
|
498 |
-
$(this).prev().val('');
|
499 |
-
});
|
500 |
-
|
501 |
-
$(document).on('click', '.all_theme_default', function (event) {
|
502 |
-
event.preventDefault();
|
503 |
-
$table = $(this).parents('table');
|
504 |
-
$table.find('.br_colorpicker_field').css('backgroundColor', '#000000').colpickSetColor('#000000');
|
505 |
-
$table.find('.br_colorpicker_field').next().val('');
|
506 |
-
$table.find('select').val("");
|
507 |
-
$table.find('input[type=text]').val("");
|
508 |
-
});
|
509 |
-
|
510 |
-
$('.filter_settings_tabs').on('click', 'a', function (event) {
|
511 |
-
if( ! $(this).is('.link-tab') ) {
|
512 |
-
event.preventDefault();
|
513 |
-
$('#br_opened_tab').val( $(this).attr('href').replace('#', '') );
|
514 |
-
$id = $(this).attr('href');
|
515 |
-
$('.tab-item.current').removeClass('current');
|
516 |
-
$($id).addClass('current');
|
517 |
-
|
518 |
-
$('.filter_settings_tabs .nav-tab').removeClass('nav-tab-active');
|
519 |
-
$(this).addClass('nav-tab-active');
|
520 |
-
}
|
521 |
-
});
|
522 |
-
|
523 |
-
$(document).on('change', '.berocket_aapf_widget_admin_widget_type_select', function () {
|
524 |
-
$parent = $(this).parents('form');
|
525 |
-
if ( $(this).val() == 'filter' ) {
|
526 |
-
$('.berocket_aapf_admin_filter_widget_content', $parent).show();
|
527 |
-
$('.berocket_aapf_admin_widget_selected_area', $parent).hide();
|
528 |
-
$('.berocket_aapf_admin_search_box', $parent).hide();
|
529 |
-
$('.berocket_product_category_value_limit, .berocket_widget_output_limitation_block', $parent).show();
|
530 |
-
$('.berocket_widget_reset_button_block', $parent).hide();
|
531 |
-
} else if( $(this).val() == 'update_button' ) {
|
532 |
-
$('.berocket_aapf_admin_filter_widget_content', $parent).hide();
|
533 |
-
$('.berocket_aapf_admin_widget_selected_area', $parent).hide();
|
534 |
-
$('.berocket_aapf_admin_search_box', $parent).hide();
|
535 |
-
$('.berocket_product_category_value_limit, .berocket_widget_output_limitation_block', $parent).hide();
|
536 |
-
$('.berocket_widget_reset_button_block', $parent).hide();
|
537 |
-
} else if( $(this).val() == 'reset_button' ) {
|
538 |
-
$('.berocket_aapf_admin_filter_widget_content', $parent).hide();
|
539 |
-
$('.berocket_aapf_admin_widget_selected_area', $parent).hide();
|
540 |
-
$('.berocket_aapf_admin_search_box', $parent).hide();
|
541 |
-
$('.berocket_product_category_value_limit, .berocket_widget_output_limitation_block', $parent).hide();
|
542 |
-
$('.berocket_widget_reset_button_block', $parent).show();
|
543 |
-
} else if( $(this).val() == 'selected_area' ) {
|
544 |
-
$('.berocket_aapf_admin_filter_widget_content', $parent).hide();
|
545 |
-
$('.berocket_aapf_admin_search_box', $parent).hide();
|
546 |
-
$('.berocket_aapf_admin_widget_selected_area', $parent).show();
|
547 |
-
$('.berocket_product_category_value_limit, .berocket_widget_output_limitation_block', $parent).hide();
|
548 |
-
$('.berocket_widget_reset_button_block', $parent).hide();
|
549 |
-
} else if( $(this).val() == 'search_box' ) {
|
550 |
-
$('.berocket_aapf_admin_filter_widget_content', $parent).hide();
|
551 |
-
$('.berocket_aapf_admin_widget_selected_area', $parent).hide();
|
552 |
-
$('.berocket_aapf_admin_search_box', $parent).show();
|
553 |
-
$('.berocket_product_category_value_limit, .berocket_widget_output_limitation_block', $parent).hide();
|
554 |
-
$('.berocket_widget_reset_button_block', $parent).hide();
|
555 |
-
}
|
556 |
-
});
|
557 |
-
$(document).on('change', '.berocket_scroll_shop_top', function () {
|
558 |
-
if ( $(this).prop('checked') ) {
|
559 |
-
$(this).parent().next().show();
|
560 |
-
} else {
|
561 |
-
$(this).parent().next().hide();
|
562 |
-
}
|
563 |
-
});
|
564 |
-
$(document).on('click', '.berocket_aapf_font_awesome_icon_select',function(event) {
|
565 |
-
event.preventDefault();
|
566 |
-
$(this).next('.berocket_aapf_select_icon').show();
|
567 |
-
});
|
568 |
-
$(document).on('click', '.berocket_aapf_select_icon',function(event) {
|
569 |
-
event.preventDefault();
|
570 |
-
$(this).hide();
|
571 |
-
});
|
572 |
-
$(document).on('click', '.berocket_aapf_select_icon div p i.fa',function(event) {
|
573 |
-
event.preventDefault();
|
574 |
-
$(this).parents('.berocket_aapf_select_icon').hide();
|
575 |
-
});
|
576 |
-
$(document).on('click', '.berocket_aapf_select_icon div',function(event) {
|
577 |
-
event.preventDefault();
|
578 |
-
event.stopPropagation()
|
579 |
-
});
|
580 |
-
$(document).on('click', '.berocket_aapf_select_icon label',function(event) {
|
581 |
-
event.preventDefault();
|
582 |
-
$(this).parents('.berocket_aapf_select_icon').prevAll(".berocket_aapf_icon_text_value").val($(this).find('span').data('value'));
|
583 |
-
$(this).parents('.berocket_aapf_select_icon').prevAll(".berocket_aapf_selected_icon_show").html('<i class="fa '+$(this).find('span').data('value')+'"></i>');
|
584 |
-
$(this).parents('.berocket_aapf_select_icon').hide();
|
585 |
-
});
|
586 |
-
$(document).on('click', '.berocket_aapf_upload_icon', function(e) {
|
587 |
-
e.preventDefault();
|
588 |
-
$p = $(this);
|
589 |
-
var custom_uploader = wp.media({
|
590 |
-
title: 'Select custom Icon',
|
591 |
-
button: {
|
592 |
-
text: 'Set Icon'
|
593 |
-
},
|
594 |
-
multiple: false
|
595 |
-
}).on('select', function() {
|
596 |
-
var attachment = custom_uploader.state().get('selection').first().toJSON();
|
597 |
-
$p.prevAll(".berocket_aapf_selected_icon_show").html('<i class="fa"><image src="'+attachment.url+'" alt=""></i>');
|
598 |
-
$p.prevAll(".berocket_aapf_icon_text_value").val(attachment.url);
|
599 |
-
}).open();
|
600 |
-
});
|
601 |
-
$(document).on('click', '.berocket_aapf_remove_icon',function(event) {
|
602 |
-
event.preventDefault();
|
603 |
-
$(this).prevAll(".berocket_aapf_icon_text_value").val("");
|
604 |
-
$(this).prevAll(".berocket_aapf_selected_icon_show").html("");
|
605 |
-
});
|
606 |
-
br_widget_set();
|
607 |
-
$(document).on( 'change', '.br_theme_set_select', function(event) {
|
608 |
-
var $parent = $(this).parents('.br_checkbox_radio_settings');
|
609 |
-
var $data = $(this).find('option:selected').data();
|
610 |
-
var $color = '000000';
|
611 |
-
if( ! $data['border_color'] ) {
|
612 |
-
$color = '000000';
|
613 |
-
} else {
|
614 |
-
$color = $data['border_color'];
|
615 |
-
}
|
616 |
-
$parent.find('.br_border_color_set').prev().css('backgroundColor', '#' + $color).colpickSetColor('#' + $color);
|
617 |
-
$parent.find('.br_border_color_set').val( $data['border_color'] );
|
618 |
-
if( ! $data['font_color'] ) {
|
619 |
-
$color = '000000';
|
620 |
-
} else {
|
621 |
-
$color = $data['font_color'];
|
622 |
-
}
|
623 |
-
$parent.find('.br_font_color_set').prev().css('backgroundColor', '#' + $color).colpickSetColor('#' + $color);
|
624 |
-
$parent.find('.br_font_color_set').val( $data['font_color'] );
|
625 |
-
if( ! $data['background'] ) {
|
626 |
-
$color = '000000';
|
627 |
-
} else {
|
628 |
-
$color = $data['background'];
|
629 |
-
}
|
630 |
-
$parent.find('.br_background_set').prev().css('backgroundColor', '#' + $color).colpickSetColor('#' + $color);
|
631 |
-
$parent.find('.br_background_set').val( $data['background'] );
|
632 |
-
$parent.find('.br_border_width_set').val( $data['border_width'] );
|
633 |
-
$parent.find('.br_border_radius_set').val( $data['border_radius'] );
|
634 |
-
$parent.find('.br_size_set').val( $data['size'] );
|
635 |
-
$parent.find('.br_icon_set').val( $data['icon'] );
|
636 |
-
});
|
637 |
-
$(document).on( 'change', '.br_checkbox_radio_settings input, .br_checkbox_radio_settings select', function(event) {
|
638 |
-
if( ! $(this).is( '.br_theme_set_select' ) ) {
|
639 |
-
$(this).parents('.br_checkbox_radio_settings').find('.br_theme_set_select').val('');
|
640 |
-
}
|
641 |
-
});
|
642 |
-
$(document).on('click', '.berocket_remove_ranges',function(event) {
|
643 |
-
event.preventDefault();
|
644 |
-
$(this).parents('.berocket_ranges').remove();
|
645 |
-
});
|
646 |
-
$(document).on('click', '.berocket_add_ranges',function(event) {
|
647 |
-
event.preventDefault();
|
648 |
-
$(this).before($(this).data('html'));
|
649 |
-
});
|
650 |
-
$(document).on('change', '.br_onew_child_count_select', function() {
|
651 |
-
var child_count = $(this).val();
|
652 |
-
$('.child_onew_childs_settings').hide();
|
653 |
-
$parents = $(this).parents('.berocket_aapf_widget_child_parent_one_widget');
|
654 |
-
for( var i = 1; i <= child_count; i++, $parents ) {
|
655 |
-
$('.child_onew_childs_'+i).show();
|
656 |
-
}
|
657 |
-
});
|
658 |
-
$(document).on('change', '.br_search_box_count', function() {
|
659 |
-
var $parent = $(this).parents('.berocket_aapf_admin_search_box');
|
660 |
-
for(i = 1; i < 11; i++ ) {
|
661 |
-
if( i <= $(this).val() ) {
|
662 |
-
$parent.find('.berocket_search_box_attribute_'+i).show();
|
663 |
-
} else {
|
664 |
-
$parent.find('.berocket_search_box_attribute_'+i).hide();
|
665 |
-
}
|
666 |
-
}
|
667 |
-
});
|
668 |
-
$(document).on('change', '.br_search_box_attribute_type', function() {
|
669 |
-
var $parent = $(this).parents('.br_search_box_attribute_block');
|
670 |
-
$parent.find('.br_search_box_attribute_attribute_block').hide();
|
671 |
-
$parent.find('.br_search_box_attribute_custom_taxonomy_block').hide();
|
672 |
-
if( $(this).val() == 'attribute' ) {
|
673 |
-
$parent.find('.br_search_box_attribute_attribute_block').show();
|
674 |
-
} else if( $(this).val() == 'custom_taxonomy' ) {
|
675 |
-
$parent.find('.br_search_box_attribute_custom_taxonomy_block').show();
|
676 |
-
}
|
677 |
-
});
|
678 |
-
$(document).on('change', '.berocket_search_link_select', function() {
|
679 |
-
var $parent = $(this).parents('.berocket_aapf_admin_search_box');
|
680 |
-
$parent.find('.berocket_search_link').hide();
|
681 |
-
$parent.find('.berocket_search_link_'+$(this).val()).show();
|
682 |
-
});
|
683 |
-
$(document).on('change', '.berocket_attributes_number_style', function() {
|
684 |
-
var $parent = $(this).parents('.berocket_attributes_number_style_data');
|
685 |
-
if( $(this).prop('checked') ) {
|
686 |
-
$parent.find('.berocket_attributes_number_styles').show();
|
687 |
-
} else {
|
688 |
-
$parent.find('.berocket_attributes_number_styles').hide();
|
689 |
-
}
|
690 |
-
});
|
691 |
-
$(document).on('change', '.berocket_seo_friendly_urls', berocket_change_seo_friendly_urls);
|
692 |
-
$(document).on('change', '.berocket_nice_url', berocket_change_seo_friendly_urls);
|
693 |
-
$(document).on('change', '.berocket_seo_meta_title', berocket_change_seo_meta_title);
|
694 |
-
$(document).on('change', '.berocket_use_links_filters', berocket_change_use_links_filters);
|
695 |
-
berocket_change_seo_friendly_urls();
|
696 |
-
berocket_change_seo_meta_title();
|
697 |
-
berocket_change_use_links_filters();
|
698 |
-
})
|
699 |
-
})(jQuery);
|
700 |
-
function berocket_change_seo_friendly_urls() {
|
701 |
-
if( jQuery('.berocket_seo_friendly_urls').prop('checked') ) {
|
702 |
-
jQuery('.berocket_use_slug_in_url').parents('tr').first().show();
|
703 |
-
jQuery('.berocket_use_links_filters').parents('tr').first().show();
|
704 |
-
jQuery('.berocket_nice_url').parents('tr').first().show();
|
705 |
-
jQuery('.berocket_uri_decode').parents('tr').first().show();
|
706 |
-
} else {
|
707 |
-
jQuery('.berocket_use_slug_in_url').prop('checked', false);
|
708 |
-
jQuery('.berocket_nice_url').prop('checked', false);
|
709 |
-
jQuery('.berocket_use_links_filters').prop('checked', false);
|
710 |
-
jQuery('.berocket_use_slug_in_url').parents('tr').first().hide();
|
711 |
-
jQuery('.berocket_use_links_filters').parents('tr').first().hide();
|
712 |
-
jQuery('.berocket_nice_url').parents('tr').first().hide();
|
713 |
-
jQuery('.berocket_uri_decode').parents('tr').first().hide();
|
714 |
-
}
|
715 |
-
if( jQuery('.berocket_seo_friendly_urls').prop('checked') && jQuery('.berocket_nice_url').prop('checked') ) {
|
716 |
-
jQuery('.berocket_canonicalization').parents('tr').first().show();
|
717 |
-
} else {
|
718 |
-
jQuery('.berocket_canonicalization').prop('checked', false);
|
719 |
-
jQuery('.berocket_canonicalization').parents('tr').first().hide();
|
720 |
-
}
|
721 |
-
}
|
722 |
-
function berocket_change_seo_meta_title() {
|
723 |
-
if( jQuery('.berocket_seo_meta_title').prop('checked') ) {
|
724 |
-
jQuery('.berocket_seo_meta_title_elements').show();
|
725 |
-
} else {
|
726 |
-
jQuery('.berocket_seo_meta_title_elements').hide();
|
727 |
-
}
|
728 |
-
}
|
729 |
-
function berocket_change_use_links_filters() {
|
730 |
-
if( jQuery('.berocket_use_links_filters').prop('checked') ) {
|
731 |
-
jQuery('.berocket_use_noindex').show();
|
732 |
-
jQuery('.berocket_use_nofollow').show();
|
733 |
-
} else {
|
734 |
-
jQuery('.berocket_use_noindex').hide();
|
735 |
-
jQuery('.berocket_use_nofollow').hide();
|
736 |
-
}
|
737 |
-
}
|
738 |
-
var br_widget_setted = false;
|
739 |
-
function br_widget_set() {
|
740 |
-
if ( br_widget_setted !== false ) {
|
741 |
-
clearTimeout( br_widget_setted );
|
742 |
-
}
|
743 |
-
br_widget_setted = setTimeout( function () {
|
744 |
-
if( typeof(brjsf) != 'undefined' && jQuery.isFunction(brjsf) && jQuery.isFunction(brjsf_accordion) ) {
|
745 |
-
brjsf(jQuery( ".br_select_menu_left" ));
|
746 |
-
brjsf(jQuery( ".br_select_menu_right" ));
|
747 |
-
brjsf_accordion(jQuery( ".br_accordion" ));
|
748 |
-
jQuery('.berocket_aapf_widget_admin_widget_type_select').parents('.editwidget').first().css('width', 'initial');
|
749 |
-
} else {
|
750 |
-
br_widget_set();
|
751 |
-
}
|
752 |
-
br_widget_setted = false;
|
753 |
-
}, 400);
|
754 |
-
}
|
755 |
-
var br_saved_timeout;
|
756 |
-
var br_savin_ajax = false;
|
757 |
-
(function ($){
|
758 |
-
$(document).ready( function () {
|
759 |
-
$(document).on('click', '.br_aapf_settings_fa .berocket_upload_image', function(e) {
|
760 |
-
e.preventDefault();
|
761 |
-
$p = $(this);
|
762 |
-
var custom_uploader = wp.media({
|
763 |
-
title: 'Select custom Icon',
|
764 |
-
button: {
|
765 |
-
text: 'Set Icon'
|
766 |
-
},
|
767 |
-
multiple: false
|
768 |
-
}).on('select', function() {
|
769 |
-
var attachment = custom_uploader.state().get('selection').first().toJSON();
|
770 |
-
$p.prevAll(".berocket_selected_image").html('<image src="'+attachment.url+'" alt="">').show();
|
771 |
-
$p.prevAll(".berocket_image_value").val(attachment.url);
|
772 |
-
}).open();
|
773 |
-
});
|
774 |
-
$(document).on('click', '.br_aapf_settings_fa .berocket_remove_image',function(event) {
|
775 |
-
event.preventDefault();
|
776 |
-
$(this).prevAll(".berocket_image_value").val("");
|
777 |
-
$(this).prevAll(".berocket_selected_image").html("").hide();
|
778 |
-
});
|
779 |
-
var berocket_fa_select_for = $('.berocket_fa_dark');
|
780 |
-
$(document).on('click', '.br_aapf_settings_fa .berocket_select_fontawesome .berocket_select_fa',function(event) {
|
781 |
-
event.preventDefault();
|
782 |
-
berocket_fa_select_for = $(this);
|
783 |
-
$('.berocket_fa_dark').not(':first').remove();
|
784 |
-
var $html = $('<div class="berocket_select_fontawesome"></div>');
|
785 |
-
$html.append($('.berocket_fa_dark'));
|
786 |
-
var $html2 = $('<div class="br_aapf_settings_fa"></div>');
|
787 |
-
$html2.append($html);
|
788 |
-
$('body').children('.br_aapf_settings_fa').remove();
|
789 |
-
$('body').append($html2);
|
790 |
-
$('.berocket_fa_dark').show();
|
791 |
-
});
|
792 |
-
$(document).on('hover', '.br_aapf_settings_fa .berocket_select_fontawesome .berocket_fa_hover', function() {
|
793 |
-
var window_width = $(window).width();
|
794 |
-
window_width = window_width / 2;
|
795 |
-
var $this = $(this).parents('.berocket_fa_icon');
|
796 |
-
if( $this.offset().left < window_width ) {
|
797 |
-
$this.find('.berocket_fa_preview').css({left: '0', right: 'initial'});
|
798 |
-
$this.find('.berocket_fa_preview span').appendTo($this.find('.berocket_fa_preview'));
|
799 |
-
} else {
|
800 |
-
$this.find('.berocket_fa_preview').css({left: 'initial', right: '0'});
|
801 |
-
$this.find('.berocket_fa_preview .fa').appendTo($this.find('.berocket_fa_preview'));
|
802 |
-
}
|
803 |
-
});
|
804 |
-
$(document).on('click', '.br_aapf_settings_fa .berocket_select_fontawesome .berocket_fa_hover',function(event) {
|
805 |
-
event.preventDefault();
|
806 |
-
var value = $(this).parents('.berocket_fa_icon').first().find('.berocket_fa_preview span').text();
|
807 |
-
$(berocket_fa_select_for).parents('.berocket_select_fontawesome').find('.berocket_fa_value').val(value);
|
808 |
-
$(berocket_fa_select_for).parents('.berocket_select_fontawesome').find('.berocket_selected_fa').html('<i class="fa '+value+'"></i>');
|
809 |
-
$('.berocket_fa_dark').hide();
|
810 |
-
});
|
811 |
-
$(document).on('click', '.br_aapf_settings_fa .berocket_select_fontawesome .berocket_remove_fa',function(event) {
|
812 |
-
event.preventDefault();
|
813 |
-
$(this).parents('.berocket_select_fontawesome').find('.berocket_fa_value').val('');
|
814 |
-
$(this).parents('.berocket_select_fontawesome').find('.berocket_selected_fa').html('');
|
815 |
-
});
|
816 |
-
$(document).on('keyup', '.br_aapf_settings_fa .berocket_select_fontawesome .berocket_fa_search', function() {
|
817 |
-
var $parent = $(this).parents('.berocket_select_fontawesome').first();
|
818 |
-
var value = $(this).val();
|
819 |
-
value = value.replace(/\s+/g, '');
|
820 |
-
value = value.toLowerCase();
|
821 |
-
if( value.length >=1 ) {
|
822 |
-
$parent.find('.berocket_fa_icon').hide();
|
823 |
-
$parent.find('.berocket_fa_preview span:contains("'+value+'")').parents('.berocket_fa_icon').show();
|
824 |
-
} else {
|
825 |
-
$parent.find('.berocket_fa_icon').show();
|
826 |
-
}
|
827 |
-
});
|
828 |
-
$(document).on('click', '.br_aapf_settings_fa .berocket_select_fontawesome .berocket_fa_dark',function(event) {
|
829 |
-
event.preventDefault();
|
830 |
-
$(this).hide();
|
831 |
-
});
|
832 |
-
$(document).on('click', '.br_aapf_settings_fa .berocket_select_fontawesome .berocket_fa_dark .berocket_fa_close',function(event) {
|
833 |
-
event.preventDefault();
|
834 |
-
$(this).parents('.berocket_fa_dark').hide();
|
835 |
-
});
|
836 |
-
$(document).on('click', '.br_aapf_settings_fa .berocket_select_fontawesome .berocket_fa_popup',function(event) {
|
837 |
-
event.preventDefault();
|
838 |
-
event.stopPropagation();
|
839 |
-
});
|
840 |
-
$(document).on('click', '.berocket_generate_new_filter_from_old', function(event) {
|
841 |
-
event.preventDefault();
|
842 |
-
var form_data = $(this).parents('form').first().serialize();
|
843 |
-
form_data = 'action=aapf_generate_new_filter&'+form_data;
|
844 |
-
$.post(ajaxurl, form_data, function (data) {
|
845 |
-
if( data != 'error' ) {
|
846 |
-
location.href = data;
|
847 |
-
}
|
848 |
-
});
|
849 |
-
});
|
850 |
-
jQuery('#widget-1_berocket_aapf_widget-__i__, #widget-2_berocket_aapf_widget-__i__, #widget-3_berocket_aapf_widget-__i__, #widget-4_berocket_aapf_widget-__i__, #widget-5_berocket_aapf_widget-__i__, #widget-6_berocket_aapf_widget-__i__, #widget-7_berocket_aapf_widget-__i__, #widget-8_berocket_aapf_widget-__i__').remove();
|
851 |
-
$(document).on('click', '.berocket_create_new', function(event) {
|
852 |
-
event.preventDefault();
|
853 |
-
var $this = $(this);
|
854 |
-
var data = $(this).data();
|
855 |
-
$.post(ajaxurl, data, function(html) {
|
856 |
-
var parent = $this.parents('form').first();
|
857 |
-
if( $this.parents('.widget').length ) {
|
858 |
-
parent = $this.parents('.widget').first();
|
859 |
-
}
|
860 |
-
parent.css('position', 'relative');
|
861 |
-
parent.append($(html));
|
862 |
-
berocket_add_submit_function_to_element();
|
863 |
-
});
|
864 |
-
});
|
865 |
-
function berocket_add_submit_function_to_element() {
|
866 |
-
$('.berocket_simple_filter_creation:not(.berocket_submit_event_added)').on('submit', function(event) {
|
867 |
-
event.preventDefault();
|
868 |
-
$this = $(this);
|
869 |
-
var form_data = $this.serialize();
|
870 |
-
$.post($this.attr('action'), form_data, function(result) {
|
871 |
-
if( typeof(window[$this.data('function')]) == 'function' ) {
|
872 |
-
window[$this.data('function')]($this, result);
|
873 |
-
}
|
874 |
-
}, 'json');
|
875 |
-
}).addClass('berocket_submit_event_added');
|
876 |
-
}
|
877 |
-
$(document).on('click', '.berocket_simple_filter_creation .berocket_simple_close', function(event) {
|
878 |
-
event.preventDefault();
|
879 |
-
$(this).parents('.berocket_simple_filter_creation').remove();
|
880 |
-
});
|
881 |
-
$(document).on('change', '.berocket_new_widget_selectbox', function() {
|
882 |
-
var edit = $(this).find('option:selected').data('edit');
|
883 |
-
if( typeof(edit) != 'undefined' && edit ) {
|
884 |
-
$(this).next('.berocket_aapf_edit_post_link').attr('href', edit).show();
|
885 |
-
} else {
|
886 |
-
$(this).next('.berocket_aapf_edit_post_link').hide();
|
887 |
-
}
|
888 |
-
});
|
889 |
-
});
|
890 |
-
})(jQuery);
|
891 |
-
function berocket_semple_creation_single_return($this, data) {
|
892 |
-
var $widget = $this.parent();
|
893 |
-
jQuery('.berocket_new_widget_selectbox.single').append('<option data-name="'+data.name2+'" data-edit="'+data.edit+'" value="'+data.value+'">'+data.name+'</option>');
|
894 |
-
$widget.find('.berocket_new_widget_selectbox.single').val(data.value).trigger('change');
|
895 |
-
$this.remove();
|
896 |
-
}
|
897 |
-
function berocket_semple_creation_group_return($this, data) {
|
898 |
-
var $widget = $this.parent();
|
899 |
-
jQuery('.berocket_new_widget_selectbox.group').append('<option data-edit="'+data.edit+'" value="'+data.value+'">'+data.name+'</option>');
|
900 |
-
$widget.find('.berocket_new_widget_selectbox.group').val(data.value).trigger('change');
|
901 |
-
$this.remove();
|
902 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
addons/deprecated_filters/deprecated_filters.php
DELETED
@@ -1,658 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
class BeRocket_aapf_deprecated_compat_addon extends BeRocket_framework_addon_lib {
|
3 |
-
public $addon_file = __FILE__;
|
4 |
-
public $plugin_name = 'ajax_filters';
|
5 |
-
public $php_file_name = 'display_widget';
|
6 |
-
function get_addon_data() {
|
7 |
-
$data = parent::get_addon_data();
|
8 |
-
return array_merge($data, array(
|
9 |
-
'addon_name' => __('Deprecated Filters', 'BeRocket_AJAX_domain'),
|
10 |
-
'deprecated' => true,
|
11 |
-
'tooltip' => __('<span style="color: red;">IT WILL BE REMOVED IN THE FUTURE</span><br>Temporary compatibility with older filters', 'BeRocket_AJAX_domain')
|
12 |
-
));
|
13 |
-
}
|
14 |
-
function init_active() {
|
15 |
-
parent::init_active();
|
16 |
-
add_filter('BeRocket_AAPF_widget_load_file', array($this, 'disable_file'));
|
17 |
-
add_filter('BRAAPF_single_filter_settings_meta_use', array($this, 'settings_meta'), 10, 3);
|
18 |
-
add_filter('BRAAPF_single_filter_settings_enqueue_scripts', array($this, 'enqueue_scripts'), 10, 1);
|
19 |
-
add_action( 'braapf_register_frontend_assets', array( $this, 'init_scripts' ), 9999999999 );
|
20 |
-
add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_additional_scripts' ) );
|
21 |
-
foreach (glob(__DIR__ . "/display_filter/*.php") as $filename)
|
22 |
-
{
|
23 |
-
include_once($filename);
|
24 |
-
}
|
25 |
-
add_action('wp', array($this, 'wp'));
|
26 |
-
add_filter('brfr_data_ajax_filters', array($this, 'settings_page'));
|
27 |
-
add_filter('brfr_ajax_filters_prevent_disable', array($this, 'section_prevent_disable'), 10, 3);
|
28 |
-
add_filter( 'berocket_filter_filter_type_array', array($this, 'filter_filter_type_array'), 20 );
|
29 |
-
add_filter( 'brfr_data_ajax_filters', array($this, 'plugin_settings_page'), 50) ;
|
30 |
-
add_filter( 'brfr_ajax_filters_old_design', array($this, 'section_old_design'), 50, 3) ;
|
31 |
-
add_filter( 'ajax_filters_get_template_part', array($this, 'deprecated_template_get'), 10, 2 );
|
32 |
-
add_filter( 'aapf_localize_widget_script', array($this, 'js_data_fix'), 9000000 );
|
33 |
-
add_action( 'bapf_search_button_meta_box', array($this, 'search_box_settings'), 10, 2 );
|
34 |
-
add_filter( 'berocket_aapf_group_before_all', array($this, 'search_box_before_group_start'), 11, 2 );
|
35 |
-
add_filter( 'berocket_aapf_group_after_all', array($this, 'search_box_after_group_end'), 9, 2 );
|
36 |
-
add_filter( 'BeRocket_AAPF_getall_Template_Styles', array($this, 'remove_new_templates'), 9000000 );
|
37 |
-
add_filter( 'braapf_custom_user_css_replacement', array($this, 'custom_user_css_replacement') );
|
38 |
-
update_option('braapf_new_filters_converted', false);
|
39 |
-
if( (! empty($_GET['page']) && $_GET['page'] == 'br-product-filters' )
|
40 |
-
|| (! empty($_GET['post_type']) && in_array($_GET['post_type'], array('br_product_filter', 'br_filters_group'))) ) {
|
41 |
-
add_filter('berocket_display_additional_notices', array($this, 'deprecated_notice'));
|
42 |
-
}
|
43 |
-
}
|
44 |
-
function deprecated_notice($notices) {
|
45 |
-
$notices[] = array(
|
46 |
-
'start' => 0,
|
47 |
-
'end' => 0,
|
48 |
-
'name' => 'aapf_remove_deprecated_filters',
|
49 |
-
'html' => 'AJAX Product Filters. Deprecated Filters add-on enabled on your site, but it will be removed in near future. You can disable Deprecated Filters in <a href="'.admin_url('admin.php?page=br-product-filters&tab=addons').'">Plugin settings -> Add-ons tab</a>',
|
50 |
-
'righthtml' => '',
|
51 |
-
'rightwidth' => 0,
|
52 |
-
'nothankswidth' => 0,
|
53 |
-
'contentwidth' => 1600,
|
54 |
-
'subscribe' => false,
|
55 |
-
'priority' => 10,
|
56 |
-
'height' => 70,
|
57 |
-
'repeat' => false,
|
58 |
-
'repeatcount' => 1,
|
59 |
-
'image' => array(
|
60 |
-
'local' => plugin_dir_url( BeRocket_AJAX_filters_file ) . 'images/attention.png',
|
61 |
-
),
|
62 |
-
);
|
63 |
-
return $notices;
|
64 |
-
}
|
65 |
-
function wp() {
|
66 |
-
$BeRocket_AAPF = BeRocket_AAPF::getInstance();
|
67 |
-
$option = $BeRocket_AAPF->get_option();
|
68 |
-
if ( ! empty($option['selected_area_show']) ) {
|
69 |
-
add_action ( br_get_value_from_array($option, 'elements_position_hook', 'woocommerce_archive_description'), array($this, 'selected_area'), 1 );
|
70 |
-
remove_action ( br_get_value_from_array($option, 'elements_position_hook', 'woocommerce_archive_description'), array($BeRocket_AAPF, 'selected_area'), 1 );
|
71 |
-
}
|
72 |
-
}
|
73 |
-
function disable_file($isload) {
|
74 |
-
return false;
|
75 |
-
}
|
76 |
-
function enqueue_additional_scripts() {
|
77 |
-
wp_register_script( 'berocket_aapf_widget-tag_cloud', plugins_url( 'j.doe.cloud.min.js', __FILE__ ), array( 'jquery-ui-core' ), BeRocket_AJAX_filters_version );
|
78 |
-
}
|
79 |
-
function enqueue_scripts($enqueue) {
|
80 |
-
BeRocket_AAPF::wp_enqueue_script('braapf-deprecated-admin-js', plugins_url( '/admin.js', __FILE__ ), array('jquery') );
|
81 |
-
wp_localize_script(
|
82 |
-
'braapf-deprecated-admin-js',
|
83 |
-
'aapf_admin_text',
|
84 |
-
array(
|
85 |
-
'checkbox_text' => __('Checkbox', 'BeRocket_AJAX_domain'),
|
86 |
-
'radio_text' => __('Radio', 'BeRocket_AJAX_domain'),
|
87 |
-
'select_text' => __('Select', 'BeRocket_AJAX_domain'),
|
88 |
-
'color_text' => __('Color', 'BeRocket_AJAX_domain'),
|
89 |
-
'image_text' => __('Image', 'BeRocket_AJAX_domain'),
|
90 |
-
'slider_text' => __('Slider', 'BeRocket_AJAX_domain'),
|
91 |
-
'tag_cloud_text' => __('Tag cloud', 'BeRocket_AJAX_domain'),
|
92 |
-
)
|
93 |
-
);
|
94 |
-
return false;
|
95 |
-
}
|
96 |
-
function settings_meta($isuse, $clthis, $post) {
|
97 |
-
$instance = $clthis->get_option($post->ID);
|
98 |
-
$post_name = $clthis->post_name;
|
99 |
-
include "filter_post.php";
|
100 |
-
return false;
|
101 |
-
}
|
102 |
-
function init_scripts() {
|
103 |
-
wp_deregister_script('berocket_aapf_widget-script');
|
104 |
-
wp_deregister_style('berocket_aapf_widget-style');
|
105 |
-
wp_register_script( 'berocket_aapf_widget-script', plugins_url( 'widget.min.js', __FILE__ ), array( 'jquery', 'jquery-ui-slider', 'jquery-ui-datepicker' ), BeRocket_AJAX_filters_version );
|
106 |
-
wp_register_style ( 'berocket_aapf_widget-style', plugins_url( 'widget.css', __FILE__ ), "", BeRocket_AJAX_filters_version );
|
107 |
-
add_action('wp_footer', array($this, 'footer_css'));
|
108 |
-
add_action( "wp_ajax_br_aapf_get_child", array ( $this, 'br_aapf_get_child' ) );
|
109 |
-
add_action( "wp_ajax_nopriv_br_aapf_get_child", array ( $this, 'br_aapf_get_child' ) );
|
110 |
-
}
|
111 |
-
public function footer_css() {
|
112 |
-
$this->br_custom_user_css();
|
113 |
-
}
|
114 |
-
public function selected_area() {
|
115 |
-
$set_query_var_title = array();
|
116 |
-
$BeRocket_AAPF = BeRocket_AAPF::getInstance();
|
117 |
-
$br_options = $BeRocket_AAPF->get_option();
|
118 |
-
$br_options = apply_filters( 'berocket_aapf_listener_br_options', $br_options );
|
119 |
-
$set_query_var_title['title'] = apply_filters( 'berocket_aapf_widget_title', ( empty($title) ? '' : $title ) );
|
120 |
-
$set_query_var_title['uo'] = br_aapf_converter_styles( ( empty($br_options['styles']) ? '' : $br_options['styles'] ) );
|
121 |
-
$set_query_var_title['selected_area_show'] = empty($br_options['selected_area_hide_empty']);
|
122 |
-
$set_query_var_title['hide_selected_arrow'] = false;
|
123 |
-
$set_query_var_title['selected_is_hide'] = false;
|
124 |
-
$set_query_var_title['is_hooked'] = true;
|
125 |
-
$set_query_var_title['is_hide_mobile'] = false;
|
126 |
-
set_query_var( 'berocket_query_var_title', $set_query_var_title );
|
127 |
-
br_get_template_part( 'old_templates/widget_selected_area' );
|
128 |
-
}
|
129 |
-
public function settings_page($data) {
|
130 |
-
$data['Addons']['prevent_disable'] = array(
|
131 |
-
"section" => "prevent_disable",
|
132 |
-
"value" => "",
|
133 |
-
);
|
134 |
-
return $data;
|
135 |
-
}
|
136 |
-
function section_prevent_disable ( $item, $element_data, $options ) {
|
137 |
-
$html = '<script>
|
138 |
-
jQuery(":contains(Deprecated Filters)").parents(".berocket_addon_label").find("input").on("change", function(e) {
|
139 |
-
if( ! jQuery(this).prop("checked") ) {
|
140 |
-
jQuery(document).trigger("braapf_deprecated_filters_disabled");
|
141 |
-
}
|
142 |
-
});
|
143 |
-
</script>';
|
144 |
-
$popup_text = '<h2>'. __('ATTENTION! After disabling this addon all filters will be converted to new version and there is no way to convert them back automatically.', 'BeRocket_AJAX_domain') . '</h2>'
|
145 |
-
. '<p><strong>' . __('We recommend you to try it on a staging/dev/local site first.', 'BeRocket_AJAX_domain') . '</strong></p>'
|
146 |
-
. __('Please check this on addon deactivation (it will be deactivated when settings saved).', 'BeRocket_AJAX_domain')
|
147 |
-
. '<ol>'
|
148 |
-
. '<li>' . __('Filters on Front-end, how they looks and works. Some styles can differ in new version.', 'BeRocket_AJAX_domain') . '</li>';
|
149 |
-
if( ! empty($options['user_custom_css']) ) {
|
150 |
-
$popup_text .= '<li>' . __('You have Custom CSS. Most likely it won\'t work without this addon. You will need to update it as CSS classes were changed.', 'BeRocket_AJAX_domain') . '</li>';
|
151 |
-
}
|
152 |
-
if( ! empty($options['javascript']) && (
|
153 |
-
! empty($options['javascript']['berocket_ajax_filtering_start'])
|
154 |
-
|| ! empty($options['javascript']['berocket_ajax_filtering_start'])
|
155 |
-
|| ! empty($options['javascript']['berocket_ajax_filtering_start'])
|
156 |
-
) ) {
|
157 |
-
$popup_text .= '<li>' . __('You have Custom Javascript. You need to check it after turning off this addon. It can work correctly same as stop working.', 'BeRocket_AJAX_domain') . '</li>';
|
158 |
-
}
|
159 |
-
$popup_text .= '</ol>'
|
160 |
-
. '<p><strong>' . __('Do you want to disable it anyway?', 'BeRocket_AJAX_domain') . '</strong></p>';
|
161 |
-
|
162 |
-
BeRocket_popup_display::add_popup(
|
163 |
-
array(
|
164 |
-
'yes_no_buttons' => array(
|
165 |
-
'show' => true,
|
166 |
-
'yes_text' => __('Yes, disable add-on', 'BeRocket_AJAX_domain'),
|
167 |
-
'no_text' => __('No, turn it back', 'BeRocket_AJAX_domain'),
|
168 |
-
'location' => 'popup',
|
169 |
-
'yes_func' => '',
|
170 |
-
'no_func' => 'jQuery(":contains(Deprecated Filters)").parents(".berocket_addon_label").find("input").prop("checked", true);',
|
171 |
-
),
|
172 |
-
'no_x_button' => true,
|
173 |
-
'height' => '500px',
|
174 |
-
'width' => '800px',
|
175 |
-
),
|
176 |
-
$popup_text,
|
177 |
-
array('event_new' => array('type' => 'event', 'event' => 'braapf_deprecated_filters_disabled'))
|
178 |
-
);
|
179 |
-
return $html;
|
180 |
-
}
|
181 |
-
function filter_filter_type_array($filter_type) {
|
182 |
-
$filter_type = berocket_insert_to_array(
|
183 |
-
$filter_type,
|
184 |
-
'tag',
|
185 |
-
array(
|
186 |
-
'product_cat' => array(
|
187 |
-
'name' => __('Product sub-categories', 'BeRocket_AJAX_domain'),
|
188 |
-
'sameas' => 'product_cat',
|
189 |
-
),
|
190 |
-
)
|
191 |
-
);
|
192 |
-
return $filter_type;
|
193 |
-
}
|
194 |
-
function plugin_settings_page($data) {
|
195 |
-
$data['General'] = berocket_insert_to_array(
|
196 |
-
$data['General'],
|
197 |
-
'hide_values',
|
198 |
-
array(
|
199 |
-
'use_select2' => array(
|
200 |
-
"label" => __( 'Select2', "BeRocket_AJAX_domain" ),
|
201 |
-
"type" => "checkbox",
|
202 |
-
"name" => "use_select2",
|
203 |
-
"class" => "br_use_select2",
|
204 |
-
"value" => '1',
|
205 |
-
'label_for' => __("Use Select2 script for dropdown menu", 'BeRocket_AJAX_domain') . '<br>',
|
206 |
-
),
|
207 |
-
)
|
208 |
-
);
|
209 |
-
$data['Design'] = berocket_insert_to_array(
|
210 |
-
$data['Design'],
|
211 |
-
'design',
|
212 |
-
array(
|
213 |
-
'design_old' => array(
|
214 |
-
'section' => 'old_design',
|
215 |
-
"value" => "",
|
216 |
-
),
|
217 |
-
),
|
218 |
-
true
|
219 |
-
);
|
220 |
-
return $data;
|
221 |
-
}
|
222 |
-
public function section_old_design($html, $item, $options) {
|
223 |
-
$designables = br_aapf_get_styled();
|
224 |
-
ob_start();
|
225 |
-
include __DIR__ . '/settings/design.php';
|
226 |
-
$html = ob_get_clean();
|
227 |
-
return $html;
|
228 |
-
}
|
229 |
-
function br_custom_user_css() {
|
230 |
-
$BeRocket_AAPF = BeRocket_AAPF::getInstance();
|
231 |
-
$options = $BeRocket_AAPF->get_option();
|
232 |
-
$replace_css = array(
|
233 |
-
'#widget#' => '.berocket_aapf_widget',
|
234 |
-
'#widget-title#' => '.berocket_aapf_widget-title'
|
235 |
-
);
|
236 |
-
$result_css = "";
|
237 |
-
$result_css = str_replace(array('<style>', '</style>', '<'), '', $options[ 'user_custom_css' ]);
|
238 |
-
foreach ( $replace_css as $key => $value ) {
|
239 |
-
$result_css = str_replace( $key, $value, $result_css );
|
240 |
-
}
|
241 |
-
$result_css = trim($result_css);
|
242 |
-
$uo = br_aapf_converter_styles( (isset($options['styles']) ? $options['styles'] : array()) );
|
243 |
-
if( ! empty($uo['style']['selected_area']) ) {
|
244 |
-
$result_css .= 'div.berocket_aapf_widget_selected_area .berocket_aapf_widget_selected_filter a, div.berocket_aapf_selected_area_block a{'.$uo['style']['selected_area'].'}';
|
245 |
-
}
|
246 |
-
if( ! empty($uo['style']['selected_area_hover']) ) {
|
247 |
-
$result_css .= 'div.berocket_aapf_widget_selected_area .berocket_aapf_widget_selected_filter a.br_hover *, div.berocket_aapf_widget_selected_area .berocket_aapf_widget_selected_filter a.br_hover, div.berocket_aapf_selected_area_block a.br_hover{'.$uo['style']['selected_area_hover'].'}';
|
248 |
-
}
|
249 |
-
if ( ! empty($options['styles_input']['checkbox']['icon']) ) {
|
250 |
-
$result_css .= 'ul.berocket_aapf_widget li > span > input[type="checkbox"] + .berocket_label_widgets:before {display:inline-block;}';
|
251 |
-
$result_css .= '.berocket_aapf_widget input[type="checkbox"] {display: none;}';
|
252 |
-
}
|
253 |
-
$add_css = $BeRocket_AAPF->convert_styles_to_string($options['styles_input']['checkbox']);
|
254 |
-
if( ! empty($add_css) ) {
|
255 |
-
$result_css .= 'ul.berocket_aapf_widget li > span > input[type="checkbox"] + .berocket_label_widgets:before {'.$add_css.'}';
|
256 |
-
}
|
257 |
-
if ( ! empty($options['styles_input']['checkbox']['icon']) ) {
|
258 |
-
$result_css .= 'ul.berocket_aapf_widget li > span > input[type="checkbox"]:checked + .berocket_label_widgets:before {';
|
259 |
-
$result_css .= 'content: "\\'.$options['styles_input']['checkbox']['icon'].'";';
|
260 |
-
$result_css .= '}';
|
261 |
-
}
|
262 |
-
if ( ! empty($options['styles_input']['radio']['icon']) ) {
|
263 |
-
$result_css .= 'ul.berocket_aapf_widget li > span > input[type="radio"] + .berocket_label_widgets:before {display:inline-block;}';
|
264 |
-
$result_css .= '.berocket_aapf_widget input[type="radio"] {display: none;}';
|
265 |
-
}
|
266 |
-
$add_css = $BeRocket_AAPF->convert_styles_to_string($options['styles_input']['radio']);
|
267 |
-
if( ! empty($add_css) ) {
|
268 |
-
$result_css .= 'ul.berocket_aapf_widget li > span > input[type="radio"] + .berocket_label_widgets:before {' . $add_css . '}';
|
269 |
-
}
|
270 |
-
if ( ! empty($options['styles_input']['radio']['icon']) ) {
|
271 |
-
$result_css .= 'ul.berocket_aapf_widget li > span > input[type="radio"]:checked + .berocket_label_widgets:before {';
|
272 |
-
$result_css .= 'content: "\\'.$options['styles_input']['radio']['icon'].'";';
|
273 |
-
$result_css .= '}';
|
274 |
-
}
|
275 |
-
if ( ! empty($options['styles_input']['slider']['line_color']) ) {
|
276 |
-
$result_css .= '.berocket_aapf_widget .slide .berocket_filter_slider.ui-widget-content .ui-slider-range, .berocket_aapf_widget .slide .berocket_filter_price_slider.ui-widget-content .ui-slider-range{';
|
277 |
-
$result_css .= 'background-color: ';
|
278 |
-
if ( $options['styles_input']['slider']['line_color'][0] != '#' ) {
|
279 |
-
$result_css .= '#';
|
280 |
-
}
|
281 |
-
$result_css .= $options['styles_input']['slider']['line_color'].';';
|
282 |
-
$result_css .= '}';
|
283 |
-
}
|
284 |
-
$add_css = '';
|
285 |
-
if ( isset($options['styles_input']['slider']['line_height']) && strlen($options['styles_input']['slider']['line_height']) ) {
|
286 |
-
$add_css .= 'height: '.$options['styles_input']['slider']['line_height'].'px;';
|
287 |
-
}
|
288 |
-
if ( ! empty($options['styles_input']['slider']['line_border_color']) ) {
|
289 |
-
$add_css .= 'border-color: ';
|
290 |
-
if ( $options['styles_input']['slider']['line_border_color'][0] != '#' ) {
|
291 |
-
$add_css .= '#';
|
292 |
-
}
|
293 |
-
$add_css .= $options['styles_input']['slider']['line_border_color'].';';
|
294 |
-
}
|
295 |
-
if ( ! empty($options['styles_input']['slider']['back_line_color']) ) {
|
296 |
-
$add_css .= 'background-color: ';
|
297 |
-
if ( $options['styles_input']['slider']['back_line_color'][0] != '#' ) {
|
298 |
-
$add_css .= '#';
|
299 |
-
}
|
300 |
-
$add_css .= $options['styles_input']['slider']['back_line_color'].';';
|
301 |
-
}
|
302 |
-
if ( isset($options['styles_input']['slider']['line_border_width']) && strlen($options['styles_input']['slider']['line_border_width']) ) {
|
303 |
-
$add_css .= 'border-width: '.$options['styles_input']['slider']['line_border_width'].'px;';
|
304 |
-
}
|
305 |
-
if( ! empty($add_css) ) {
|
306 |
-
$result_css .= '.berocket_aapf_widget .slide .berocket_filter_slider.ui-widget-content, .berocket_aapf_widget .slide .berocket_filter_price_slider.ui-widget-content{'.$add_css.'}';
|
307 |
-
}
|
308 |
-
$add_css = '';
|
309 |
-
if ( isset($options['styles_input']['slider']['button_size']) && strlen($options['styles_input']['slider']['button_size']) ) {
|
310 |
-
$add_css .= 'font-size: '.$options['styles_input']['slider']['button_size'].'px;';
|
311 |
-
}
|
312 |
-
if ( ! empty($options['styles_input']['slider']['button_color']) ) {
|
313 |
-
$add_css .= 'background-color: ';
|
314 |
-
if ( $options['styles_input']['slider']['button_color'][0] != '#' ) {
|
315 |
-
$add_css .= '#';
|
316 |
-
}
|
317 |
-
$add_css .= $options['styles_input']['slider']['button_color'].';';
|
318 |
-
}
|
319 |
-
if ( ! empty($options['styles_input']['slider']['button_border_color']) ) {
|
320 |
-
$add_css .= 'border-color: ';
|
321 |
-
if ( $options['styles_input']['slider']['button_border_color'][0] != '#' ) {
|
322 |
-
$add_css .= '#';
|
323 |
-
}
|
324 |
-
$add_css .= $options['styles_input']['slider']['button_border_color'].';';
|
325 |
-
}
|
326 |
-
if ( isset($options['styles_input']['slider']['button_border_width']) && strlen($options['styles_input']['slider']['button_border_width']) ) {
|
327 |
-
$add_css .= 'border-width: '.$options['styles_input']['slider']['button_border_width'].'px;';
|
328 |
-
}
|
329 |
-
if ( isset($options['styles_input']['slider']['button_border_radius']) && strlen($options['styles_input']['slider']['button_border_radius']) ) {
|
330 |
-
$add_css .= 'border-radius: '.$options['styles_input']['slider']['button_border_radius'].'px;';
|
331 |
-
}
|
332 |
-
if( ! empty($add_css) ) {
|
333 |
-
$result_css .= '.berocket_aapf_widget .slide .berocket_filter_slider .ui-state-default,
|
334 |
-
.berocket_aapf_widget .slide .berocket_filter_price_slider .ui-state-default,
|
335 |
-
.berocket_aapf_widget .slide .berocket_filter_slider.ui-widget-content .ui-state-default,
|
336 |
-
.berocket_aapf_widget .slide .berocket_filter_price_slider.ui-widget-content .ui-state-default,
|
337 |
-
.berocket_aapf_widget .slide .berocket_filter_slider .ui-widget-header .ui-state-default,
|
338 |
-
.berocket_aapf_widget .slide .berocket_filter_price_slider .ui-widget-header .ui-state-default
|
339 |
-
.berocket_aapf_widget .berocket_filter_slider.ui-widget-content .ui-slider-handle,
|
340 |
-
.berocket_aapf_widget .berocket_filter_price_slider.ui-widget-content .ui-slider-handle{'.$add_css.'}';
|
341 |
-
}
|
342 |
-
if( ! empty( $uo['style']['selected_area_block'] ) || ! empty( $uo['style']['selected_area_border'] ) ) {
|
343 |
-
$result_css .= ' .berocket_aapf_selected_area_hook div.berocket_aapf_widget_selected_area .berocket_aapf_widget_selected_filter a{'
|
344 |
-
.( ! empty( $uo['style']['selected_area_block'] ) ? 'background-'.$uo['style']['selected_area_block'] : '' )
|
345 |
-
.( ! empty( $uo['style']['selected_area_border'] ) ? ' border-'.$uo['style']['selected_area_border'] : '' ).'}';
|
346 |
-
}
|
347 |
-
$add_css = '';
|
348 |
-
if ( ! empty($options['styles_input']['pc_ub']['back_color']) ) {
|
349 |
-
$add_css .= 'background-color: ';
|
350 |
-
if ( $options['styles_input']['pc_ub']['back_color'][0] != '#' ) {
|
351 |
-
$add_css .= '#';
|
352 |
-
}
|
353 |
-
$add_css .= $options['styles_input']['pc_ub']['back_color'].';';
|
354 |
-
}
|
355 |
-
if ( ! empty($options['styles_input']['pc_ub']['border_color']) ) {
|
356 |
-
$add_css .= 'border-color: ';
|
357 |
-
if ( $options['styles_input']['pc_ub']['border_color'][0] != '#' ) {
|
358 |
-
$add_css .= '#';
|
359 |
-
}
|
360 |
-
$add_css .= $options['styles_input']['pc_ub']['border_color'].';';
|
361 |
-
}
|
362 |
-
if ( ! empty($options['styles_input']['pc_ub']['font_color']) ) {
|
363 |
-
$add_css .= 'color: ';
|
364 |
-
if ( $options['styles_input']['pc_ub']['font_color'][0] != '#' ) {
|
365 |
-
$add_css .= '#';
|
366 |
-
}
|
367 |
-
$add_css .= $options['styles_input']['pc_ub']['font_color'].';';
|
368 |
-
}
|
369 |
-
if ( isset($options['styles_input']['pc_ub']['font_size']) && strlen($options['styles_input']['pc_ub']['font_size']) ) {
|
370 |
-
$add_css .= 'font-size: '.$options['styles_input']['pc_ub']['font_size'].'px;';
|
371 |
-
}
|
372 |
-
if( ! empty($add_css) ) {
|
373 |
-
$result_css .= '.berocket_aapf_widget div.berocket_aapf_product_count_desc {'.$add_css.'}';
|
374 |
-
}
|
375 |
-
$add_css = '';
|
376 |
-
if ( ! empty($options['styles_input']['pc_ub']['back_color']) ) {
|
377 |
-
$add_css .= 'background-color: ';
|
378 |
-
if ( $options['styles_input']['pc_ub']['back_color'][0] != '#' ) {
|
379 |
-
$add_css .= '#';
|
380 |
-
}
|
381 |
-
$add_css .= $options['styles_input']['pc_ub']['back_color'].';';
|
382 |
-
}
|
383 |
-
if ( ! empty($options['styles_input']['pc_ub']['border_color']) ) {
|
384 |
-
$add_css .= 'border-color: ';
|
385 |
-
if ( $options['styles_input']['pc_ub']['border_color'][0] != '#' ) {
|
386 |
-
$add_css .= '#';
|
387 |
-
}
|
388 |
-
$add_css .= $options['styles_input']['pc_ub']['border_color'].';';
|
389 |
-
}
|
390 |
-
if( ! empty($add_css) ) {
|
391 |
-
$result_css .= '.berocket_aapf_widget div.berocket_aapf_product_count_desc > span {'.$add_css.'}';
|
392 |
-
}
|
393 |
-
$add_css = '';
|
394 |
-
if ( ! empty($options['styles_input']['pc_ub']['show_font_color']) ) {
|
395 |
-
$add_css .= 'color: ';
|
396 |
-
if ( $options['styles_input']['pc_ub']['show_font_color'][0] != '#' ) {
|
397 |
-
$add_css .= '#';
|
398 |
-
}
|
399 |
-
$add_css .= $options['styles_input']['pc_ub']['show_font_color'].';';
|
400 |
-
}
|
401 |
-
if ( ! empty($options['styles_input']['pc_ub']['show_font_size']) ) {
|
402 |
-
$add_css .= 'font-size: '.$options['styles_input']['pc_ub']['show_font_size'].'px;';
|
403 |
-
}
|
404 |
-
if( ! empty($add_css) ) {
|
405 |
-
$result_css .= '.berocket_aapf_widget div.berocket_aapf_product_count_desc .berocket_aapf_widget_update_button {'.$add_css.'}';
|
406 |
-
}
|
407 |
-
if ( ! empty($options['styles_input']['pc_ub']['show_font_color_hover']) ) {
|
408 |
-
$result_css .= '.berocket_aapf_widget div.berocket_aapf_product_count_desc .berocket_aapf_widget_update_button:hover {';
|
409 |
-
$result_css .= 'color: ';
|
410 |
-
if ( $options['styles_input']['pc_ub']['show_font_color_hover'][0] != '#' ) {
|
411 |
-
$result_css .= '#';
|
412 |
-
}
|
413 |
-
$result_css .= $options['styles_input']['pc_ub']['show_font_color_hover'].';';
|
414 |
-
$result_css .= '}';
|
415 |
-
}
|
416 |
-
$add_css = '';
|
417 |
-
if ( ! empty($options['styles_input']['pc_ub']['close_font_color']) ) {
|
418 |
-
$add_css .= 'color: ';
|
419 |
-
if ( $options['styles_input']['pc_ub']['close_font_color'][0] != '#' ) {
|
420 |
-
$add_css .= '#';
|
421 |
-
}
|
422 |
-
$add_css .= $options['styles_input']['pc_ub']['close_font_color'].';';
|
423 |
-
}
|
424 |
-
if ( ! empty($options['styles_input']['pc_ub']['close_size']) ) {
|
425 |
-
$add_css .= 'font-size: '.$options['styles_input']['pc_ub']['close_size'].'px;';
|
426 |
-
}
|
427 |
-
if( ! empty($add_css) ) {
|
428 |
-
$result_css .= '.berocket_aapf_widget div.berocket_aapf_product_count_desc .berocket_aapf_close_pc {'.$add_css.'}';
|
429 |
-
}
|
430 |
-
if ( ! empty($options['styles_input']['pc_ub']['close_font_color_hover']) ) {
|
431 |
-
$result_css .= '.berocket_aapf_widget div.berocket_aapf_product_count_desc .berocket_aapf_close_pc:hover {';
|
432 |
-
$result_css .= 'color: ';
|
433 |
-
if ( $options['styles_input']['pc_ub']['close_font_color_hover'][0] != '#' ) {
|
434 |
-
$result_css .= '#';
|
435 |
-
}
|
436 |
-
$result_css .= $options['styles_input']['pc_ub']['close_font_color_hover'].';';
|
437 |
-
$result_css .= '}';
|
438 |
-
}
|
439 |
-
$add_css = $BeRocket_AAPF->convert_styles_to_string($options['styles_input']['onlyTitle_title']);
|
440 |
-
if( ! empty($add_css) ) {
|
441 |
-
$result_css .= 'div.berocket_single_filter_widget.berocket_hidden_clickable .berocket_aapf_widget-title_div,
|
442 |
-
div.berocket_single_filter_widget.berocket_hidden_clickable .berocket_aapf_widget-title_div span {'.$add_css.'}';
|
443 |
-
}
|
444 |
-
$add_css = $BeRocket_AAPF->convert_styles_to_string($options['styles_input']['onlyTitle_titleopened']);
|
445 |
-
if( ! empty($add_css) ) {
|
446 |
-
$result_css .= 'div.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_widget-title_div,
|
447 |
-
div.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_widget-title_div span {'.$add_css.'}';
|
448 |
-
}
|
449 |
-
$add_css = $BeRocket_AAPF->convert_styles_to_string($options['styles_input']['onlyTitle_filter']);
|
450 |
-
if( ! empty($add_css) ) {
|
451 |
-
$result_css .= 'div.berocket_single_filter_widget.berocket_hidden_clickable .berocket_aapf_widget {'.$add_css.'}';
|
452 |
-
}
|
453 |
-
if ( ! empty($options['styles_input']['onlyTitle_filter']['fcolor']) ) {
|
454 |
-
$result_css .= 'div.berocket_single_filter_widget.berocket_hidden_clickable .berocket_aapf_widget * {';
|
455 |
-
$result_css .= 'color: ';
|
456 |
-
if ( $options['styles_input']['onlyTitle_filter']['fcolor'][0] != '#' ) {
|
457 |
-
$result_css .= '#';
|
458 |
-
}
|
459 |
-
$result_css .= $options['styles_input']['onlyTitle_filter']['fcolor'].';';
|
460 |
-
$result_css .= '}';
|
461 |
-
$result_css .= 'div.berocket_single_filter_widget.berocket_hidden_clickable .berocket_aapf_widget input {';
|
462 |
-
$result_css .= 'color: black;';
|
463 |
-
$result_css .= '}';
|
464 |
-
}
|
465 |
-
if( ! empty($result_css) ) {
|
466 |
-
echo '<style type="text/css">' . $result_css . '</style>';
|
467 |
-
}
|
468 |
-
}
|
469 |
-
function deprecated_template_get($template, $name) {
|
470 |
-
if( strpos($name, 'old_templates/') !== FALSE ) {
|
471 |
-
$new_name = str_replace('old_templates/', '', $name);
|
472 |
-
$new_template = locate_template( "woocommerce-ajax_filters/{$new_name}.php" );
|
473 |
-
if( $new_template ) {
|
474 |
-
$template = $new_template;
|
475 |
-
}
|
476 |
-
}
|
477 |
-
return $template;
|
478 |
-
}
|
479 |
-
function js_data_fix($data) {
|
480 |
-
$BeRocket_AAPF = BeRocket_AAPF::getInstance();
|
481 |
-
$br_options = apply_filters( 'berocket_aapf_listener_br_options', $BeRocket_AAPF->get_option() );
|
482 |
-
$data['load_image'] = '<div class="berocket_aapf_widget_loading"><div class="berocket_aapf_widget_loading_container">
|
483 |
-
<div class="berocket_aapf_widget_loading_top">' . ( ! empty( $br_options['ajax_load_text']['top'] ) ? $br_options['ajax_load_text']['top'] : '' ) . '</div>
|
484 |
-
<div class="berocket_aapf_widget_loading_left">' . ( ! empty( $br_options['ajax_load_text']['left'] ) ? $br_options['ajax_load_text']['left'] : '' ) . '</div>' .
|
485 |
-
( ! empty( $br_options['ajax_load_icon'] ) ? '<img alt="" src="'.$br_options['ajax_load_icon'].'">' : '<div class="berocket_aapf_widget_loading_image"></div>' ) .
|
486 |
-
'<div class="berocket_aapf_widget_loading_right">' . ( ! empty( $br_options['ajax_load_text']['right'] ) ? $br_options['ajax_load_text']['right'] : '' ) . '</div>
|
487 |
-
<div class="berocket_aapf_widget_loading_bottom">' . ( ! empty( $br_options['ajax_load_text']['bottom'] ) ? $br_options['ajax_load_text']['bottom'] : '' ) . '</div>
|
488 |
-
</div></div>';
|
489 |
-
return $data;
|
490 |
-
}
|
491 |
-
function search_box_before_group_start($custom_vars, $filters) {
|
492 |
-
if( ! empty($filters['search_box']) ) {
|
493 |
-
$search_box_style = br_get_value_from_array($filters, 'search_box_style');
|
494 |
-
$search_box_url = br_get_value_from_array($filters, 'search_box_url');
|
495 |
-
$sb_style = '';
|
496 |
-
if ( $search_box_style['position'] == 'horizontal' ) {
|
497 |
-
$sb_count = count($filters['filters']);
|
498 |
-
if( $search_box_style['search_position'] == 'before_after' ) {
|
499 |
-
$sb_count += 2;
|
500 |
-
} else {
|
501 |
-
$sb_count++;
|
502 |
-
}
|
503 |
-
$search_box_width = (int)(100 / $sb_count);
|
504 |
-
$sb_style .= 'width:'.$search_box_width.'%;display:inline-block;padding: 4px;';
|
505 |
-
}
|
506 |
-
$search_box_button_class = 'search_box_button_class_'.rand();
|
507 |
-
if ( $search_box_style['search_position'] != 'after' ) {
|
508 |
-
echo '<div style="'.$sb_style.'"><a data-url="'.$search_box_url.'" class="'.$search_box_button_class.' berocket_search_box_button">'.$search_box_style['search_text'].'</a></div>';
|
509 |
-
}
|
510 |
-
$custom_vars['search_box_button_class'] = $search_box_button_class;
|
511 |
-
$sbb_style = '';
|
512 |
-
if( ! empty($search_box_style['button_background']) ) {
|
513 |
-
$sbb_style .= 'background-color:'.($search_box_style['button_background'][0] == '#' ? $search_box_style['button_background'] : '#'.$search_box_style['button_background']).';';
|
514 |
-
}
|
515 |
-
if( ! empty($search_box_style['text_color']) ) {
|
516 |
-
$sbb_style .= 'color:'.($search_box_style['text_color'][0] == '#' ? $search_box_style['text_color'] : '#'.$search_box_style['text_color']).';';
|
517 |
-
}
|
518 |
-
$sbb_style_hover = '';
|
519 |
-
if( ! empty($search_box_style['button_background_over']) ) {
|
520 |
-
$sbb_style_hover .= 'background-color:'.($search_box_style['button_background_over'][0] == '#' ? $search_box_style['button_background_over'] : '#'.$search_box_style['button_background_over']).';';
|
521 |
-
}
|
522 |
-
if( ! empty($search_box_style['text_color_over']) ) {
|
523 |
-
$sbb_style_hover .= 'color:'.($search_box_style['text_color_over'][0] == '#' ? $search_box_style['text_color_over'] : '#'.$search_box_style['text_color_over']).';';
|
524 |
-
}
|
525 |
-
$custom_vars['sbb_style'] = $sbb_style;
|
526 |
-
$custom_vars['sbb_style_hover'] = $sbb_style_hover;
|
527 |
-
}
|
528 |
-
return $custom_vars;
|
529 |
-
}
|
530 |
-
function search_box_after_group_end($custom_vars, $filters) {
|
531 |
-
extract($custom_vars);
|
532 |
-
if( ! empty($filters['search_box']) ) {
|
533 |
-
if ( $search_box_style['search_position'] != 'before' ) {
|
534 |
-
echo '<div style="'.$sb_style.'">
|
535 |
-
<a data-url="'.$search_box_url.'"
|
536 |
-
class="'.$search_box_button_class.' berocket_search_box_button">
|
537 |
-
'.$search_box_style['search_text'].'</a></div>';
|
538 |
-
}
|
539 |
-
echo '<style>.'.$search_box_button_class.'{'.$sbb_style.'}.'.$search_box_button_class.':hover{'.$sbb_style_hover.'}</style>';
|
540 |
-
}
|
541 |
-
return $custom_vars;
|
542 |
-
}
|
543 |
-
function search_box_settings($post_name, $filters) {
|
544 |
-
?>
|
545 |
-
<div>
|
546 |
-
<label><?php _e('Search button position', 'BeRocket_AJAX_domain') ?></label>
|
547 |
-
<select class="br_select_menu_left" name="<?php echo $post_name; ?>[search_box_style][search_position]">
|
548 |
-
<option value="before"<?php if( br_get_value_from_array($filters, array('search_box_style', 'search_position')) == 'before' ) echo ' selected'; ?>><?php _e('Before', 'BeRocket_AJAX_domain') ?></option>
|
549 |
-
<option value="after"<?php if( br_get_value_from_array($filters, array('search_box_style', 'search_position')) == 'after' ) echo ' selected'; ?>><?php _e('After', 'BeRocket_AJAX_domain') ?></option>
|
550 |
-
<option value="before_after"<?php if( br_get_value_from_array($filters, array('search_box_style', 'search_position')) == 'before_after' ) echo ' selected'; ?>><?php _e('Before and after', 'BeRocket_AJAX_domain') ?></option>
|
551 |
-
</select>
|
552 |
-
</div>
|
553 |
-
<div>
|
554 |
-
<label><?php _e('Search button text', 'BeRocket_AJAX_domain') ?></label>
|
555 |
-
<input type="text" class="br_admin_full_size" value="<?php echo br_get_value_from_array($filters, array('search_box_style', 'search_text')); ?>" name="<?php echo $post_name; ?>[search_box_style][search_text]">
|
556 |
-
</div>
|
557 |
-
<div>
|
558 |
-
<label><?php _e('Button background color', 'BeRocket_AJAX_domain') ?></label>
|
559 |
-
<div class="br_colorpicker_field" data-color="<?php echo br_get_value_from_array($filters, array('search_box_style', 'button_background'), '000000'); ?>"></div>
|
560 |
-
<input type="hidden" value="<?php echo br_get_value_from_array($filters, array('search_box_style', 'button_background')) ?>" name="<?php echo $post_name; ?>[search_box_style][button_background]">
|
561 |
-
</div>
|
562 |
-
<div>
|
563 |
-
<label><?php _e('Button background color on mouse over', 'BeRocket_AJAX_domain') ?></label>
|
564 |
-
<div class="br_colorpicker_field" data-color="<?php echo br_get_value_from_array($filters, array('search_box_style', 'button_background_over'), '000000'); ?>"></div>
|
565 |
-
<input type="hidden" value="<?php echo br_get_value_from_array($filters, array('search_box_style', 'button_background_over')) ?>" name="<?php echo $post_name; ?>[search_box_style][button_background_over]">
|
566 |
-
</div>
|
567 |
-
<div>
|
568 |
-
<label><?php _e('Button text color', 'BeRocket_AJAX_domain') ?></label>
|
569 |
-
<div class="br_colorpicker_field" data-color="<?php echo br_get_value_from_array($filters, array('search_box_style', 'text_color'), '000000') ?>"></div>
|
570 |
-
<input type="hidden" value="<?php echo br_get_value_from_array($filters, array('search_box_style', 'text_color')) ?>" name="<?php echo $post_name; ?>[search_box_style][text_color]">
|
571 |
-
</div>
|
572 |
-
<div>
|
573 |
-
<label><?php _e('Button text color on mouse over', 'BeRocket_AJAX_domain') ?></label>
|
574 |
-
<div class="br_colorpicker_field" data-color="<?php echo br_get_value_from_array($filters, array('search_box_style', 'text_color_over'), '000000') ?>"></div>
|
575 |
-
<input type="hidden" value="<?php echo br_get_value_from_array($filters, array('search_box_style', 'text_color_over')) ?>" name="<?php echo $post_name; ?>[search_box_style][text_color_over]">
|
576 |
-
</div>
|
577 |
-
<?php
|
578 |
-
}
|
579 |
-
function remove_new_templates() {
|
580 |
-
return array();
|
581 |
-
}
|
582 |
-
function custom_user_css_replacement($replace = array()) {
|
583 |
-
$replace['#widget#'] = '.berocket_aapf_widget';
|
584 |
-
$replace['#widget-title#'] = '.berocket_aapf_widget-title';
|
585 |
-
return $replace;
|
586 |
-
}
|
587 |
-
public function br_aapf_get_child() {
|
588 |
-
$br_options = apply_filters( 'berocket_aapf_listener_br_options', $this->get_option() );
|
589 |
-
$taxonomy = $_POST['taxonomy'];
|
590 |
-
$type = $_POST['type'];
|
591 |
-
$term_id = $_POST['term_id'];
|
592 |
-
$term_id = str_replace( '\\', '', $term_id );
|
593 |
-
$term_id = json_decode($term_id);
|
594 |
-
$term_id = berocket_sanitize_array($term_id);
|
595 |
-
if ( $type == 'slider' ) {
|
596 |
-
$all_terms_name = array();
|
597 |
-
$terms_1 = get_terms( $taxonomy );
|
598 |
-
$is_numeric = true;
|
599 |
-
$terms = array();
|
600 |
-
foreach ( $terms_1 as $term_ar ) {
|
601 |
-
array_push( $all_terms_name, $term_ar->name );
|
602 |
-
if( ! is_numeric( substr( $term_ar->name[0], 0, 1 ) ) ) {
|
603 |
-
$is_numeric = false;
|
604 |
-
}
|
605 |
-
}
|
606 |
-
if( $is_numeric ) {
|
607 |
-
sort( $all_terms_name, SORT_NUMERIC );
|
608 |
-
} else {
|
609 |
-
sort( $all_terms_name );
|
610 |
-
}
|
611 |
-
$start_terms = array_search( $term_id[0], $all_terms_name );
|
612 |
-
$end_terms = array_search( $term_id[1], $all_terms_name );
|
613 |
-
$all_terms_name = array_slice( $all_terms_name, $start_terms, ( $end_terms - $start_terms + 1 ) );
|
614 |
-
foreach ( $all_terms_name as $term_name ) {
|
615 |
-
$term_id = get_term_by ( 'name', $term_name, $taxonomy );
|
616 |
-
$args_terms = array(
|
617 |
-
'orderby' => 'id',
|
618 |
-
'order' => 'ASC',
|
619 |
-
'hide_empty' => false,
|
620 |
-
'parent' => $term_id->term_id,
|
621 |
-
);
|
622 |
-
$current_terms = get_terms( $taxonomy, $args_terms );
|
623 |
-
foreach ( $current_terms as $current_term ) {
|
624 |
-
$terms[] = $current_term;
|
625 |
-
}
|
626 |
-
}
|
627 |
-
wp_send_json($terms);
|
628 |
-
} else {
|
629 |
-
if( is_array($term_id) && count($term_id) > 0 ) {
|
630 |
-
$terms = array();
|
631 |
-
foreach ( $term_id as $parent ) {
|
632 |
-
$args_terms = array(
|
633 |
-
'taxonomy' => $taxonomy,
|
634 |
-
'hide_empty' => false,
|
635 |
-
'parent' => intval($parent),
|
636 |
-
);
|
637 |
-
$new_terms = berocket_aapf_get_terms($args_terms);
|
638 |
-
if( ! is_array( $new_terms ) ) {
|
639 |
-
$new_terms = array();
|
640 |
-
}
|
641 |
-
if ( is_array( $new_terms ) ) {
|
642 |
-
foreach ( $new_terms as $key => $term_val ) {
|
643 |
-
$new_terms[$key]->color = get_metadata( 'berocket_term', $term_val->term_id, 'color' );
|
644 |
-
$new_terms[$key]->r_class = '';
|
645 |
-
if( ! empty($br_options['hide_value']['o']) && isset($term_val->count) && $term_val->count == 0 ) {
|
646 |
-
$new_terms[$key]->r_class += 'berocket_hide_o_value ';
|
647 |
-
}
|
648 |
-
}
|
649 |
-
}
|
650 |
-
$terms = array_merge( $terms, $new_terms );
|
651 |
-
}
|
652 |
-
wp_send_json($terms);
|
653 |
-
}
|
654 |
-
}
|
655 |
-
wp_die();
|
656 |
-
}
|
657 |
-
}
|
658 |
-
new BeRocket_aapf_deprecated_compat_addon();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
addons/deprecated_filters/display_filter/reset_button.php
DELETED
@@ -1,28 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
class BeRocket_AAPF_display_filters_reset_button_type extends BeRocket_AAPF_display_filters_additional_type {
|
3 |
-
public static $type_slug = 'reset_button';
|
4 |
-
public static $type_name;
|
5 |
-
public static $needed_options = array(
|
6 |
-
'title' => 'Reset Filters',
|
7 |
-
'is_hide_mobile' => false
|
8 |
-
);
|
9 |
-
function init() {
|
10 |
-
static::$type_name = __('Reset Products button', 'BeRocket_AJAX_domain');
|
11 |
-
parent::init();
|
12 |
-
}
|
13 |
-
public static function return_html($html, $additional) {
|
14 |
-
extract($additional['options']);
|
15 |
-
$br_options = self::get_option();
|
16 |
-
$set_query_var_title = array(
|
17 |
-
'title' => $additional['options']['title'],
|
18 |
-
'uo' => br_aapf_converter_styles( (empty($br_options['styles']) ? NULL : $br_options['styles']) ),
|
19 |
-
'is_hide_mobile' => ( empty($additional['options']['is_hide_mobile']) ? '' : $additional['options']['is_hide_mobile'] ),
|
20 |
-
'custom_css' => berocket_isset($css_class),
|
21 |
-
);
|
22 |
-
set_query_var( 'berocket_query_var_title', $set_query_var_title );
|
23 |
-
ob_start();
|
24 |
-
br_get_template_part( 'old_templates/widget_reset_button' );
|
25 |
-
return ob_get_clean();
|
26 |
-
}
|
27 |
-
}
|
28 |
-
new BeRocket_AAPF_display_filters_reset_button_type();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
addons/deprecated_filters/display_filter/selected_area.php
DELETED
@@ -1,37 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
class BeRocket_AAPF_display_filters_selected_area_type extends BeRocket_AAPF_display_filters_additional_type {
|
3 |
-
public static $type_slug = 'selected_area';
|
4 |
-
public static $type_name;
|
5 |
-
public static $needed_options = array(
|
6 |
-
'title' => '',
|
7 |
-
'scroll_theme' => 'dark',
|
8 |
-
'is_hide_mobile' => false,
|
9 |
-
'selected_area_show' => '0',
|
10 |
-
'hide_selected_arrow' => '0',
|
11 |
-
'selected_is_hide' => '0',
|
12 |
-
);
|
13 |
-
function init() {
|
14 |
-
static::$type_name = __('Selected Filters area', 'BeRocket_AJAX_domain');
|
15 |
-
parent::init();
|
16 |
-
}
|
17 |
-
public static function return_html($html, $additional) {
|
18 |
-
extract($additional['options']);
|
19 |
-
$br_options = self::get_option();
|
20 |
-
$style = br_get_value_from_array($additional, array('args', 'widget_inline_style'));
|
21 |
-
$set_query_var_title = array(
|
22 |
-
'title' => $additional['options']['title'],
|
23 |
-
'uo' => br_aapf_converter_styles( (empty($br_options['styles']) ? NULL : $br_options['styles']) ),
|
24 |
-
'is_hide_mobile' => ( empty($additional['options']['is_hide_mobile']) ? '' : $additional['options']['is_hide_mobile'] ),
|
25 |
-
'selected_area_show' => $additional['options']['selected_area_show'],
|
26 |
-
'hide_selected_arrow' => $additional['options']['hide_selected_arrow'],
|
27 |
-
'selected_is_hide' => $additional['options']['selected_is_hide'],
|
28 |
-
'style' => $style,
|
29 |
-
'custom_css' => berocket_isset($css_class),
|
30 |
-
);
|
31 |
-
set_query_var( 'berocket_query_var_title', $set_query_var_title );
|
32 |
-
ob_start();
|
33 |
-
br_get_template_part( 'old_templates/widget_selected_area' );
|
34 |
-
return ob_get_clean();
|
35 |
-
}
|
36 |
-
}
|
37 |
-
new BeRocket_AAPF_display_filters_selected_area_type();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
addons/deprecated_filters/display_filter/update_button.php
DELETED
@@ -1,29 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
class BeRocket_AAPF_display_filters_update_button_type extends BeRocket_AAPF_display_filters_additional_type {
|
3 |
-
public static $type_slug = 'update_button';
|
4 |
-
public static $type_name;
|
5 |
-
public static $needed_options = array(
|
6 |
-
'title' => 'Update',
|
7 |
-
'is_hide_mobile' => false
|
8 |
-
);
|
9 |
-
function init() {
|
10 |
-
static::$type_name = __('Update Products button', 'BeRocket_AJAX_domain');
|
11 |
-
parent::init();
|
12 |
-
}
|
13 |
-
public static function return_html($html, $additional) {
|
14 |
-
extract($additional['options']);
|
15 |
-
$br_options = self::get_option();
|
16 |
-
$set_query_var_title = array(
|
17 |
-
'title' => $additional['options']['title'],
|
18 |
-
'uo' => br_aapf_converter_styles( (empty($br_options['styles']) ? NULL : $br_options['styles']) ),
|
19 |
-
'is_hide_mobile' => ( empty($additional['options']['is_hide_mobile']) ? '' : $additional['options']['is_hide_mobile'] ),
|
20 |
-
'custom_css' => berocket_isset($css_class),
|
21 |
-
);
|
22 |
-
set_query_var( 'berocket_query_var_title', $set_query_var_title );
|
23 |
-
ob_start();
|
24 |
-
br_get_template_part( 'old_templates/widget_update_button' );
|
25 |
-
return ob_get_clean();
|
26 |
-
}
|
27 |
-
}
|
28 |
-
new BeRocket_AAPF_display_filters_update_button_type();
|
29 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
addons/deprecated_filters/display_widget.php
DELETED
@@ -1,687 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* BeRocket_AAPF_Widget - main filter widget. One filter for any needs
|
5 |
-
*/
|
6 |
-
class BeRocket_AAPF_Widget {
|
7 |
-
|
8 |
-
public static $defaults = array(
|
9 |
-
'br_wp_footer' => false,
|
10 |
-
'widget_type' => 'filter',
|
11 |
-
'title' => '',
|
12 |
-
'filter_type' => 'attribute',
|
13 |
-
'attribute' => 'price',
|
14 |
-
'custom_taxonomy' => 'product_cat',
|
15 |
-
'type' => 'slider',
|
16 |
-
'select_first_element_text' => '',
|
17 |
-
'operator' => 'OR',
|
18 |
-
'order_values_by' => '',
|
19 |
-
'order_values_type' => '',
|
20 |
-
'text_before_price' => '',
|
21 |
-
'text_after_price' => '',
|
22 |
-
'enable_slider_inputs' => '',
|
23 |
-
'parent_product_cat' => '',
|
24 |
-
'depth_count' => '0',
|
25 |
-
'widget_collapse_enable' => '0',
|
26 |
-
'widget_is_hide' => '0',
|
27 |
-
'show_product_count_per_attr' => '0',
|
28 |
-
'hide_child_attributes' => '0',
|
29 |
-
'hide_collapse_arrow' => '0',
|
30 |
-
'use_value_with_color' => '0',
|
31 |
-
'values_per_row' => '1',
|
32 |
-
'icon_before_title' => '',
|
33 |
-
'icon_after_title' => '',
|
34 |
-
'icon_before_value' => '',
|
35 |
-
'icon_after_value' => '',
|
36 |
-
'price_values' => '',
|
37 |
-
'description' => '',
|
38 |
-
'css_class' => '',
|
39 |
-
'tag_cloud_height' => '0',
|
40 |
-
'tag_cloud_min_font' => '12',
|
41 |
-
'tag_cloud_max_font' => '14',
|
42 |
-
'tag_cloud_tags_count' => '100',
|
43 |
-
'tag_cloud_type' => 'doe',
|
44 |
-
'use_min_price' => '0',
|
45 |
-
'min_price' => '0',
|
46 |
-
'use_max_price' => '0',
|
47 |
-
'max_price' => '1',
|
48 |
-
'height' => 'auto',
|
49 |
-
'scroll_theme' => 'dark',
|
50 |
-
'selected_area_show' => '0',
|
51 |
-
'hide_selected_arrow' => '0',
|
52 |
-
'selected_is_hide' => '0',
|
53 |
-
'slider_default' => '0',
|
54 |
-
'number_style' => '0',
|
55 |
-
'number_style_thousand_separate'=> '',
|
56 |
-
'number_style_decimal_separate' => '.',
|
57 |
-
'number_style_decimal_number' => '2',
|
58 |
-
'is_hide_mobile' => '0',
|
59 |
-
'user_can_see' => '',
|
60 |
-
'cat_propagation' => '0',
|
61 |
-
'product_cat' => '',
|
62 |
-
'parent_product_cat_current' => '0',
|
63 |
-
'attribute_count' => '',
|
64 |
-
'show_page' => array( 'shop', 'product_cat', 'product_tag', 'product_taxonomy' ),
|
65 |
-
'cat_value_limit' => '0',
|
66 |
-
'child_parent' => '',
|
67 |
-
'child_parent_depth' => '1',
|
68 |
-
'child_parent_no_values' => '',
|
69 |
-
'child_parent_previous' => '',
|
70 |
-
'child_parent_no_products' => '',
|
71 |
-
'child_onew_count' => '1',
|
72 |
-
'child_onew_childs' => array(
|
73 |
-
1 => array('title' => '', 'no_product' => '', 'no_values' => '', 'previous' => ''),
|
74 |
-
2 => array('title' => '', 'no_product' => '', 'no_values' => '', 'previous' => ''),
|
75 |
-
3 => array('title' => '', 'no_product' => '', 'no_values' => '', 'previous' => ''),
|
76 |
-
4 => array('title' => '', 'no_product' => '', 'no_values' => '', 'previous' => ''),
|
77 |
-
5 => array('title' => '', 'no_product' => '', 'no_values' => '', 'previous' => ''),
|
78 |
-
6 => array('title' => '', 'no_product' => '', 'no_values' => '', 'previous' => ''),
|
79 |
-
7 => array('title' => '', 'no_product' => '', 'no_values' => '', 'previous' => ''),
|
80 |
-
8 => array('title' => '', 'no_product' => '', 'no_values' => '', 'previous' => ''),
|
81 |
-
9 => array('title' => '', 'no_product' => '', 'no_values' => '', 'previous' => ''),
|
82 |
-
10 => array('title' => '', 'no_product' => '', 'no_values' => '', 'previous' => ''),
|
83 |
-
),
|
84 |
-
'search_box_link_type' => 'shop_page',
|
85 |
-
'search_box_url' => '',
|
86 |
-
'search_box_category' => '',
|
87 |
-
'search_box_count' => '1',
|
88 |
-
'search_box_attributes' => array(
|
89 |
-
1 => array('type' => 'attribute', 'attribute' => '', 'custom_taxonomy' => '', 'title' => '', 'visual_type' => 'select'),
|
90 |
-
2 => array('type' => 'attribute', 'attribute' => '', 'custom_taxonomy' => '', 'title' => '', 'visual_type' => 'select'),
|
91 |
-
3 => array('type' => 'attribute', 'attribute' => '', 'custom_taxonomy' => '', 'title' => '', 'visual_type' => 'select'),
|
92 |
-
4 => array('type' => 'attribute', 'attribute' => '', 'custom_taxonomy' => '', 'title' => '', 'visual_type' => 'select'),
|
93 |
-
5 => array('type' => 'attribute', 'attribute' => '', 'custom_taxonomy' => '', 'title' => '', 'visual_type' => 'select'),
|
94 |
-
6 => array('type' => 'attribute', 'attribute' => '', 'custom_taxonomy' => '', 'title' => '', 'visual_type' => 'select'),
|
95 |
-
7 => array('type' => 'attribute', 'attribute' => '', 'custom_taxonomy' => '', 'title' => '', 'visual_type' => 'select'),
|
96 |
-
8 => array('type' => 'attribute', 'attribute' => '', 'custom_taxonomy' => '', 'title' => '', 'visual_type' => 'select'),
|
97 |
-
9 => array('type' => 'attribute', 'attribute' => '', 'custom_taxonomy' => '', 'title' => '', 'visual_type' => 'select'),
|
98 |
-
10 => array('type' => 'attribute', 'attribute' => '', 'custom_taxonomy' => '', 'title' => '', 'visual_type' => 'select'),
|
99 |
-
),
|
100 |
-
'search_box_style' => array(
|
101 |
-
'position' => 'vertical',
|
102 |
-
'search_position' => 'after',
|
103 |
-
'search_text' => 'Search',
|
104 |
-
'background' => 'bbbbff',
|
105 |
-
'back_opacity' => '0',
|
106 |
-
'button_background' => '888800',
|
107 |
-
'button_background_over' => 'aaaa00',
|
108 |
-
'text_color' => '000000',
|
109 |
-
'text_color_over' => '000000',
|
110 |
-
),
|
111 |
-
'ranges' => array( 1, 10 ),
|
112 |
-
'hide_first_last_ranges' => '',
|
113 |
-
'include_exclude_select' => '',
|
114 |
-
'include_exclude_list' => array(),
|
115 |
-
);
|
116 |
-
|
117 |
-
/**
|
118 |
-
* Constructor
|
119 |
-
*/
|
120 |
-
function __construct( $instance, $args = array() ) {
|
121 |
-
if( ! empty($args['widget_id']) ) {
|
122 |
-
$this->id = $args['widget_id'];
|
123 |
-
$this->number = $args['widget_id'];
|
124 |
-
}
|
125 |
-
if( empty($this->number) || $this->number == -1 ) {
|
126 |
-
global $berocket_aapf_shortcode_id;
|
127 |
-
if( empty($berocket_aapf_shortcode_id) ) {
|
128 |
-
$berocket_aapf_shortcode_id = 1;
|
129 |
-
} else {
|
130 |
-
$berocket_aapf_shortcode_id++;
|
131 |
-
}
|
132 |
-
$this->id = 'berocket_aapf_widget-s'.$berocket_aapf_shortcode_id;
|
133 |
-
$args['widget_id'] = $this->id;
|
134 |
-
$this->number = 's'.$berocket_aapf_shortcode_id;
|
135 |
-
}
|
136 |
-
$set_query_var_title = array();
|
137 |
-
$set_query_var_main = array();
|
138 |
-
$set_query_var_footer = array();
|
139 |
-
$filter_type_array = array(
|
140 |
-
'attribute' => array(
|
141 |
-
'name' => __('Attribute', 'BeRocket_AJAX_domain'),
|
142 |
-
'sameas' => 'attribute',
|
143 |
-
),
|
144 |
-
'tag' => array(
|
145 |
-
'name' => __('Tag', 'BeRocket_AJAX_domain'),
|
146 |
-
'sameas' => 'tag',
|
147 |
-
),
|
148 |
-
'all_product_cat' => array(
|
149 |
-
'name' => __('Product Category', 'BeRocket_AJAX_domain'),
|
150 |
-
'sameas' => 'custom_taxonomy',
|
151 |
-
'attribute' => 'product_cat',
|
152 |
-
),
|
153 |
-
);
|
154 |
-
if ( function_exists('wc_get_product_visibility_term_ids') ) {
|
155 |
-
$filter_type_array['_rating'] = array(
|
156 |
-
'name' => __('Rating', 'BeRocket_AJAX_domain'),
|
157 |
-
'sameas' => '_rating',
|
158 |
-
);
|
159 |
-
}
|
160 |
-
$filter_type_array = apply_filters('berocket_filter_filter_type_array', $filter_type_array, $instance);
|
161 |
-
if( empty($instance['filter_type']) || ! array_key_exists($instance['filter_type'], $filter_type_array) ) {
|
162 |
-
foreach($filter_type_array as $filter_type_key => $filter_type_val) {
|
163 |
-
$instance['filter_type'] = $filter_type_key;
|
164 |
-
break;
|
165 |
-
}
|
166 |
-
}
|
167 |
-
if( ! empty($instance['filter_type']) && ! empty($filter_type_array[$instance['filter_type']]) && ! empty($filter_type_array[$instance['filter_type']]['sameas']) ) {
|
168 |
-
$sameas = $filter_type_array[$instance['filter_type']];
|
169 |
-
$instance['filter_type'] = $sameas['sameas'];
|
170 |
-
if( ! empty($sameas['attribute']) ) {
|
171 |
-
if( $sameas['sameas'] == 'custom_taxonomy' ) {
|
172 |
-
$instance['custom_taxonomy'] = $sameas['attribute'];
|
173 |
-
} elseif( $sameas['sameas'] == 'attribute' ) {
|
174 |
-
$instance['attribute'] = $sameas['attribute'];
|
175 |
-
}
|
176 |
-
}
|
177 |
-
}
|
178 |
-
//CHECK WIDGET TYPES
|
179 |
-
list($berocket_admin_filter_types, $berocket_admin_filter_types_by_attr) = berocket_aapf_get_filter_types();
|
180 |
-
$select_options_variants = array();
|
181 |
-
if ( $instance['filter_type'] == 'tag' ) {
|
182 |
-
$select_options_variants = $berocket_admin_filter_types['tag'];
|
183 |
-
} else if ( $instance['filter_type'] == 'product_cat' || ( $instance['filter_type'] == 'custom_taxonomy' && ( $instance['custom_taxonomy'] == 'product_tag' || $instance['custom_taxonomy'] == 'product_cat' ) ) ) {
|
184 |
-
$select_options_variants = $berocket_admin_filter_types['product_cat'];
|
185 |
-
} else if ( $instance['filter_type'] == '_sale' || $instance['filter_type'] == '_stock_status' || $instance['filter_type'] == '_rating' ) {
|
186 |
-
$select_options_variants = $berocket_admin_filter_types['sale'];
|
187 |
-
} else if ( $instance['filter_type'] == 'custom_taxonomy' ) {
|
188 |
-
$select_options_variants = $berocket_admin_filter_types['custom_taxonomy'];
|
189 |
-
} else if ( $instance['filter_type'] == 'attribute' ) {
|
190 |
-
if ( $instance['attribute'] == 'price' ) {
|
191 |
-
$select_options_variants = $berocket_admin_filter_types['price'];
|
192 |
-
} else {
|
193 |
-
$select_options_variants = $berocket_admin_filter_types['attribute'];
|
194 |
-
}
|
195 |
-
} else if ( $instance['filter_type'] == 'filter_by' ) {
|
196 |
-
$select_options_variants = $berocket_admin_filter_types['filter_by'];
|
197 |
-
}
|
198 |
-
$selected = false;
|
199 |
-
$first = false;
|
200 |
-
foreach($select_options_variants as $select_options_variant) {
|
201 |
-
if( ! empty($berocket_admin_filter_types_by_attr[$select_options_variant]) ) {
|
202 |
-
if( $instance['type'] == $berocket_admin_filter_types_by_attr[$select_options_variant]['value'] ) {
|
203 |
-
$selected = true;
|
204 |
-
break;
|
205 |
-
}
|
206 |
-
if( $first === false ) {
|
207 |
-
$first = $berocket_admin_filter_types_by_attr[$select_options_variant]['value'];
|
208 |
-
}
|
209 |
-
}
|
210 |
-
}
|
211 |
-
if( ! $selected ) {
|
212 |
-
$instance['type'] = $first;
|
213 |
-
}
|
214 |
-
$widget_type_array = apply_filters( 'berocket_widget_widget_type_array', apply_filters( 'berocket_aapf_display_filter_type_list', array(
|
215 |
-
'filter' => __('Filter', 'BeRocket_AJAX_domain'),
|
216 |
-
) ) );
|
217 |
-
if( ! array_key_exists($instance['widget_type'], $widget_type_array) ) {
|
218 |
-
foreach($widget_type_array as $widget_type_id => $widget_type_name) {
|
219 |
-
$instance['widget_type'] = $widget_type_id;
|
220 |
-
break;
|
221 |
-
}
|
222 |
-
}
|
223 |
-
$instance['title'] = apply_filters( 'widget_title', empty($instance['title']) ? '' : $instance['title'], $instance );
|
224 |
-
$br_options = apply_filters( 'berocket_aapf_listener_br_options', BeRocket_AAPF::get_aapf_option() );
|
225 |
-
$default_language = apply_filters( 'wpml_default_language', NULL );
|
226 |
-
|
227 |
-
global $wp_query, $wp_the_query, $wp, $sitepress, $br_wc_query;
|
228 |
-
if( ! isset( BeRocket_AAPF::$error_log['6_widgets'] ) )
|
229 |
-
{
|
230 |
-
BeRocket_AAPF::$error_log['6_widgets'] = array();
|
231 |
-
}
|
232 |
-
$widget_error_log = array();
|
233 |
-
|
234 |
-
$instance = array_merge( self::$defaults, $instance );
|
235 |
-
$instance = apply_filters('aapf_widget_instance', $instance);
|
236 |
-
$args = apply_filters('aapf_widget_args', $args);
|
237 |
-
if( ( $instance['user_can_see'] == 'logged' && ! is_user_logged_in() ) || ( $instance['user_can_see'] == 'not_logged' && is_user_logged_in() ) ) {
|
238 |
-
return false;
|
239 |
-
}
|
240 |
-
|
241 |
-
if( BeRocket_AAPF::$debug_mode ) {
|
242 |
-
$widget_error_log['wp_query'] = $wp_query;
|
243 |
-
$widget_error_log['args'] = $args;
|
244 |
-
$widget_error_log['instance'] = $instance;
|
245 |
-
}
|
246 |
-
|
247 |
-
$BeRocket_AAPF = BeRocket_AAPF::getInstance();
|
248 |
-
$BeRocket_AAPF::require_all_scripts(true);
|
249 |
-
$BeRocket_AAPF::require_all_styles(true);
|
250 |
-
if( ! empty($br_options['filters_turn_off']) ) return false;
|
251 |
-
|
252 |
-
if( ! empty($instance['child_parent']) && in_array($instance['child_parent'], array('child', 'parent')) ) {
|
253 |
-
$br_options['show_all_values'] = true;
|
254 |
-
}
|
255 |
-
|
256 |
-
if ( isset ( $br_wc_query ) ) {
|
257 |
-
if( ! is_a($br_wc_query, 'WP_Query') ) {
|
258 |
-
$br_wc_query = new WP_Query( $br_wc_query );
|
259 |
-
}
|
260 |
-
if( class_exists('WC_Query') && method_exists('WC_Query', 'product_query') && method_exists('WC_Query', 'get_main_query') ) {
|
261 |
-
$wc_query = wc()->query->get_main_query();
|
262 |
-
}
|
263 |
-
$old_query = $wp_query;
|
264 |
-
$old_the_query = $wp_the_query;
|
265 |
-
$wp_query = $br_wc_query;
|
266 |
-
$wp_the_query = $br_wc_query;
|
267 |
-
if( class_exists('WC_Query') && method_exists('WC_Query', 'product_query') && method_exists('WC_Query', 'get_main_query') ) {
|
268 |
-
wc()->query->product_query($wp_query);
|
269 |
-
}
|
270 |
-
}
|
271 |
-
|
272 |
-
if ( empty($instance['br_wp_footer']) ) {
|
273 |
-
global $br_widget_ids;
|
274 |
-
if ( ! isset( $br_widget_ids ) ) {
|
275 |
-
$br_widget_ids = array();
|
276 |
-
}
|
277 |
-
$br_widget_ids[] = array('instance' => $instance, 'args' => $args);
|
278 |
-
}
|
279 |
-
|
280 |
-
$text_before_price = br_get_value_from_array($instance, 'text_before_price');
|
281 |
-
$text_after_price = br_get_value_from_array($instance, 'text_after_price');
|
282 |
-
$text_before_price = apply_filters('aapf_widget_text_before_price', ( isset($text_before_price) ? $text_before_price : '' ) );
|
283 |
-
$text_after_price = apply_filters('aapf_widget_text_after_price', ( isset($text_after_price) ? $text_after_price : '' ) );
|
284 |
-
if( ! empty($text_before_price) || ! empty($text_after_price) ) {
|
285 |
-
$cur_symbol = get_woocommerce_currency_symbol();
|
286 |
-
$cur_slug = get_woocommerce_currency();
|
287 |
-
if( !empty($text_before_price) ) {
|
288 |
-
$text_before_price = str_replace(array('%cur_symbol%', '%cur_slug%'), array($cur_symbol, $cur_slug), $text_before_price);
|
289 |
-
}
|
290 |
-
if( !empty($text_after_price) ) {
|
291 |
-
$text_after_price = str_replace(array('%cur_symbol%', '%cur_slug%'), array($cur_symbol, $cur_slug), $text_after_price);
|
292 |
-
}
|
293 |
-
}
|
294 |
-
$instance['text_before_price'] = $text_before_price;
|
295 |
-
$instance['text_after_price'] = $text_after_price;
|
296 |
-
extract( $args );
|
297 |
-
extract( $instance );
|
298 |
-
|
299 |
-
if( ! empty($style) ) {
|
300 |
-
echo 'This Filter cannot be displayed as deprecated.';
|
301 |
-
if ( current_user_can( 'manage_woocommerce' ) ) {
|
302 |
-
echo ' You can disable "Deprecated filters" add-on in <a href="' . admin_url('admin.php?page=br-product-filters&tab=addons') . '">Plugin settings</a>';
|
303 |
-
}
|
304 |
-
return false;
|
305 |
-
}
|
306 |
-
|
307 |
-
if ( empty($order_values_by) ) {
|
308 |
-
$order_values_by = 'Default';
|
309 |
-
}
|
310 |
-
|
311 |
-
if ( ! empty($filter_type) && ( $filter_type == 'product_cat' || $filter_type == '_stock_status' || $filter_type == '_sale' || $filter_type == '_rating' ) ) {
|
312 |
-
$attribute = $filter_type;
|
313 |
-
$filter_type = 'attribute';
|
314 |
-
}
|
315 |
-
|
316 |
-
if( empty($br_options['ajax_site']) ) {
|
317 |
-
do_action('br_footer_script');
|
318 |
-
} else {
|
319 |
-
echo '<script>jQuery(document).ready(function() {if(typeof(berocket_filters_first_load) == "function") {berocket_filters_first_load();}});</script>';
|
320 |
-
}
|
321 |
-
if( apply_filters( 'berocket_aapf_widget_display_custom_filter', false, berocket_isset($widget_type), $instance, $args, $this ) ) {
|
322 |
-
$this->filter_return($br_wc_query, $wp_the_query, $wp_query, $wc_query, $old_the_query, $old_query, $widget_error_log);
|
323 |
-
return '';
|
324 |
-
}
|
325 |
-
|
326 |
-
if( ! empty($widget_type) && $custom_type_html = apply_filters('berocket_aapf_display_filter_custom_type', '', $widget_type, array('options' => $instance, 'args' => $args)) ) {
|
327 |
-
if( $custom_type_html !== TRUE ) {
|
328 |
-
echo berocket_isset($before_widget);
|
329 |
-
echo $custom_type_html;
|
330 |
-
echo berocket_isset($after_widget);
|
331 |
-
}
|
332 |
-
$widget_error_log['return'] = $widget_type;
|
333 |
-
$this->filter_return($br_wc_query, $wp_the_query, $wp_query, $wc_query, $old_the_query, $old_query, $widget_error_log);
|
334 |
-
return '';
|
335 |
-
}
|
336 |
-
|
337 |
-
$woocommerce_hide_out_of_stock_items = BeRocket_AAPF_Widget_functions::woocommerce_hide_out_of_stock_items();
|
338 |
-
if( $woocommerce_hide_out_of_stock_items == 'yes' && $filter_type == 'attribute' && $attribute == '_stock_status' ) {
|
339 |
-
$widget_error_log['return'] = 'stock_status';
|
340 |
-
$this->filter_return($br_wc_query, $wp_the_query, $wp_query, $wc_query, $old_the_query, $old_query, $widget_error_log);
|
341 |
-
return true;
|
342 |
-
}
|
343 |
-
|
344 |
-
if( $type == "slider" ) {
|
345 |
-
$operator = 'OR';
|
346 |
-
}
|
347 |
-
|
348 |
-
$terms = $sort_terms = $price_range = array();
|
349 |
-
list($terms_error_return, $terms_ready, $terms, $type) = apply_filters( 'berocket_widget_attribute_type_terms', array(false, false, $terms, $type), $attribute, $filter_type, $instance );
|
350 |
-
if( $terms_ready ) {
|
351 |
-
if( $terms_error_return === FALSE ) {
|
352 |
-
$set_query_var_title['terms'] = apply_filters( 'berocket_aapf_widget_terms', $terms );
|
353 |
-
if( BeRocket_AAPF::$debug_mode ) {
|
354 |
-
$widget_error_log['terms'] = $terms;
|
355 |
-
}
|
356 |
-
} else {
|
357 |
-
$widget_error_log['terms'] = $terms;
|
358 |
-
$widget_error_log['return'] = $terms_error_return;
|
359 |
-
$this->filter_return($br_wc_query, $wp_the_query, $wp_query, $wc_query, $old_the_query, $old_query, $widget_error_log);
|
360 |
-
return false;
|
361 |
-
}
|
362 |
-
} else {
|
363 |
-
if ( $filter_type == 'attribute' && $attribute == 'price' && $type == 'slider' ) {
|
364 |
-
if ( ! empty($price_values) ) {
|
365 |
-
$price_range = explode( ",", $price_values );
|
366 |
-
} elseif( $use_min_price && $use_max_price ) {
|
367 |
-
$price_range = array($min_price, $max_price);
|
368 |
-
} else {
|
369 |
-
$price_range = BeRocket_AAPF_Widget_functions::get_price_range( ( isset($cat_value_limit) ? $cat_value_limit : null ) );
|
370 |
-
if ( ! $price_range or count( $price_range ) < 2 ) {
|
371 |
-
$widget_error_log['price_range'] = $price_range;
|
372 |
-
$widget_error_log['return'] = 'price_range < 2';
|
373 |
-
$this->filter_return($br_wc_query, $wp_the_query, $wp_query, $wc_query, $old_the_query, $old_query, $widget_error_log);
|
374 |
-
return false;
|
375 |
-
}
|
376 |
-
}
|
377 |
-
if( BeRocket_AAPF::$debug_mode ) {
|
378 |
-
$widget_error_log['price_range'] = $price_range;
|
379 |
-
}
|
380 |
-
if( ! empty($text_before_price) || ! empty($text_after_price) ) {
|
381 |
-
wp_localize_script(
|
382 |
-
'berocket_aapf_widget-script',
|
383 |
-
'br_price_text',
|
384 |
-
array(
|
385 |
-
'before' => (isset($text_before_price) ? $text_before_price : ''),
|
386 |
-
'after' => (isset($text_after_price) ? $text_after_price : ''),
|
387 |
-
)
|
388 |
-
);
|
389 |
-
}
|
390 |
-
$set_query_var_title['text_before_price'] = (isset($text_before_price) ? $text_before_price : null);
|
391 |
-
$set_query_var_title['text_after_price'] = (isset($text_after_price) ? $text_after_price : null);
|
392 |
-
} elseif ( $filter_type != 'attribute' || $attribute != 'price' ) {
|
393 |
-
$get_terms_args = array(
|
394 |
-
'taxonomy' => $attribute,
|
395 |
-
'hide_empty' => true
|
396 |
-
);
|
397 |
-
$get_terms_advanced = array(
|
398 |
-
'operator' => $operator,
|
399 |
-
'force_query' => ! empty($br_wp_footer)
|
400 |
-
);
|
401 |
-
if( ! empty($cat_value_limit) ) {
|
402 |
-
$get_terms_advanced['additional_tax_query'] = array(
|
403 |
-
'field' => 'slug',
|
404 |
-
'include_children' => true,
|
405 |
-
'operator' => 'IN',
|
406 |
-
'taxonomy' => 'product_cat',
|
407 |
-
'terms' => array($cat_value_limit)
|
408 |
-
);
|
409 |
-
}
|
410 |
-
if ( $attribute == '_rating' ) {
|
411 |
-
$get_terms_args['taxonomy'] = 'product_visibility';
|
412 |
-
$get_terms_args['slug'] = array('rated-1', 'rated-2', 'rated-3', 'rated-4', 'rated-5');
|
413 |
-
} elseif( $filter_type == 'tag' ) {
|
414 |
-
$get_terms_args['taxonomy'] = 'product_tag';
|
415 |
-
} elseif( $filter_type == 'custom_taxonomy' ) {
|
416 |
-
$get_terms_args['taxonomy'] = $custom_taxonomy;
|
417 |
-
} elseif( $filter_type == 'attribute' && $attribute == 'product_cat' ) {
|
418 |
-
$get_terms_advanced['depth'] = intval($depth_count);
|
419 |
-
if( ! empty($parent_product_cat_current) ) {
|
420 |
-
$cate = get_queried_object();
|
421 |
-
if( isset($cate->term_id) ) {
|
422 |
-
$cateID = $cate->term_id;
|
423 |
-
} else {
|
424 |
-
$cateID = 0;
|
425 |
-
}
|
426 |
-
$parent_product_cat = $cateID;
|
427 |
-
}
|
428 |
-
$get_terms_args['child_of'] = intval($parent_product_cat);
|
429 |
-
}
|
430 |
-
if( ! empty($order_values_by) && $order_values_by == 'Alpha' ) {
|
431 |
-
$get_terms_args['orderby'] = 'name';
|
432 |
-
} elseif( ! empty($order_values_by) && $order_values_by == 'Numeric' ) {
|
433 |
-
$get_terms_args['orderby'] = 'name_num';
|
434 |
-
}
|
435 |
-
if( ! empty($order_values_type) ) {
|
436 |
-
$get_terms_args['order'] = ($order_values_type == 'asc' ? 'ASC' : 'DESC');
|
437 |
-
}
|
438 |
-
$get_terms_args = apply_filters('berocket_aapf_get_terms_args', $get_terms_args, $instance, $args);
|
439 |
-
$get_terms_advanced = apply_filters('berocket_aapf_get_terms_additional', $get_terms_advanced, $instance, $args, $get_terms_args);
|
440 |
-
$terms = berocket_aapf_get_terms( $get_terms_args, $get_terms_advanced );
|
441 |
-
if ( $attribute == '_rating' ) {
|
442 |
-
if( is_array($terms) && ! is_wp_error($terms) ) {
|
443 |
-
$rating_names = array(
|
444 |
-
'rated-1' => ( $type == 'select' ? __('1 star', 'BeRocket_AJAX_domain') : __('<i class="fa fa-star"></i><i class="fa fa-star-o"></i><i class="fa fa-star-o"></i><i class="fa fa-star-o"></i><i class="fa fa-star-o"></i>', 'BeRocket_AJAX_domain') ),
|
445 |
-
'rated-2' => ( $type == 'select' ? __('2 stars', 'BeRocket_AJAX_domain') : __('<i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star-o"></i><i class="fa fa-star-o"></i><i class="fa fa-star-o"></i>', 'BeRocket_AJAX_domain') ),
|
446 |
-
'rated-3' => ( $type == 'select' ? __('3 stars', 'BeRocket_AJAX_domain') : __('<i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star-o"></i><i class="fa fa-star-o"></i>', 'BeRocket_AJAX_domain') ),
|
447 |
-
'rated-4' => ( $type == 'select' ? __('4 stars', 'BeRocket_AJAX_domain') : __('<i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star-o"></i>', 'BeRocket_AJAX_domain') ),
|
448 |
-
'rated-5' => ( $type == 'select' ? __('5 stars', 'BeRocket_AJAX_domain') : __('<i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i>', 'BeRocket_AJAX_domain') ),
|
449 |
-
);
|
450 |
-
foreach($terms as &$term) {
|
451 |
-
if( isset($rating_names[$term->slug]) ) {
|
452 |
-
$term->name = $rating_names[$term->slug];
|
453 |
-
}
|
454 |
-
}
|
455 |
-
}
|
456 |
-
}
|
457 |
-
$terms = apply_filters('berocket_aapf_widget_include_exclude_items', $terms, $instance, $get_terms_args, $get_terms_advanced);
|
458 |
-
if ( isset($terms) && is_array($terms) && count( $terms ) < 1 ) {
|
459 |
-
$widget_error_log['terms'] = $terms;
|
460 |
-
$widget_error_log['return'] = 'terms < 1';
|
461 |
-
$this->filter_return($br_wc_query, $wp_the_query, $wp_query, $wc_query, $old_the_query, $old_query, $widget_error_log);
|
462 |
-
return false;
|
463 |
-
}
|
464 |
-
$set_query_var_title['terms'] = $terms;
|
465 |
-
}
|
466 |
-
}
|
467 |
-
|
468 |
-
$style = $class = '';
|
469 |
-
$style = br_get_value_from_array($args, 'widget_inline_style');
|
470 |
-
if( ! empty($height) and $height != 'auto' ){
|
471 |
-
$style .= "max-height: {$height}px; overflow: hidden;";
|
472 |
-
$class = "berocket_aapf_widget_height_control";
|
473 |
-
}
|
474 |
-
|
475 |
-
if( !$scroll_theme ) $scroll_theme = 'dark';
|
476 |
-
if( $filter_type == 'custom_taxonomy' )
|
477 |
-
$attribute = $custom_taxonomy;
|
478 |
-
if( ! isset($attribute_count) || $attribute_count == '' ) {
|
479 |
-
$attribute_count = br_get_value_from_array($br_options,'attribute_count');
|
480 |
-
}
|
481 |
-
|
482 |
-
if( $type == 'select' || $type == 'slider' ) {
|
483 |
-
$values_per_row = 1;
|
484 |
-
}
|
485 |
-
|
486 |
-
$set_query_var_title['operator'] = $operator;
|
487 |
-
$set_query_var_title['attribute'] = $attribute;
|
488 |
-
$set_query_var_title['type'] = $type;
|
489 |
-
$set_query_var_title['title'] = apply_filters( 'berocket_aapf_widget_title', $title );
|
490 |
-
$set_query_var_title['class'] = apply_filters( 'berocket_aapf_widget_class', $class );
|
491 |
-
$set_query_var_title['css_class'] = apply_filters( 'berocket_aapf_widget_css_class', (isset($css_class) ? $css_class : '') );
|
492 |
-
$set_query_var_title['style'] = apply_filters( 'berocket_aapf_widget_style', $style );
|
493 |
-
$set_query_var_title['scroll_theme'] = $scroll_theme;
|
494 |
-
$set_query_var_title['x'] = time();
|
495 |
-
$set_query_var_title['filter_type'] = $filter_type;
|
496 |
-
$set_query_var_title['uo'] = br_aapf_converter_styles( (empty($br_options['styles']) ? '' : $br_options['styles']) );
|
497 |
-
$set_query_var_title['notuo'] = (empty($br_options['styles']) ? '' : $br_options['styles']);
|
498 |
-
$set_query_var_title['widget_is_hide'] = (! empty($widget_collapse_enable) && ! empty($widget_is_hide));
|
499 |
-
$set_query_var_title['widget_collapse_disable'] = empty($widget_collapse_enable);
|
500 |
-
$set_query_var_title['is_hide_mobile'] = ! empty($is_hide_mobile);
|
501 |
-
$set_query_var_title['show_product_count_per_attr'] = ! empty($show_product_count_per_attr);
|
502 |
-
$set_query_var_title['hide_child_attributes'] = ! empty($hide_child_attributes);
|
503 |
-
$set_query_var_title['cat_value_limit'] = ( isset($cat_value_limit) ? $cat_value_limit : null );
|
504 |
-
$set_query_var_title['select_first_element_text'] = ( empty($select_first_element_text) ? __('Any', 'BeRocket_AJAX_domain') : $select_first_element_text );
|
505 |
-
$set_query_var_title['icon_before_title'] = (isset($icon_before_title) ? $icon_before_title : null);
|
506 |
-
$set_query_var_title['icon_after_title'] = (isset($icon_after_title) ? $icon_after_title : null);
|
507 |
-
$set_query_var_title['hide_o_value'] = ! empty($br_options['hide_value']['o']);
|
508 |
-
$set_query_var_title['hide_sel_value'] = ! empty($br_options['hide_value']['sel']);
|
509 |
-
$set_query_var_title['hide_empty_value'] = ! empty($br_options['hide_value']['empty']);
|
510 |
-
$set_query_var_title['hide_button_value'] = ! empty($br_options['hide_value']['button']);
|
511 |
-
$set_query_var_title['attribute_count_show_hide'] = berocket_isset($attribute_count_show_hide);
|
512 |
-
$set_query_var_title['attribute_count'] = $attribute_count;
|
513 |
-
$set_query_var_title['description'] = (isset($description) ? $description : null);
|
514 |
-
$set_query_var_title['hide_collapse_arrow'] = (empty($widget_collapse_enable) || ! empty($hide_collapse_arrow));
|
515 |
-
$set_query_var_title['values_per_row'] = (isset($values_per_row) ? $values_per_row : null);
|
516 |
-
$set_query_var_title['child_parent'] = (isset($child_parent) ? $child_parent : null);
|
517 |
-
$set_query_var_title['child_parent_depth'] = (isset($child_parent_depth) ? $child_parent_depth : null);
|
518 |
-
$set_query_var_title['product_count_style'] = (isset($br_options['styles_input']['product_count']) ? $br_options['styles_input']['product_count'] : '').'pcs '.(isset($br_options['styles_input']['product_count_position']) ? $br_options['styles_input']['product_count_position'] : null).'pcs';
|
519 |
-
$set_query_var_title['styles_input'] = (isset($br_options['styles_input']) ? $br_options['styles_input'] : array());
|
520 |
-
$set_query_var_title['child_parent_previous'] = (isset($child_parent_previous) ? $child_parent_previous : null);
|
521 |
-
$set_query_var_title['child_parent_no_values'] = (isset($child_parent_no_values) ? $child_parent_no_values : null);
|
522 |
-
$set_query_var_title['child_parent_no_products'] = (isset($child_parent_no_products) ? $child_parent_no_products : null);
|
523 |
-
$set_query_var_title['before_title'] = (isset($before_title) ? $before_title : null);
|
524 |
-
$set_query_var_title['after_title'] = (isset($after_title) ? $after_title : null);
|
525 |
-
$set_query_var_title['widget_id'] = ( $this->id ? $this->id : $widget_id );
|
526 |
-
$set_query_var_title['widget_id_number'] = ( $this->number ? $this->number : $widget_id_number );
|
527 |
-
$set_query_var_title['slug_urls'] = ! empty($br_options['slug_urls']);
|
528 |
-
$set_query_var_title['first_page_jump'] = ( empty($first_page_jump) ? '' : $first_page_jump );
|
529 |
-
$set_query_var_title['icon_before_value'] = (isset($icon_before_value) ? $icon_before_value : null);
|
530 |
-
$set_query_var_title['icon_after_value'] = (isset($icon_after_value) ? $icon_after_value : null);
|
531 |
-
$set_query_var_title = apply_filters('berocket_aapf_query_var_title_filter', $set_query_var_title, $instance, $br_options);
|
532 |
-
set_query_var( 'berocket_query_var_title', $set_query_var_title );
|
533 |
-
|
534 |
-
// widget title and start tag ( <ul> ) can be found in templates/widget_start.php
|
535 |
-
echo berocket_isset($before_widget);
|
536 |
-
do_action('berocket_aapf_widget_before_start');
|
537 |
-
br_get_template_part('old_templates/widget_start');
|
538 |
-
do_action('berocket_aapf_widget_after_start');
|
539 |
-
|
540 |
-
if ( $type == 'tag_cloud' ) {
|
541 |
-
$tag_script_var = array(
|
542 |
-
'height' => $tag_cloud_height,
|
543 |
-
'min_font_size' => $tag_cloud_min_font,
|
544 |
-
'max_font_size' => $tag_cloud_max_font,
|
545 |
-
'tags_count' => $tag_cloud_tags_count,
|
546 |
-
'tags_type' => $tag_cloud_type
|
547 |
-
);
|
548 |
-
$set_query_var_title['tag_script_var'] = $tag_script_var;
|
549 |
-
} elseif ( $type == 'color' || $type == 'image' ) {
|
550 |
-
$set_query_var_title['use_value_with_color'] = (isset($use_value_with_color) ? $use_value_with_color : null);
|
551 |
-
$set_query_var_title['disable_multiple'] = (isset($disable_multiple) ? $disable_multiple : null);
|
552 |
-
$set_query_var_title['color_image_block_size'] = berocket_isset($color_image_block_size, false, 'h2em w2em');
|
553 |
-
$set_query_var_title['color_image_checked'] = berocket_isset($color_image_checked, false, 'brchecked_default');
|
554 |
-
$set_query_var_title['color_image_checked_custom_css'] = berocket_isset($color_image_checked_custom_css);
|
555 |
-
$set_query_var_title['color_image_block_size_height'] = berocket_isset($color_image_block_size_height);
|
556 |
-
$set_query_var_title['color_image_block_size_width'] = berocket_isset($color_image_block_size_width);
|
557 |
-
} elseif( $type == 'select' ) {
|
558 |
-
$set_query_var_title['select_multiple'] = ! empty($select_multiple);
|
559 |
-
}
|
560 |
-
$slider_with_string = false;
|
561 |
-
$stringed_is_numeric = true;
|
562 |
-
$slider_step = 1;
|
563 |
-
if ( $filter_type == 'attribute' && $attribute == 'price' && $type == 'slider' ) {
|
564 |
-
$min = $max = false;
|
565 |
-
$main_class = 'slider';
|
566 |
-
$slider_class = 'berocket_filter_slider';
|
567 |
-
|
568 |
-
wp_localize_script(
|
569 |
-
'berocket_aapf_widget-script',
|
570 |
-
'br_price_text',
|
571 |
-
array(
|
572 |
-
'before' => (isset($text_before_price) ? $text_before_price : ''),
|
573 |
-
'after' => (isset($text_after_price) ? $text_after_price : ''),
|
574 |
-
)
|
575 |
-
);
|
576 |
-
if ( ! empty($price_values) ) {
|
577 |
-
$price_range = explode( ",", $price_values );
|
578 |
-
} else {
|
579 |
-
$price_range = BeRocket_AAPF_Widget_functions::get_price_range( ( isset($cat_value_limit) ? $cat_value_limit : null ) );
|
580 |
-
}
|
581 |
-
if ( ! empty($price_values) ) {
|
582 |
-
$all_terms_name = $price_range;
|
583 |
-
$all_terms_slug = $price_range;
|
584 |
-
$stringed_is_numeric = true;
|
585 |
-
$min = 0;
|
586 |
-
$max = count( $all_terms_name ) - 1;
|
587 |
-
$slider_with_string = true;
|
588 |
-
} else {
|
589 |
-
if( $price_range ) {
|
590 |
-
foreach ( $price_range as $price ) {
|
591 |
-
if ( $min === false or $min > (int) $price ) {
|
592 |
-
$min = $price;
|
593 |
-
}
|
594 |
-
if ( $max === false or $max < (int) $price ) {
|
595 |
-
$max = $price;
|
596 |
-
}
|
597 |
-
}
|
598 |
-
}
|
599 |
-
if( $use_min_price ) {
|
600 |
-
$min = $min_price;
|
601 |
-
}
|
602 |
-
if ( $use_max_price ) {
|
603 |
-
$max = $max_price;
|
604 |
-
}
|
605 |
-
}
|
606 |
-
if( ! empty($_POST['price']) ) {
|
607 |
-
if ( ! empty($price_values) ) {
|
608 |
-
$slider_value1 = array_search( $_POST['price'][0], $all_terms_name );
|
609 |
-
$slider_value2 = array_search( $_POST['price'][1], $all_terms_name );
|
610 |
-
} else {
|
611 |
-
$slider_value1 = apply_filters('berocket_price_filter_widget_min_amount', apply_filters('berocket_price_slider_widget_min_amount', apply_filters('woocommerce_price_filter_widget_min_amount', $_POST['price'][0])), $_POST['price'][0]);
|
612 |
-
$slider_value2 = apply_filters('berocket_price_filter_widget_max_amount', apply_filters('berocket_price_slider_widget_max_amount', apply_filters('woocommerce_price_filter_widget_max_amount', $_POST['price'][1])), $_POST['price'][1]);
|
613 |
-
}
|
614 |
-
} else {
|
615 |
-
$slider_value1 = $min;
|
616 |
-
$slider_value2 = $max;
|
617 |
-
}
|
618 |
-
$id = 'br_price';
|
619 |
-
$slider_class .= ' berocket_filter_price_slider';
|
620 |
-
$main_class .= ' price';
|
621 |
-
|
622 |
-
$min = floor( $min );
|
623 |
-
$max = ceil( $max );
|
624 |
-
|
625 |
-
$wpml_id = preg_replace( '#^pa_#', '', $id );
|
626 |
-
$wpml_id = 'pa_'.berocket_wpml_attribute_translate($wpml_id);
|
627 |
-
$set_query_var_title['slider_value1'] = $slider_value1;
|
628 |
-
$set_query_var_title['slider_value2'] = $slider_value2;
|
629 |
-
$set_query_var_title['filter_slider_id'] = $wpml_id;
|
630 |
-
$set_query_var_title['main_class'] = $main_class;
|
631 |
-
$set_query_var_title['slider_class'] = $slider_class;
|
632 |
-
$set_query_var_title['min'] = $min;
|
633 |
-
$set_query_var_title['max'] = $max;
|
634 |
-
$set_query_var_title['step'] = $slider_step;
|
635 |
-
$set_query_var_title['slider_with_string'] = $slider_with_string;
|
636 |
-
$set_query_var_title['all_terms_name'] = ( empty($all_terms_name) ? null : $all_terms_name );
|
637 |
-
$set_query_var_title['all_terms_slug'] = ( empty($all_terms_slug) ? null : $all_terms_slug );
|
638 |
-
$set_query_var_title['text_before_price'] = (isset($text_before_price) ? $text_before_price : null);
|
639 |
-
$set_query_var_title['text_after_price'] = (isset($text_after_price) ? $text_after_price : null);
|
640 |
-
$set_query_var_title['enable_slider_inputs'] = (isset($enable_slider_inputs) ? $enable_slider_inputs : null);
|
641 |
-
if( ! empty($number_style) ) {
|
642 |
-
$set_query_var_title['number_style'] = array(
|
643 |
-
( empty($number_style_thousand_separate) ? '' : $number_style_thousand_separate ),
|
644 |
-
( empty($number_style_decimal_separate) ? '' : $number_style_decimal_separate ),
|
645 |
-
( empty($number_style_decimal_number) ? '' : $number_style_decimal_number )
|
646 |
-
);
|
647 |
-
} else {
|
648 |
-
$set_query_var_title['number_style'] = '';
|
649 |
-
}
|
650 |
-
}
|
651 |
-
$set_query_var_title = apply_filters('berocket_query_var_title_before_widget_deprecated', $set_query_var_title, $type, $instance, $args, $terms);
|
652 |
-
set_query_var( 'berocket_query_var_title', $set_query_var_title);
|
653 |
-
br_get_template_part( 'old_templates/'.apply_filters('berocket_widget_load_template_name', $type, $instance, (empty($terms) ? '' : $terms)) );
|
654 |
-
|
655 |
-
do_action('berocket_aapf_widget_before_end');
|
656 |
-
br_get_template_part('old_templates/widget_end');
|
657 |
-
do_action('berocket_aapf_widget_after_end');
|
658 |
-
echo berocket_isset($after_widget);
|
659 |
-
if( BeRocket_AAPF::$debug_mode ) {
|
660 |
-
$widget_error_log['terms'] = (isset($terms) ? $terms : null);
|
661 |
-
}
|
662 |
-
$widget_error_log['return'] = 'OK';
|
663 |
-
$this->filter_return($br_wc_query, $wp_the_query, $wp_query, $wc_query, $old_the_query, $old_query, $widget_error_log);
|
664 |
-
}
|
665 |
-
|
666 |
-
public function filter_return(&$br_wc_query, &$wp_the_query, &$wp_query, &$wc_query, &$old_the_query, &$old_query, $widget_error_log) {
|
667 |
-
BeRocket_AAPF::$error_log['6_widgets'][] = $widget_error_log;
|
668 |
-
if ( isset ( $br_wc_query ) ) {
|
669 |
-
if ( isset ( $old_query ) ) {
|
670 |
-
$wp_the_query = $old_the_query;
|
671 |
-
$wp_query = $old_query;
|
672 |
-
}
|
673 |
-
if( ! empty($wc_query) && is_a($wc_query, 'WP_Query') && class_exists('WC_Query') && method_exists('WC_Query', 'product_query') && method_exists('WC_Query', 'get_main_query') ) {
|
674 |
-
wc()->query->product_query($wc_query);
|
675 |
-
}
|
676 |
-
wc()->query->remove_ordering_args();
|
677 |
-
}
|
678 |
-
do_action('berocket_aapf_filter_end_generation');
|
679 |
-
}
|
680 |
-
//DEPRECATED SOON
|
681 |
-
function update( $new_instance, $old_instance ) {
|
682 |
-
return $old_instance;
|
683 |
-
}
|
684 |
-
function form( $instance ) {
|
685 |
-
include AAPF_TEMPLATE_PATH . "admin.php";
|
686 |
-
}
|
687 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
addons/deprecated_filters/filter_post.php
DELETED
@@ -1,724 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
$attributes = br_aapf_get_attributes();
|
3 |
-
$categories = BeRocket_AAPF_Widget_functions::get_product_categories( '' );
|
4 |
-
$categories = BeRocket_AAPF_Widget_functions::set_terms_on_same_level( $categories );
|
5 |
-
$tags = get_terms( 'product_tag' );
|
6 |
-
$custom_taxonomies = get_object_taxonomies( 'product' );
|
7 |
-
$custom_taxonomies = array_combine($custom_taxonomies, $custom_taxonomies);
|
8 |
-
if( empty($instance['filter_type']) ) {
|
9 |
-
$instance['filter_type'] = 'attribute';
|
10 |
-
}
|
11 |
-
if( empty($instance['attribute']) ) {
|
12 |
-
$instance['attribute'] = 'price';
|
13 |
-
}
|
14 |
-
if( ! empty($instance['version']) ) {
|
15 |
-
$popup_text = '<h2>' . __('ATTENTION! This filter was created with new styles and settings.', 'BeRocket_AJAX_domain') . '</h2>'
|
16 |
-
. '<p>' . __('Plugin do not have feature to move it back to old(DEPRECATED) version automatically.', 'BeRocket_AJAX_domain') . '</p>'
|
17 |
-
. '<p>' . __('If you enabled old(DEPRECATED) filters addon because you have some issues with new version, then please ', 'BeRocket_AJAX_domain')
|
18 |
-
. '<a target="_blank" href="https://berocket.com/contact?step=issue&plugin=1">' . __('CONTACT US', 'BeRocket_AJAX_domain') . '.</a>' . '</p>'
|
19 |
-
. '<p>' . __('You will need to re-create the filter while moving from new to old version.', 'BeRocket_AJAX_domain') . '</p>'
|
20 |
-
. '<p><strong>' . __('Do you want to edit anyway?', 'BeRocket_AJAX_domain') . '</strong></p>';
|
21 |
-
BeRocket_popup_display::add_popup(
|
22 |
-
array(
|
23 |
-
'yes_no_buttons' => array(
|
24 |
-
'show' => true,
|
25 |
-
'yes_text' => __('Yes, edit filter', 'BeRocket_AJAX_domain'),
|
26 |
-
'no_text' => __('No, return back', 'BeRocket_AJAX_domain'),
|
27 |
-
'location' => 'popup',
|
28 |
-
'yes_func' => '',
|
29 |
-
'no_func' => 'window.history.back();setTimeout(function(){if (!braapf_has_history){window.close();}}, 200);',
|
30 |
-
),
|
31 |
-
'no_x_button' => true,
|
32 |
-
'close_with' => array(
|
33 |
-
'yes_button',
|
34 |
-
'no_button', '', '', '', '', '', '', ''
|
35 |
-
),
|
36 |
-
'width' => '600px',
|
37 |
-
'height' => '400px'
|
38 |
-
),
|
39 |
-
$popup_text,
|
40 |
-
array('page_open' => array('type' => 'page_open'))
|
41 |
-
);
|
42 |
-
?>
|
43 |
-
<script>
|
44 |
-
var braapf_has_history = false;
|
45 |
-
jQuery(window).on('beforeunload', function(){
|
46 |
-
braapf_has_history = true;
|
47 |
-
});
|
48 |
-
</script>
|
49 |
-
<?php
|
50 |
-
}
|
51 |
-
echo '<div style="text-align: center;">
|
52 |
-
<p style="font-size: 24px;"><strong>!IMPORTANT!</strong> This filter is <strong>DEPRECATED</strong> and will be replaced with new filters in near future.</p>
|
53 |
-
<p style="font-size: 24px;">We recommend you to replace it manually on a staging/dev/local site first.</p>
|
54 |
-
<p style="font-size: 24px;">You can disable "Deprecated filters" add-on in <a href="' . admin_url('admin.php?page=br-product-filters&tab=addons') . '">Plugin settings</a></p>
|
55 |
-
<button class="berocket_aapf_widget_content_show" style="font-size: 24px;">OK, show filter settings</button>
|
56 |
-
</div>
|
57 |
-
<script>
|
58 |
-
jQuery(document).on("click", ".berocket_aapf_widget_content_show", function(e) {
|
59 |
-
e.preventDefault();
|
60 |
-
jQuery(".berocket_aapf_widget_content").show();
|
61 |
-
jQuery(this).hide();
|
62 |
-
});
|
63 |
-
</script>';
|
64 |
-
?>
|
65 |
-
<div class="berocket_aapf_widget_content" style="display:none;">
|
66 |
-
<div class="widget-liquid-right tab-item current">
|
67 |
-
<div class="berocketwizard_widget_type">
|
68 |
-
<label class="br_admin_center"><?php _e('Widget Type', 'BeRocket_AJAX_domain') ?></label>
|
69 |
-
<select id="<?php echo 'widget_type'; ?>" name="<?php echo $post_name.'[widget_type]'; ?>" class="berocket_aapf_widget_admin_widget_type_select br_select_menu_left">
|
70 |
-
<?php
|
71 |
-
$widget_type_array = apply_filters( 'berocket_widget_widget_type_array', apply_filters( 'berocket_aapf_display_filter_type_list', array(
|
72 |
-
'filter' => __('Filter', 'BeRocket_AJAX_domain'),
|
73 |
-
) ) );
|
74 |
-
$set_widget_type = false;
|
75 |
-
if( ! array_key_exists($instance['widget_type'], $widget_type_array) ) {
|
76 |
-
$set_widget_type = true;
|
77 |
-
}
|
78 |
-
foreach($widget_type_array as $widget_type_id => $widget_type_name) {
|
79 |
-
if( $set_widget_type ) {
|
80 |
-
$instance['widget_type'] = $widget_type_id;
|
81 |
-
$set_widget_type = false;
|
82 |
-
}
|
83 |
-
echo '<option value="'.$widget_type_id.'"'.($widget_type_id == $instance['widget_type'] ? ' selected' : '').'>'.$widget_type_name.'</option>';
|
84 |
-
}
|
85 |
-
?>
|
86 |
-
</select>
|
87 |
-
</div>
|
88 |
-
<?php if( empty($instance['filter_type']) ) $instance['filter_type'] = ''; ?>
|
89 |
-
<div class="berocket_aapf_admin_filter_widget_content" <?php if ( $instance['widget_type'] == 'update_button' or $instance['widget_type'] == 'reset_button' or $instance['widget_type'] == 'selected_area' or $instance['widget_type'] == 'search_box' ) echo 'style="display: none;"'; ?>>
|
90 |
-
<div class="berocketwizard_attribute">
|
91 |
-
<div class="br_admin_half_size_left">
|
92 |
-
<label class="br_admin_center"><?php _e('Filter By', 'BeRocket_AJAX_domain') ?></label>
|
93 |
-
<select id="<?php echo 'filter_type'; ?>" name="<?php echo $post_name.'[filter_type]'; ?>" class="berocket_aapf_widget_admin_filter_type_select br_select_menu_left">
|
94 |
-
<?php
|
95 |
-
$filter_type_array = array(
|
96 |
-
'attribute' => array(
|
97 |
-
'name' => __('Attribute', 'BeRocket_AJAX_domain'),
|
98 |
-
'sameas' => 'attribute',
|
99 |
-
),
|
100 |
-
'tag' => array(
|
101 |
-
'name' => __('Tag', 'BeRocket_AJAX_domain'),
|
102 |
-
'sameas' => 'tag',
|
103 |
-
),
|
104 |
-
'all_product_cat' => array(
|
105 |
-
'name' => __('Product Category', 'BeRocket_AJAX_domain'),
|
106 |
-
'sameas' => 'custom_taxonomy',
|
107 |
-
'attribute' => 'product_cat',
|
108 |
-
),
|
109 |
-
);
|
110 |
-
if ( function_exists('wc_get_product_visibility_term_ids') ) {
|
111 |
-
$filter_type_array['_rating'] = array(
|
112 |
-
'name' => __('Rating', 'BeRocket_AJAX_domain'),
|
113 |
-
'sameas' => '_rating',
|
114 |
-
);
|
115 |
-
}
|
116 |
-
$filter_type_array = apply_filters('berocket_filter_filter_type_array', $filter_type_array, $instance);
|
117 |
-
if( ! array_key_exists($instance['filter_type'], $filter_type_array) ) {
|
118 |
-
foreach($filter_type_array as $filter_type_key => $filter_type_val) {
|
119 |
-
$instance['filter_type'] = $filter_type_key;
|
120 |
-
break;
|
121 |
-
}
|
122 |
-
}
|
123 |
-
if( isset($filter_type_array['price']) ) unset($filter_type_array['price']);
|
124 |
-
foreach($filter_type_array as $filter_type_key => $filter_type_val) {
|
125 |
-
echo '<option';
|
126 |
-
foreach($filter_type_val as $data_key => $data_val) {
|
127 |
-
if( ! empty($data_val) ) {
|
128 |
-
echo ' data-'.$data_key.'="'.( is_array($data_val) ? json_encode($data_val) : $data_val).'"';
|
129 |
-
}
|
130 |
-
}
|
131 |
-
echo ' value="'.$filter_type_key.'"'.($instance['filter_type'] == $filter_type_key ? ' selected' : '').'>'.$filter_type_val['name'].'</option>';
|
132 |
-
if( $instance['filter_type'] == $filter_type_key ) {
|
133 |
-
$sameas = $filter_type_val;
|
134 |
-
}
|
135 |
-
}
|
136 |
-
?>
|
137 |
-
</select>
|
138 |
-
</div>
|
139 |
-
<div class="br_admin_half_size_right berocket_aapf_widget_admin_filter_type_ berocket_aapf_widget_admin_filter_type_attribute" <?php if ( $instance['filter_type'] and $instance['filter_type'] != 'attribute') echo 'style="display: none;"'; ?>>
|
140 |
-
<label class="br_admin_center"><?php _e('Attribute', 'BeRocket_AJAX_domain') ?></label>
|
141 |
-
<select id="<?php echo 'attribute'; ?>" name="<?php echo $post_name.'[attribute]'; ?>" class="berocket_aapf_widget_admin_filter_type_attribute_select br_select_menu_right">
|
142 |
-
<option <?php if ( $instance['attribute'] == 'price' ) echo 'selected'; ?> value="price"><?php _e('Price', 'BeRocket_AJAX_domain') ?></option>
|
143 |
-
<?php foreach ( $attributes as $k => $v ) { ?>
|
144 |
-
<option <?php if ( $instance['attribute'] == $k ) echo 'selected'; ?> value="<?php echo $k ?>"><?php echo $v ?></option>
|
145 |
-
<?php } ?>
|
146 |
-
</select>
|
147 |
-
</div>
|
148 |
-
<div class="br_admin_half_size_right berocket_aapf_widget_admin_filter_type_ berocket_aapf_widget_admin_filter_type_custom_taxonomy" <?php if ( $instance['filter_type'] != 'custom_taxonomy') echo 'style="display: none;"'; ?>>
|
149 |
-
<label class="br_admin_center"><?php _e('Custom Taxonomies', 'BeRocket_AJAX_domain') ?></label>
|
150 |
-
<select id="<?php echo 'custom_taxonomy'; ?>" name="<?php echo $post_name.'[custom_taxonomy]'; ?>" class="berocket_aapf_widget_admin_filter_type_custom_taxonomy_select br_select_menu_right">
|
151 |
-
<?php foreach( $custom_taxonomies as $k => $v ){ ?>
|
152 |
-
<option <?php if ( $instance['custom_taxonomy'] == $k ) echo 'selected'; ?> value="<?php echo $k ?>"><?php echo $v ?></option>
|
153 |
-
<?php } ?>
|
154 |
-
</select>
|
155 |
-
</div>
|
156 |
-
<div style="clear:both;"></div>
|
157 |
-
</div>
|
158 |
-
<?php
|
159 |
-
if( ! empty($sameas) ) {
|
160 |
-
$instance['filter_type'] = $sameas['sameas'];
|
161 |
-
if( ! empty($sameas['attribute']) ) {
|
162 |
-
if( $sameas['sameas'] == 'custom_taxonomy' ) {
|
163 |
-
$instance['custom_taxonomy'] = $sameas['attribute'];
|
164 |
-
} elseif( $sameas['sameas'] == 'attribute' ) {
|
165 |
-
$instance['attribute'] = $sameas['attribute'];
|
166 |
-
}
|
167 |
-
}
|
168 |
-
}
|
169 |
-
?>
|
170 |
-
<div class="br_clearfix"></div>
|
171 |
-
<div class="br_admin_three_size_left br_type_select_block"<?php if( $instance['filter_type'] == 'date' ) echo 'style="display: none;"'; ?>>
|
172 |
-
<label class="br_admin_center"><?php _e('Type', 'BeRocket_AJAX_domain') ?></label>
|
173 |
-
<?php
|
174 |
-
list($berocket_admin_filter_types, $berocket_admin_filter_types_by_attr) = berocket_aapf_get_filter_types();
|
175 |
-
|
176 |
-
$select_options_variants = array();
|
177 |
-
if ( $instance['filter_type'] == 'tag' ) {
|
178 |
-
$select_options_variants = $berocket_admin_filter_types['tag'];
|
179 |
-
} else if ( $instance['filter_type'] == 'product_cat' || ( $instance['filter_type'] == 'custom_taxonomy' && ( $instance['custom_taxonomy'] == 'product_tag' || $instance['custom_taxonomy'] == 'product_cat' ) ) ) {
|
180 |
-
$select_options_variants = $berocket_admin_filter_types['product_cat'];
|
181 |
-
} else if ( $instance['filter_type'] == '_sale' || $instance['filter_type'] == '_stock_status' || $instance['filter_type'] == '_rating' ) {
|
182 |
-
$select_options_variants = $berocket_admin_filter_types['sale'];
|
183 |
-
} else if ( $instance['filter_type'] == 'custom_taxonomy' ) {
|
184 |
-
$select_options_variants = $berocket_admin_filter_types['custom_taxonomy'];
|
185 |
-
} else if ( $instance['filter_type'] == 'attribute' ) {
|
186 |
-
if ( $instance['attribute'] == 'price' ) {
|
187 |
-
$select_options_variants = $berocket_admin_filter_types['price'];
|
188 |
-
} else {
|
189 |
-
$select_options_variants = $berocket_admin_filter_types['attribute'];
|
190 |
-
}
|
191 |
-
} else if ( $instance['filter_type'] == 'filter_by' ) {
|
192 |
-
$select_options_variants = $berocket_admin_filter_types['filter_by'];
|
193 |
-
}
|
194 |
-
?>
|
195 |
-
<select id="<?php echo 'type'; ?>" name="<?php echo $post_name.'[type]'; ?>" class="berocket_aapf_widget_admin_type_select br_select_menu_left">
|
196 |
-
<?php
|
197 |
-
$selected = false;
|
198 |
-
$first = false;
|
199 |
-
foreach($select_options_variants as $select_options_variant) {
|
200 |
-
if( ! empty($berocket_admin_filter_types_by_attr[$select_options_variant]) ) {
|
201 |
-
echo '<option value="' . $berocket_admin_filter_types_by_attr[$select_options_variant]['value'] . '"'
|
202 |
-
. ($instance['type'] == $berocket_admin_filter_types_by_attr[$select_options_variant]['value'] ? ' selected' : '')
|
203 |
-
. '>' . $berocket_admin_filter_types_by_attr[$select_options_variant]['text'] . '</option>';
|
204 |
-
if( $instance['type'] == $berocket_admin_filter_types_by_attr[$select_options_variant]['value'] ) {
|
205 |
-
$selected = true;
|
206 |
-
}
|
207 |
-
if( $first === false ) {
|
208 |
-
$first = $berocket_admin_filter_types_by_attr[$select_options_variant]['value'];
|
209 |
-
}
|
210 |
-
}
|
211 |
-
}
|
212 |
-
if( ! $selected ) {
|
213 |
-
$instance['type'] = $first;
|
214 |
-
}
|
215 |
-
?>
|
216 |
-
</select>
|
217 |
-
</div>
|
218 |
-
<div class="br_admin_three_size_left" <?php if ( ( ! $instance['filter_type'] or $instance['filter_type'] == 'attribute' ) and $instance['attribute'] == 'price' or $instance['type'] == 'slider' or $instance['filter_type'] == 'date' or $instance['filter_type'] == '_sale' or $instance['filter_type'] == '_rating' ) echo " style='display: none;'"; ?> >
|
219 |
-
<label class="br_admin_center"><?php _e('Operator', 'BeRocket_AJAX_domain') ?></label>
|
220 |
-
<select id="<?php echo 'operator'; ?>" name="<?php echo $post_name.'[operator]'; ?>" class="berocket_aapf_widget_admin_operator_select br_select_menu_left">
|
221 |
-
<option <?php if ( $instance['operator'] == 'AND' ) echo 'selected'; ?> value="AND">AND</option>
|
222 |
-
<option <?php if ( $instance['operator'] == 'OR' ) echo 'selected'; ?> value="OR">OR</option>
|
223 |
-
</select>
|
224 |
-
</div>
|
225 |
-
<div class="berocket_aapf_order_values_by br_admin_three_size_left" <?php if ( ! $instance['filter_type'] or $instance['filter_type'] == 'date' or $instance['filter_type'] == '_sale' or $instance['filter_type'] == '_rating' or $instance['filter_type'] == '_stock_status' or ( $instance['filter_type'] == 'attribute' and $instance['attribute'] == 'price' )) echo 'style="display: none;"'; ?>>
|
226 |
-
<label class="br_admin_center"><?php _e('Values Order', 'BeRocket_AJAX_domain') ?></label>
|
227 |
-
<select id="<?php echo 'order_values_by'; ?>" name="<?php echo $post_name.'[order_values_by]'; ?>" class="berocket_aapf_order_values_by_select br_select_menu_left">
|
228 |
-
<option value=""><?php _e('Default', 'BeRocket_AJAX_domain') ?></option>
|
229 |
-
<?php foreach ( array( 'Alpha' => __('Alpha', 'BeRocket_AJAX_domain'), 'Numeric' => __('Numeric', 'BeRocket_AJAX_domain') ) as $v_i => $v ) { ?>
|
230 |
-
<option <?php if ( $instance['order_values_by'] == $v_i ) echo 'selected'; ?> value="<?php echo $v_i ?>"><?php echo $v; ?></option>
|
231 |
-
<?php } ?>
|
232 |
-
</select>
|
233 |
-
</div>
|
234 |
-
<div class="berocket_aapf_order_values_type br_admin_three_size_left" <?php if ( (( $instance['filter_type'] != 'attribute' && $instance['filter_type'] != 'custom_taxonomy') || ($instance['filter_type'] == 'attribute' && $instance['attribute'] == 'price') || $instance['type'] == 'ranges') && $instance['filter_type'] != '_rating' && $instance['filter_type'] != 'tag' ) echo 'style="display: none;"'; ?>>
|
235 |
-
<label class="br_admin_center"><?php _e('Order Type', 'BeRocket_AJAX_domain') ?></label>
|
236 |
-
<select id="<?php echo 'order_values_type'; ?>" name="<?php echo $post_name.'[order_values_type]'; ?>" class="berocket_aapf_order_values_type_select br_select_menu_left">
|
237 |
-
<?php foreach ( array( 'asc' => __( 'Ascending', 'BeRocket_AJAX_domain' ), 'desc' => __( 'Descending', 'BeRocket_AJAX_domain' ) ) as $v_i => $v ) { ?>
|
238 |
-
<option <?php if ( $instance['order_values_type'] == $v_i ) echo 'selected'; ?> value="<?php echo $v_i; ?>"><?php echo $v; ?></option>
|
239 |
-
<?php } ?>
|
240 |
-
</select>
|
241 |
-
</div>
|
242 |
-
<div class="br_clearfix"></div>
|
243 |
-
<div class="berocket_widget_color_pick">
|
244 |
-
<?php if ( $instance['type'] == 'color' || $instance['type'] == 'image' ) {
|
245 |
-
if ( $instance['filter_type'] == 'attribute' ) {
|
246 |
-
$attribute_color_view = $instance['attribute'];
|
247 |
-
} elseif ( $instance['filter_type'] == 'product_cat' ) {
|
248 |
-
$attribute_color_view = 'product_cat';
|
249 |
-
} elseif ( $instance['filter_type'] == 'tag' ) {
|
250 |
-
$attribute_color_view = 'product_tag';
|
251 |
-
} elseif ( $instance['filter_type'] == 'custom_taxonomy' ) {
|
252 |
-
$attribute_color_view = $instance['custom_taxonomy'];
|
253 |
-
}
|
254 |
-
BeRocket_AAPF_Widget_functions::color_list_view( $instance['type'], $attribute_color_view, true );
|
255 |
-
} ?>
|
256 |
-
</div>
|
257 |
-
<div class="berocket_ranges_block"<?php if ( ! $instance['filter_type'] or $instance['filter_type'] != 'attribute' or $instance['attribute'] != 'price' or $instance['type'] != 'ranges' ) echo ' style="display: none;"'; ?>>
|
258 |
-
<?php
|
259 |
-
if ( isset( $instance['ranges'] ) && is_array( $instance['ranges'] ) && count( $instance['ranges'] ) > 0 ) {
|
260 |
-
foreach ( $instance['ranges'] as $range ) {
|
261 |
-
?><div class="berocket_ranges">
|
262 |
-
<input type="number" min="1" id="<?php echo 'ranges'; ?>" name="<?php echo $post_name.'[ranges]'; ?>[]" value="<?php echo $range; ?>">
|
263 |
-
<a href="#remove" class="berocket_remove_ranges"><i class="fa fa-times"></i></a>
|
264 |
-
</div><?php
|
265 |
-
}
|
266 |
-
} else {
|
267 |
-
?><div class="berocket_ranges">
|
268 |
-
<input type="number" min="1" id="<?php echo 'ranges'; ?>" name="<?php echo $post_name.'[ranges]'; ?>[]" value="1">
|
269 |
-
<a href="#remove" class="berocket_remove_ranges"><i class="fa fa-times"></i></a>
|
270 |
-
</div>
|
271 |
-
<div class="berocket_ranges">
|
272 |
-
<input type="number" min="1" id="<?php echo 'ranges'; ?>" name="<?php echo $post_name.'[ranges]'; ?>[]" value="50">
|
273 |
-
<a href="#remove" class="berocket_remove_ranges"><i class="fa fa-times"></i></a>
|
274 |
-
</div> <?php
|
275 |
-
}
|
276 |
-
?><div><a href="#add" class="berocket_add_ranges" data-html='<div class="berocket_ranges"><input type="number" min="1" id="<?php echo 'ranges'; ?>" name="<?php echo $post_name.'[ranges]'; ?>[]" value="1"><a href="#remove" class="berocket_remove_ranges"><i class="fa fa-times"></i></a></div>'><i class="fa fa-plus"></i></a></div>
|
277 |
-
<label>
|
278 |
-
<select name="<?php echo $post_name.'[range_display_type]'; ?>">
|
279 |
-
<optgroup label="<?php _e('Ranges: 1,100,200,1000', 'BeRocket_AJAX_domain'); ?>">
|
280 |
-
<?php
|
281 |
-
$range_types = array(
|
282 |
-
array('value' => '', 'name' => __('1.00-100.00, 101.00-200.00, 201.00-1000.00', 'BeRocket_AJAX_domain')),
|
283 |
-
array('value' => 'same', 'name' => __('1.00-100.00, 100.00-200.00, 200.00-1000.00', 'BeRocket_AJAX_domain')),
|
284 |
-
array('value' => 'decimal', 'name' => __('1.00-99.99, 100.00-199.99, 200.00-999.99', 'BeRocket_AJAX_domain')),
|
285 |
-
);
|
286 |
-
foreach($range_types as $range_type) {
|
287 |
-
echo '<option value="'.$range_type['value'].'"'.(br_get_value_from_array($instance, 'range_display_type') == $range_type['value'] ? ' selected' : '').'>'.$range_type['name'].'</option>';
|
288 |
-
}
|
289 |
-
?>
|
290 |
-
</optgroup>
|
291 |
-
</select>
|
292 |
-
</label>
|
293 |
-
<br />
|
294 |
-
<label>
|
295 |
-
<input type="checkbox" name="<?php echo $post_name.'[hide_first_last_ranges]'; ?>" <?php if ( ! empty($instance['hide_first_last_ranges']) ) echo 'checked'; ?> value="1" />
|
296 |
-
<?php _e('Hide first and last ranges without products', 'BeRocket_AJAX_domain') ?>
|
297 |
-
</label>
|
298 |
-
<br />
|
299 |
-
<label>
|
300 |
-
<input class="braapf_show_last_to_infinity" type="checkbox" name="<?php echo $post_name.'[show_last_to_infinity]'; ?>" <?php if ( ! empty($instance['show_last_to_infinity']) ) echo 'checked'; ?> value="1" />
|
301 |
-
<?php _e('Replace the last range value with the infinity symbol', 'BeRocket_AJAX_domain') ?>
|
302 |
-
</label>
|
303 |
-
<br />
|
304 |
-
<label class="braapf_to_infinity_text"<?php if ( empty($instance['show_last_to_infinity']) ) echo 'style="display:none;"'; ?>>
|
305 |
-
<?php _e('Infinity text', 'BeRocket_AJAX_domain') ?>
|
306 |
-
<input type="text" name="<?php echo $post_name.'[to_infinity_text]'; ?>" placeholder="∞"value="<?php echo berocket_isset($instance['to_infinity_text']); ?>">
|
307 |
-
</label>
|
308 |
-
<script>
|
309 |
-
jQuery('.braapf_show_last_to_infinity').change(function() {
|
310 |
-
if( jQuery(this).prop('checked') ) {
|
311 |
-
jQuery('.braapf_to_infinity_text').show();
|
312 |
-
} else {
|
313 |
-
jQuery('.braapf_to_infinity_text').hide();
|
314 |
-
}
|
315 |
-
});
|
316 |
-
</script>
|
317 |
-
<br />
|
318 |
-
<label>
|
319 |
-
<input type="checkbox" name="<?php echo $post_name.'[disable_multiple_ranges]'; ?>" <?php if ( ! empty($instance['disable_multiple_ranges']) ) echo 'checked'; ?> value="1" />
|
320 |
-
<?php _e('Disable multiple selection?', 'BeRocket_AJAX_domain') ?>
|
321 |
-
</label>
|
322 |
-
</div>
|
323 |
-
<div <?php if ( $instance['filter_type'] != 'attribute' || $instance['attribute'] != 'price' ) echo " style='display: none;'"; ?> class="berocket_aapf_widget_admin_price_attribute" >
|
324 |
-
<div class="br-row">
|
325 |
-
<div class="br-column-6">
|
326 |
-
<label class="br_admin_center" for="<?php echo 'text_before_price'; ?>"><?php _e('Text before price:', 'BeRocket_AJAX_domain') ?> </label>
|
327 |
-
<input class="br_admin_full_size" id="<?php echo 'text_before_price'; ?>" type="text" name="<?php echo $post_name.'[text_before_price]'; ?>" value="<?php echo $instance['text_before_price']; ?>"/>
|
328 |
-
</div>
|
329 |
-
<div class="br-column-6">
|
330 |
-
<label class="br_admin_center" for="<?php echo 'text_after_price'; ?>"><?php _e('after:', 'BeRocket_AJAX_domain') ?> </label>
|
331 |
-
<input class="br_admin_full_size" id="<?php echo 'text_after_price'; ?>" type="text" name="<?php echo $post_name.'[text_after_price]'; ?>" value="<?php echo $instance['text_after_price']; ?>" /><br>
|
332 |
-
</div>
|
333 |
-
</div>
|
334 |
-
<span>%cur_symbol% will be replaced with currency symbol($)<br/>%cur_slug% will be replaced with currency code(USD)</span><br>
|
335 |
-
<div class="berocket_aapf_widget_admin_ranges_hide" style="<?php echo ($instance['type'] == 'ranges' ? 'display: none;' : '' ) ?>">
|
336 |
-
<input id="<?php echo 'enable_slider_inputs'; ?>" type="checkbox" name="<?php echo $post_name.'[enable_slider_inputs]'; ?>" value="1"<?php if( ! empty($instance['enable_slider_inputs']) ) echo ' checked'; ?>/>
|
337 |
-
<label for="<?php echo 'enable_slider_inputs'; ?>"><?php _e('Enable Slider input fields', 'BeRocket_AJAX_domain') ?> </label>
|
338 |
-
</div>
|
339 |
-
</div>
|
340 |
-
<div <?php if ( $instance['filter_type'] != 'attribute' || $instance['attribute'] != 'price' ) echo " style='display: none;'"; ?> class="berocket_aapf_widget_admin_price_attribute" >
|
341 |
-
<label for="<?php echo 'price_values'; ?>"><?php _e('Use custom values(comma separated):', 'BeRocket_AJAX_domain') ?> </label>
|
342 |
-
<input class="br_admin_full_size" id="<?php echo 'price_values'; ?>" type="text" name="<?php echo $post_name.'[price_values]'; ?>" value="<?php echo br_get_value_from_array($instance, 'price_values'); ?>"/>
|
343 |
-
<small><?php _e('* use numeric values only, strings will not work as expected', 'BeRocket_AJAX_domain') ?></small>
|
344 |
-
</div>
|
345 |
-
<div class="br_clearfix"></div>
|
346 |
-
<div class="berocket_aapf_product_sub_cat_current" <?php if( $instance['filter_type'] != 'product_cat' ) echo 'style="display:none;"'; ?>>
|
347 |
-
<div class="br-line-space double"></div>
|
348 |
-
<div>
|
349 |
-
<label>
|
350 |
-
<input class="berocket_aapf_product_sub_cat_current_input" type="checkbox" name="<?php echo $post_name.'[parent_product_cat_current]'; ?>" <?php if ( $instance['parent_product_cat_current'] ) echo 'checked'; ?> value="1" />
|
351 |
-
<?php _e('Use current product category to get child', 'BeRocket_AJAX_domain') ?>
|
352 |
-
</label>
|
353 |
-
</div>
|
354 |
-
<div class="br-line-space"></div>
|
355 |
-
<div>
|
356 |
-
<label for="<?php echo 'depth_count'; ?>"><?php _e('Deep level:', 'BeRocket_AJAX_domain') ?></label>
|
357 |
-
<input id="<?php echo 'depth_count'; ?>" type="number" min=0 name="<?php echo $post_name.'[depth_count]'; ?>" value="<?php echo $instance['depth_count']; ?>" />
|
358 |
-
</div>
|
359 |
-
<div class="br-line-space double"></div>
|
360 |
-
</div>
|
361 |
-
<div class="berocket_aapf_product_sub_cat_div" <?php if( $instance['filter_type'] != 'product_cat' || $instance['parent_product_cat_current'] ) echo 'style="display:none;"'; ?>>
|
362 |
-
<label><?php _e('Product Category:', 'BeRocket_AJAX_domain') ?></label>
|
363 |
-
<ul class="berocket_aapf_advanced_settings_categories_list">
|
364 |
-
<li>
|
365 |
-
<?php
|
366 |
-
echo '<input type="radio" name="' . $post_name.'[parent_product_cat]'. '" ' .
|
367 |
-
( empty($instance['parent_product_cat']) ? 'checked' : '' ) . ' value="" ' .
|
368 |
-
'class="berocket_aapf_widget_admin_height_input" />';
|
369 |
-
?>
|
370 |
-
<?php _e('None', 'BeRocket_AJAX_domain') ?>
|
371 |
-
</li>
|
372 |
-
<?php
|
373 |
-
$selected_category = false;
|
374 |
-
foreach ( $categories as $category ) {
|
375 |
-
if ( (int) $instance['parent_product_cat'] == (int) $category->term_id ) {
|
376 |
-
$selected_category = true;
|
377 |
-
}
|
378 |
-
echo '<li>';
|
379 |
-
if ( (int) $category->depth ) {
|
380 |
-
for ( $depth_i = 0; $depth_i < $category->depth; $depth_i ++ ) {
|
381 |
-
echo " ";
|
382 |
-
}
|
383 |
-
}
|
384 |
-
echo '<input type="radio" name="' . $post_name.'[parent_product_cat]' . '" ' .
|
385 |
-
( ( $selected_category ) ? 'checked' : '' ) . ' value="' . ( $category->term_id ).'" ' .
|
386 |
-
'class="berocket_aapf_widget_admin_height_input" />' . ( $category->name );
|
387 |
-
echo '</li>';
|
388 |
-
$selected_category = false;
|
389 |
-
}
|
390 |
-
?>
|
391 |
-
</ul>
|
392 |
-
</div>
|
393 |
-
<div class="berocket_options_for_select"<?php if( ( $instance['filter_type'] != 'tag' and $instance['filter_type'] != 'custom_taxonomy' and $instance['filter_type'] != 'attribute' and $instance['filter_type'] != 'product_cat' ) or $instance['type'] != 'select' ) echo ' style="display:none;"'; ?>>
|
394 |
-
<div>
|
395 |
-
<label for="<?php echo 'select_first_element_text'; ?>"><?php _e('Text of the first element', 'BeRocket_AJAX_domain') ?> </label>
|
396 |
-
<input placeholder="<?php _e('Any', 'BeRocket_AJAX_domain'); ?>" id="<?php echo 'select_first_element_text'; ?>" type="text" name="<?php echo $post_name.'[select_first_element_text]'; ?>" value="<?php echo $instance['select_first_element_text']; ?>" />
|
397 |
-
</div>
|
398 |
-
<div>
|
399 |
-
<label>
|
400 |
-
<input type="checkbox" name="<?php echo $post_name; ?>[select_multiple]" <?php if ( ! empty($instance['select_multiple']) ) echo 'checked'; ?> value="1" />
|
401 |
-
<?php _e('Multiple select', 'BeRocket_AJAX_domain') ?>
|
402 |
-
</label>
|
403 |
-
</div>
|
404 |
-
</div>
|
405 |
-
<div class="br_clearfix"></div>
|
406 |
-
<h3><?php _e('Advanced Settings', 'BeRocket_AJAX_domain') ?></h3>
|
407 |
-
<div>
|
408 |
-
<?php $advanced_settings_elements = array(
|
409 |
-
'attribute_count' => '
|
410 |
-
<div class="berocket_attributes_checkbox_radio_data"'
|
411 |
-
.( ( ( $instance['filter_type'] != 'custom_taxonomy' and $instance['filter_type'] != 'attribute' ) or ( $instance['type'] != 'checkbox' and $instance['type'] != 'radio' and $instance['type'] != 'color' and $instance['type'] != 'image' )) ? ' style="display:none;"' : '' ).'>
|
412 |
-
<label for="attribute_count">'.__('Number of Attribute values', 'BeRocket_AJAX_domain').'</label>
|
413 |
-
<input id="attribute_count" type="number" name="'.$post_name.'[attribute_count]" placeholder="'.__('From settings', 'BeRocket_AJAX_domain').'" value="'.$instance['attribute_count'].'" />
|
414 |
-
<div>'.__('Show/Hide button', 'BeRocket_AJAX_domain').'
|
415 |
-
<select name="'.$post_name.'[attribute_count_show_hide]">
|
416 |
-
<option value="">'.__('Default', 'BeRocket_AJAX_domain').'</option>
|
417 |
-
<option value="visible"'.( (br_get_value_from_array($instance, 'attribute_count_show_hide') == 'visible') ? ' selected' : '' ).'>'.__('Always visible', 'BeRocket_AJAX_domain').'</option>
|
418 |
-
<option value="hidden"'.( (br_get_value_from_array($instance, 'attribute_count_show_hide') == 'hidden') ? ' selected' : '' ).'>'.__('Always hidden', 'BeRocket_AJAX_domain').'</option>
|
419 |
-
</select>
|
420 |
-
</div>
|
421 |
-
</div>',
|
422 |
-
'number_style' => '
|
423 |
-
<div class="berocket_attributes_number_style_data"'.( ( ( $instance['filter_type'] != 'custom_taxonomy' and $instance['filter_type'] != 'attribute' ) or $instance['type'] != 'slider') ? ' style="display:none;"' : '' ).'>
|
424 |
-
<div>
|
425 |
-
<input class="berocket_attributes_number_style" id="number_style" type="checkbox" name="'.$post_name.'[number_style]"'.( empty($instance['number_style']) ? '' : 'checked' ).' value="1" />
|
426 |
-
<label for="number_style">'.__('Use specific number style', 'BeRocket_AJAX_domain').'</label>
|
427 |
-
</div>
|
428 |
-
<div class="berocket_attributes_number_styles"'.( empty($instance['number_style']) ? ' style="display:none;"' : '' ).'>
|
429 |
-
<div>
|
430 |
-
<label for="number_style_thousand_separate">'.__('Thousands separator', 'BeRocket_AJAX_domain').'</label>
|
431 |
-
<input id="number_style_thousand_separate" type="text" name="'.$post_name.'[number_style_thousand_separate]" value="'.$instance['number_style_thousand_separate'].'" />
|
432 |
-
</div>
|
433 |
-
<div>
|
434 |
-
<label for="number_style_decimal_separate">'.__('Decimal separator', 'BeRocket_AJAX_domain').'</label>
|
435 |
-
<input id="number_style_decimal_separate" type="text" name="'.$post_name.'[number_style_decimal_separate]" value="'.$instance['number_style_decimal_separate'].'" />
|
436 |
-
</div>
|
437 |
-
<div>
|
438 |
-
<label for="number_style_decimal_number">'.__('Number of digits after decimal point', 'BeRocket_AJAX_domain').'</label>
|
439 |
-
<input id="number_style_decimal_number" type="number" name="'.$post_name.'[number_style_decimal_number]" value="'.$instance['number_style_decimal_number'].'" />
|
440 |
-
</div>
|
441 |
-
</div>
|
442 |
-
</div>
|
443 |
-
',
|
444 |
-
/*'widget_collapse_disable' => '
|
445 |
-
<div>
|
446 |
-
<input id="widget_collapse_disable" type="checkbox" name="'.$post_name.'[widget_collapse_disable]"'.( empty($instance['widget_collapse_disable']) ? '' : ' checked' ).' value="1" />
|
447 |
-
<label for="widget_collapse_disable">'.__('Disable collapse option', 'BeRocket_AJAX_domain').'</label>
|
448 |
-
</div>
|
449 |
-
',*/
|
450 |
-
'widget_collapse_enable' => '
|
451 |
-
<div>
|
452 |
-
<input id="widget_collapse_enable" type="checkbox" name="'.$post_name.'[widget_collapse_enable]"'.( empty($instance['widget_collapse_enable']) ? '' : ' checked' ).' value="1" />
|
453 |
-
<label for="widget_collapse_enable">'.__('Enable minimization option', 'BeRocket_AJAX_domain').'</label>
|
454 |
-
</div>
|
455 |
-
',
|
456 |
-
'widget_is_hide' =>'
|
457 |
-
<div class="berocket_aapf_widget_is_hide">
|
458 |
-
<input id="widget_is_hide" type="checkbox" name="'.$post_name.'[widget_is_hide]"'.( empty($instance['widget_is_hide']) ? '' : ' checked' ).' value="1" />
|
459 |
-
<label for="widget_is_hide">'.__('Minimize the widget on load?', 'BeRocket_AJAX_domain').'</label>
|
460 |
-
</div>
|
461 |
-
',
|
462 |
-
'hide_collapse_arrow' => '
|
463 |
-
<div class="berocket_aapf_hide_collapse_arrow">
|
464 |
-
<input id="hide_collapse_arrow" type="checkbox" name="'.$post_name.'[hide_collapse_arrow]"'.( empty($instance['hide_collapse_arrow']) ? '' : ' checked' ).' value="1" />
|
465 |
-
<label for="hide_collapse_arrow">'.__('Hide minimization arrow?', 'BeRocket_AJAX_domain').'</label>
|
466 |
-
</div>
|
467 |
-
',
|
468 |
-
'hide_child_attributes' => '
|
469 |
-
<div class="berocket_aapf_widget_admin_non_price_tag_cloud_select"'
|
470 |
-
.( ( $instance['filter_type'] == 'date' || ( $instance['filter_type'] != 'date' && ( $instance['type'] == 'tag_cloud' || $instance['type'] == 'slider' || $instance['type'] == 'select' ) ) ) ? ' style="display:none;"' : '' ).'>
|
471 |
-
<input id="hide_child_attributes" type="checkbox" name="'.$post_name.'[hide_child_attributes]"'.( empty($instance['hide_child_attributes']) ? '' : ' checked' ).' value="1" />
|
472 |
-
<label for="hide_child_attributes">'.__('Show hierarchical values as a tree with hidden child values on load?', 'BeRocket_AJAX_domain').'</label>
|
473 |
-
</div>
|
474 |
-
',
|
475 |
-
);
|
476 |
-
$advanced_settings_elements = apply_filters('berocket_widget_advanced_settings_elements', $advanced_settings_elements, $post_name, $instance);
|
477 |
-
echo implode($advanced_settings_elements);
|
478 |
-
?>
|
479 |
-
<div class="berocket_aapf_advanced_color_pick_settings"<?php if ( $instance['type'] != 'color' && $instance['type'] != 'image' ) echo " style='display: none;'"; ?>>
|
480 |
-
<div>
|
481 |
-
<input id="<?php echo 'use_value_with_color'; ?>" type="checkbox" name="<?php echo $post_name.'[use_value_with_color]'; ?>" <?php if ( $instance['use_value_with_color'] ) echo 'checked'; ?> value="1" />
|
482 |
-
<label for="<?php echo 'use_value_with_color'; ?>"><?php _e('Display value next to color/image?', 'BeRocket_AJAX_domain') ?></label>
|
483 |
-
</div>
|
484 |
-
<div>
|
485 |
-
<input id="<?php echo 'disable_multiple'; ?>" type="checkbox" name="<?php echo $post_name.'[disable_multiple]'; ?>" <?php if ( ! empty( $instance['disable_multiple'] ) ) echo 'checked'; ?> value="1" />
|
486 |
-
<label for="<?php echo 'disable_multiple'; ?>"><?php _e('Disable multiple selection?', 'BeRocket_AJAX_domain') ?></label>
|
487 |
-
</div>
|
488 |
-
<div>
|
489 |
-
<label for="color_image_block_size"><?php _e('Size of blocks(Height x Width)', 'BeRocket_AJAX_domain') ?></label>
|
490 |
-
<select id="color_image_block_size" name="<?php echo $post_name; ?>[color_image_block_size]">
|
491 |
-
<?php
|
492 |
-
$color_image_sizes = array(
|
493 |
-
'h2em w2em' => __('2em x 2em', 'BeRocket_AJAX_domain'),
|
494 |
-
'h1em w1em' => __('1em x 1em', 'BeRocket_AJAX_domain'),
|
495 |
-
'h1em w2em' => __('1em x 2em', 'BeRocket_AJAX_domain'),
|
496 |
-
'h2em w3em' => __('2em x 3em', 'BeRocket_AJAX_domain'),
|
497 |
-
'h2em w4em' => __('2em x 4em', 'BeRocket_AJAX_domain'),
|
498 |
-
'h3em w3em' => __('3em x 3em', 'BeRocket_AJAX_domain'),
|
499 |
-
'h3em w4em' => __('3em x 4em', 'BeRocket_AJAX_domain'),
|
500 |
-
'h3em w5em' => __('3em x 5em', 'BeRocket_AJAX_domain'),
|
501 |
-
'h4em w4em' => __('4em x 4em', 'BeRocket_AJAX_domain'),
|
502 |
-
'h4em w5em' => __('4em x 5em', 'BeRocket_AJAX_domain'),
|
503 |
-
'h5em w5em' => __('5em x 5em', 'BeRocket_AJAX_domain'),
|
504 |
-
'hxpx_wxpx' => __('Custom size', 'BeRocket_AJAX_domain'),
|
505 |
-
);
|
506 |
-
foreach($color_image_sizes as $color_image_size_id => $color_image_size_name) {
|
507 |
-
echo '<option value="'.$color_image_size_id.'"'.(br_get_value_from_array($instance, 'color_image_block_size') == $color_image_size_id ? ' selected' : '').'>'.$color_image_size_name.'</option>';
|
508 |
-
}
|
509 |
-
?>
|
510 |
-
</select>
|
511 |
-
<div class="color_image_block_size_ color_image_block_size_hxpx_wxpx"<?php if( br_get_value_from_array($instance, 'color_image_block_size') != 'hxpx_wxpx') echo ' style="display: none;"'; ?>>
|
512 |
-
<label><?php _e('Custom size(Height x Width)', 'BeRocket_AJAX_domain') ?></label>
|
513 |
-
<p>
|
514 |
-
<input type="number" placeholder="50" name="<?php echo $post_name; ?>[color_image_block_size_height]" value="<?php echo br_get_value_from_array($instance, 'color_image_block_size_height'); ?>">px x
|
515 |
-
<input type="number" placeholder="50" name="<?php echo $post_name; ?>[color_image_block_size_width]" value="<?php echo br_get_value_from_array($instance, 'color_image_block_size_width'); ?>">px</p>
|
516 |
-
</div>
|
517 |
-
</div>
|
518 |
-
<div>
|
519 |
-
<label for="color_image_checked"><?php _e('Selected value style', 'BeRocket_AJAX_domain') ?></label>
|
520 |
-
<select id="color_image_checked" name="<?php echo $post_name; ?>[color_image_checked]">
|
521 |
-
<?php
|
522 |
-
$color_image_sizes = array(
|
523 |
-
'brchecked_default' => __('Default', 'BeRocket_AJAX_domain'),
|
524 |
-
'brchecked_rotate' => __('Rotate', 'BeRocket_AJAX_domain'),
|
525 |
-
'brchecked_scale' => __('Scale', 'BeRocket_AJAX_domain'),
|
526 |
-
'brchecked_shadow' => __('Blue Shadow', 'BeRocket_AJAX_domain'),
|
527 |
-
'brchecked_custom' => __('Custom CSS', 'BeRocket_AJAX_domain'),
|
528 |
-
);
|
529 |
-
foreach($color_image_sizes as $color_image_size_id => $color_image_size_name) {
|
530 |
-
echo '<option value="'.$color_image_size_id.'"'.(br_get_value_from_array($instance, 'color_image_checked') == $color_image_size_id ? ' selected' : '').'>'.$color_image_size_name.'</option>';
|
531 |
-
}
|
532 |
-
?>
|
533 |
-
</select>
|
534 |
-
<div class="color_image_checked_ color_image_checked_brchecked_custom"<?php if( br_get_value_from_array($instance, 'color_image_checked') != 'brchecked_custom') echo ' style="display: none;"'; ?>>
|
535 |
-
<label for="color_image_checked_custom_css"><?php _e('Custom CSS for Checked block', 'BeRocket_AJAX_domain') ?></label>
|
536 |
-
<p><textarea style="width: 100%;" id="color_image_checked_custom_css" name="<?php echo $post_name; ?>[color_image_checked_custom_css]"><?php echo br_get_value_from_array($instance, 'color_image_checked_custom_css');?></textarea></p>
|
537 |
-
</div>
|
538 |
-
</div>
|
539 |
-
</div>
|
540 |
-
<div class="br-line-space double"></div>
|
541 |
-
<div class="br_accordion br_icons">
|
542 |
-
<h3><?php _e('Icons', 'BeRocket_AJAX_domain') ?></h3>
|
543 |
-
<div>
|
544 |
-
<label class="br_admin_center"><?php _e('Title Icons', 'BeRocket_AJAX_domain') ?></label>
|
545 |
-
<div class="br_clearfix"></div>
|
546 |
-
<div class="br_admin_half_size_left"><?php echo berocket_font_select_upload(__('Before', 'BeRocket_AJAX_domain'), 'icon_before_title', $post_name.'[icon_before_title]', $instance['icon_before_title'] ); ?></div>
|
547 |
-
<div class="br_admin_half_size_right"><?php echo berocket_font_select_upload(__('After', 'BeRocket_AJAX_domain'), 'icon_after_title' , $post_name.'[icon_after_title]' , $instance['icon_after_title'] ); ?></div>
|
548 |
-
<div class="br_clearfix"></div>
|
549 |
-
<div class="berocket_aapf_icons_select_block" <?php if ($instance['type'] == 'select') echo 'style="display:none;"' ?>>
|
550 |
-
<label class="br_admin_center"><?php _e('Value Icons', 'BeRocket_AJAX_domain') ?></label>
|
551 |
-
<div class="br_clearfix"></div>
|
552 |
-
<div class="br_admin_half_size_left"><?php echo berocket_font_select_upload(__('Before', 'BeRocket_AJAX_domain'), 'icon_before_value', $post_name.'[icon_before_value]', $instance['icon_before_value'] ); ?></div>
|
553 |
-
<div class="br_admin_half_size_right"><?php echo berocket_font_select_upload(__('After', 'BeRocket_AJAX_domain') , 'icon_after_value' , $post_name.'[icon_after_value]', $instance['icon_after_value'] ); ?></div>
|
554 |
-
<div class="br_clearfix"></div>
|
555 |
-
</div>
|
556 |
-
</div>
|
557 |
-
</div>
|
558 |
-
<div>
|
559 |
-
<label class="br_admin_center" style="text-align: left;" for="<?php echo 'description'; ?>"><?php _e('Description', 'BeRocket_AJAX_domain') ?></label>
|
560 |
-
<textarea style="resize: none; width: 100%;" id="<?php echo 'description'; ?>" name="<?php echo $post_name.'[description]'; ?>"><?php echo $instance['description']; ?></textarea>
|
561 |
-
</div>
|
562 |
-
<?php echo br_get_value_from_array($instance, 'filter_type_attribute'); ?>
|
563 |
-
<div class="berocket_aapf_widget_admin_tag_cloud_block" <?php if ($instance['type'] != 'tag_cloud') echo 'style="display:none;"' ?>>
|
564 |
-
<div>
|
565 |
-
<label for="<?php echo 'tag_cloud_height'; ?>"><?php _e('Tags Cloud Height:', 'BeRocket_AJAX_domain') ?> </label>
|
566 |
-
<input id="<?php echo 'tag_cloud_height'; ?>" type="text" name="<?php echo $post_name.'[tag_cloud_height]'; ?>" value="<?php echo berocket_isset($instance['tag_cloud_height']); ?>" class="berocket_aapf_widget_admin_height_input" />px
|
567 |
-
</div>
|
568 |
-
<div>
|
569 |
-
<label for="<?php echo 'tag_cloud_min_font'; ?>"><?php _e('Min Font Size:', 'BeRocket_AJAX_domain') ?> </label>
|
570 |
-
<input id="<?php echo 'tag_cloud_min_font'; ?>" type="text" name="<?php echo $post_name.'[tag_cloud_min_font]'; ?>" value="<?php echo berocket_isset($instance['tag_cloud_min_font']); ?>" class="berocket_aapf_widget_admin_height_input" />px
|
571 |
-
</div>
|
572 |
-
<div>
|
573 |
-
<label for="<?php echo 'tag_cloud_max_font'; ?>"><?php _e('Max Font Size:', 'BeRocket_AJAX_domain') ?> </label>
|
574 |
-
<input id="<?php echo 'tag_cloud_max_font'; ?>" type="text" name="<?php echo $post_name.'[tag_cloud_max_font]'; ?>" value="<?php echo berocket_isset($instance['tag_cloud_max_font']); ?>" class="berocket_aapf_widget_admin_height_input" />px
|
575 |
-
</div>
|
576 |
-
<div>
|
577 |
-
<label for="<?php echo 'tag_cloud_tags_count'; ?>"><?php _e('Max Tags Count:', 'BeRocket_AJAX_domain') ?> </label>
|
578 |
-
<input id="<?php echo 'tag_cloud_tags_count'; ?>" type="text" name="<?php echo $post_name.'[tag_cloud_tags_count]'; ?>" value="<?php echo berocket_isset($instance['tag_cloud_tags_count']); ?>" class="berocket_aapf_widget_admin_height_input" />
|
579 |
-
</div>
|
580 |
-
</div>
|
581 |
-
<div class="berocket_aapf_widget_admin_price_attribute" <?php if ( ! ( $instance['attribute'] == 'price' && $instance['type'] == 'slider' ) ) echo " style='display: none;'"; ?> >
|
582 |
-
<div class="br_admin_half_size_left">
|
583 |
-
<div class="berocket_aapf_checked_show_next">
|
584 |
-
<input id="<?php echo 'use_min_price'; ?>" type="checkbox" name="<?php echo $post_name.'[use_min_price]'; ?>" <?php if ( $instance['use_min_price'] ) echo 'checked'; ?> value="1" class="berocket_aapf_widget_admin_input_price_is"/>
|
585 |
-
<label class="br_admin_full_size" for="<?php echo 'use_min_price'; ?>"><?php _e('Use min price', 'BeRocket_AJAX_domain') ?></label>
|
586 |
-
</div>
|
587 |
-
<div <?php if ( !$instance['use_min_price'] ) echo 'style="display:none"'; ?>>
|
588 |
-
<input type=number min=0 id="<?php echo 'min_price'; ?>" name="<?php echo $post_name.'[min_price]'; ?>" value="<?php echo ( ( $instance['min_price'] ) ? $instance['min_price'] : '0' ); ?>" class="br_admin_full_size berocket_aapf_widget_admin_input_price">
|
589 |
-
</div>
|
590 |
-
</div>
|
591 |
-
<div class="br_admin_half_size_right">
|
592 |
-
<div class="berocket_aapf_checked_show_next">
|
593 |
-
<input id="<?php echo 'use_max_price'; ?>" type="checkbox" name="<?php echo $post_name.'[use_max_price]'; ?>" <?php if ( $instance['use_max_price'] ) echo 'checked'; ?> value="1" class="berocket_aapf_widget_admin_input_price_is"/>
|
594 |
-
<label class="br_admin_full_size" for="<?php echo 'use_max_price'; ?>"><?php _e('Use max price', 'BeRocket_AJAX_domain') ?></label>
|
595 |
-
</div>
|
596 |
-
<div <?php if ( !$instance['use_max_price'] ) echo 'style="display:none"'; ?>>
|
597 |
-
<input type=number min=0 id="<?php echo 'max_price'; ?>" name="<?php echo $post_name.'[max_price]'; ?>" value="<?php echo ( ( $instance['max_price'] ) ? $instance['max_price'] : '0' ); ?>" class="br_admin_full_size berocket_aapf_widget_admin_input_price">
|
598 |
-
</div>
|
599 |
-
</div>
|
600 |
-
<div class="br_clearfix"></div>
|
601 |
-
</div>
|
602 |
-
<div>
|
603 |
-
<label for="<?php echo 'height'; ?>"><?php _e('Height of the Filter Block:', 'BeRocket_AJAX_domain') ?> </label>
|
604 |
-
<input id="<?php echo 'height'; ?>" type="text" name="<?php echo $post_name.'[height]'; ?>" value="<?php echo $instance['height']; ?>" class="berocket_aapf_widget_admin_height_input" />px
|
605 |
-
</div>
|
606 |
-
<div>
|
607 |
-
<label for="<?php echo 'scroll_theme'; ?>"><?php _e('Scrollbar theme:', 'BeRocket_AJAX_domain') ?> </label>
|
608 |
-
<select id="<?php echo 'scroll_theme'; ?>" name="<?php echo $post_name.'[scroll_theme]'; ?>" class="berocket_aapf_widget_admin_scroll_theme_select br_select_menu_left">
|
609 |
-
<?php
|
610 |
-
$scroll_themes = array("light", "dark", "minimal", "minimal-dark", "light-2", "dark-2", "light-3", "dark-3", "light-thick", "dark-thick", "light-thin",
|
611 |
-
"dark-thin", "inset", "inset-dark", "inset-2", "inset-2-dark", "inset-3", "inset-3-dark", "rounded", "rounded-dark", "rounded-dots",
|
612 |
-
"rounded-dots-dark", "3d", "3d-dark", "3d-thick", "3d-thick-dark");
|
613 |
-
foreach( $scroll_themes as $theme ): ?>
|
614 |
-
<option <?php if ( $instance['scroll_theme'] == $theme ) echo 'selected'; ?>><?php echo $theme; ?></option>
|
615 |
-
<?php endforeach; ?>
|
616 |
-
</select>
|
617 |
-
</div>
|
618 |
-
<?php do_action( 'berocket_widget_filter_advanced_settings_end', $post_name, $instance); ?>
|
619 |
-
</div>
|
620 |
-
</div>
|
621 |
-
<div class="berocket_aapf_admin_widget_selected_area" <?php if ( $instance['widget_type'] != 'selected_area' or $instance['widget_type'] == 'search_box' ) echo 'style="display: none;"'; ?>>
|
622 |
-
<div class="br-line-space"></div>
|
623 |
-
<div>
|
624 |
-
<label>
|
625 |
-
<input type="checkbox" name="<?php echo $post_name.'[selected_area_show]'; ?>" <?php if ( $instance['selected_area_show'] ) echo 'checked'; ?> value="1" />
|
626 |
-
<?php _e('Show if nothing is selected', 'BeRocket_AJAX_domain') ?>
|
627 |
-
</label>
|
628 |
-
</div>
|
629 |
-
<div>
|
630 |
-
<label>
|
631 |
-
<input type="checkbox" name="<?php echo $post_name.'[hide_selected_arrow]'; ?>" <?php if ( $instance['hide_selected_arrow'] ) echo 'checked'; ?> value="1" />
|
632 |
-
<?php _e('Hide minimization arrow?', 'BeRocket_AJAX_domain') ?>
|
633 |
-
</label>
|
634 |
-
</div>
|
635 |
-
<div>
|
636 |
-
<label>
|
637 |
-
<input type="checkbox" name="<?php echo $post_name.'[selected_is_hide]'; ?>" <?php if ( $instance['selected_is_hide'] ) echo 'checked'; ?> value="1" />
|
638 |
-
<?php _e('Minimize the widget on load?', 'BeRocket_AJAX_domain') ?>
|
639 |
-
</label>
|
640 |
-
</div>
|
641 |
-
</div>
|
642 |
-
<?php do_action( 'berocket_widget_filter_post_end', $post_name, $instance); ?>
|
643 |
-
<script>
|
644 |
-
jQuery('#color_image_block_size').on('change', function() {
|
645 |
-
jQuery('.color_image_block_size_').hide();
|
646 |
-
jQuery('.color_image_block_size_'+jQuery(this).val()).show();
|
647 |
-
});
|
648 |
-
jQuery('#color_image_checked').on('change', function() {
|
649 |
-
jQuery('.color_image_checked_').hide();
|
650 |
-
jQuery('.color_image_checked_'+jQuery(this).val()).show();
|
651 |
-
});
|
652 |
-
jQuery(document).ready(function() {
|
653 |
-
jQuery('.br_colorpicker_field').each(function (i,o){
|
654 |
-
jQuery(o).css('backgroundColor', '#'+jQuery(o).data('color'));
|
655 |
-
jQuery(o).colpick({
|
656 |
-
layout: 'hex',
|
657 |
-
submit: 0,
|
658 |
-
color: '#'+jQuery(o).data('color'),
|
659 |
-
onChange: function(hsb,hex,rgb,el,bySetColor) {
|
660 |
-
jQuery(el).removeClass('colorpicker_removed');
|
661 |
-
jQuery(el).css('backgroundColor', '#'+hex).next().val(hex).trigger('change');
|
662 |
-
}
|
663 |
-
})
|
664 |
-
});
|
665 |
-
});
|
666 |
-
function berocket_aapf_widget_is_hide () {
|
667 |
-
if( jQuery('#widget_collapse_enable').prop('checked') ) {
|
668 |
-
jQuery('.berocket_aapf_widget_is_hide, .berocket_aapf_hide_collapse_arrow').show();
|
669 |
-
} else {
|
670 |
-
jQuery('.berocket_aapf_widget_is_hide, .berocket_aapf_hide_collapse_arrow').hide();
|
671 |
-
}
|
672 |
-
}
|
673 |
-
jQuery(document).on('change', '#widget_collapse_enable', berocket_aapf_widget_is_hide);
|
674 |
-
berocket_aapf_widget_is_hide();
|
675 |
-
</script>
|
676 |
-
<?php $instance['cat_value_limit'] = ( empty($instance['cat_value_limit']) ? '' : urldecode($instance['cat_value_limit']) ); ?>
|
677 |
-
<div class="berocket_widget_output_limitation_block"<?php if( ! empty($instance['widget_type']) && $instance['widget_type'] != 'filter' ) echo ' style="display: none";'?>>
|
678 |
-
<h3 class="berocket_aapf_admin_section_title "><?php _e('Widget Output Limitations', 'BeRocket_AJAX_domain') ?></h3>
|
679 |
-
<div class="br_accordion berocket_product_category_value_limit"<?php if( ! empty($instance['widget_type']) && $instance['widget_type'] != 'filter' ) echo ' style="display: none";'?>>
|
680 |
-
<h3><?php _e('Product Category Value Limitation', 'BeRocket_AJAX_domain') ?></h3>
|
681 |
-
<div>
|
682 |
-
<ul class="br_admin_150_height">
|
683 |
-
<li>
|
684 |
-
<input type="radio" name="<?php echo $post_name.'[cat_value_limit]'; ?>" <?php if ( ! $instance['cat_value_limit'] ) echo 'checked'; ?> value="0"/>
|
685 |
-
<?php _e('Disable', 'BeRocket_AJAX_domain') ?>
|
686 |
-
</li>
|
687 |
-
<?php
|
688 |
-
foreach( $categories as $category ){
|
689 |
-
$selected_category = false;
|
690 |
-
if( $instance['cat_value_limit'] == $category->slug )
|
691 |
-
$selected_category = true;
|
692 |
-
?>
|
693 |
-
<li>
|
694 |
-
<?php
|
695 |
-
if ( (int)$category->depth ) for ( $depth_i = 0; $depth_i < $category->depth*3; $depth_i++ ) echo " ";
|
696 |
-
?>
|
697 |
-
<input type="radio" name="<?php echo $post_name.'[cat_value_limit]'; ?>" <?php if ( $selected_category ) echo 'checked'; ?> value="<?php echo $category->slug ?>"/>
|
698 |
-
<?php echo $category->name ?>
|
699 |
-
</li>
|
700 |
-
<?php } ?>
|
701 |
-
</ul>
|
702 |
-
</div>
|
703 |
-
</div>
|
704 |
-
<?php do_action( 'berocket_widget_filter_output_limitation_end', $post_name, $instance); ?>
|
705 |
-
</div>
|
706 |
-
<div class="berocket_widget_reset_button_block"<?php if( empty($instance['widget_type']) || $instance['widget_type'] != 'reset_button' ) echo ' style="display: none";'?>>
|
707 |
-
<label class="br_admin_center"><?php _e('Hide button', 'BeRocket_AJAX_domain') ?></label>
|
708 |
-
<select id="<?php echo 'operator'; ?>" name="<?php echo $post_name.'[reset_hide]'; ?>" class="br_select_menu_left">
|
709 |
-
<option <?php if ( empty($instance['reset_hide']) ) echo 'selected'; ?> value=""><?php _e('Do not hide', 'BeRocket_AJAX_domain'); ?></option>
|
710 |
-
<option <?php if ( $instance['reset_hide'] == 'berocket_no_filters' ) echo 'selected'; ?> value="berocket_no_filters"><?php _e('Hide only when no filters on page', 'BeRocket_AJAX_domain'); ?></option>
|
711 |
-
<option <?php if ( $instance['reset_hide'] == 'berocket_no_filters berocket_not_selected' ) echo 'selected'; ?> value="berocket_no_filters berocket_not_selected"><?php _e('Hide when no filters on page or page not filtered', 'BeRocket_AJAX_domain'); ?></option>
|
712 |
-
</select>
|
713 |
-
</div>
|
714 |
-
<div>
|
715 |
-
<h3><label class="br_admin_center" style="text-align: left;" for="<?php echo 'css_class'; ?>"><?php _e('CSS Class', 'BeRocket_AJAX_domain') ?> </label></h3>
|
716 |
-
<input id="<?php echo 'css_class'; ?>" type="text" name="<?php echo $post_name.'[css_class]'; ?>" value="<?php echo $instance['css_class']; ?>" class="berocket_aapf_widget_admin_css_class_input br_admin_full_size" />
|
717 |
-
<small class="br_admin_center" style="font-size: 1em;"><?php _e('(use white space for multiple classes)', 'BeRocket_AJAX_domain') ?></small>
|
718 |
-
</div>
|
719 |
-
<script>
|
720 |
-
if( typeof(br_widget_set) == 'function' )
|
721 |
-
br_widget_set();
|
722 |
-
</script>
|
723 |
-
</div>
|
724 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
addons/deprecated_filters/images/ajax-loader.gif
DELETED
Binary file
|
addons/deprecated_filters/j.doe.cloud.min.js
DELETED
@@ -1,320 +0,0 @@
|
|
1 |
-
(function($) {
|
2 |
-
$.fn["doecloud"] = function(options) {
|
3 |
-
return this.each(function() {
|
4 |
-
var $this = $(this);
|
5 |
-
var opts = $this.data('options');
|
6 |
-
if(!opts) {
|
7 |
-
opts = $.extend({}, $.fn.doecloud.defaults, options);
|
8 |
-
}else{
|
9 |
-
$.extend(opts, options);
|
10 |
-
$this.data('options', opts);
|
11 |
-
}
|
12 |
-
if(opts.ui){
|
13 |
-
$(this).addClass('ui-widget');
|
14 |
-
$(this).addClass('ui-widget-content');
|
15 |
-
$(this).addClass('ui-corner-all');
|
16 |
-
}
|
17 |
-
|
18 |
-
var width = opts.width;
|
19 |
-
if(!width){
|
20 |
-
width=$(this).width();
|
21 |
-
}
|
22 |
-
var height = opts.height;
|
23 |
-
if(!height){
|
24 |
-
height=$(this).height();
|
25 |
-
}
|
26 |
-
|
27 |
-
var rel = height/width;
|
28 |
-
var rel2 = rel*rel;
|
29 |
-
var rel2e = rel2;
|
30 |
-
$(this).css({overflow:'hidden',width:width+'px',height:height+'px',position:'relative'});
|
31 |
-
|
32 |
-
var maxSize = -1;
|
33 |
-
var maxFontsize = opts.maxFontSize;
|
34 |
-
var endFontSize = opts.minFontSize;
|
35 |
-
var maxCount = opts.maxCount;
|
36 |
-
var count = 0;
|
37 |
-
var cX = width*0.5;
|
38 |
-
var cY = height*0.5;
|
39 |
-
var spacing = opts.spacing;
|
40 |
-
|
41 |
-
var cloud = [];
|
42 |
-
var linesXf = [];
|
43 |
-
var linesXs = [];
|
44 |
-
var linesYf = [];
|
45 |
-
var linesYs = [];
|
46 |
-
|
47 |
-
var minValueItem = -1;
|
48 |
-
var maxValueItem = 1;
|
49 |
-
$(this).find(opts.itemSelector).each(function(){
|
50 |
-
var val = parseInt($(this).attr(opts.valueAttribute));
|
51 |
-
if( minValueItem == -1 || minValueItem > val ) {
|
52 |
-
minValueItem = val;
|
53 |
-
}
|
54 |
-
if( val > maxValueItem ) {
|
55 |
-
maxValueItem = val;
|
56 |
-
}
|
57 |
-
})
|
58 |
-
var minItemTopPos = -1;
|
59 |
-
var maxItemTopPos = 0;
|
60 |
-
$(this).find(opts.itemSelector).each(function(){
|
61 |
-
if(opts.ui){
|
62 |
-
$(this).addClass('ui-state-default');
|
63 |
-
$(this).addClass('ui-corner-all');
|
64 |
-
}
|
65 |
-
|
66 |
-
var first = false;
|
67 |
-
var val = parseInt($(this).attr(opts.valueAttribute));
|
68 |
-
if(maxSize==-1){
|
69 |
-
maxSize = val;
|
70 |
-
first = true;
|
71 |
-
}
|
72 |
-
var fontSize = endFontSize+(maxFontsize-endFontSize)*((val-minValueItem)/(maxValueItem-minValueItem));
|
73 |
-
count++;
|
74 |
-
if(count>maxCount){
|
75 |
-
$(this).css('display','none');
|
76 |
-
return true;
|
77 |
-
}
|
78 |
-
$(this).css({position:'absolute',display:'inline-block','font-size':Math.round(fontSize)+'px'});
|
79 |
-
var iW = $(this).outerWidth()+spacing;
|
80 |
-
var iH = $(this).outerHeight()+spacing;
|
81 |
-
var iX = Math.round(-iW*0.5);
|
82 |
-
var iY = Math.round(-iH*0.5);
|
83 |
-
var radius2 = 10000000;
|
84 |
-
var lastRadius2 = 0;
|
85 |
-
|
86 |
-
// Lets try everything
|
87 |
-
var pX = 0;
|
88 |
-
var pcX = 0;
|
89 |
-
var pcX2 = 0;
|
90 |
-
var pY = 0;
|
91 |
-
var pcY = 0;
|
92 |
-
var pcY2 = 0;
|
93 |
-
|
94 |
-
//////////////////////////////////////////
|
95 |
-
// left
|
96 |
-
var l1=linesXf.length;
|
97 |
-
for(var i=0;i<l1;i++){
|
98 |
-
pX = linesXf[i]-iW;
|
99 |
-
pcX = linesXf[i]-iW*0.5;
|
100 |
-
//pcX *= rel;
|
101 |
-
pcX2 = pcX*pcX;
|
102 |
-
if(pcX2*rel2e<lastRadius2){
|
103 |
-
continue;
|
104 |
-
}
|
105 |
-
|
106 |
-
// Try middle first
|
107 |
-
pY = -iH*0.5;
|
108 |
-
pcY = 0;
|
109 |
-
|
110 |
-
if(pcX2*rel2<radius2){
|
111 |
-
// Object closer
|
112 |
-
// Collision?
|
113 |
-
if(!doeCollision(cloud,pX,pY,iW,iH)){
|
114 |
-
iX = pX;
|
115 |
-
iY = pY;
|
116 |
-
radius2=pcX2*rel2;
|
117 |
-
}
|
118 |
-
}
|
119 |
-
/////////////////////////
|
120 |
-
// Top
|
121 |
-
var l2=linesYf.length;
|
122 |
-
for(var j=0;j<l2;j++){
|
123 |
-
pY = linesYf[j]-iH;
|
124 |
-
pcY = linesYf[j]-iH*0.5;
|
125 |
-
pcY2 = pcY*pcY;
|
126 |
-
|
127 |
-
// Closer?
|
128 |
-
if(pcY2+pcX2*rel2<radius2 && pcY2+pcX2*rel2e>lastRadius2 && cX+pX >= 0 && cY+pY >= 0 && cX+pX+iW <= width && cX+pX+iH <= height){
|
129 |
-
// Object closer
|
130 |
-
// Collision?
|
131 |
-
if(!doeCollision(cloud,pX,pY,iW,iH)){
|
132 |
-
iX = pX;
|
133 |
-
iY = pY;
|
134 |
-
radius2=pcY2+pcX2*rel2;
|
135 |
-
}
|
136 |
-
}
|
137 |
-
}
|
138 |
-
/////////////////////////
|
139 |
-
// Bottom
|
140 |
-
var l2=linesYf.length;
|
141 |
-
for(var j=0;j<l2;j++){
|
142 |
-
pY = linesYs[j];
|
143 |
-
pcY = linesYs[j]-iH*0.5;
|
144 |
-
pcY2 = pcY*pcY;
|
145 |
-
// Closer?
|
146 |
-
if(pcY2+pcX2*rel2<radius2 && pcY2+pcX2*rel2e>lastRadius2 && cX+pX >= 0 && cY+pY >= 0 && cX+pX+iW <= width && cX+pX+iH <= height){
|
147 |
-
// Object closer
|
148 |
-
// Collision?
|
149 |
-
if(!doeCollision(cloud,pX,pY,iW,iH)){
|
150 |
-
iX = pX;
|
151 |
-
iY = pY;
|
152 |
-
radius2=pcY2+pcX2*rel2;
|
153 |
-
}
|
154 |
-
}
|
155 |
-
}
|
156 |
-
}
|
157 |
-
|
158 |
-
//////////////////////////////////////////
|
159 |
-
// right
|
160 |
-
var l1=linesXs.length;
|
161 |
-
for(var i=0;i<linesXs.length;i++){
|
162 |
-
pX = linesXs[i];
|
163 |
-
pcX = linesXs[i]+iW*0.5;
|
164 |
-
//pcX *= rel;
|
165 |
-
pcX2 = pcX*pcX;
|
166 |
-
if(pcX2*rel2e<lastRadius2){
|
167 |
-
continue;
|
168 |
-
}
|
169 |
-
|
170 |
-
// Try middle first
|
171 |
-
pY = -iH*0.5;
|
172 |
-
pcY = 0;
|
173 |
-
pcY2 = 0;
|
174 |
-
if(pcX2*rel2<radius2){
|
175 |
-
// Object closer
|
176 |
-
// Collision?
|
177 |
-
if(!doeCollision(cloud,pX,pY,iW,iH)){
|
178 |
-
iX = pX;
|
179 |
-
iY = pY;
|
180 |
-
radius2=pcX2*rel2;
|
181 |
-
}
|
182 |
-
}
|
183 |
-
/////////////////////////
|
184 |
-
// Top
|
185 |
-
var l2=linesYf.length;
|
186 |
-
for(var j=0;j<l2;j++){
|
187 |
-
pY = linesYf[j]-iH;
|
188 |
-
pcY = linesYf[j]-iH*0.5;
|
189 |
-
pcY2 = pcY*pcY;
|
190 |
-
// Closer?
|
191 |
-
if(pcY2+pcX2*rel2<radius2 && pcY2+pcX2*rel2e>lastRadius2 && cX+pX >= 0 && cY+pY >= 0 && cX+pX+iW <= width && cX+pX+iH <= height){
|
192 |
-
// Object closer
|
193 |
-
// Collision?
|
194 |
-
if(!doeCollision(cloud,pX,pY,iW,iH)){
|
195 |
-
iX = pX;
|
196 |
-
iY = pY;
|
197 |
-
radius2=pcY2+pcX2*rel2;
|
198 |
-
}
|
199 |
-
}
|
200 |
-
}
|
201 |
-
/////////////////////////
|
202 |
-
// Bottom
|
203 |
-
var l2=linesYs.length;
|
204 |
-
for(var j=0;j<l2;j++){
|
205 |
-
pY = linesYs[j];
|
206 |
-
pcY = linesYs[j]+iH*0.5;
|
207 |
-
pcY2 = pcY*pcY;
|
208 |
-
// Closer?
|
209 |
-
if(pcY2+pcX2*rel2<radius2 && pcY2+pcX2*rel2e>lastRadius2 && cX+pX >= 0 && cY+pY >= 0 && cX+pX+iW <= width && cX+pX+iH <= height){
|
210 |
-
// Object closer
|
211 |
-
// Collision?
|
212 |
-
if(!doeCollision(cloud,pX,pY,iW,iH)){
|
213 |
-
iX = pX;
|
214 |
-
iY = pY;
|
215 |
-
radius2=pcY2+pcX2*rel2;
|
216 |
-
}
|
217 |
-
}
|
218 |
-
}
|
219 |
-
}
|
220 |
-
////////////////////////
|
221 |
-
// center top
|
222 |
-
pX = -iW*0.5;
|
223 |
-
pcX = 0;
|
224 |
-
pcX2 = 0;
|
225 |
-
var l1=linesYf.length;
|
226 |
-
for(var i=0;i<l1;i++){
|
227 |
-
pY = linesYf[i]-iH;
|
228 |
-
pcY = linesYf[i]-iH*0.5;
|
229 |
-
pcY2 = pcY*pcY;
|
230 |
-
if(pcY2+pcX2*rel2<radius2 && pcY2+pcX2*rel2e>lastRadius2 && cX+pX >= 0 && cY+pY >= 0 && cX+pX+iW <= width && cX+pX+iH <= height){
|
231 |
-
// Object closer
|
232 |
-
// Collision?
|
233 |
-
if(!doeCollision(cloud,pX,pY,iW,iH)){
|
234 |
-
iX = pX;
|
235 |
-
iY = pY;
|
236 |
-
radius2=pcY2+pcX2*rel2;
|
237 |
-
}
|
238 |
-
}
|
239 |
-
}
|
240 |
-
////////////////////////
|
241 |
-
// center bottom
|
242 |
-
var l1=linesYs.length;
|
243 |
-
for(var i=0;i<l1;i++){
|
244 |
-
pY = linesYs[i];
|
245 |
-
pcY = linesYs[i]+iH*0.5;
|
246 |
-
pcY2 = pcY*pcY;
|
247 |
-
if(pcY2+pcX2*rel2<radius2 && pcY2+pcX2*rel2e>lastRadius2 && cX+pX >= 0 && cY+pY >= 0 && cX+pX+iW <= width && cX+pX+iH <= height){
|
248 |
-
// Object closer
|
249 |
-
// Collision?
|
250 |
-
if(!doeCollision(cloud,pX,pY,iW,iH)){
|
251 |
-
iX = pX;
|
252 |
-
iY = pY;
|
253 |
-
radius2=pcY2+pcX2*rel2;
|
254 |
-
}
|
255 |
-
}
|
256 |
-
}
|
257 |
-
if( ! (cX+iX >= 0 && cY+iY >= 0 && cX+iX+iW <= width && cY+iY+iH <= height) ) {
|
258 |
-
$(this).hide();
|
259 |
-
} else {
|
260 |
-
if( minItemTopPos == -1 || (cY+iY) < minItemTopPos ) {
|
261 |
-
minItemTopPos = (cY+iY);
|
262 |
-
}
|
263 |
-
if( (cY+iY+iH) > maxItemTopPos ) {
|
264 |
-
maxItemTopPos = (cY+iY+iH);
|
265 |
-
}
|
266 |
-
}
|
267 |
-
$(this).css({left:(cX+iX)+'px',top:(cY+iY)+'px'});
|
268 |
-
linesXf.push(iX);
|
269 |
-
linesXs.push(iX+iW);
|
270 |
-
linesYf.push(iY);
|
271 |
-
linesYs.push(iY+iH);
|
272 |
-
cloud.push({x:iX+1,y:iY+1,w:iW-2,h:iH-2});
|
273 |
-
lastRadius2 = radius2;
|
274 |
-
});
|
275 |
-
if( minItemTopPos > 0 ) {
|
276 |
-
$(this).find(opts.itemSelector).each(function(){
|
277 |
-
var itemTop = $(this).css('top');
|
278 |
-
if( itemTop ) {
|
279 |
-
itemTop.replace('px', '');
|
280 |
-
itemTop = parseFloat(itemTop);
|
281 |
-
itemTop = itemTop - minItemTopPos;
|
282 |
-
$(this).css('top', itemTop+'px');
|
283 |
-
}
|
284 |
-
});
|
285 |
-
}
|
286 |
-
if( ! opts.height ) {
|
287 |
-
$(this).css('height', (10 + maxItemTopPos - minItemTopPos)+'px');
|
288 |
-
}
|
289 |
-
|
290 |
-
});
|
291 |
-
};
|
292 |
-
|
293 |
-
$.fn.doecloud.defaults = {
|
294 |
-
itemSelector: ' > li',
|
295 |
-
valueAttribute: 'title',
|
296 |
-
width: 0,
|
297 |
-
height: 0,
|
298 |
-
spacing: 0,
|
299 |
-
maxFontSize: 40,
|
300 |
-
minFontSize: 4,
|
301 |
-
maxCount: 100,
|
302 |
-
promote: true,
|
303 |
-
ui: true
|
304 |
-
};
|
305 |
-
})(jQuery);
|
306 |
-
|
307 |
-
function doeCollision(objects,x,y,width,height){
|
308 |
-
var l=objects.length;
|
309 |
-
for(var i=0;i<l;i++){
|
310 |
-
var o=objects[i];
|
311 |
-
if(
|
312 |
-
(x+width)>=o.x && x<=(o.x+o.w) &&
|
313 |
-
(y+height)>=o.y && y<=(o.y+o.h)
|
314 |
-
){
|
315 |
-
return true;
|
316 |
-
}
|
317 |
-
}
|
318 |
-
return false;
|
319 |
-
}
|
320 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
addons/deprecated_filters/settings/design.php
DELETED
@@ -1,773 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
$fonts_list = g_fonts_list();
|
3 |
-
?>
|
4 |
-
<table class="wp-list-table widefat fixed posts">
|
5 |
-
<thead>
|
6 |
-
<tr>
|
7 |
-
<th class="manage-column column-cb check-column" id="cb" scope="col">
|
8 |
-
<label for="cb-select-all-1" class="screen-reader-text"><?php _e('Select All', 'BeRocket_AJAX_domain') ?></label>
|
9 |
-
<input type="checkbox" id="cb-select-all-1" />
|
10 |
-
</th>
|
11 |
-
<th class="manage-column" scope="col"><?php _e('Element', 'BeRocket_AJAX_domain') ?></th>
|
12 |
-
<th class="manage-column admin-column-color" scope="col"><?php _e('Color', 'BeRocket_AJAX_domain') ?></th>
|
13 |
-
<th class="manage-column admin-column-font-family" scope="col"><?php _e('Font Family', 'BeRocket_AJAX_domain') ?></th>
|
14 |
-
<th class="manage-column admin-column-font-weight" scope="col"><?php _e('Font-Weight', 'BeRocket_AJAX_domain') ?><br /><small><?php _e('(depends on font)', 'BeRocket_AJAX_domain') ?></small></th>
|
15 |
-
<th class="manage-column admin-column-font-size" scope="col"><?php _e('Font-Size', 'BeRocket_AJAX_domain') ?></th>
|
16 |
-
<th class="manage-column admin-column-theme" scope="col"><?php _e('Theme', 'BeRocket_AJAX_domain') ?></th>
|
17 |
-
</tr>
|
18 |
-
</thead>
|
19 |
-
|
20 |
-
<tfoot>
|
21 |
-
<tr>
|
22 |
-
<th class="manage-column column-cb check-column" scope="col">
|
23 |
-
<label for="cb-select-all-2" class="screen-reader-text"><?php _e('Select All', 'BeRocket_AJAX_domain') ?></label>
|
24 |
-
<input type="checkbox" id="cb-select-all-2" />
|
25 |
-
</th>
|
26 |
-
<th class="manage-column" scope="col"><?php _e('Element', 'BeRocket_AJAX_domain') ?></th>
|
27 |
-
<th class="manage-column admin-column-color" scope="col"><?php _e('Color', 'BeRocket_AJAX_domain') ?></th>
|
28 |
-
<th class="manage-column admin-column-font-family" scope="col"><?php _e('Font Family', 'BeRocket_AJAX_domain') ?></th>
|
29 |
-
<th class="manage-column admin-column-font-weight" scope="col"><?php _e('Font-Weight', 'BeRocket_AJAX_domain') ?><br /><small><?php _e('(depends on font)', 'BeRocket_AJAX_domain') ?></small></th>
|
30 |
-
<th class="manage-column admin-column-font-size" scope="col"><?php _e('Font-Size', 'BeRocket_AJAX_domain') ?></th>
|
31 |
-
<th class="manage-column admin-column-theme" scope="col"><?php _e('Theme', 'BeRocket_AJAX_domain') ?></th>
|
32 |
-
</tr>
|
33 |
-
<tr>
|
34 |
-
<th class="manage-column admin-column-theme" scope="col" colspan="7">
|
35 |
-
<input type="button" value="<?php _e('Set all to theme default', 'BeRocket_AJAX_domain') ?>" class="all_theme_default button">
|
36 |
-
<div style="clear:both;"></div>
|
37 |
-
</th>
|
38 |
-
</tr>
|
39 |
-
</tfoot>
|
40 |
-
|
41 |
-
<tbody id="the-list">
|
42 |
-
<?php
|
43 |
-
$i_designable = 1;
|
44 |
-
foreach ( $designables as $key => $designable ) {
|
45 |
-
?>
|
46 |
-
<tr class="type-page status-publish author-self">
|
47 |
-
<th class="check-column" scope="row">
|
48 |
-
<label for="cb-select-<?php echo $i_designable ?>" class="screen-reader-text"><?php _e('Select Element', 'BeRocket_AJAX_domain') ?></label>
|
49 |
-
<input type="checkbox" value="<?php echo $i_designable ?>" name="element[]" id="cb-select-<?php echo $i_designable ?>">
|
50 |
-
<div class="locked-indicator"></div>
|
51 |
-
</th>
|
52 |
-
<td><?php echo $designable['name'] ?></td>
|
53 |
-
<td class="admin-column-color">
|
54 |
-
<?php if ( $designable['has']['color'] ) { ?>
|
55 |
-
<div class="br_colorpicker_field" data-color="<?php echo ( ! empty($options['styles'][$key]['color']) ) ? $options['styles'][$key]['color'] : '000000' ?>"></div>
|
56 |
-
<input type="hidden" value="<?php echo ( ! empty($options['styles'][$key]['color']) ) ? $options['styles'][$key]['color'] : '' ?>" name="br_filters_options[styles][<?php echo $key ?>][color]" />
|
57 |
-
<input type="button" value="<?php _e('Default', 'BeRocket_AJAX_domain') ?>" class="theme_default button tiny-button">
|
58 |
-
<?php } else {
|
59 |
-
_e('N/A', 'BeRocket_AJAX_domain');
|
60 |
-
} ?>
|
61 |
-
</td>
|
62 |
-
<td class="admin-column-font-family">
|
63 |
-
<?php if ( $designable['has']['font_family'] ) { ?>
|
64 |
-
<select name="br_filters_options[styles][<?php echo $key ?>][font_family]">
|
65 |
-
<option value=""><?php _e('Theme Default', 'BeRocket_AJAX_domain') ?></option>
|
66 |
-
<?php foreach( $fonts_list as $font ) { ?>
|
67 |
-
<option <?php echo ( br_get_value_from_array($options, array('styles', $key, 'font_family')) == $font ) ? 'selected' : '' ?>><?php echo $font?></option>
|
68 |
-
<?php } ?>
|
69 |
-
</select>
|
70 |
-
<?php } else {
|
71 |
-
_e('N/A', 'BeRocket_AJAX_domain');
|
72 |
-
} ?>
|
73 |
-
</td>
|
74 |
-
<td class="admin-column-font-weight">
|
75 |
-
<?php if ( $designable['has']['bold'] ) {
|
76 |
-
if( empty( $options['styles'][$key]['bold'] ) ) {
|
77 |
-
$options['styles'][$key]['bold'] = '';
|
78 |
-
} ?>
|
79 |
-
<select name="br_filters_options[styles][<?php echo $key ?>][bold]">
|
80 |
-
<option value=""><?php _e('Theme Default', 'BeRocket_AJAX_domain') ?></option>
|
81 |
-
<?php
|
82 |
-
$font_weight = array(
|
83 |
-
'Textual Values' => array(
|
84 |
-
'lighter' => 'light',
|
85 |
-
'normal' => 'normal',
|
86 |
-
'bold' => 'bold',
|
87 |
-
'bolder' => 'bolder',
|
88 |
-
),
|
89 |
-
'Numeric Values' => array(
|
90 |
-
'100' => '100',
|
91 |
-
'200' => '200',
|
92 |
-
'300' => '300',
|
93 |
-
'400' => '400',
|
94 |
-
'500' => '500',
|
95 |
-
'600' => '600',
|
96 |
-
'700' => '700',
|
97 |
-
'800' => '800',
|
98 |
-
'900' => '900',
|
99 |
-
),
|
100 |
-
);
|
101 |
-
$fw_current = br_get_value_from_array($options, array('styles', $key, 'bold'));
|
102 |
-
foreach($font_weight as $fm_optgroup => $fw_options) {
|
103 |
-
echo '<optgroup label="', $fm_optgroup, '">';
|
104 |
-
foreach($fw_options as $fw_key => $fw_value) {
|
105 |
-
echo '<option', ( $fw_current == $fw_key ? ' selected' : '' ), ' value="', $fw_key, '">', $fw_value, '</option>';
|
106 |
-
}
|
107 |
-
echo '</optgroup>';
|
108 |
-
}
|
109 |
-
?>
|
110 |
-
</select>
|
111 |
-
<?php } else {
|
112 |
-
_e('N/A', 'BeRocket_AJAX_domain');
|
113 |
-
} ?>
|
114 |
-
</td>
|
115 |
-
<td class="admin-column-font-size">
|
116 |
-
<?php if ( ! empty($designable['has']['font_size']) ) { ?>
|
117 |
-
<input type="text" placeholder="<?php _e('Theme Default', 'BeRocket_AJAX_domain') ?>" name="br_filters_options[styles][<?php echo $key ?>][font_size]" value="<?php echo br_get_value_from_array($options, array('styles', $key, 'font_size')) ?>" />
|
118 |
-
<?php } else {
|
119 |
-
_e('N/A', 'BeRocket_AJAX_domain');
|
120 |
-
} ?>
|
121 |
-
</td>
|
122 |
-
<td class="admin-column-theme">
|
123 |
-
<?php if ( $designable['has']['theme'] ) { ?>
|
124 |
-
<select name="br_filters_options[styles][<?php echo $key ?>][theme]">
|
125 |
-
<option value=""><?php _e('Without Theme', 'BeRocket_AJAX_domain') ?></option>
|
126 |
-
<?php if ( $key != 'selectbox' ) { ?>
|
127 |
-
<option value="aapf_grey1" <?php echo ( empty($options['styles'][$key]['theme']) && $options['styles'][$key]['theme'] == 'aapf_grey1' ) ? 'selected' : '' ?>>Grey</option>
|
128 |
-
<?php } ?>
|
129 |
-
<?php if ( $key != 'slider' and $key != 'checkbox_radio' ) { ?>
|
130 |
-
<option value="aapf_grey2" <?php echo ( ! empty($options['styles'][$key]['theme']) && $options['styles'][$key]['theme'] == 'aapf_grey2' ) ? 'selected' : '' ?>>Grey 2</option>
|
131 |
-
<?php } ?>
|
132 |
-
</select>
|
133 |
-
<?php } else {
|
134 |
-
_e('N/A', 'BeRocket_AJAX_domain');
|
135 |
-
} ?>
|
136 |
-
</td>
|
137 |
-
</tr>
|
138 |
-
<?php
|
139 |
-
$i_designable++;
|
140 |
-
}
|
141 |
-
?>
|
142 |
-
</tbody>
|
143 |
-
</table>
|
144 |
-
<table class="wp-list-table widefat fixed posts">
|
145 |
-
<thead>
|
146 |
-
<tr><th colspan="9" style="text-align: center; font-size: 2em;"><?php _e('Checkbox / Radio', 'BeRocket_AJAX_domain') ?></th></tr>
|
147 |
-
<tr>
|
148 |
-
<th class="manage-column admin-column-font-size" scope="col"><?php _e('Element', 'BeRocket_AJAX_domain') ?></th>
|
149 |
-
<th class="manage-column admin-column-color" scope="col"><?php _e('Border color', 'BeRocket_AJAX_domain') ?></th>
|
150 |
-
<th class="manage-column admin-column-font-size" scope="col"><?php _e('Border width', 'BeRocket_AJAX_domain') ?></th>
|
151 |
-
<th class="manage-column admin-column-font-size" scope="col"><?php _e('Border radius', 'BeRocket_AJAX_domain') ?></th>
|
152 |
-
<th class="manage-column admin-column-font-size" scope="col"><?php _e('Size', 'BeRocket_AJAX_domain') ?></th>
|
153 |
-
<th class="manage-column admin-column-color" scope="col"><?php _e('Font color', 'BeRocket_AJAX_domain') ?></th>
|
154 |
-
<th class="manage-column admin-column-color" scope="col"><?php _e('Background', 'BeRocket_AJAX_domain') ?></th>
|
155 |
-
<th class="manage-column admin-column-color" scope="col"><?php _e('Icon', 'BeRocket_AJAX_domain') ?></th>
|
156 |
-
<th class="manage-column admin-column-color" scope="col"><?php _e('Theme', 'BeRocket_AJAX_domain') ?></th>
|
157 |
-
</tr>
|
158 |
-
</thead>
|
159 |
-
<tbody>
|
160 |
-
<tr class="br_checkbox_radio_settings">
|
161 |
-
<td><?php _e('Checkbox', 'BeRocket_AJAX_domain') ?></td>
|
162 |
-
<td class="admin-column-color">
|
163 |
-
<div class="br_colorpicker_field" data-color="<?php echo br_get_value_from_array($options, array('styles_input', 'checkbox', 'bcolor'), '000000') ?>"></div>
|
164 |
-
<input class="br_border_color_set" type="hidden" value="<?php echo br_get_value_from_array($options, array('styles_input', 'checkbox', 'bcolor')) ?>" name="br_filters_options[styles_input][checkbox][bcolor]" />
|
165 |
-
<input type="button" value="<?php _e('Default', 'BeRocket_AJAX_domain') ?>" class="theme_default button tiny-button">
|
166 |
-
</td>
|
167 |
-
<td class="admin-column-font-size">
|
168 |
-
<input class="br_border_width_set" type="text" placeholder="<?php _e('Theme Default', 'BeRocket_AJAX_domain') ?>" name="br_filters_options[styles_input][checkbox][bwidth]" value="<?php echo br_get_value_from_array($options, array('styles_input', 'checkbox', 'bwidth')); ?>" />
|
169 |
-
</td>
|
170 |
-
<td class="admin-column-font-size">
|
171 |
-
<input class="br_border_radius_set" type="text" placeholder="<?php _e('Theme Default', 'BeRocket_AJAX_domain') ?>" name="br_filters_options[styles_input][checkbox][bradius]" value="<?php echo br_get_value_from_array($options, array('styles_input', 'checkbox', 'bradius')); ?>" />
|
172 |
-
</td>
|
173 |
-
<td class="admin-column-font-size">
|
174 |
-
<input class="br_size_set" type="text" placeholder="<?php _e('Theme Default', 'BeRocket_AJAX_domain') ?>" name="br_filters_options[styles_input][checkbox][fontsize]" value="<?php echo br_get_value_from_array($options, array('styles_input', 'checkbox', 'fontsize')); ?>" />
|
175 |
-
</td>
|
176 |
-
<td class="admin-column-color">
|
177 |
-
<div class="br_colorpicker_field" data-color="<?php echo br_get_value_from_array($options, array('styles_input', 'checkbox', 'fcolor'), '000000') ?>"></div>
|
178 |
-
<input class="br_font_color_set" type="hidden" value="<?php echo br_get_value_from_array($options, array('styles_input', 'checkbox', 'fcolor')) ?>" name="br_filters_options[styles_input][checkbox][fcolor]" />
|
179 |
-
<input type="button" value="<?php _e('Default', 'BeRocket_AJAX_domain') ?>" class="theme_default button tiny-button">
|
180 |
-
</td>
|
181 |
-
<td class="admin-column-color">
|
182 |
-
<div class="br_colorpicker_field" data-color="<?php echo br_get_value_from_array($options, array('styles_input', 'checkbox', 'backcolor'), '000000') ?>"></div>
|
183 |
-
<input class="br_background_set" type="hidden" value="<?php echo br_get_value_from_array($options, array('styles_input', 'checkbox', 'backcolor')) ?>" name="br_filters_options[styles_input][checkbox][backcolor]" />
|
184 |
-
<input type="button" value="<?php _e('Default', 'BeRocket_AJAX_domain') ?>" class="theme_default button tiny-button">
|
185 |
-
</td>
|
186 |
-
<td class="admin-column-color">
|
187 |
-
<select name="br_filters_options[styles_input][checkbox][icon]" class="fontawesome br_icon_set">
|
188 |
-
<option value=""<?php if ( empty($options['styles_input']['checkbox']['icon']) ) echo ' selected' ?>>NONE</option>
|
189 |
-
<?php $radion_icon = array( 'f00c', '2713', 'f00d', 'f067', 'f055', 'f0fe', 'f14a', 'f058' );
|
190 |
-
foreach( $radion_icon as $r_icon ) {
|
191 |
-
echo '<option value="'.$r_icon.'"'.( br_get_value_from_array($options, array('styles_input', 'checkbox', 'icon')) == $r_icon ? ' selected' : '' ).'>&#x'.$r_icon.';</option>';
|
192 |
-
}?>
|
193 |
-
</select>
|
194 |
-
</td>
|
195 |
-
<td class="admin-column-color">
|
196 |
-
<select name="br_filters_options[styles_input][checkbox][theme]" class="br_theme_set_select">
|
197 |
-
<option value=""<?php if ( empty($options['styles_input']['checkbox']['theme']) ) echo ' selected' ?>>NONE</option>
|
198 |
-
<?php
|
199 |
-
$checkbox_theme_current = br_get_value_from_array($options, array('styles_input', 'checkbox', 'theme'));
|
200 |
-
$checkbox_themes = array(
|
201 |
-
'black_1' => array(
|
202 |
-
'name' => 'Black 1',
|
203 |
-
'border_color' => '',
|
204 |
-
'border_width' => '0',
|
205 |
-
'border_radius' => '5',
|
206 |
-
'size' => '',
|
207 |
-
'font_color' => '333333',
|
208 |
-
'background' => 'bbbbbb',
|
209 |
-
'icon' => 'f00c',
|
210 |
-
),
|
211 |
-
'black_2' => array(
|
212 |
-
'name' => 'Black 2',
|
213 |
-
'border_color' => '333333',
|
214 |
-
'border_width' => '1',
|
215 |
-
'border_radius' => '2',
|
216 |
-
'size' => '',
|
217 |
-
'font_color' => '333333',
|
218 |
-
'background' => '',
|
219 |
-
'icon' => '2713',
|
220 |
-
),
|
221 |
-
'black_3' => array(
|
222 |
-
'name' => 'Black 3',
|
223 |
-
'border_color' => '333333',
|
224 |
-
'border_width' => '2',
|
225 |
-
'border_radius' => '50',
|
226 |
-
'size' => '',
|
227 |
-
'font_color' => '333333',
|
228 |
-
'background' => '',
|
229 |
-
'icon' => 'f058',
|
230 |
-
),
|
231 |
-
'black_4' => array(
|
232 |
-
'name' => 'Black 4',
|
233 |
-
'border_color' => '333333',
|
234 |
-
'border_width' => '2',
|
235 |
-
'border_radius' => '2',
|
236 |
-
'size' => '',
|
237 |
-
'font_color' => '333333',
|
238 |
-
'background' => '',
|
239 |
-
'icon' => 'f14a',
|
240 |
-
),
|
241 |
-
'white_1' => array(
|
242 |
-
'name' => 'White 1',
|
243 |
-
'border_color' => '',
|
244 |
-
'border_width' => '0',
|
245 |
-
'border_radius' => '5',
|
246 |
-
'size' => '',
|
247 |
-
'font_color' => 'dddddd',
|
248 |
-
'background' => '333333',
|
249 |
-
'icon' => 'f00c',
|
250 |
-
),
|
251 |
-
'white_2' => array(
|
252 |
-
'name' => 'White 2',
|
253 |
-
'border_color' => 'dddddd',
|
254 |
-
'border_width' => '1',
|
255 |
-
'border_radius' => '2',
|
256 |
-
'size' => '',
|
257 |
-
'font_color' => 'dddddd',
|
258 |
-
'background' => '',
|
259 |
-
'icon' => '2713',
|
260 |
-
),
|
261 |
-
'white_3' => array(
|
262 |
-
'name' => 'White 3',
|
263 |
-
'border_color' => 'dddddd',
|
264 |
-
'border_width' => '2',
|
265 |
-
'border_radius' => '50',
|
266 |
-
'size' => '',
|
267 |
-
'font_color' => 'dddddd',
|
268 |
-
'background' => '',
|
269 |
-
'icon' => 'f058',
|
270 |
-
),
|
271 |
-
'white_4' => array(
|
272 |
-
'name' => 'White 4',
|
273 |
-
'border_color' => 'dddddd',
|
274 |
-
'border_width' => '2',
|
275 |
-
'border_radius' => '2',
|
276 |
-
'size' => '',
|
277 |
-
'font_color' => 'dddddd',
|
278 |
-
'background' => '',
|
279 |
-
'icon' => 'f14a',
|
280 |
-
),
|
281 |
-
'red_1' => array(
|
282 |
-
'name' => 'Red 1',
|
283 |
-
'border_color' => '',
|
284 |
-
'border_width' => '0',
|
285 |
-
'border_radius' => '5',
|
286 |
-
'size' => '',
|
287 |
-
'font_color' => 'dd3333',
|
288 |
-
'background' => '333333',
|
289 |
-
'icon' => 'f00c',
|
290 |
-
),
|
291 |
-
'red_2' => array(
|
292 |
-
'name' => 'Red 2',
|
293 |
-
'border_color' => 'dd3333',
|
294 |
-
'border_width' => '1',
|
295 |
-
'border_radius' => '2',
|
296 |
-
'size' => '',
|
297 |
-
'font_color' => 'dd3333',
|
298 |
-
'background' => '',
|
299 |
-
'icon' => '2713',
|
300 |
-
),
|
301 |
-
'red_3' => array(
|
302 |
-
'name' => 'Red 3',
|
303 |
-
'border_color' => 'dd3333',
|
304 |
-
'border_width' => '2',
|
305 |
-
'border_radius' => '50',
|
306 |
-
'size' => '',
|
307 |
-
'font_color' => 'dd3333',
|
308 |
-
'background' => '',
|
309 |
-
'icon' => 'f058',
|
310 |
-
),
|
311 |
-
'red_4' => array(
|
312 |
-
'name' => 'Red 4',
|
313 |
-
'border_color' => 'dd3333',
|
314 |
-
'border_width' => '2',
|
315 |
-
'border_radius' => '2',
|
316 |
-
'size' => '',
|
317 |
-
'font_color' => 'dd3333',
|
318 |
-
'background' => '',
|
319 |
-
'icon' => 'f14a',
|
320 |
-
),
|
321 |
-
'green_1' => array(
|
322 |
-
'name' => 'Green 1',
|
323 |
-
'border_color' => '',
|
324 |
-
'border_width' => '0',
|
325 |
-
'border_radius' => '5',
|
326 |
-
'size' => '',
|
327 |
-
'font_color' => '33dd33',
|
328 |
-
'background' => '333333',
|
329 |
-
'icon' => 'f00c',
|
330 |
-
),
|
331 |
-
'green_2' => array(
|
332 |
-
'name' => 'Green 2',
|
333 |
-
'border_color' => '33dd33',
|
334 |
-
'border_width' => '1',
|
335 |
-
'border_radius' => '2',
|
336 |
-
'size' => '',
|
337 |
-
'font_color' => '33dd33',
|
338 |
-
'background' => '',
|
339 |
-
'icon' => '2713',
|
340 |
-
),
|
341 |
-
'green_3' => array(
|
342 |
-
'name' => 'Green 3',
|
343 |
-
'border_color' => '33dd33',
|
344 |
-
'border_width' => '2',
|
345 |
-
'border_radius' => '50',
|
346 |
-
'size' => '',
|
347 |
-
'font_color' => '33dd33',
|
348 |
-
'background' => '',
|
349 |
-
'icon' => 'f058',
|
350 |
-
),
|
351 |
-
'green_4' => array(
|
352 |
-
'name' => 'Green 4',
|
353 |
-
'border_color' => '33dd33',
|
354 |
-
'border_width' => '2',
|
355 |
-
'border_radius' => '2',
|
356 |
-
'size' => '',
|
357 |
-
'font_color' => '33dd33',
|
358 |
-
'background' => '',
|
359 |
-
'icon' => 'f14a',
|
360 |
-
),
|
361 |
-
'blue_1' => array(
|
362 |
-
'name' => 'Blue 1',
|
363 |
-
'border_color' => '',
|
364 |
-
'border_width' => '0',
|
365 |
-
'border_radius' => '5',
|
366 |
-
'size' => '',
|
367 |
-
'font_color' => '3333dd',
|
368 |
-
'background' => '333333',
|
369 |
-
'icon' => 'f00c',
|
370 |
-
),
|
371 |
-
'blue_2' => array(
|
372 |
-
'name' => 'Blue 2',
|
373 |
-
'border_color' => '3333dd',
|
374 |
-
'border_width' => '1',
|
375 |
-
'border_radius' => '2',
|
376 |
-
'size' => '',
|
377 |
-
'font_color' => '3333dd',
|
378 |
-
'background' => '',
|
379 |
-
'icon' => '2713',
|
380 |
-
),
|
381 |
-
'blue_3' => array(
|
382 |
-
'name' => 'Blue 3',
|
383 |
-
'border_color' => '3333dd',
|
384 |
-
'border_width' => '2',
|
385 |
-
'border_radius' => '50',
|
386 |
-
'size' => '',
|
387 |
-
'font_color' => '3333dd',
|
388 |
-
'background' => '',
|
389 |
-
'icon' => 'f058',
|
390 |
-
),
|
391 |
-
'blue_4' => array(
|
392 |
-
'name' => 'Blue 4',
|
393 |
-
'border_color' => '3333dd',
|
394 |
-
'border_width' => '2',
|
395 |
-
'border_radius' => '2',
|
396 |
-
'size' => '',
|
397 |
-
'font_color' => '3333dd',
|
398 |
-
'background' => '',
|
399 |
-
'icon' => 'f14a',
|
400 |
-
),
|
401 |
-
);
|
402 |
-
foreach($checkbox_themes as $chth_key => $chth_data) {
|
403 |
-
echo '<option value="', $chth_key, '"';
|
404 |
-
foreach($chth_data as $chth_data_key => $chth_data_val) {
|
405 |
-
echo ' data-', $chth_data_key, '="', $chth_data_val, '"';
|
406 |
-
}
|
407 |
-
if( $checkbox_theme_current == $chth_key ) {
|
408 |
-
echo ' selected';
|
409 |
-
}
|
410 |
-
echo '>', $chth_data['name'], '</option>';
|
411 |
-
}
|
412 |
-
?>
|
413 |
-
</select>
|
414 |
-
</td>
|
415 |
-
</tr>
|
416 |
-
<tr class="br_checkbox_radio_settings">
|
417 |
-
<td><?php _e('Radio', 'BeRocket_AJAX_domain') ?></td>
|
418 |
-
<td class="admin-column-color">
|
419 |
-
<div class="br_colorpicker_field" data-color="<?php echo br_get_value_from_array($options, array('styles_input', 'radio', 'bcolor'), '000000') ?>"></div>
|
420 |
-
<input class="br_border_color_set" type="hidden" value="<?php echo br_get_value_from_array($options, array('styles_input', 'radio', 'bcolor')) ?>" name="br_filters_options[styles_input][radio][bcolor]" />
|
421 |
-
<input type="button" value="<?php _e('Default', 'BeRocket_AJAX_domain') ?>" class="theme_default button tiny-button">
|
422 |
-
</td>
|
423 |
-
<td class="admin-column-font-size">
|
424 |
-
<input class="br_border_width_set" type="text" placeholder="<?php _e('Theme Default', 'BeRocket_AJAX_domain') ?>" name="br_filters_options[styles_input][radio][bwidth]" value="<?php echo br_get_value_from_array($options, array('styles_input', 'radio', 'bwidth')) ?>" />
|
425 |
-
</td>
|
426 |
-
<td class="admin-column-font-size">
|
427 |
-
<input class="br_border_radius_set" type="text" placeholder="<?php _e('Theme Default', 'BeRocket_AJAX_domain') ?>" name="br_filters_options[styles_input][radio][bradius]" value="<?php echo br_get_value_from_array($options, array('styles_input', 'radio', 'bradius')) ?>" />
|
428 |
-
</td>
|
429 |
-
<td class="admin-column-font-size">
|
430 |
-
<input class="br_size_set" type="text" placeholder="<?php _e('Theme Default', 'BeRocket_AJAX_domain') ?>" name="br_filters_options[styles_input][radio][fontsize]" value="<?php echo br_get_value_from_array($options, array('styles_input', 'radio', 'fontsize')) ?>" />
|
431 |
-
</td>
|
432 |
-
<td class="admin-column-color">
|
433 |
-
<div class="br_colorpicker_field" data-color="<?php echo br_get_value_from_array($options, array('styles_input', 'radio', 'fcolor'), '000000') ?>"></div>
|
434 |
-
<input class="br_font_color_set" type="hidden" value="<?php echo br_get_value_from_array($options, array('styles_input', 'radio', 'fcolor')) ?>" name="br_filters_options[styles_input][radio][fcolor]" />
|
435 |
-
<input type="button" value="<?php _e('Default', 'BeRocket_AJAX_domain') ?>" class="theme_default button tiny-button">
|
436 |
-
</td>
|
437 |
-
<td class="admin-column-color">
|
438 |
-
<div class="br_colorpicker_field" data-color="<?php echo br_get_value_from_array($options, array('styles_input', 'radio', 'backcolor'), '000000') ?>"></div>
|
439 |
-
<input class="br_background_set" type="hidden" value="<?php echo br_get_value_from_array($options, array('styles_input', 'radio', 'backcolor')) ?>" name="br_filters_options[styles_input][radio][backcolor]" />
|
440 |
-
<input type="button" value="<?php _e('Default', 'BeRocket_AJAX_domain') ?>" class="theme_default button tiny-button">
|
441 |
-
</td>
|
442 |
-
<td class="admin-column-color">
|
443 |
-
<select name="br_filters_options[styles_input][radio][icon]" class="fontawesome br_icon_set">
|
444 |
-
<option value=""<?php if ( empty($options['styles_input']['radio']['icon']) ) echo ' selected' ?>>NONE</option>
|
445 |
-
<?php $radion_icon = array( 'f111', '2022', 'f10c', 'f192', 'f0c8', 'f055', 'f0fe', 'f14a', 'f058' );
|
446 |
-
foreach( $radion_icon as $r_icon ) {
|
447 |
-
echo '<option value="'.$r_icon.'"'.( br_get_value_from_array($options, array('styles_input', 'radio', 'icon')) == $r_icon ? ' selected' : '' ).'>&#x'.$r_icon.';</option>';
|
448 |
-
}?>
|
449 |
-
</select>
|
450 |
-
</td>
|
451 |
-
<td class="admin-column-color">
|
452 |
-
<select name="br_filters_options[styles_input][radio][theme]" class="br_theme_set_select">
|
453 |
-
<option value=""<?php if ( empty($options['styles_input']['radio']['theme']) ) echo ' selected' ?>>NONE</option>
|
454 |
-
<?php
|
455 |
-
$radio_theme_current = br_get_value_from_array($options, array('styles_input', 'checkbox', 'theme'));
|
456 |
-
$radio_themes = array(
|
457 |
-
'black_1' => array(
|
458 |
-
'name' => 'Black 1',
|
459 |
-
'border_color' => '',
|
460 |
-
'border_width' => '0',
|
461 |
-
'border_radius' => '5',
|
462 |
-
'size' => '',
|
463 |
-
'font_color' => '333333',
|
464 |
-
'background' => 'bbbbbb',
|
465 |
-
'icon' => 'f111',
|
466 |
-
),
|
467 |
-
'black_2' => array(
|
468 |
-
'name' => 'Black 2',
|
469 |
-
'border_color' => '333333',
|
470 |
-
'border_width' => '1',
|
471 |
-
'border_radius' => '2',
|
472 |
-
'size' => '',
|
473 |
-
'font_color' => '333333',
|
474 |
-
'background' => '',
|
475 |
-
'icon' => 'f0c8',
|
476 |
-
),
|
477 |
-
'black_3' => array(
|
478 |
-
'name' => 'Black 3',
|
479 |
-
'border_color' => '333333',
|
480 |
-
'border_width' => '2',
|
481 |
-
'border_radius' => '',
|
482 |
-
'size' => '10',
|
483 |
-
'font_color' => '333333',
|
484 |
-
'background' => '',
|
485 |
-
'icon' => 'f055',
|
486 |
-
),
|
487 |
-
'white_1' => array(
|
488 |
-
'name' => 'White 1',
|
489 |
-
'border_color' => '',
|
490 |
-
'border_width' => '0',
|
491 |
-
'border_radius' => '5',
|
492 |
-
'size' => '',
|
493 |
-
'font_color' => 'dddddd',
|
494 |
-
'background' => '333333',
|
495 |
-
'icon' => 'f111',
|
496 |
-
),
|
497 |
-
'white_2' => array(
|
498 |
-
'name' => 'White 2',
|
499 |
-
'border_color' => 'dddddd',
|
500 |
-
'border_width' => '1',
|
501 |
-
'border_radius' => '2',
|
502 |
-
'size' => '',
|
503 |
-
'font_color' => 'dddddd',
|
504 |
-
'background' => '',
|
505 |
-
'icon' => 'f0c8',
|
506 |
-
),
|
507 |
-
'white_3' => array(
|
508 |
-
'name' => 'White 3',
|
509 |
-
'border_color' => 'dddddd',
|
510 |
-
'border_width' => '2',
|
511 |
-
'border_radius' => '',
|
512 |
-
'size' => '10',
|
513 |
-
'font_color' => 'dddddd',
|
514 |
-
'background' => '',
|
515 |
-
'icon' => 'f055',
|
516 |
-
),
|
517 |
-
'red_1' => array(
|
518 |
-
'name' => 'Red 1',
|
519 |
-
'border_color' => '',
|
520 |
-
'border_width' => '0',
|
521 |
-
'border_radius' => '5',
|
522 |
-
'size' => '',
|
523 |
-
'font_color' => 'dd3333',
|
524 |
-
'background' => '333333',
|
525 |
-
'icon' => 'f111',
|
526 |
-
),
|
527 |
-
'red_2' => array(
|
528 |
-
'name' => 'Red 2',
|
529 |
-
'border_color' => 'dd3333',
|
530 |
-
'border_width' => '1',
|
531 |
-
'border_radius' => '2',
|
532 |
-
'size' => '',
|
533 |
-
'font_color' => 'dd3333',
|
534 |
-
'background' => '',
|
535 |
-
'icon' => 'f0c8',
|
536 |
-
),
|
537 |
-
'red_3' => array(
|
538 |
-
'name' => 'Red 3',
|
539 |
-
'border_color' => 'dd3333',
|
540 |
-
'border_width' => '2',
|
541 |
-
'border_radius' => '',
|
542 |
-
'size' => '10',
|
543 |
-
'font_color' => 'dd3333',
|
544 |
-
'background' => '',
|
545 |
-
'icon' => 'f055',
|
546 |
-
),
|
547 |
-
'green_1' => array(
|
548 |
-
'name' => 'Green 1',
|
549 |
-
'border_color' => '',
|
550 |
-
'border_width' => '0',
|
551 |
-
'border_radius' => '5',
|
552 |
-
'size' => '',
|
553 |
-
'font_color' => '33dd33',
|
554 |
-
'background' => '333333',
|
555 |
-
'icon' => 'f111',
|
556 |
-
),
|
557 |
-
'green_2' => array(
|
558 |
-
'name' => 'Green 2',
|
559 |
-
'border_color' => '33dd33',
|
560 |
-
'border_width' => '1',
|
561 |
-
'border_radius' => '2',
|
562 |
-
'size' => '',
|
563 |
-
'font_color' => '33dd33',
|
564 |
-
'background' => '',
|
565 |
-
'icon' => 'f0c8',
|
566 |
-
),
|
567 |
-
'green_3' => array(
|
568 |
-
'name' => 'Green 3',
|
569 |
-
'border_color' => '33dd33',
|
570 |
-
'border_width' => '2',
|
571 |
-
'border_radius' => '',
|
572 |
-
'size' => '10',
|
573 |
-
'font_color' => '33dd33',
|
574 |
-
'background' => '',
|
575 |
-
'icon' => 'f055',
|
576 |
-
),
|
577 |
-
'blue_1' => array(
|
578 |
-
'name' => 'Blue 1',
|
579 |
-
'border_color' => '',
|
580 |
-
'border_width' => '0',
|
581 |
-
'border_radius' => '5',
|
582 |
-
'size' => '',
|
583 |
-
'font_color' => '3333dd',
|
584 |
-
'background' => '333333',
|
585 |
-
'icon' => 'f111',
|
586 |
-
),
|
587 |
-
'blue_2' => array(
|
588 |
-
'name' => 'Blue 2',
|
589 |
-
'border_color' => '3333dd',
|
590 |
-
'border_width' => '1',
|
591 |
-
'border_radius' => '2',
|
592 |
-
'size' => '',
|
593 |
-
'font_color' => '3333dd',
|
594 |
-
'background' => '',
|
595 |
-
'icon' => 'f0c8',
|
596 |
-
),
|
597 |
-
'blue_3' => array(
|
598 |
-
'name' => 'Blue 3',
|
599 |
-
'border_color' => '3333dd',
|
600 |
-
'border_width' => '2',
|
601 |
-
'border_radius' => '',
|
602 |
-
'size' => '10',
|
603 |
-
'font_color' => '3333dd',
|
604 |
-
'background' => '',
|
605 |
-
'icon' => 'f055',
|
606 |
-
),
|
607 |
-
);
|
608 |
-
foreach($radio_themes as $rth_key => $rth_data) {
|
609 |
-
echo '<option value="', $rth_key, '"';
|
610 |
-
foreach($rth_data as $rth_data_key => $rth_data_val) {
|
611 |
-
echo ' data-', $rth_data_key, '="', $rth_data_val, '"';
|
612 |
-
}
|
613 |
-
if( $checkbox_theme_current == $rth_key ) {
|
614 |
-
echo ' selected';
|
615 |
-
}
|
616 |
-
echo '>', $rth_data['name'], '</option>';
|
617 |
-
}
|
618 |
-
?>
|
619 |
-
</select>
|
620 |
-
</td>
|
621 |
-
</tr>
|
622 |
-
</tbody>
|
623 |
-
<tfoot>
|
624 |
-
<tr>
|
625 |
-
<th class="manage-column admin-column-theme" scope="col" colspan="9">
|
626 |
-
<input type="button" value="<?php _e('Set all to theme default', 'BeRocket_AJAX_domain') ?>" class="all_theme_default button">
|
627 |
-
<div style="clear:both;"></div>
|
628 |
-
</th>
|
629 |
-
</tr>
|
630 |
-
</tfoot>
|
631 |
-
</table>
|
632 |
-
<table class="wp-list-table widefat fixed posts">
|
633 |
-
<thead>
|
634 |
-
<tr><th colspan="10" style="text-align: center; font-size: 2em;"><?php _e('Slider', 'BeRocket_AJAX_domain') ?></th></tr>
|
635 |
-
<tr>
|
636 |
-
<th class="manage-column admin-column-color" scope="col"><?php _e('Line color', 'BeRocket_AJAX_domain') ?></th>
|
637 |
-
<th class="manage-column admin-column-color" scope="col"><?php _e('Back line color', 'BeRocket_AJAX_domain') ?></th>
|
638 |
-
<th class="manage-column admin-column-font-size" scope="col"><?php _e('Line height', 'BeRocket_AJAX_domain') ?></th>
|
639 |
-
<th class="manage-column admin-column-color" scope="col"><?php _e('Line border color', 'BeRocket_AJAX_domain') ?></th>
|
640 |
-
<th class="manage-column admin-column-font-size" scope="col"><?php _e('Line border width', 'BeRocket_AJAX_domain') ?></th>
|
641 |
-
<th class="manage-column admin-column-font-size" scope="col"><?php _e('Button size', 'BeRocket_AJAX_domain') ?></th>
|
642 |
-
<th class="manage-column admin-column-color" scope="col"><?php _e('Button color', 'BeRocket_AJAX_domain') ?></th>
|
643 |
-
<th class="manage-column admin-column-color" scope="col"><?php _e('Button border color', 'BeRocket_AJAX_domain') ?></th>
|
644 |
-
<th class="manage-column admin-column-font-size" scope="col"><?php _e('Button border width', 'BeRocket_AJAX_domain') ?></th>
|
645 |
-
<th class="manage-column admin-column-font-size" scope="col"><?php _e('Button border radius', 'BeRocket_AJAX_domain') ?></th>
|
646 |
-
</tr>
|
647 |
-
</thead>
|
648 |
-
<tbody>
|
649 |
-
<tr>
|
650 |
-
<td class="admin-column-color">
|
651 |
-
<div class="br_colorpicker_field" data-color="<?php echo br_get_value_from_array($options, array('styles_input', 'slider', 'line_color'), '000000') ?>"></div>
|
652 |
-
<input type="hidden" value="<?php echo br_get_value_from_array($options, array('styles_input', 'slider', 'line_color')) ?>" name="br_filters_options[styles_input][slider][line_color]" />
|
653 |
-
<input type="button" value="<?php _e('Default', 'BeRocket_AJAX_domain') ?>" class="theme_default button tiny-button">
|
654 |
-
</td>
|
655 |
-
<td class="admin-column-color">
|
656 |
-
<div class="br_colorpicker_field" data-color="<?php echo br_get_value_from_array($options, array('styles_input', 'slider', 'back_line_color'), '000000') ?>"></div>
|
657 |
-
<input type="hidden" value="<?php echo br_get_value_from_array($options, array('styles_input', 'slider', 'back_line_color')) ?>" name="br_filters_options[styles_input][slider][back_line_color]" />
|
658 |
-
<input type="button" value="<?php _e('Default', 'BeRocket_AJAX_domain') ?>" class="theme_default button tiny-button">
|
659 |
-
</td>
|
660 |
-
<td class="admin-column-font-size">
|
661 |
-
<input type="text" placeholder="<?php _e('Theme Default', 'BeRocket_AJAX_domain') ?>" name="br_filters_options[styles_input][slider][line_height]" value="<?php echo br_get_value_from_array($options, array('styles_input', 'slider', 'line_height')) ?>" />
|
662 |
-
</td>
|
663 |
-
<td class="admin-column-color">
|
664 |
-
<div class="br_colorpicker_field" data-color="<?php echo br_get_value_from_array($options, array('styles_input', 'slider', 'line_border_color'), '000000') ?>"></div>
|
665 |
-
<input type="hidden" value="<?php echo br_get_value_from_array($options, array('styles_input', 'slider', 'line_border_color')) ?>" name="br_filters_options[styles_input][slider][line_border_color]" />
|
666 |
-
<input type="button" value="<?php _e('Default', 'BeRocket_AJAX_domain') ?>" class="theme_default button tiny-button">
|
667 |
-
</td>
|
668 |
-
<td class="admin-column-font-size">
|
669 |
-
<input type="text" placeholder="<?php _e('Theme Default', 'BeRocket_AJAX_domain') ?>" name="br_filters_options[styles_input][slider][line_border_width]" value="<?php echo br_get_value_from_array($options, array('styles_input', 'slider', 'line_border_width')) ?>" />
|
670 |
-
</td>
|
671 |
-
<td class="admin-column-font-size">
|
672 |
-
<input type="text" placeholder="<?php _e('Theme Default', 'BeRocket_AJAX_domain') ?>" name="br_filters_options[styles_input][slider][button_size]" value="<?php echo br_get_value_from_array($options, array('styles_input', 'slider', 'button_size')) ?>" />
|
673 |
-
</td>
|
674 |
-
<td class="admin-column-color">
|
675 |
-
<div class="br_colorpicker_field" data-color="<?php echo br_get_value_from_array($options, array('styles_input', 'slider', 'button_color'), '000000') ?>"></div>
|
676 |
-
<input type="hidden" value="<?php echo br_get_value_from_array($options, array('styles_input', 'slider', 'button_color')) ?>" name="br_filters_options[styles_input][slider][button_color]" />
|
677 |
-
<input type="button" value="<?php _e('Default', 'BeRocket_AJAX_domain') ?>" class="theme_default button tiny-button">
|
678 |
-
</td>
|
679 |
-
<td class="admin-column-color">
|
680 |
-
<div class="br_colorpicker_field" data-color="<?php echo br_get_value_from_array($options, array('styles_input', 'slider', 'button_border_color'), '000000') ?>"></div>
|
681 |
-
<input type="hidden" value="<?php echo br_get_value_from_array($options, array('styles_input', 'slider', 'button_border_color')) ?>" name="br_filters_options[styles_input][slider][button_border_color]" />
|
682 |
-
<input type="button" value="<?php _e('Default', 'BeRocket_AJAX_domain') ?>" class="theme_default button tiny-button">
|
683 |
-
</td>
|
684 |
-
<td class="admin-column-font-size">
|
685 |
-
<input type="text" placeholder="<?php _e('Theme Default', 'BeRocket_AJAX_domain') ?>" name="br_filters_options[styles_input][slider][button_border_width]" value="<?php echo br_get_value_from_array($options, array('styles_input', 'slider', 'button_border_width')); ?>" />
|
686 |
-
</td>
|
687 |
-
<td class="admin-column-font-size">
|
688 |
-
<input type="text" placeholder="<?php _e('Theme Default', 'BeRocket_AJAX_domain') ?>" name="br_filters_options[styles_input][slider][button_border_radius]" value="<?php echo br_get_value_from_array($options, array('styles_input', 'slider', 'button_border_radius')); ?>" />
|
689 |
-
</td>
|
690 |
-
</tr>
|
691 |
-
</tbody>
|
692 |
-
<tfoot>
|
693 |
-
<tr>
|
694 |
-
<th class="manage-column admin-column-theme" scope="col" colspan="10">
|
695 |
-
<input type="button" value="<?php _e('Set all to theme default', 'BeRocket_AJAX_domain') ?>" class="all_theme_default button">
|
696 |
-
<div style="clear:both;"></div>
|
697 |
-
</th>
|
698 |
-
</tr>
|
699 |
-
</tfoot>
|
700 |
-
</table>
|
701 |
-
<table class="wp-list-table widefat fixed posts">
|
702 |
-
<thead>
|
703 |
-
<tr><th colspan="10" style="text-align: center; font-size: 2em;"><?php _e('Product count description before filtering with Apply Filters button', 'BeRocket_AJAX_domain') ?></th></tr>
|
704 |
-
<tr>
|
705 |
-
<th class="manage-column admin-column-color" scope="col"><?php _e('Background color', 'BeRocket_AJAX_domain') ?></th>
|
706 |
-
<th class="manage-column admin-column-color" scope="col"><?php _e('Border color', 'BeRocket_AJAX_domain') ?></th>
|
707 |
-
<th class="manage-column admin-column-font-size" scope="col"><?php _e('Font size', 'BeRocket_AJAX_domain') ?></th>
|
708 |
-
<th class="manage-column admin-column-color" scope="col"><?php _e('Font color', 'BeRocket_AJAX_domain') ?></th>
|
709 |
-
<th class="manage-column admin-column-font-size" scope="col"><?php _e('Show button font size', 'BeRocket_AJAX_domain') ?></th>
|
710 |
-
<th class="manage-column admin-column-color" scope="col"><?php _e('Show button font color', 'BeRocket_AJAX_domain') ?></th>
|
711 |
-
<th class="manage-column admin-column-color" scope="col"><?php _e('Show button font color on mouse over', 'BeRocket_AJAX_domain') ?></th>
|
712 |
-
<th class="manage-column admin-column-font-size" scope="col"><?php _e('Close button size', 'BeRocket_AJAX_domain') ?></th>
|
713 |
-
<th class="manage-column admin-column-color" scope="col"><?php _e('Close button font color', 'BeRocket_AJAX_domain') ?></th>
|
714 |
-
<th class="manage-column admin-column-color" scope="col"><?php _e('Close button font color on mouse over', 'BeRocket_AJAX_domain') ?></th>
|
715 |
-
</tr>
|
716 |
-
</thead>
|
717 |
-
<tbody>
|
718 |
-
<tr>
|
719 |
-
<td class="admin-column-color">
|
720 |
-
<div class="br_colorpicker_field" data-color="<?php echo br_get_value_from_array($options, array('styles_input', 'pc_ub', 'back_color'), '000000') ?>"></div>
|
721 |
-
<input type="hidden" value="<?php echo br_get_value_from_array($options, array('styles_input', 'pc_ub', 'back_color')) ?>" name="br_filters_options[styles_input][pc_ub][back_color]" />
|
722 |
-
<input type="button" value="<?php _e('Default', 'BeRocket_AJAX_domain') ?>" class="theme_default button tiny-button">
|
723 |
-
</td>
|
724 |
-
<td class="admin-column-color">
|
725 |
-
<div class="br_colorpicker_field" data-color="<?php echo br_get_value_from_array($options, array('styles_input', 'pc_ub', 'border_color'), '000000') ?>"></div>
|
726 |
-
<input type="hidden" value="<?php echo br_get_value_from_array($options, array('styles_input', 'pc_ub', 'border_color')) ?>" name="br_filters_options[styles_input][pc_ub][border_color]" />
|
727 |
-
<input type="button" value="<?php _e('Default', 'BeRocket_AJAX_domain') ?>" class="theme_default button tiny-button">
|
728 |
-
</td>
|
729 |
-
<td class="admin-column-font-size">
|
730 |
-
<input type="text" placeholder="<?php _e('Theme Default', 'BeRocket_AJAX_domain') ?>" name="br_filters_options[styles_input][pc_ub][font_size]" value="<?php echo br_get_value_from_array($options, array('styles_input', 'pc_ub', 'font_size')); ?>" />
|
731 |
-
</td>
|
732 |
-
<td class="admin-column-color">
|
733 |
-
<div class="br_colorpicker_field" data-color="<?php echo br_get_value_from_array($options, array('styles_input', 'pc_ub', 'font_color'), '000000') ?>"></div>
|
734 |
-
<input type="hidden" value="<?php echo br_get_value_from_array($options, array('styles_input', 'pc_ub', 'font_color')) ?>" name="br_filters_options[styles_input][pc_ub][font_color]" />
|
735 |
-
<input type="button" value="<?php _e('Default', 'BeRocket_AJAX_domain') ?>" class="theme_default button tiny-button">
|
736 |
-
</td>
|
737 |
-
<td class="admin-column-font-size">
|
738 |
-
<input type="text" placeholder="<?php _e('Theme Default', 'BeRocket_AJAX_domain') ?>" name="br_filters_options[styles_input][pc_ub][show_font_size]" value="<?php echo br_get_value_from_array($options, array('styles_input', 'pc_ub', 'show_font_size')); ?>" />
|
739 |
-
</td>
|
740 |
-
<td class="admin-column-color">
|
741 |
-
<div class="br_colorpicker_field" data-color="<?php echo br_get_value_from_array($options, array('styles_input', 'pc_ub', 'show_font_color'), '000000') ?>"></div>
|
742 |
-
<input type="hidden" value="<?php echo br_get_value_from_array($options, array('styles_input', 'pc_ub', 'show_font_color')) ?>" name="br_filters_options[styles_input][pc_ub][show_font_color]" />
|
743 |
-
<input type="button" value="<?php _e('Default', 'BeRocket_AJAX_domain') ?>" class="theme_default button tiny-button">
|
744 |
-
</td>
|
745 |
-
<td class="admin-column-color">
|
746 |
-
<div class="br_colorpicker_field" data-color="<?php echo br_get_value_from_array($options, array('styles_input', 'pc_ub', 'show_font_color_hover'), '000000') ?>"></div>
|
747 |
-
<input type="hidden" value="<?php echo br_get_value_from_array($options, array('styles_input', 'pc_ub', 'show_font_color_hover')) ?>" name="br_filters_options[styles_input][pc_ub][show_font_color_hover]" />
|
748 |
-
<input type="button" value="<?php _e('Default', 'BeRocket_AJAX_domain') ?>" class="theme_default button tiny-button">
|
749 |
-
</td>
|
750 |
-
<td class="admin-column-font-size">
|
751 |
-
<input type="text" placeholder="<?php _e('Theme Default', 'BeRocket_AJAX_domain') ?>" name="br_filters_options[styles_input][pc_ub][close_size]" value="<?php echo br_get_value_from_array($options, array('styles_input', 'pc_ub', 'close_size')); ?>" />
|
752 |
-
</td>
|
753 |
-
<td class="admin-column-color">
|
754 |
-
<div class="br_colorpicker_field" data-color="<?php echo br_get_value_from_array($options, array('styles_input', 'pc_ub', 'close_font_color'), '000000') ?>"></div>
|
755 |
-
<input type="hidden" value="<?php echo br_get_value_from_array($options, array('styles_input', 'pc_ub', 'close_font_color')) ?>" name="br_filters_options[styles_input][pc_ub][close_font_color]" />
|
756 |
-
<input type="button" value="<?php _e('Default', 'BeRocket_AJAX_domain') ?>" class="theme_default button tiny-button">
|
757 |
-
</td>
|
758 |
-
<td class="admin-column-color">
|
759 |
-
<div class="br_colorpicker_field" data-color="<?php echo br_get_value_from_array($options, array('styles_input', 'pc_ub', 'close_font_color_hover'), '000000') ?>"></div>
|
760 |
-
<input type="hidden" value="<?php echo br_get_value_from_array($options, array('styles_input', 'pc_ub', 'close_font_color_hover')) ?>" name="br_filters_options[styles_input][pc_ub][close_font_color_hover]" />
|
761 |
-
<input type="button" value="<?php _e('Default', 'BeRocket_AJAX_domain') ?>" class="theme_default button tiny-button">
|
762 |
-
</td>
|
763 |
-
</tr>
|
764 |
-
</tbody>
|
765 |
-
<tfoot>
|
766 |
-
<tr>
|
767 |
-
<th class="manage-column admin-column-theme" scope="col" colspan="10">
|
768 |
-
<input type="button" value="<?php _e('Set all to theme default', 'BeRocket_AJAX_domain') ?>" class="all_theme_default button">
|
769 |
-
<div style="clear:both;"></div>
|
770 |
-
</th>
|
771 |
-
</tr>
|
772 |
-
</tfoot>
|
773 |
-
</table>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
addons/deprecated_filters/widget.css
DELETED
@@ -1,1413 +0,0 @@
|
|
1 |
-
.hide_products > *{
|
2 |
-
-webkit-filter: blur(1px); -moz-filter: blur(1px); -o-filter: blur(1px); -ms-filter: blur(1px); filter: blur(1px);
|
3 |
-
filter:progid:DXImageTransform.Microsoft.Blur(PixelRadius='1');
|
4 |
-
}
|
5 |
-
|
6 |
-
.berocket_aapf_widget-wrapper {
|
7 |
-
position: relative;
|
8 |
-
}
|
9 |
-
|
10 |
-
.hide_products .berocket_aapf_widget_loading{
|
11 |
-
-webkit-filter: none; -moz-filter: none; -o-filter: none; -ms-filter: none; filter: none;
|
12 |
-
}
|
13 |
-
.hide_products {
|
14 |
-
position:relative;
|
15 |
-
}
|
16 |
-
|
17 |
-
.berocket_aapf_widget .berocket_label_widgets{
|
18 |
-
display: inline;
|
19 |
-
}
|
20 |
-
|
21 |
-
.berocket_aapf_widget .themed input[type="checkbox"] {
|
22 |
-
position: absolute;
|
23 |
-
left: -9999px;
|
24 |
-
}
|
25 |
-
|
26 |
-
.berocket_aapf_widget input[type="radio"].themed {
|
27 |
-
position: absolute;
|
28 |
-
left: -9999px;
|
29 |
-
}
|
30 |
-
|
31 |
-
.berocket_aapf_widget.berocket_aapf_widget-tag_cloud{
|
32 |
-
margin-bottom: 10px;
|
33 |
-
padding-bottom: 30px;
|
34 |
-
}
|
35 |
-
ul.berocket_aapf_widget.berocket_aapf_widget-tag_cloud.ui-widget {
|
36 |
-
border: 0;
|
37 |
-
}
|
38 |
-
ul.berocket_aapf_widget.berocket_aapf_widget-tag_cloud.ui-widget .berocket_tag_cloud_element{
|
39 |
-
border: 0;
|
40 |
-
background: transparent;
|
41 |
-
}
|
42 |
-
.berocket_aapf_widget .berocket_tag_cloud_element input[type="checkbox"] + label:before {
|
43 |
-
content: "";
|
44 |
-
width: 0;
|
45 |
-
height: 0;
|
46 |
-
background: none;
|
47 |
-
}
|
48 |
-
|
49 |
-
.berocket_aapf_widget-title{
|
50 |
-
margin-bottom: 5px;
|
51 |
-
font-size: inherit;
|
52 |
-
clear: none;
|
53 |
-
}
|
54 |
-
|
55 |
-
.berocket_aapf_widget-title_div .berocket_aapf_description{
|
56 |
-
position: absolute;
|
57 |
-
right: 0;
|
58 |
-
top: 50%;
|
59 |
-
margin-top: -0.6em;
|
60 |
-
margin-right: 5px;
|
61 |
-
width: 1.2em;
|
62 |
-
height: 1.2em;
|
63 |
-
}
|
64 |
-
|
65 |
-
.berocket_aapf_widget-title_div .berocket_aapf_description div{
|
66 |
-
display: none;
|
67 |
-
}
|
68 |
-
|
69 |
-
.berocket_aapf_description_div, .berocket_aapf_widget-title_div .berocket_aapf_description div{
|
70 |
-
position: absolute;
|
71 |
-
width: 240px;
|
72 |
-
padding: 10px 15px;
|
73 |
-
background-color: white;
|
74 |
-
color: #333;
|
75 |
-
border: 1px solid #cbcbcb;
|
76 |
-
cursor: auto;
|
77 |
-
box-shadow: 2px 2px 3px 0 rgba(50, 50, 50, 0.34);
|
78 |
-
z-index: 99999999;
|
79 |
-
line-height: 1.5em;
|
80 |
-
}
|
81 |
-
.berocket_aapf_description_div.berocket_aapf_description_div_top_right, .berocket_aapf_description_div.berocket_aapf_description_div_bottom_right{
|
82 |
-
box-shadow: -2px 2px 3px 0 rgba(50, 50, 50, 0.34);
|
83 |
-
}
|
84 |
-
|
85 |
-
.berocket_aapf_description_div .berocket_aapf_description_arrow{
|
86 |
-
background: none repeat scroll 0 0 white;
|
87 |
-
content: "";
|
88 |
-
height: 15px;
|
89 |
-
position: absolute;
|
90 |
-
transform: rotate(45deg);
|
91 |
-
width: 15px;
|
92 |
-
}
|
93 |
-
.berocket_aapf_description_div p, .berocket_aapf_widget-title_div .berocket_aapf_description div p{
|
94 |
-
margin: 0;
|
95 |
-
padding: 0;
|
96 |
-
}
|
97 |
-
.berocket_aapf_description_div_top_left .berocket_aapf_description_arrow{
|
98 |
-
top: 15px;
|
99 |
-
left: -9px;
|
100 |
-
border-left: 1px solid #cbcbcb;
|
101 |
-
border-bottom: 1px solid #cbcbcb;
|
102 |
-
}
|
103 |
-
.berocket_aapf_description_div_top_right .berocket_aapf_description_arrow{
|
104 |
-
top: 15px;
|
105 |
-
right: -9px;
|
106 |
-
border-right: 1px solid #cbcbcb;
|
107 |
-
border-top: 1px solid #cbcbcb;
|
108 |
-
}
|
109 |
-
.berocket_aapf_description_div_bottom_left .berocket_aapf_description_arrow{
|
110 |
-
bottom: 15px;
|
111 |
-
left: -9px;
|
112 |
-
border-left: 1px solid #cbcbcb;
|
113 |
-
border-bottom: 1px solid #cbcbcb;
|
114 |
-
}
|
115 |
-
.berocket_aapf_description_div_bottom_right .berocket_aapf_description_arrow{
|
116 |
-
bottom: 15px;
|
117 |
-
right: -9px;
|
118 |
-
border-right: 1px solid #cbcbcb;
|
119 |
-
border-top: 1px solid #cbcbcb;
|
120 |
-
}
|
121 |
-
|
122 |
-
.berocket_aapf_description_div.right{
|
123 |
-
box-shadow: -2px 2px 3px 0 rgba(50, 50, 50, 0.24);
|
124 |
-
}
|
125 |
-
|
126 |
-
.berocket_aapf_description_div.right:after{
|
127 |
-
border-right: 1px solid #b1b1b1;
|
128 |
-
border-top: 1px solid #b1b1b1;
|
129 |
-
left: auto;
|
130 |
-
right: -9px;
|
131 |
-
}
|
132 |
-
|
133 |
-
.berocket_aapf_widget-title_div .berocket_aapf_description i{
|
134 |
-
transition: all 0.2s ease-out 0.1s;
|
135 |
-
cursor: pointer;
|
136 |
-
display: block;
|
137 |
-
font-size: 1.2em;
|
138 |
-
line-height: 1em;
|
139 |
-
text-align: center;
|
140 |
-
width: 100%;
|
141 |
-
}
|
142 |
-
|
143 |
-
.berocket_aapf_widget-title_div .berocket_aapf_description i:hover{
|
144 |
-
transform: scale(1.2);
|
145 |
-
}
|
146 |
-
|
147 |
-
.berocket_aapf_widget .berocket_widget_icon{
|
148 |
-
max-height: 1em;
|
149 |
-
max-width: 1em;
|
150 |
-
}
|
151 |
-
|
152 |
-
.berocket_aapf_widget-title_div{
|
153 |
-
clear: both;
|
154 |
-
cursor: pointer;
|
155 |
-
position: relative;
|
156 |
-
min-height: 2em;
|
157 |
-
padding-right: 30px;
|
158 |
-
font-size: 14px;
|
159 |
-
}
|
160 |
-
.berocket_widget_has_description .berocket_aapf_widget-title_div {
|
161 |
-
padding-right: 50px;
|
162 |
-
}
|
163 |
-
.berocket_aapf_widget-title_div.disable_colapse {
|
164 |
-
cursor:initial;
|
165 |
-
}
|
166 |
-
|
167 |
-
.berocket_aapf_widget .berocket_checkbox_color.berocket_color_with_value{
|
168 |
-
display: block !important;
|
169 |
-
}
|
170 |
-
.berocket_aapf_widget .berocket_checkbox_color{
|
171 |
-
display: inline-block !important;
|
172 |
-
height: 2.6em;
|
173 |
-
}
|
174 |
-
.berocket_aapf_widget .berocket_checkbox_color.h3em{
|
175 |
-
height: 3.6em;
|
176 |
-
}
|
177 |
-
.berocket_aapf_widget .berocket_checkbox_color.h4em{
|
178 |
-
height: 4.6em;
|
179 |
-
}
|
180 |
-
.berocket_aapf_widget .berocket_checkbox_color.h5em{
|
181 |
-
height: 5.6em;
|
182 |
-
}
|
183 |
-
.berocket_aapf_widget .berocket_checkbox_color span *{
|
184 |
-
display: none !important;
|
185 |
-
}
|
186 |
-
.berocket_aapf_widget .berocket_checkbox_color span label{
|
187 |
-
display: inline-block !important;
|
188 |
-
}
|
189 |
-
.berocket_aapf_widget .berocket_checkbox_color span label *{
|
190 |
-
display: inline-block !important;
|
191 |
-
}
|
192 |
-
.berocket_aapf_widget .berocket_checkbox_color.berocket_color_without_value.brchecked_default input[type="checkbox"]:checked + label .berocket_color_span_block,
|
193 |
-
.berocket_aapf_widget .berocket_checkbox_color.berocket_color_without_value.brchecked_default .berocket_checked .berocket_color_span_block{
|
194 |
-
-webkit-transform:rotate(15deg);
|
195 |
-
-moz-transform:rotate(15deg);
|
196 |
-
-ms-transform:rotate(15deg);
|
197 |
-
-o-transform:rotate(15deg);
|
198 |
-
transform:rotate(15deg);
|
199 |
-
}
|
200 |
-
.berocket_aapf_widget .berocket_checkbox_color.berocket_color_with_value.brchecked_default input[type="checkbox"]:checked + label .berocket_color_span_block,
|
201 |
-
.berocket_aapf_widget .berocket_checkbox_color.berocket_color_with_value.brchecked_default .berocket_checked .berocket_color_span_block{
|
202 |
-
width: 3em;
|
203 |
-
}
|
204 |
-
.berocket_aapf_widget .berocket_checkbox_color.berocket_color_with_value.w1em.brchecked_default input[type="checkbox"]:checked + label .berocket_color_span_block,
|
205 |
-
.berocket_aapf_widget .berocket_checkbox_color.berocket_color_with_value.w1em.brchecked_default .berocket_checked .berocket_color_span_block{
|
206 |
-
width: 1.5em;
|
207 |
-
}
|
208 |
-
.berocket_aapf_widget .berocket_checkbox_color.berocket_color_with_value.w2em.brchecked_default input[type="checkbox"]:checked + label .berocket_color_span_block,
|
209 |
-
.berocket_aapf_widget .berocket_checkbox_color.berocket_color_with_value.w2em.brchecked_default .berocket_checked .berocket_color_span_block{
|
210 |
-
width: 3em;
|
211 |
-
}
|
212 |
-
.berocket_aapf_widget .berocket_checkbox_color.berocket_color_with_value.w3em.brchecked_default input[type="checkbox"]:checked + label .berocket_color_span_block,
|
213 |
-
.berocket_aapf_widget .berocket_checkbox_color.berocket_color_with_value.w3em.brchecked_default .berocket_checked .berocket_color_span_block{
|
214 |
-
width: 4em;
|
215 |
-
}
|
216 |
-
.berocket_aapf_widget .berocket_checkbox_color.berocket_color_with_value.w4em.brchecked_default input[type="checkbox"]:checked + label .berocket_color_span_block,
|
217 |
-
.berocket_aapf_widget .berocket_checkbox_color.berocket_color_with_value.w4em.brchecked_default .berocket_checked .berocket_color_span_block{
|
218 |
-
width: 5em;
|
219 |
-
}
|
220 |
-
.berocket_aapf_widget .berocket_checkbox_color.berocket_color_with_value.w5em.brchecked_default input[type="checkbox"]:checked + label .berocket_color_span_block,
|
221 |
-
.berocket_aapf_widget .berocket_checkbox_color.berocket_color_with_value.w5em.brchecked_default .berocket_checked .berocket_color_span_block{
|
222 |
-
width: 6em;
|
223 |
-
}
|
224 |
-
.berocket_aapf_widget .berocket_checkbox_color.berocket_color_with_value.brchecked_default input[type="checkbox"]:checked + label .berocket_color_text,
|
225 |
-
.berocket_aapf_widget .berocket_checkbox_color.berocket_color_with_value.w1em.brchecked_default input[type="checkbox"]:checked + label .berocket_color_text,
|
226 |
-
.berocket_aapf_widget .berocket_checkbox_color.berocket_color_with_value.brchecked_default .berocket_checked .berocket_color_text,
|
227 |
-
.berocket_aapf_widget .berocket_checkbox_color.berocket_color_with_value.w1em.brchecked_default .berocket_checked .berocket_color_text{
|
228 |
-
margin-left: 0.5em;
|
229 |
-
}
|
230 |
-
.berocket_aapf_widget .berocket_checkbox_color.brchecked_scale input[type="checkbox"]:checked + label .berocket_color_span_block,
|
231 |
-
.berocket_aapf_widget .berocket_checkbox_color.brchecked_scale .berocket_checked .berocket_color_span_block{
|
232 |
-
transform: scale(1.1);
|
233 |
-
}
|
234 |
-
.berocket_aapf_widget .berocket_checkbox_color.brchecked_rotate input[type="checkbox"]:checked + label .berocket_color_span_block,
|
235 |
-
.berocket_aapf_widget .berocket_checkbox_color.brchecked_rotate .berocket_checked .berocket_color_span_block{
|
236 |
-
transform: rotate(10deg);
|
237 |
-
}
|
238 |
-
.berocket_aapf_widget .berocket_checkbox_color.brchecked_shadow input[type="checkbox"]:checked + label .berocket_color_span_block,
|
239 |
-
.berocket_aapf_widget .berocket_checkbox_color.brchecked_shadow .berocket_checked .berocket_color_span_block{
|
240 |
-
box-shadow: 0px 0px 1px 3px #8888FF;
|
241 |
-
}
|
242 |
-
.berocket_aapf_widget .berocket_checkbox_color .berocket_label_widgets{
|
243 |
-
display: inline-block !important;
|
244 |
-
height: 2em;
|
245 |
-
margin: 0.3em;
|
246 |
-
cursor: pointer;
|
247 |
-
}
|
248 |
-
.berocket_aapf_widget .berocket_checkbox_color label span.berocket_color_text{
|
249 |
-
margin-left: 1.5em;
|
250 |
-
-webkit-transition: all 0.2s ease-out 0.1s;
|
251 |
-
-moz-transition: all 0.2s ease-out 0.1s;
|
252 |
-
-o-transition: all 0.2s ease-out 0.1s;
|
253 |
-
transition: all 0.2s ease-out 0.1s;
|
254 |
-
}
|
255 |
-
.berocket_aapf_widget .berocket_checkbox_color.w1em label span.berocket_color_text{
|
256 |
-
margin-left: 1em;
|
257 |
-
}
|
258 |
-
.berocket_aapf_widget .berocket_checkbox_color label span.berocket_color_span_block, span.berocket_color_span_block{
|
259 |
-
display: inline-block !important;
|
260 |
-
overflow: hidden;
|
261 |
-
position: relative;
|
262 |
-
height: 2em;
|
263 |
-
width: 2em;
|
264 |
-
line-height: 2em;
|
265 |
-
border: 2px solid black;
|
266 |
-
text-align: center;
|
267 |
-
vertical-align: middle;
|
268 |
-
color: #222 !important;
|
269 |
-
text-shadow:
|
270 |
-
0px 0px 3px #FFF,
|
271 |
-
1px 0px 2px #FFF,
|
272 |
-
0px 1px 2px #FFF,
|
273 |
-
-1px 0px 2px #FFF,
|
274 |
-
0px -1px 2px #FFF,
|
275 |
-
1px 1px 2px #FFF,
|
276 |
-
1px -1px 2px #FFF,
|
277 |
-
-1px 1px 2px #FFF,
|
278 |
-
-1px -1px 2px #FFF;
|
279 |
-
-webkit-transition: all 0.2s ease-out 0.1s;
|
280 |
-
-moz-transition: all 0.2s ease-out 0.1s;
|
281 |
-
-o-transition: all 0.2s ease-out 0.1s;
|
282 |
-
transition: all 0.2s ease-out 0.1s;
|
283 |
-
}
|
284 |
-
.berocket_aapf_widget .berocket_checkbox_color.w1em label span.berocket_color_span_block, span.berocket_color_span_block{
|
285 |
-
width: 1em;
|
286 |
-
}
|
287 |
-
.berocket_aapf_widget .berocket_checkbox_color.w2em label span.berocket_color_span_block, span.berocket_color_span_block{
|
288 |
-
width: 2em;
|
289 |
-
}
|
290 |
-
.berocket_aapf_widget .berocket_checkbox_color.w3em label span.berocket_color_span_block, span.berocket_color_span_block{
|
291 |
-
width: 3em;
|
292 |
-
}
|
293 |
-
.berocket_aapf_widget .berocket_checkbox_color.w4em label span.berocket_color_span_block, span.berocket_color_span_block{
|
294 |
-
width: 4em;
|
295 |
-
}
|
296 |
-
.berocket_aapf_widget .berocket_checkbox_color.w5em label span.berocket_color_span_block, span.berocket_color_span_block{
|
297 |
-
width: 5em;
|
298 |
-
}
|
299 |
-
.berocket_aapf_widget .berocket_checkbox_color.h1em label span.berocket_color_span_block, span.berocket_color_span_block{
|
300 |
-
height: 1em;
|
301 |
-
line-height: 1em;
|
302 |
-
}
|
303 |
-
.berocket_aapf_widget .berocket_checkbox_color.h2em label span.berocket_color_span_block, span.berocket_color_span_block{
|
304 |
-
height: 2em;
|
305 |
-
line-height: 2em;
|
306 |
-
}
|
307 |
-
.berocket_aapf_widget .berocket_checkbox_color.h3em label span.berocket_color_span_block, span.berocket_color_span_block{
|
308 |
-
height: 3em;
|
309 |
-
line-height: 3em;
|
310 |
-
}
|
311 |
-
.berocket_aapf_widget .berocket_checkbox_color.h4em label span.berocket_color_span_block, span.berocket_color_span_block{
|
312 |
-
height: 4em;
|
313 |
-
line-height: 4em;
|
314 |
-
}
|
315 |
-
.berocket_aapf_widget .berocket_checkbox_color.h5em label span.berocket_color_span_block, span.berocket_color_span_block{
|
316 |
-
height: 5em;
|
317 |
-
line-height: 5em;
|
318 |
-
}
|
319 |
-
.berocket_color_span_block .fa{
|
320 |
-
position: absolute;
|
321 |
-
left: 0;
|
322 |
-
right: 0;
|
323 |
-
top: 0;
|
324 |
-
bottom: 0;
|
325 |
-
text-align: center;
|
326 |
-
vertical-align: middle;
|
327 |
-
font-size: 1em;
|
328 |
-
line-height: 2em;
|
329 |
-
}
|
330 |
-
.berocket_color_span_block .berocket_color_span_absolute{
|
331 |
-
position: absolute;
|
332 |
-
z-index:10;
|
333 |
-
left: 50%;
|
334 |
-
}
|
335 |
-
.berocket_color_span_block .berocket_color_span_absolute span{
|
336 |
-
position: relative;
|
337 |
-
left: -50%;
|
338 |
-
}
|
339 |
-
.berocket_aapf_widget_selected_filter a{
|
340 |
-
margin: 2px 0;
|
341 |
-
display: inline-block
|
342 |
-
}
|
343 |
-
.berocket_aapf_widget .berocket_checkbox_color input[type="checkbox"] + label:before{
|
344 |
-
content: "";
|
345 |
-
width: 0;
|
346 |
-
height: 0;
|
347 |
-
background: none;
|
348 |
-
display: none;
|
349 |
-
}
|
350 |
-
.berocket_aapf_widget{
|
351 |
-
margin-bottom: 30px;
|
352 |
-
margin-right: 3%;
|
353 |
-
clear: both;
|
354 |
-
position: relative;
|
355 |
-
height: initial;
|
356 |
-
}
|
357 |
-
.berocket_aapf_widget:not(.berocket_aapf_widget-tag_cloud) {
|
358 |
-
height: initial!important;
|
359 |
-
}
|
360 |
-
|
361 |
-
.berocket_aapf_widget_show{
|
362 |
-
position: absolute;
|
363 |
-
right: 0;
|
364 |
-
top: 50%;
|
365 |
-
margin-top: -0.75em;
|
366 |
-
margin-right: 5px;
|
367 |
-
width: 1.5em;
|
368 |
-
height: 1.5em;
|
369 |
-
}
|
370 |
-
.berocket_widget_has_description .berocket_aapf_widget_show {
|
371 |
-
right: 20px;
|
372 |
-
}
|
373 |
-
.berocket_aapf_widget_show .fa.fa-angle-left,
|
374 |
-
.berocket_aapf_widget_show .fa.fa-angle-right {
|
375 |
-
display: block;
|
376 |
-
font-size: 1.5em;
|
377 |
-
line-height: 1em;
|
378 |
-
text-align: center;
|
379 |
-
width: 100%;
|
380 |
-
}
|
381 |
-
@media screen and (max-width: 700px){
|
382 |
-
.berocket_aapf_widget_show.mobile_hide{
|
383 |
-
display: none;
|
384 |
-
}
|
385 |
-
}
|
386 |
-
.berocket_aapf_widget_show.show_button
|
387 |
-
{
|
388 |
-
-moz-transform: rotate(270deg);
|
389 |
-
-ms-transform: rotate(270deg);
|
390 |
-
-webkit-transform: rotate(270deg);
|
391 |
-
-o-transform: rotate(270deg);
|
392 |
-
transform: rotate(270deg);
|
393 |
-
}
|
394 |
-
.berocket_aapf_widget_show.hide_button
|
395 |
-
{
|
396 |
-
-moz-transform: rotate(90deg);
|
397 |
-
-ms-transform: rotate(90deg);
|
398 |
-
-webkit-transform: rotate(90deg);
|
399 |
-
-o-transform: rotate(90deg);
|
400 |
-
transform: rotate(90deg);
|
401 |
-
}
|
402 |
-
ul.berocket_aapf_widget{
|
403 |
-
margin-bottom: 30px;
|
404 |
-
}
|
405 |
-
|
406 |
-
ul.berocket_aapf_widget .berocket_checkbox_color{
|
407 |
-
width: initial;
|
408 |
-
}
|
409 |
-
ul.berocket_aapf_widget li{
|
410 |
-
list-style-type: none;
|
411 |
-
padding: 0;
|
412 |
-
}
|
413 |
-
ul.berocket_aapf_widget.berocket_values_2 li,
|
414 |
-
ul.berocket_aapf_widget.berocket_values_3 li,
|
415 |
-
ul.berocket_aapf_widget.berocket_values_4 li {
|
416 |
-
display: inline-block;
|
417 |
-
box-sizing: border-box;
|
418 |
-
margin: 0;
|
419 |
-
}
|
420 |
-
ul.berocket_aapf_widget.berocket_values_2 li{
|
421 |
-
width: 48%;
|
422 |
-
}
|
423 |
-
ul.berocket_aapf_widget.berocket_values_3 li{
|
424 |
-
width: 31%;
|
425 |
-
}
|
426 |
-
ul.berocket_aapf_widget.berocket_values_4 li{
|
427 |
-
width: 23%;
|
428 |
-
}
|
429 |
-
.berocket_aapf_widget.berocket_values_2 .berocket_checkbox_color.berocket_color_with_value,
|
430 |
-
.berocket_aapf_widget.berocket_values_3 .berocket_checkbox_color.berocket_color_with_value,
|
431 |
-
.berocket_aapf_widget.berocket_values_4 .berocket_checkbox_color.berocket_color_with_value,
|
432 |
-
.show_o_sel_values .berocket_aapf_widget.berocket_values_2 .berocket_checkbox_color.berocket_color_with_value,
|
433 |
-
.show_o_sel_values .berocket_aapf_widget.berocket_values_3 .berocket_checkbox_color.berocket_color_with_value,
|
434 |
-
.show_o_sel_values .berocket_aapf_widget.berocket_values_4 .berocket_checkbox_color.berocket_color_with_value{
|
435 |
-
display: inline-block!important;
|
436 |
-
}
|
437 |
-
.berocket_aapf_widget li.berocket_checkbox_color.berocket_color_with_value.berocket_hide_sel_value,
|
438 |
-
.berocket_aapf_widget li.berocket_checkbox_color.berocket_color_with_value.berocket_hide_o_value{
|
439 |
-
display: none!important;
|
440 |
-
}
|
441 |
-
ul.berocket_aapf_widget .berocket_widget_show_values{
|
442 |
-
cursor: pointer;
|
443 |
-
display: block;
|
444 |
-
position: relative;
|
445 |
-
margin-bottom: 10px;
|
446 |
-
top: 10px;
|
447 |
-
font-size: 0.9em;
|
448 |
-
}
|
449 |
-
ul.berocket_aapf_widget .berocket_widget_show_values span:not(.show_button,.hide_button){
|
450 |
-
font-family: FontAwesome;
|
451 |
-
}
|
452 |
-
ul.berocket_aapf_widget .berocket_widget_show_values span{
|
453 |
-
margin-right: 20px;
|
454 |
-
display: inline-block;
|
455 |
-
width: 1.8em;
|
456 |
-
height: 1em;
|
457 |
-
position: relative;
|
458 |
-
text-align: center;
|
459 |
-
vertical-align: middle;
|
460 |
-
}
|
461 |
-
|
462 |
-
ul.berocket_aapf_widget .berocket_widget_show_values span.show_button:before
|
463 |
-
{
|
464 |
-
content: "\f107";
|
465 |
-
}
|
466 |
-
|
467 |
-
ul.berocket_aapf_widget .berocket_widget_show_values span.hide_button:before
|
468 |
-
{
|
469 |
-
content: "\f106";
|
470 |
-
}
|
471 |
-
|
472 |
-
.berocket_aapf_widget li.berocket_hide_o_value,
|
473 |
-
.berocket_aapf_widget li.berocket_hide_sel_value,
|
474 |
-
.berocket_aapf_widget li.berocket_hide_attribute_count_value,
|
475 |
-
.berocket_aapf_widget li.berocket_hide_o_value.berocket_hide_attribute_count_value,
|
476 |
-
.berocket_aapf_widget li.berocket_hide_o_value.berocket_color_with_value,
|
477 |
-
.berocket_aapf_widget li.berocket_hide_sel_value.berocket_color_with_value,
|
478 |
-
.berocket_aapf_widget li.berocket_hide_attribute_count_value.berocket_color_with_value,
|
479 |
-
.berocket_aapf_widget li.berocket_hide_o_value.berocket_hide_attribute_count_value.berocket_color_with_value,
|
480 |
-
select option.berocket_hide_o_value {
|
481 |
-
display: none !important;
|
482 |
-
}
|
483 |
-
|
484 |
-
.br_child_parent_wrapper .berocket_aapf_widget li.berocket_hide_o_value,
|
485 |
-
.show_o_sel_values .berocket_aapf_widget li.berocket_hide_o_value,
|
486 |
-
.show_o_sel_values .berocket_aapf_widget li.berocket_hide_sel_value,
|
487 |
-
.show_o_sel_values .berocket_aapf_widget li.berocket_hide_attribute_count_value {
|
488 |
-
display: block !important;
|
489 |
-
}
|
490 |
-
.br_child_parent_wrapper li.berocket_hide_o_value.berocket_color_without_value,
|
491 |
-
.show_o_sel_values li.berocket_hide_o_value.berocket_color_without_value,
|
492 |
-
.show_o_sel_values li.berocket_hide_sel_value.berocket_color_without_value,
|
493 |
-
.show_o_sel_values li.berocket_hide_attribute_count_value.berocket_color_without_value {
|
494 |
-
display: inline-block !important;
|
495 |
-
}
|
496 |
-
|
497 |
-
ul.berocket_aapf_widget li > span{
|
498 |
-
display: block;
|
499 |
-
cursor: pointer;
|
500 |
-
min-height: 20px;
|
501 |
-
line-height: 1em;
|
502 |
-
}
|
503 |
-
|
504 |
-
ul.berocket_aapf_widget li > span label:hover{
|
505 |
-
color: #000000;
|
506 |
-
}
|
507 |
-
|
508 |
-
.berocket_aapf_widget_loading{
|
509 |
-
position: absolute;
|
510 |
-
top: 0;
|
511 |
-
left: 0;
|
512 |
-
right: 0;
|
513 |
-
bottom: 0;
|
514 |
-
z-index: 10000;
|
515 |
-
background-color: transparent;
|
516 |
-
}
|
517 |
-
|
518 |
-
.berocket_aapf_widget_loading:after{
|
519 |
-
content: " ";
|
520 |
-
position: absolute;
|
521 |
-
top: 0;
|
522 |
-
left: 0;
|
523 |
-
right: 0;
|
524 |
-
bottom: 0;
|
525 |
-
z-index: 9999;
|
526 |
-
background-color: white;
|
527 |
-
display: block;
|
528 |
-
opacity: 0.7;
|
529 |
-
}
|
530 |
-
|
531 |
-
.berocket_aapf_widget_loading .berocket_aapf_widget_loading_container{
|
532 |
-
position: relative;
|
533 |
-
top: 40%;
|
534 |
-
width: 430px;
|
535 |
-
max-width: 100%;
|
536 |
-
height: 200px;
|
537 |
-
margin: auto;
|
538 |
-
z-index: 10000;
|
539 |
-
}
|
540 |
-
.berocket_aapf_widget_loading .berocket_aapf_widget_loading_image{
|
541 |
-
background: transparent url('images/ajax-loader.gif') no-repeat center center;
|
542 |
-
display: inline-block;
|
543 |
-
float: left;
|
544 |
-
height: 30px;
|
545 |
-
width: 30px;
|
546 |
-
}
|
547 |
-
|
548 |
-
.berocket_aapf_widget_loading img{
|
549 |
-
display: inline-block;
|
550 |
-
float: left;
|
551 |
-
width: 30px;
|
552 |
-
}
|
553 |
-
|
554 |
-
.berocket_aapf_widget_loading .berocket_aapf_widget_loading_top, .berocket_aapf_widget_loading .berocket_aapf_widget_loading_bottom{
|
555 |
-
text-align: center;
|
556 |
-
letter-spacing: 0;
|
557 |
-
font-size: 18px;
|
558 |
-
clear: both;
|
559 |
-
}
|
560 |
-
|
561 |
-
.berocket_aapf_widget_loading .berocket_aapf_widget_loading_left, .berocket_aapf_widget_loading .berocket_aapf_widget_loading_right{
|
562 |
-
display: inline-block;
|
563 |
-
float: left;
|
564 |
-
width: 190px;
|
565 |
-
padding: 0 5px;
|
566 |
-
letter-spacing: 0;
|
567 |
-
height: 30px;
|
568 |
-
font-size: 18px;
|
569 |
-
box-sizing: content-box;
|
570 |
-
}
|
571 |
-
.berocket_aapf_widget_loading .berocket_aapf_widget_loading_left{
|
572 |
-
text-align: right;
|
573 |
-
}
|
574 |
-
|
575 |
-
.berocket_aapf_widget_loading .berocket_aapf_widget_loading_right{
|
576 |
-
text-align: left;
|
577 |
-
}
|
578 |
-
|
579 |
-
.no-products{
|
580 |
-
font-size: 26px;
|
581 |
-
font-weight: bold;
|
582 |
-
line-height: 6em;
|
583 |
-
text-align: center;
|
584 |
-
}
|
585 |
-
|
586 |
-
span.product-size{
|
587 |
-
color: #777;
|
588 |
-
display: block;
|
589 |
-
text-align: center;
|
590 |
-
}
|
591 |
-
|
592 |
-
.berocket_aapf_widget li.slider span.left, .berocket_aapf_widget li.slider span.right{
|
593 |
-
height: 40px;
|
594 |
-
float: left;
|
595 |
-
font-size: 12px;
|
596 |
-
max-width: 50%;
|
597 |
-
text-align: left;
|
598 |
-
}
|
599 |
-
|
600 |
-
.berocket_aapf_widget li.slider span.left input, .berocket_aapf_widget li.slider span.right input{
|
601 |
-
|
602 |
-
border: 1px solid #E8E8E8;
|
603 |
-
font-size: 13px;
|
604 |
-
font-style: italic;
|
605 |
-
padding: 4px 9px;
|
606 |
-
width: 60%;
|
607 |
-
background: white;
|
608 |
-
line-height: 1.1em;
|
609 |
-
}
|
610 |
-
|
611 |
-
.berocket_aapf_widget li.slider span.right{
|
612 |
-
float: right;
|
613 |
-
text-align: right;
|
614 |
-
}
|
615 |
-
|
616 |
-
.berocket_filter_slider.ui-widget-content, .berocket_filter_price_slider.ui-widget-content{
|
617 |
-
background: none repeat scroll 0 0 #b0b5b9;
|
618 |
-
border: 0 none;
|
619 |
-
border-radius: 0;
|
620 |
-
height: 4px;
|
621 |
-
padding: 0;
|
622 |
-
}
|
623 |
-
|
624 |
-
.berocket_filter_slider.ui-widget-content .ui-slider-range, .berocket_filter_price_slider.ui-widget-content .ui-slider-range{
|
625 |
-
background: none repeat scroll 0 0 #000000;
|
626 |
-
}
|
627 |
-
.slide.default .berocket_filter_slider.ui-widget-content .ui-slider-range,
|
628 |
-
.slide.default .berocket_filter_price_slider.ui-widget-content .ui-slider-range{
|
629 |
-
background: #222;
|
630 |
-
}
|
631 |
-
.slide.default .berocket_filter_slider.ui-widget-content,
|
632 |
-
.slide.default .berocket_filter_price_slider.ui-widget-content{
|
633 |
-
height: 4px;
|
634 |
-
border: 1px solid #555;
|
635 |
-
font-size: 10px;
|
636 |
-
}
|
637 |
-
.slide.default .berocket_filter_slider .ui-state-default,
|
638 |
-
.slide.default .berocket_filter_price_slider .ui-state-default,
|
639 |
-
.slide.default .berocket_filter_slider.ui-widget-content .ui-state-default,
|
640 |
-
.slide.default .berocket_filter_price_slider.ui-widget-content .ui-state-default,
|
641 |
-
.slide.default .berocket_filter_slider .ui-widget-header .ui-state-default,
|
642 |
-
.slide.default .berocket_filter_price_slider .ui-widget-header .ui-state-default,
|
643 |
-
.berocket_filter_slider.ui-widget-content .ui-slider-handle,
|
644 |
-
.berocket_filter_price_slider.ui-widget-content .ui-slider-handle{
|
645 |
-
background: #ddd;
|
646 |
-
font-size: 14px;
|
647 |
-
width: 1em;
|
648 |
-
height: 1em;
|
649 |
-
border: 1px solid #555;
|
650 |
-
top: -6px;
|
651 |
-
border-radius: 2em;
|
652 |
-
}
|
653 |
-
|
654 |
-
.berocket_aapf_widget li.slider div.slide{
|
655 |
-
clear: both;
|
656 |
-
height: auto;
|
657 |
-
text-align: right;
|
658 |
-
line-height: 0;
|
659 |
-
}
|
660 |
-
|
661 |
-
.ui-slider {
|
662 |
-
position: relative;
|
663 |
-
text-align: left;
|
664 |
-
}
|
665 |
-
.ui-slider .ui-slider-handle {
|
666 |
-
position: absolute;
|
667 |
-
z-index: 2;
|
668 |
-
width: 1.2em;
|
669 |
-
height: 1.2em;
|
670 |
-
cursor: pointer;
|
671 |
-
-ms-touch-action: none;
|
672 |
-
touch-action: none;
|
673 |
-
}
|
674 |
-
.ui-slider .ui-slider-range {
|
675 |
-
position: absolute;
|
676 |
-
z-index: 1;
|
677 |
-
font-size: .7em;
|
678 |
-
display: block;
|
679 |
-
border: 0;
|
680 |
-
background-position: 0 0;
|
681 |
-
}
|
682 |
-
.ui-slider.ui-state-disabled .ui-slider-handle,
|
683 |
-
.ui-slider.ui-state-disabled .ui-slider-range {
|
684 |
-
filter: inherit;
|
685 |
-
}
|
686 |
-
|
687 |
-
.ui-slider-horizontal {
|
688 |
-
height: .8em;
|
689 |
-
}
|
690 |
-
.ui-slider-horizontal .ui-slider-handle {
|
691 |
-
top: -.3em;
|
692 |
-
margin-left: -.6em;
|
693 |
-
}
|
694 |
-
.berocket_filter_slider > a:last-child {
|
695 |
-
margin-left: -12px;
|
696 |
-
}
|
697 |
-
.ui-slider-horizontal .ui-slider-range {
|
698 |
-
top: 0;
|
699 |
-
height: 100%;
|
700 |
-
}
|
701 |
-
.ui-slider-horizontal .ui-slider-range-min {
|
702 |
-
left: 0;
|
703 |
-
}
|
704 |
-
.ui-slider-horizontal .ui-slider-range-max {
|
705 |
-
right: 0;
|
706 |
-
}
|
707 |
-
|
708 |
-
.ui-slider-vertical {
|
709 |
-
width: .8em;
|
710 |
-
height: 100px;
|
711 |
-
}
|
712 |
-
.ui-slider-vertical .ui-slider-handle {
|
713 |
-
left: -.3em;
|
714 |
-
margin-left: 0;
|
715 |
-
margin-bottom: -.6em;
|
716 |
-
}
|
717 |
-
.ui-slider-vertical .ui-slider-range {
|
718 |
-
left: 0;
|
719 |
-
width: 100%;
|
720 |
-
}
|
721 |
-
.ui-slider-vertical .ui-slider-range-min {
|
722 |
-
bottom: 0;
|
723 |
-
}
|
724 |
-
.ui-slider-vertical .ui-slider-range-max {
|
725 |
-
top: 0;
|
726 |
-
}
|
727 |
-
|
728 |
-
.slide .ui-corner-all,
|
729 |
-
.slide .ui-corner-bottom,
|
730 |
-
.slide .ui-corner-right,
|
731 |
-
.slide .ui-corner-br {
|
732 |
-
border-bottom-right-radius: 4px;
|
733 |
-
}
|
734 |
-
.slide .ui-corner-all,
|
735 |
-
.slide .ui-corner-bottom,
|
736 |
-
.slide .ui-corner-left,
|
737 |
-
.slide .ui-corner-bl {
|
738 |
-
border-bottom-left-radius: 4px;
|
739 |
-
}
|
740 |
-
.slide .ui-corner-all,
|
741 |
-
.slide .ui-corner-top,
|
742 |
-
.slide .ui-corner-right,
|
743 |
-
.slide .ui-corner-tr {
|
744 |
-
border-top-right-radius: 4px;
|
745 |
-
}
|
746 |
-
.slide .ui-corner-all,
|
747 |
-
.slide .ui-corner-top,
|
748 |
-
.slide .ui-corner-left,
|
749 |
-
.slide .ui-corner-tl {
|
750 |
-
border-top-left-radius: 4px;
|
751 |
-
}
|
752 |
-
ul.berocket_aapf_widget li.slider > span {
|
753 |
-
cursor: initial;
|
754 |
-
}
|
755 |
-
ul.berocket_aapf_widget li.slider .berocket_filter_slider {
|
756 |
-
cursor: pointer;
|
757 |
-
}
|
758 |
-
.slide .ui-widget-content {
|
759 |
-
background: #ffffff;
|
760 |
-
border: 1px solid #aaaaaa;
|
761 |
-
color: #222222;
|
762 |
-
}
|
763 |
-
.slide .ui-state-default,
|
764 |
-
.slide .ui-widget-content .ui-state-default,
|
765 |
-
.slide .ui-widget-header .ui-state-default {
|
766 |
-
background: #e6e6e6;
|
767 |
-
border: 1px solid #d3d3d3;
|
768 |
-
color: #555555;
|
769 |
-
font-weight: normal;
|
770 |
-
}
|
771 |
-
ul.berocket_aapf_widget li.berocket_tag_cloud_element
|
772 |
-
{
|
773 |
-
display: inline-block;
|
774 |
-
overflow: hidden;
|
775 |
-
}
|
776 |
-
ul.berocket_aapf_widget li.berocket_tag_cloud_element > span
|
777 |
-
{
|
778 |
-
display: inline-block;
|
779 |
-
height: initial;
|
780 |
-
}
|
781 |
-
ul.berocket_aapf_widget li.berocket_tag_cloud_element > span input
|
782 |
-
{
|
783 |
-
display: none;
|
784 |
-
}
|
785 |
-
ul.berocket_aapf_widget li.berocket_tag_cloud_element > span input:checked ~ label
|
786 |
-
{
|
787 |
-
background-color: #CCF;
|
788 |
-
}
|
789 |
-
ul.berocket_aapf_widget li.berocket_tag_cloud_element > span label
|
790 |
-
{
|
791 |
-
padding: 0;
|
792 |
-
cursor: pointer;
|
793 |
-
}
|
794 |
-
@media only screen and (max-device-width: 767px) {
|
795 |
-
.bapf_sngl_hd_mobile,
|
796 |
-
.berocket_aapf_hide_mobile {
|
797 |
-
display: none !important;
|
798 |
-
}
|
799 |
-
}
|
800 |
-
|
801 |
-
.berocket_aapf_widget.berocket_aapf_widget_selected_area ul,
|
802 |
-
.berocket_aapf_widget.berocket_aapf_widget_selected_area li{
|
803 |
-
list-style: outside none none;
|
804 |
-
}
|
805 |
-
.berocket_aapf_selected_area_hook .berocket_aapf_widget_selected_filter,
|
806 |
-
.berocket_aapf_selected_area_hook ul{
|
807 |
-
clear: both;
|
808 |
-
}
|
809 |
-
.berocket_aapf_selected_area_hook li{
|
810 |
-
float: left;
|
811 |
-
margin-right: 1em;
|
812 |
-
}
|
813 |
-
.berocket_aapf_selected_area_block *{
|
814 |
-
color: inherit;
|
815 |
-
}
|
816 |
-
.berocket_aapf_selected_area_block .berocket_aapf_widget_selected_filter a{
|
817 |
-
border: 1px solid transparent;
|
818 |
-
border-radius: 4px;
|
819 |
-
display: block;
|
820 |
-
padding: 2px 5px;
|
821 |
-
}
|
822 |
-
.berocket_aapf_widget li.berocket_checkbox_color > span > input[type="checkbox"] + .berocket_label_widgets:before {
|
823 |
-
display: none;
|
824 |
-
}
|
825 |
-
.berocket_aapf_widget li > span > input[type="checkbox"] + .berocket_label_widgets:before {
|
826 |
-
border: 2px solid #787878;
|
827 |
-
border-radius: 3px;
|
828 |
-
font-family: FontAwesome;
|
829 |
-
content: "\00a0";
|
830 |
-
display: none;
|
831 |
-
font-size: 14px;
|
832 |
-
height: 0.7em;
|
833 |
-
line-height: 0.7em;
|
834 |
-
text-indent: -0.08em;
|
835 |
-
width: 0.7em;
|
836 |
-
cursor: pointer;
|
837 |
-
box-sizing: content-box;
|
838 |
-
color: #787878;
|
839 |
-
padding: 0px;
|
840 |
-
}
|
841 |
-
|
842 |
-
.berocket_aapf_widget li > span > input[type="radio"] + .berocket_label_widgets:before {
|
843 |
-
border: 2px solid #787878;
|
844 |
-
border-radius: 50%;
|
845 |
-
box-sizing: content-box;
|
846 |
-
color: #787878;
|
847 |
-
content: " ";
|
848 |
-
cursor: pointer;
|
849 |
-
display: none;
|
850 |
-
font-family: FontAwesome;
|
851 |
-
font-size: 6px;
|
852 |
-
height: 1.3em;
|
853 |
-
line-height: 1.28em;
|
854 |
-
text-align: center;
|
855 |
-
text-indent: -0.02em;
|
856 |
-
vertical-align: top;
|
857 |
-
width: 1.3em;
|
858 |
-
padding: 1px;
|
859 |
-
}
|
860 |
-
.berocket_child_parent_sample{
|
861 |
-
display: none;
|
862 |
-
}
|
863 |
-
.berocket_widget_color_pick .br_colorpicker_field{
|
864 |
-
width: 2em;
|
865 |
-
height: 2em;
|
866 |
-
border: 1px solid #333;
|
867 |
-
}
|
868 |
-
ul.berocket_aapf_widget li.berocket_checkbox_color > span > input[type="radio"]:checked + .berocket_label_widgets:before,
|
869 |
-
.berocket_checkbox_color .berocket_color_span_block.berocket_aapf_count:before,
|
870 |
-
.berocket_checkbox_color .berocket_color_span_block.berocket_aapf_count:after{
|
871 |
-
content: "";
|
872 |
-
}
|
873 |
-
.rightpcs .berocket_aapf_count{
|
874 |
-
float: right;
|
875 |
-
}
|
876 |
-
.berocket_aapf_widget.rightpcs .berocket_label_widgets
|
877 |
-
{
|
878 |
-
display: block;
|
879 |
-
}
|
880 |
-
.right2empcs .berocket_aapf_count{
|
881 |
-
padding-left: 5px;
|
882 |
-
}
|
883 |
-
.right2empcs .berocket_color_span_block.berocket_aapf_count{
|
884 |
-
padding-left: 0px;
|
885 |
-
}
|
886 |
-
.roundpcs .berocket_aapf_count:before{
|
887 |
-
content: "(";
|
888 |
-
}
|
889 |
-
.roundpcs .berocket_aapf_count:after{
|
890 |
-
content: ")";
|
891 |
-
}
|
892 |
-
.quadpcs .berocket_aapf_count:before{
|
893 |
-
content: "[";
|
894 |
-
}
|
895 |
-
.quadpcs .berocket_aapf_count:after{
|
896 |
-
content: "]";
|
897 |
-
}
|
898 |
-
.berocket_aapf_product_count_desc.br_aapf_pcd_left{
|
899 |
-
left: 100%;
|
900 |
-
padding-right: 1.3em;
|
901 |
-
}
|
902 |
-
.berocket_aapf_product_count_desc.br_aapf_pcd_right{
|
903 |
-
right: 100%;
|
904 |
-
padding-left: 1.3em;
|
905 |
-
}
|
906 |
-
.berocket_aapf_product_count_desc {
|
907 |
-
background: none repeat scroll 0 0 white;
|
908 |
-
border: 1px solid #999999;
|
909 |
-
padding-left: 0.7em;
|
910 |
-
padding-right: 0.7em;
|
911 |
-
position: absolute;
|
912 |
-
top: 1em;
|
913 |
-
min-width: 250px;
|
914 |
-
z-index: 1000;
|
915 |
-
}
|
916 |
-
.berocket_aapf_product_count_desc .berocket_aapf_close_pc {
|
917 |
-
position: absolute;
|
918 |
-
width: 1.2em;
|
919 |
-
text-align: center;
|
920 |
-
z-index: 200;
|
921 |
-
}
|
922 |
-
.berocket_aapf_product_count_desc.br_aapf_pcd_left .berocket_aapf_close_pc {
|
923 |
-
right: 0;
|
924 |
-
}
|
925 |
-
.berocket_aapf_product_count_desc.br_aapf_pcd_right .berocket_aapf_close_pc {
|
926 |
-
left: 0;
|
927 |
-
}
|
928 |
-
.berocket_aapf_product_count_desc.br_aapf_pcd_left > span {
|
929 |
-
left: -0.55em;
|
930 |
-
border-bottom: 1px solid #999;
|
931 |
-
border-left: 1px solid #999;
|
932 |
-
}
|
933 |
-
.berocket_aapf_product_count_desc.br_aapf_pcd_right > span {
|
934 |
-
right: -0.55em;
|
935 |
-
border-top: 1px solid #999;
|
936 |
-
border-right: 1px solid #999;
|
937 |
-
}
|
938 |
-
.berocket_aapf_product_count_desc > span {
|
939 |
-
background: none repeat scroll 0 0 white;
|
940 |
-
display: block;
|
941 |
-
height: 1em;
|
942 |
-
position: absolute;
|
943 |
-
top: 0.3em;
|
944 |
-
transform: rotate(45deg);
|
945 |
-
width: 1em;
|
946 |
-
z-index: 100;
|
947 |
-
}
|
948 |
-
.berocket_term_depth_1 label {
|
949 |
-
padding-left: 1em;
|
950 |
-
}
|
951 |
-
.berocket_term_depth_2 label {
|
952 |
-
padding-left: 2em;
|
953 |
-
}
|
954 |
-
.berocket_term_depth_3 label {
|
955 |
-
padding-left: 3em;
|
956 |
-
}
|
957 |
-
.berocket_term_depth_4 label {
|
958 |
-
padding-left: 4em;
|
959 |
-
}
|
960 |
-
.berocket_term_depth_5 label {
|
961 |
-
padding-left: 5em;
|
962 |
-
}
|
963 |
-
.berocket_child_no_values,
|
964 |
-
.berocket_child_previous,
|
965 |
-
.berocket_child_no_products {
|
966 |
-
display: none;
|
967 |
-
}
|
968 |
-
.berocket_search_box_block {
|
969 |
-
position: relative;
|
970 |
-
padding: 0.5em;
|
971 |
-
}
|
972 |
-
.berocket_search_box_block .berocket_search_box_background_all {
|
973 |
-
position: relative;
|
974 |
-
z-index: 200;
|
975 |
-
}
|
976 |
-
.berocket_search_box_block .berocket_search_box_background {
|
977 |
-
z-index: 100;
|
978 |
-
position: absolute;
|
979 |
-
top: 0;
|
980 |
-
bottom: 0;
|
981 |
-
left: 0;
|
982 |
-
right: 0;
|
983 |
-
}
|
984 |
-
.berocket_search_box_block select {
|
985 |
-
min-width: 100%;
|
986 |
-
}
|
987 |
-
.berocket_search_box_button {
|
988 |
-
cursor: pointer;
|
989 |
-
display: block;
|
990 |
-
text-align: center;
|
991 |
-
padding: 5px 0;
|
992 |
-
}
|
993 |
-
.berocket_search_box_block .berocket_aapf_widget-wrapper ul {
|
994 |
-
margin: 0;
|
995 |
-
}
|
996 |
-
.berocket_search_box_block .berocket_aapf_widget-wrapper {
|
997 |
-
margin: 1em 0;
|
998 |
-
}
|
999 |
-
.ui-widget.ui-datepicker {
|
1000 |
-
font-size: 14px;
|
1001 |
-
z-index: 9000!important;
|
1002 |
-
}
|
1003 |
-
.berocket_datepicker_fields {
|
1004 |
-
width: 49%;
|
1005 |
-
display: block;
|
1006 |
-
float: left;
|
1007 |
-
box-sizing: border-box;
|
1008 |
-
}
|
1009 |
-
.berocket_datepicker_fields.field_1 {
|
1010 |
-
margin-right: 2%;
|
1011 |
-
}
|
1012 |
-
.berocket_datepicker_fields input {
|
1013 |
-
text-align: center;
|
1014 |
-
}
|
1015 |
-
.br_child_toggle {
|
1016 |
-
display: none;
|
1017 |
-
}
|
1018 |
-
ul.berocket_aapf_widget li.berocket_hide_child_attributes {
|
1019 |
-
display: none!important;
|
1020 |
-
}
|
1021 |
-
.berocket_aapf_widget.berocket_style_none{
|
1022 |
-
display: none;
|
1023 |
-
}
|
1024 |
-
.berocket_aapf_widget.berocket_style_block{
|
1025 |
-
display: block;
|
1026 |
-
}
|
1027 |
-
|
1028 |
-
.widget_berocket_aapf .ui-widget.ui-widget-content{
|
1029 |
-
border: 0;
|
1030 |
-
}
|
1031 |
-
.widget_berocket_aapf .ui-state-default,
|
1032 |
-
.widget_berocket_aapf .ui-widget-content .ui-state-default,
|
1033 |
-
.widget_berocket_aapf .ui-widget-header .ui-state-default,
|
1034 |
-
.widget_berocket_aapf .ui-button,
|
1035 |
-
html .widget_berocket_aapf .ui-button.ui-state-disabled:hover,
|
1036 |
-
html .widget_berocket_aapf .ui-button.ui-state-disabled:active{
|
1037 |
-
border: 0;
|
1038 |
-
}
|
1039 |
-
.berocket_datepicker_fields input{
|
1040 |
-
width: 100%;
|
1041 |
-
}
|
1042 |
-
|
1043 |
-
.berocket_single_filter_widget {
|
1044 |
-
padding: 0!important;
|
1045 |
-
margin: 0!important;
|
1046 |
-
width:initial!important;
|
1047 |
-
height:initial!important;
|
1048 |
-
}
|
1049 |
-
.berocket_aapf_widget .fa.fa-star-o{font-weight:400;}
|
1050 |
-
.berocket_aapf_widget .select2 .select2-search input[type=search] {
|
1051 |
-
height:26px;
|
1052 |
-
background-image:none!important;
|
1053 |
-
}
|
1054 |
-
.berocket_aapf_widget .select2 .select2-selection--multiple {
|
1055 |
-
height:initial!important;
|
1056 |
-
}
|
1057 |
-
|
1058 |
-
.berocket_color_span_block .berocket_color_multiple {
|
1059 |
-
position: absolute;
|
1060 |
-
top: 0;
|
1061 |
-
bottom: 0;
|
1062 |
-
left: 0;
|
1063 |
-
right: 0;
|
1064 |
-
z-index: 2;
|
1065 |
-
transform: rotateZ(45deg);
|
1066 |
-
padding: 0;
|
1067 |
-
margin: 0;
|
1068 |
-
box-sizing: border-box;
|
1069 |
-
margin-top: -2em;
|
1070 |
-
margin-bottom: -2em;
|
1071 |
-
}
|
1072 |
-
.berocket_checkbox_color.w1em.h1em .berocket_color_span_block .berocket_color_multiple,
|
1073 |
-
.berocket_checkbox_color.w2em.h2em .berocket_color_span_block .berocket_color_multiple,
|
1074 |
-
.berocket_checkbox_color.w3em.h3em .berocket_color_span_block .berocket_color_multiple,
|
1075 |
-
.berocket_checkbox_color.w4em.h4em .berocket_color_span_block .berocket_color_multiple,
|
1076 |
-
.berocket_checkbox_color.w5em.h5em .berocket_color_span_block .berocket_color_multiple {
|
1077 |
-
margin-left: -15%;
|
1078 |
-
margin-right: -15%;
|
1079 |
-
}
|
1080 |
-
.berocket_color_span_block .berocket_color_multiple .berocket_color_multiple_single {
|
1081 |
-
position: absolute;
|
1082 |
-
top: -50%;
|
1083 |
-
bottom: -50%;
|
1084 |
-
padding: 0;
|
1085 |
-
margin: 0;
|
1086 |
-
box-shadow: none;
|
1087 |
-
box-sizing: border-box;
|
1088 |
-
border: 0;
|
1089 |
-
}
|
1090 |
-
|
1091 |
-
.berocket_color_span_block .berocket_color_multiple_2 .berocket_color_multiple_single {
|
1092 |
-
width:100%;
|
1093 |
-
}
|
1094 |
-
|
1095 |
-
.berocket_color_span_block .berocket_color_multiple_3 .berocket_color_multiple_single {
|
1096 |
-
width:100%;
|
1097 |
-
}
|
1098 |
-
.berocket_color_span_block .berocket_color_multiple_3 .berocket_color_multiple_single.berocket_color_multiple_single_1 {
|
1099 |
-
width:34%;
|
1100 |
-
}
|
1101 |
-
.berocket_color_span_block .berocket_color_multiple_3 .berocket_color_multiple_single.berocket_color_multiple_single_0,
|
1102 |
-
.berocket_color_span_block .berocket_color_multiple_3 .berocket_color_multiple_single.berocket_color_multiple_single_2 {
|
1103 |
-
width:83%;
|
1104 |
-
}
|
1105 |
-
.berocket_color_span_block .berocket_color_multiple_4 .berocket_color_multiple_single {
|
1106 |
-
width:25%;
|
1107 |
-
}
|
1108 |
-
.berocket_color_span_block .berocket_color_multiple_4 .berocket_color_multiple_single.berocket_color_multiple_single_0,
|
1109 |
-
.berocket_color_span_block .berocket_color_multiple_4 .berocket_color_multiple_single.berocket_color_multiple_single_3 {
|
1110 |
-
width:75%;
|
1111 |
-
}
|
1112 |
-
|
1113 |
-
.berocket_color_span_block .berocket_color_multiple .berocket_color_multiple_single_0 {
|
1114 |
-
left:-50%;
|
1115 |
-
}
|
1116 |
-
|
1117 |
-
.berocket_color_span_block .berocket_color_multiple_2 .berocket_color_multiple_single_1 {
|
1118 |
-
left:50%;
|
1119 |
-
}
|
1120 |
-
|
1121 |
-
.berocket_color_span_block .berocket_color_multiple_3 .berocket_color_multiple_single_1 {
|
1122 |
-
left:33%;
|
1123 |
-
}
|
1124 |
-
|
1125 |
-
.berocket_color_span_block .berocket_color_multiple_4 .berocket_color_multiple_single_1 {
|
1126 |
-
left:25%;
|
1127 |
-
}
|
1128 |
-
|
1129 |
-
.berocket_color_span_block .berocket_color_multiple_3 .berocket_color_multiple_single_2 {
|
1130 |
-
left:67%;
|
1131 |
-
}
|
1132 |
-
|
1133 |
-
.berocket_color_span_block .berocket_color_multiple_4 .berocket_color_multiple_single_2 {
|
1134 |
-
left:50%;
|
1135 |
-
}
|
1136 |
-
|
1137 |
-
.berocket_color_span_block .berocket_color_multiple_4 .berocket_color_multiple_single_3 {
|
1138 |
-
left:75%;
|
1139 |
-
}
|
1140 |
-
/*Widget absolute and display only title*/
|
1141 |
-
.berocket_single_filter_widget.berocket_inline_filters,
|
1142 |
-
.berocket_single_filter_widget.berocket_inline_clickable {
|
1143 |
-
float:left!important;
|
1144 |
-
padding-right:15px!important;
|
1145 |
-
}
|
1146 |
-
.berocket_single_filter_widget.berocket_inline_filters {
|
1147 |
-
width: 12.5%!important;
|
1148 |
-
}
|
1149 |
-
#berocket-ajax-filters-sidebar .berocket_single_filter_widget.berocket_hidden_clickable .berocket_aapf_widget-title_div,
|
1150 |
-
.berocket_single_filter_widget.berocket_hidden_clickable .berocket_aapf_widget-title_div {
|
1151 |
-
border:2px solid #333333!important;
|
1152 |
-
background-color: #333333!important;
|
1153 |
-
color: #ccc!important;
|
1154 |
-
padding: 5px!important;
|
1155 |
-
padding-right: 35px!important;
|
1156 |
-
border-radius: 5px!important;
|
1157 |
-
}
|
1158 |
-
.berocket_single_filter_widget.berocket_hidden_clickable .berocket_widget_has_description .berocket_aapf_widget-title_div {
|
1159 |
-
padding-right: 55px!important;
|
1160 |
-
}
|
1161 |
-
.berocket_single_filter_widget.berocket_hidden_clickable .berocket_aapf_widget-wrapper {
|
1162 |
-
padding-bottom: 5px!important;
|
1163 |
-
}
|
1164 |
-
.berocket_single_filter_widget.berocket_hidden_clickable .berocket_aapf_widget-title_div h3 {
|
1165 |
-
margin: 0!important;
|
1166 |
-
padding: 0!important;
|
1167 |
-
font-size: inherit!important;
|
1168 |
-
color:inherit!important;
|
1169 |
-
}
|
1170 |
-
.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_widget-title_div {
|
1171 |
-
border:2px solid #ccc!important;
|
1172 |
-
color: black!important;
|
1173 |
-
background-color: #ccc!important;
|
1174 |
-
border-radius: 5px 5px 0 0!important;
|
1175 |
-
padding-bottom: 10px!important;
|
1176 |
-
}
|
1177 |
-
.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_widget-wrapper {
|
1178 |
-
padding-bottom: 0!important;
|
1179 |
-
}
|
1180 |
-
.berocket_single_filter_widget.berocket_hidden_clickable .berocket_aapf_widget {
|
1181 |
-
position: absolute!important;
|
1182 |
-
top:100%!important;
|
1183 |
-
width:100%!important;
|
1184 |
-
background-color:white!important;
|
1185 |
-
z-index: 800!important;
|
1186 |
-
margin: 0!important;
|
1187 |
-
border:2px solid #ccc!important;
|
1188 |
-
padding: 5px!important;
|
1189 |
-
display: none;
|
1190 |
-
}
|
1191 |
-
.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_widget {
|
1192 |
-
z-index: 900!important;
|
1193 |
-
}
|
1194 |
-
.berocket_single_filter_widget.berocket_hidden_clickable.berocket_hidden_clickable_left .berocket_aapf_widget {
|
1195 |
-
left: 0!important;
|
1196 |
-
}
|
1197 |
-
.berocket_single_filter_widget.berocket_hidden_clickable.berocket_hidden_clickable_right .berocket_aapf_widget {
|
1198 |
-
right: 0!important;
|
1199 |
-
}
|
1200 |
-
@media screen and (max-width: 767px){
|
1201 |
-
.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible {
|
1202 |
-
position: fixed!important;
|
1203 |
-
top: 0!important;
|
1204 |
-
left: 0!important;
|
1205 |
-
bottom: 0!important;
|
1206 |
-
right:0!important;
|
1207 |
-
z-index: 9000000000!important;
|
1208 |
-
background-color: white!important;
|
1209 |
-
overflow: auto!important;
|
1210 |
-
}
|
1211 |
-
.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_widget {
|
1212 |
-
border: 0!important;
|
1213 |
-
width: 100%!important;
|
1214 |
-
max-width: 100%!important;
|
1215 |
-
}
|
1216 |
-
.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_widget_show.mobile_hide {
|
1217 |
-
display: block!important;
|
1218 |
-
}
|
1219 |
-
.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_widget_show.mobile_hide .fa-angle-left:before,
|
1220 |
-
.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_widget_show.mobile_hide .fa-angle-right:before {
|
1221 |
-
content: "\f00d"!important;
|
1222 |
-
}
|
1223 |
-
.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_description {
|
1224 |
-
display: none!important;
|
1225 |
-
}
|
1226 |
-
body .select2-container,
|
1227 |
-
body .ui-widget.ui-datepicker {
|
1228 |
-
z-index: 9000000009!important;
|
1229 |
-
}
|
1230 |
-
}
|
1231 |
-
.berocket_element_above_products {
|
1232 |
-
clear: both!important;
|
1233 |
-
overflow: visible!important;
|
1234 |
-
}
|
1235 |
-
.berocket_single_filter_widget,
|
1236 |
-
.berocket_single_filter_widget div {
|
1237 |
-
overflow:visible!important;
|
1238 |
-
}
|
1239 |
-
div.berocket_single_filter_widget div.berocket_aapf_widget-wrapper * {
|
1240 |
-
opacity:1;
|
1241 |
-
}
|
1242 |
-
@media screen and (max-width: 767px){
|
1243 |
-
.bapf_sngl_hd_mobile {
|
1244 |
-
display: none!important;
|
1245 |
-
}
|
1246 |
-
}
|
1247 |
-
@media screen and (min-width: 768px) and (max-width: 1024px){
|
1248 |
-
.bapf_sngl_hd_tablet {
|
1249 |
-
display: none!important;
|
1250 |
-
}
|
1251 |
-
}
|
1252 |
-
@media screen and (min-width: 1025px){
|
1253 |
-
.bapf_sngl_hd_desktop {
|
1254 |
-
display: none!important;
|
1255 |
-
}
|
1256 |
-
}
|
1257 |
-
.berocket_aapf_widget select {
|
1258 |
-
overflow: auto!important;
|
1259 |
-
}
|
1260 |
-
.berocket_element_above_products_after {
|
1261 |
-
clear:both;
|
1262 |
-
}
|
1263 |
-
|
1264 |
-
ul.berocket_aapf_widget li > span > input + .berocket_label_widgets::before {
|
1265 |
-
margin-right: 6px;
|
1266 |
-
}
|
1267 |
-
|
1268 |
-
/* HIDDEN FILTERS UNDER ICON */
|
1269 |
-
|
1270 |
-
.berocket_element_above_products_is_hide {
|
1271 |
-
overflow: hidden !important;
|
1272 |
-
}
|
1273 |
-
.berocket_element_above_products_is_hide.br_is_hidden {
|
1274 |
-
opacity: 0;
|
1275 |
-
max-height: 1px;
|
1276 |
-
position: relative;
|
1277 |
-
}
|
1278 |
-
.berocket_element_above_products_is_hide_toggle {
|
1279 |
-
height: 20px;
|
1280 |
-
width: 200px !important;
|
1281 |
-
margin: 40px 0;
|
1282 |
-
display: inline-block;
|
1283 |
-
position: relative;
|
1284 |
-
padding-left: 25px;
|
1285 |
-
outline: 0 none !important;
|
1286 |
-
color: #2a2a2a;
|
1287 |
-
font-weight: 600;
|
1288 |
-
font-size: 16px;
|
1289 |
-
}
|
1290 |
-
.berocket_element_above_products_is_hide_toggle span,
|
1291 |
-
.berocket_element_above_products_is_hide_toggle span:before,
|
1292 |
-
.berocket_element_above_products_is_hide_toggle span:after {
|
1293 |
-
position: absolute;
|
1294 |
-
left: 0;
|
1295 |
-
width: 17px;
|
1296 |
-
height: 2px;
|
1297 |
-
display: block;
|
1298 |
-
}
|
1299 |
-
|
1300 |
-
/* CUSTOM SIDEBAR */
|
1301 |
-
body {
|
1302 |
-
transition: margin-left 0.2s;
|
1303 |
-
}
|
1304 |
-
body.berocket_ajax_filters_sidebar_active {
|
1305 |
-
margin-left: 200px;
|
1306 |
-
}
|
1307 |
-
.berocket_ajax_filters_toggle {
|
1308 |
-
height: 26px;
|
1309 |
-
width: 200px !important;
|
1310 |
-
margin: 40px 0;
|
1311 |
-
display: inline-block;
|
1312 |
-
position: relative;
|
1313 |
-
padding-left: 25px;
|
1314 |
-
outline: 0 none !important;
|
1315 |
-
text-decoration: none!important;
|
1316 |
-
box-sizing: border-box!important;
|
1317 |
-
color: #2a2a2a;
|
1318 |
-
font-weight: 600;
|
1319 |
-
font-size: 16px;
|
1320 |
-
border-color: #ababab;
|
1321 |
-
}
|
1322 |
-
|
1323 |
-
#berocket-ajax-filters-sidebar {
|
1324 |
-
display: block;
|
1325 |
-
position: fixed;
|
1326 |
-
top: 0;
|
1327 |
-
left: -350px;
|
1328 |
-
bottom: 0;
|
1329 |
-
width: 350px;
|
1330 |
-
max-width: 100%;
|
1331 |
-
background: white;
|
1332 |
-
transition: all 0.2s;
|
1333 |
-
z-index: 100000;
|
1334 |
-
box-sizing: border-box;
|
1335 |
-
overflow: auto !important;
|
1336 |
-
}
|
1337 |
-
#berocket-ajax-filters-sidebar-shadow {
|
1338 |
-
content: "";
|
1339 |
-
display: none;
|
1340 |
-
position: fixed;
|
1341 |
-
top: 0;
|
1342 |
-
left: 0;
|
1343 |
-
bottom: 0;
|
1344 |
-
right: 0;
|
1345 |
-
z-index: 99999;
|
1346 |
-
background: black;
|
1347 |
-
opacity: 0.7;
|
1348 |
-
}
|
1349 |
-
.admin-bar #berocket-ajax-filters-sidebar {
|
1350 |
-
top: 32px;
|
1351 |
-
}
|
1352 |
-
#berocket-ajax-filters-sidebar.active,
|
1353 |
-
#berocket-ajax-filters-sidebar.active + #berocket-ajax-filters-sidebar-shadow{
|
1354 |
-
left: 0;
|
1355 |
-
display: block;
|
1356 |
-
}
|
1357 |
-
#berocket-ajax-filters-sidebar .berocket_ajax_group_filter_title {
|
1358 |
-
padding: 15px 88px 15px 15px !important;
|
1359 |
-
font-weight: 500 !important;
|
1360 |
-
font-size: 24px !important;
|
1361 |
-
color: #333333 !important;
|
1362 |
-
border-bottom: 1px solid #ccc !important;
|
1363 |
-
}
|
1364 |
-
#berocket-ajax-filters-sidebar > div {
|
1365 |
-
padding: 15px!important;
|
1366 |
-
}
|
1367 |
-
#berocket-ajax-filters-sidebar .berocket_aapf_widget-title_div {
|
1368 |
-
color: #333333 !important;
|
1369 |
-
font-size: 19px !important;
|
1370 |
-
font-weight: 600 !important;
|
1371 |
-
}
|
1372 |
-
#berocket-ajax-filters-sidebar .berocket_aapf_widget,
|
1373 |
-
#berocket-ajax-filters-sidebar .berocket_aapf_widget li {
|
1374 |
-
margin: 0 !important;
|
1375 |
-
}
|
1376 |
-
#berocket-ajax-filters-sidebar .berocket_aapf_widget .berocket_checkbox_color .berocket_label_widgets {
|
1377 |
-
margin: 0 0.6em 0.6em 0 !important;
|
1378 |
-
}
|
1379 |
-
#berocket-ajax-filters-sidebar-close{
|
1380 |
-
position: absolute !important;
|
1381 |
-
right: 0 !important;
|
1382 |
-
line-height: 39px;
|
1383 |
-
padding: 17px 15px 13px !important;
|
1384 |
-
font-family: Arial, serif !important;
|
1385 |
-
color: #a2a2a2;
|
1386 |
-
}
|
1387 |
-
#berocket-ajax-filters-sidebar-close + * {
|
1388 |
-
margin-top: 70px!important;
|
1389 |
-
}
|
1390 |
-
#berocket-ajax-filters-sidebar-close + .berocket_ajax_group_filter_title {
|
1391 |
-
margin-top: 0!important;
|
1392 |
-
}
|
1393 |
-
@media screen and (max-width:782px) {
|
1394 |
-
.admin-bar #berocket-ajax-filters-sidebar {
|
1395 |
-
top: 46px;
|
1396 |
-
}
|
1397 |
-
}
|
1398 |
-
@media screen and (max-width:600px) {
|
1399 |
-
.admin-bar #berocket-ajax-filters-sidebar {
|
1400 |
-
top: 0;
|
1401 |
-
}
|
1402 |
-
}
|
1403 |
-
|
1404 |
-
|
1405 |
-
/* COMPATIBILITY WITH THEMES */
|
1406 |
-
/* FLATSOME */
|
1407 |
-
.berocket_aapf_widget-wrapper .slider:not(.flickity-enabled) {
|
1408 |
-
overflow: initial;
|
1409 |
-
white-space: initial;
|
1410 |
-
}
|
1411 |
-
.select2-container {
|
1412 |
-
z-index: 999999;
|
1413 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
addons/deprecated_filters/widget.min.js
DELETED
@@ -1,2362 +0,0 @@
|
|
1 |
-
/* packer link http://dean.edwards.name/packer/ */
|
2 |
-
var updateProducts, berocket_set_slider, berocket_product_recount, global_ajax_data, br_reset_all_filters, berocket_filters_first_load, berocket_in_array;
|
3 |
-
var berocket_aapf_widget_product_filters = [],
|
4 |
-
berocket_aapf_widget_product_limits = [],
|
5 |
-
berocket_aapf_widget_product_price_limit = [],
|
6 |
-
berocket_aapf_attribute_data = {name: [], data: [], jquery: false, loaded: false},
|
7 |
-
berocket_aapf_child_parent_loaded = true,
|
8 |
-
woocommerce_pagination_page = 1,
|
9 |
-
berocket_aapf_widget_wait_for_button = false,
|
10 |
-
berocket_aapf_widget_selected_filters = [],
|
11 |
-
berocket_aapf_reset_info = [],
|
12 |
-
berocket_aapf_404_jump = false,
|
13 |
-
berocket_aapf_404_jump_fail = false,
|
14 |
-
berocket_aapf_widget_first_page_jump = true,
|
15 |
-
$berocket_aapf_last_changed,
|
16 |
-
berocket_last_ajax_request = null,
|
17 |
-
berocket_last_ajax_request_id = 1,
|
18 |
-
berocket_child_no_products = '',
|
19 |
-
berocket_replace_only_html = false;
|
20 |
-
(function ($){
|
21 |
-
$('body').append('<div class="berocket_aapf_widget_loading_preload" style="position:relative; width: 1px; height: 1px;overflow: hidden;">'+the_ajax_script.load_image+'</div>');
|
22 |
-
$(document).ready(function (){
|
23 |
-
$('.berocket_aapf_widget_loading_preload').remove();
|
24 |
-
|
25 |
-
$(document).on('change', '.br_date_filter', function() {
|
26 |
-
var $berocket_aapf_widget = $(this).parents('.berocket_aapf_widget');
|
27 |
-
var $date_info = $berocket_aapf_widget.find('.berocket_date_picker');
|
28 |
-
var value = berocket_convert_date_to_date_picker($(this).datepicker( "getDate" ));
|
29 |
-
var value_send = berocket_convert_date_to_date_picker_send($(this).datepicker( "getDate" ));
|
30 |
-
value = value.replace(/\//g, '');
|
31 |
-
if( $(this).is('.br_start_date')) {
|
32 |
-
$date_info.data('value_1', $(this).val());
|
33 |
-
$date_info.data('value1', value_send);
|
34 |
-
} else {
|
35 |
-
$date_info.data('value_2', $(this).val());
|
36 |
-
$date_info.data('value2', value_send);
|
37 |
-
}
|
38 |
-
});
|
39 |
-
function berocket_convert_date_to_date_picker(date) {
|
40 |
-
var mm = date.getMonth();
|
41 |
-
mm++;
|
42 |
-
if( mm < 10 ) {
|
43 |
-
mm = '0'+mm;
|
44 |
-
}
|
45 |
-
var dd = date.getDate();
|
46 |
-
if( dd < 10 ) {
|
47 |
-
dd = '0'+dd;
|
48 |
-
}
|
49 |
-
var yy = date.getFullYear();
|
50 |
-
return mm+'/'+dd+'/'+yy;
|
51 |
-
}
|
52 |
-
function berocket_convert_date_to_date_picker_send(date) {
|
53 |
-
var mm = date.getMonth();
|
54 |
-
mm++;
|
55 |
-
if( mm < 10 ) {
|
56 |
-
mm = '0'+mm;
|
57 |
-
}
|
58 |
-
var dd = date.getDate();
|
59 |
-
if( dd < 10 ) {
|
60 |
-
dd = '0'+dd;
|
61 |
-
}
|
62 |
-
var yy = date.getFullYear();
|
63 |
-
return yy+''+mm+''+dd;
|
64 |
-
}
|
65 |
-
if( $(the_ajax_script.products_holder_id).is('.wf-container') ) {
|
66 |
-
berocket_replace_only_html = true;
|
67 |
-
}
|
68 |
-
|
69 |
-
var berocket_unselect_all = false;
|
70 |
-
|
71 |
-
function berocket_fire( func ){
|
72 |
-
if ( typeof the_ajax_script.user_func != 'undefined'
|
73 |
-
&& the_ajax_script.user_func != null
|
74 |
-
&& typeof func != 'undefined'
|
75 |
-
&& func.length > 0
|
76 |
-
) {
|
77 |
-
try{
|
78 |
-
eval( func );
|
79 |
-
} catch(err){
|
80 |
-
alert('You have some incorrect JavaScript code (AJAX Products Filter)');
|
81 |
-
}
|
82 |
-
}
|
83 |
-
}
|
84 |
-
|
85 |
-
function update_selected_area() {
|
86 |
-
var selected_area_exist = true;
|
87 |
-
if ( ! $('.berocket_aapf_widget_selected_area').hasClass('berocket_aapf_widget_selected_area') ) {
|
88 |
-
selected_area_exist = false;
|
89 |
-
if( ! $('.berocket_aapf_reset_button').hasClass('berocket_aapf_reset_button') ) {
|
90 |
-
return false;
|
91 |
-
}
|
92 |
-
}
|
93 |
-
tmp_html = '';
|
94 |
-
prev_label = false;
|
95 |
-
el_type = '';
|
96 |
-
selected = [];
|
97 |
-
berocket_aapf_reset_info = [];
|
98 |
-
var select_taxonomies = [];
|
99 |
-
if ( typeof berocket_aapf_widget_selected_filters != 'undefined' && berocket_aapf_widget_selected_filters.length > 0 ) {
|
100 |
-
$(berocket_aapf_widget_selected_filters).each(function (i, $el) {
|
101 |
-
var elements_data = [];
|
102 |
-
if ($el.is('select')) {
|
103 |
-
taxonomy = $el.data('taxonomy');
|
104 |
-
if( select_taxonomies.indexOf(taxonomy) == -1 ) {
|
105 |
-
select_taxonomies.push(taxonomy);
|
106 |
-
label = $el.parents('ul.berocket_aapf_widget').prev().find('.widget-title').first().text();
|
107 |
-
el_type = 'select';
|
108 |
-
$el.find("option:selected").each(function(i, o) {
|
109 |
-
if( $(o).val() ) {
|
110 |
-
option = $(o).data('term_name');
|
111 |
-
el_id = $(o).val();
|
112 |
-
elements_data.push({el_id:el_id, el_type:el_type, option:option, label:label, taxonomy:taxonomy, el:$el});
|
113 |
-
}
|
114 |
-
});
|
115 |
-
}
|
116 |
-
} else if ($el.is('input')) {
|
117 |
-
taxonomy = $el.data('taxonomy');
|
118 |
-
label = $el.parents('ul.berocket_aapf_widget').prev().find('.widget-title').first().text();
|
119 |
-
option = $el.data('term_name');
|
120 |
-
el_type = $el.attr('type');
|
121 |
-
el_id = $el.parents('li').first().find('label').data('for');
|
122 |
-
if ( $el.data('taxonomy-type') == 'color' ) {
|
123 |
-
el_type = $el.data('taxonomy-type');
|
124 |
-
option = $el.parents('li').first().find('label').html();
|
125 |
-
}
|
126 |
-
elements_data.push({el_id:el_id, el_type:el_type, option:option, label:label, taxonomy:taxonomy, el:$el});
|
127 |
-
} else if ($el.hasClass('berocket_filter_slider') || $el.hasClass('berocket_date_picker')) {
|
128 |
-
taxonomy = $el.data('taxonomy');
|
129 |
-
val1 = $( '#'+$el.data('fields_1') ).val();
|
130 |
-
val2 = $( '#'+$el.data('fields_2') ).val();
|
131 |
-
el_type = 'slider';
|
132 |
-
label = $el.parents('ul.berocket_aapf_widget').prev().find('h3').first().text();
|
133 |
-
//if (val1 != $el.data('min') || val2 != $el.data('max')) {
|
134 |
-
if ( $el.hasClass('berocket_date_picker') ) {
|
135 |
-
val1 = $el.data('value_1');
|
136 |
-
val2 = $el.data('value_2');
|
137 |
-
if( typeof(label) == 'undefined' || ! label ) {
|
138 |
-
label = 'Date';
|
139 |
-
}
|
140 |
-
el_type = '_date';
|
141 |
-
} else if ($el.hasClass('berocket_filter_price_slider')) {
|
142 |
-
if( typeof(label) == 'undefined' || ! label ) {
|
143 |
-
label = 'Price';
|
144 |
-
}
|
145 |
-
}
|
146 |
-
//}
|
147 |
-
el_id = $el.data('fields_2');
|
148 |
-
option = val1 + ' - ' + val2;
|
149 |
-
elements_data.push({el_id:el_id, el_type:el_type, option:option, label:label, taxonomy:taxonomy, el:$el});
|
150 |
-
}
|
151 |
-
elements_data.forEach(function(element_data) {
|
152 |
-
var el_id = element_data.el_id;
|
153 |
-
var el_type = element_data.el_type;
|
154 |
-
var option = element_data.option;
|
155 |
-
var label = element_data.label;
|
156 |
-
var taxonomy = element_data.taxonomy;
|
157 |
-
var $el = element_data.el;
|
158 |
-
berocket_aapf_reset_info.push({type:el_type, id:el_id, taxonomy:taxonomy});
|
159 |
-
|
160 |
-
if( selected_area_exist ) {
|
161 |
-
option = '<li><a href="#Unselect_' + label + '" data-el_type="' + el_type + '" data-el_id="' + el_id + '" data-el_taxonomy="' + taxonomy + '"><i class="fa fa-times"></i> ' + option + '</a></li>';
|
162 |
-
|
163 |
-
if ( ! $el.hasClass('berocket_filter_slider') || selected.indexOf( taxonomy ) == -1 )
|
164 |
-
if (prev_label === false) {
|
165 |
-
tmp_html += '<div class="berocket_aapf_widget_selected_filter"><span>' + label + '</span><ul>' + option;
|
166 |
-
} else if (prev_label == taxonomy) {
|
167 |
-
tmp_html += option;
|
168 |
-
} else {
|
169 |
-
tmp_html += '</ul></div><div class="berocket_aapf_widget_selected_filter"><span>' + label + '</span><ul>' + option;
|
170 |
-
}
|
171 |
-
|
172 |
-
prev_label = taxonomy;
|
173 |
-
selected.push( taxonomy );
|
174 |
-
}
|
175 |
-
});
|
176 |
-
});
|
177 |
-
}
|
178 |
-
|
179 |
-
if ( tmp_html == '' ) {
|
180 |
-
$('.berocket_aapf_widget_selected_area').html(tmp_html);
|
181 |
-
$('.berocket_aapf_widget_selected_area_hide').parent().hide();
|
182 |
-
$('.berocket_aapf_widget_selected_area_text').html(the_ajax_script.translate.nothing_selected);
|
183 |
-
} else {
|
184 |
-
tmp_html += '</ul></div>';
|
185 |
-
tmp_html += '<ul><li><a href="#Unselect_all" class="br_unselect_all"><i class="fa fa-times"></i> '+the_ajax_script.translate.unselect_all+'</a></li></ul>';
|
186 |
-
$('.berocket_aapf_widget_selected_area').html(tmp_html);
|
187 |
-
$('.berocket_aapf_widget_selected_area_hide').parent().show();
|
188 |
-
}
|
189 |
-
}
|
190 |
-
|
191 |
-
$(document).on( 'click', '.berocket_aapf_product_count_desc', function( event ) {
|
192 |
-
event.preventDefault();
|
193 |
-
event.stopPropagation();
|
194 |
-
});
|
195 |
-
|
196 |
-
$(document).on( 'click', '.berocket_aapf_product_count_desc .berocket_aapf_close_pc', function( event ) {
|
197 |
-
event.preventDefault();
|
198 |
-
$(this).parents('.berocket_aapf_product_count_desc').remove();
|
199 |
-
});
|
200 |
-
|
201 |
-
function update_data_containers(search_box, search_block) {
|
202 |
-
if ( typeof(search_box) == 'undefined' ) {
|
203 |
-
search_box = false;
|
204 |
-
}
|
205 |
-
if ( typeof(search_block) == 'undefined' ) {
|
206 |
-
search_block = $(document);
|
207 |
-
}
|
208 |
-
berocket_aapf_widget_product_filters = [];
|
209 |
-
berocket_aapf_widget_selected_filters = [];
|
210 |
-
|
211 |
-
search_block.find('.berocket_aapf_widget li:not(.slider) input, .berocket_aapf_widget li:not(slider) select').each(function (i,o) {
|
212 |
-
$el = $(o);
|
213 |
-
|
214 |
-
if ( $el.is("select") ) {
|
215 |
-
el_data = [];
|
216 |
-
$el.find("option:selected").each(function(i, o) {
|
217 |
-
if( $(o).val() ) {
|
218 |
-
el_data.push($(o).data());
|
219 |
-
}
|
220 |
-
});
|
221 |
-
el_data_child_parent_depth = $el.parents('.berocket_aapf_widget').data('child_parent_depth') || 0;
|
222 |
-
|
223 |
-
el_data.forEach(function(element) {
|
224 |
-
var el_show = true;
|
225 |
-
$(berocket_aapf_widget_product_filters).each(function (i, o) {
|
226 |
-
if (o[0] == element.taxonomy) {
|
227 |
-
if ( o[5] < el_data_child_parent_depth ) {
|
228 |
-
if ( element.term_id != undefined && element.term_slug != undefined ) {
|
229 |
-
berocket_aapf_widget_product_filters[i] = [element.taxonomy, element.term_id, element.operator, element.term_slug, element.filter_type, el_data_child_parent_depth];
|
230 |
-
berocket_aapf_widget_selected_filters[i] = $el;
|
231 |
-
}
|
232 |
-
el_show = false;
|
233 |
-
}
|
234 |
-
}
|
235 |
-
});
|
236 |
-
if( el_show && $el.val() ){
|
237 |
-
berocket_aapf_widget_product_filters[berocket_aapf_widget_product_filters.length] = [element.taxonomy, element.term_id, element.operator, element.term_slug, element.filter_type, el_data_child_parent_depth];
|
238 |
-
berocket_aapf_widget_selected_filters[berocket_aapf_widget_selected_filters.length] = $el;
|
239 |
-
}
|
240 |
-
});
|
241 |
-
} else if ( $el.is(':checked') || $el.is(':selected') ){
|
242 |
-
el_data = $el.data();
|
243 |
-
el_data_child_parent_depth = $el.parents('.berocket_aapf_widget').data('child_parent_depth') || 0;
|
244 |
-
|
245 |
-
var el_show = true;
|
246 |
-
remove = 0;
|
247 |
-
$(berocket_aapf_widget_product_filters).each(function (i, o) {
|
248 |
-
if ( o[0] == el_data.taxonomy ) {
|
249 |
-
if ( o[5] < el_data_child_parent_depth ) {
|
250 |
-
berocket_aapf_widget_product_filters.splice( i - remove, 1 );
|
251 |
-
berocket_aapf_widget_selected_filters.splice( i - remove, 1 );
|
252 |
-
remove++;
|
253 |
-
} else if ( o[1] == el_data.term_id ) {
|
254 |
-
el_show = false;
|
255 |
-
}
|
256 |
-
}
|
257 |
-
});
|
258 |
-
if (el_data.term_id != undefined && el_show) {
|
259 |
-
berocket_aapf_widget_product_filters[berocket_aapf_widget_product_filters.length] = [el_data.taxonomy, el_data.term_id, el_data.operator, el_data.term_slug, el_data.filter_type, el_data_child_parent_depth];
|
260 |
-
berocket_aapf_widget_selected_filters[berocket_aapf_widget_selected_filters.length] = $el;
|
261 |
-
}
|
262 |
-
}
|
263 |
-
});
|
264 |
-
|
265 |
-
berocket_aapf_widget_product_limits = [];
|
266 |
-
berocket_aapf_widget_product_price_limit = [];
|
267 |
-
$t = search_block.find('.berocket_filter_slider, .berocket_date_picker');
|
268 |
-
if( $t.hasClass('berocket_filter_slider') || $t.hasClass('berocket_date_picker') ){
|
269 |
-
$t.each(function (i,o){
|
270 |
-
if ( $(o).parents( '.berocket_child_parent_sample' ).length == 0 ) {
|
271 |
-
var all_terms_name = $(o).data('all_terms_name');
|
272 |
-
var string_slider_edited = true;
|
273 |
-
if( $(o).hasClass('berocket_date_picker') ) {
|
274 |
-
val1 = $(o).data('value1');
|
275 |
-
val2 = $(o).data('value2');
|
276 |
-
} else {
|
277 |
-
val1 = $(o).data('value_1');
|
278 |
-
val2 = $(o).data('value_2');
|
279 |
-
}
|
280 |
-
data_child_parent_depth = $(o).parents('.berocket_aapf_widget').data('child_parent_depth') || 0;
|
281 |
-
var min = $(o).data( 'min' );
|
282 |
-
var max = $(o).data( 'max' );
|
283 |
-
if( $(o).hasClass('berocket_date_picker') ) {
|
284 |
-
min = min.replace(/\//g, '');
|
285 |
-
max = max.replace(/\//g, '');
|
286 |
-
}
|
287 |
-
if( all_terms_name != null ){
|
288 |
-
if( ! ( val1 != all_terms_name[ min ] || val2 != all_terms_name[ max ] ) ) {
|
289 |
-
string_slider_edited = false;
|
290 |
-
}
|
291 |
-
min = all_terms_name[ min ];
|
292 |
-
max = all_terms_name[ max ];
|
293 |
-
}
|
294 |
-
var is_changed = false;
|
295 |
-
if( $(o).hasClass('berocket_date_picker') ) {
|
296 |
-
is_changed = ( val1 != min || val2 !=max );
|
297 |
-
} else {
|
298 |
-
is_changed = ( ( val1 != ( min / $(o).data( 'step' ) ) || val2 != ( max / $(o).data( 'step' ) ) ) && ( string_slider_edited || data_child_parent_depth > 0 ) );
|
299 |
-
}
|
300 |
-
if( is_changed ) {
|
301 |
-
berocket_aapf_widget_selected_filters[berocket_aapf_widget_selected_filters.length] = $(o);
|
302 |
-
if( $(o).hasClass('berocket_filter_price_slider') ){
|
303 |
-
berocket_aapf_widget_product_price_limit = [val1, val2];
|
304 |
-
} else {
|
305 |
-
var add_limit = true;
|
306 |
-
for( i = 0 ; i < berocket_aapf_widget_product_limits.length ; i++ ) {
|
307 |
-
if( berocket_aapf_widget_product_limits[ i ][ 0 ] == $(o).data( 'taxonomy' ) ) {
|
308 |
-
if ( berocket_aapf_widget_product_limits[ i ][ 3 ] < data_child_parent_depth ) {
|
309 |
-
berocket_aapf_widget_product_limits[i] = [$(o).data('taxonomy'), val1, val2, data_child_parent_depth];
|
310 |
-
}
|
311 |
-
add_limit = false;
|
312 |
-
}
|
313 |
-
}
|
314 |
-
if( add_limit ) {
|
315 |
-
berocket_aapf_widget_product_limits[berocket_aapf_widget_product_limits.length] = [$(o).data('taxonomy'), val1, val2, data_child_parent_depth];
|
316 |
-
}
|
317 |
-
}
|
318 |
-
}
|
319 |
-
}
|
320 |
-
});
|
321 |
-
}
|
322 |
-
}
|
323 |
-
|
324 |
-
get_widget_selected_filters = function() {
|
325 |
-
search_box = false;
|
326 |
-
search_block = $(document);
|
327 |
-
check_berocket_aapf_widget_product_filters = [];
|
328 |
-
check_berocket_aapf_widget_selected_filters = [];
|
329 |
-
|
330 |
-
search_block.find('.berocket_aapf_widget li:not(.slider) input, .berocket_aapf_widget li:not(slider) select').each(function (i,o) {
|
331 |
-
$el = $(o);
|
332 |
-
|
333 |
-
if ( $el.is("select") ) {
|
334 |
-
if( $el.find("option:selected").length ) {
|
335 |
-
el_data = $el.find("option:selected").data();
|
336 |
-
el_data_child_parent_depth = $el.parents('.berocket_aapf_widget').data('child_parent_depth') || 0;
|
337 |
-
|
338 |
-
var el_show = true;
|
339 |
-
if( el_show && $el.val() ){
|
340 |
-
check_berocket_aapf_widget_product_filters[check_berocket_aapf_widget_product_filters.length] = [el_data.taxonomy, el_data.term_id, el_data.operator, el_data.term_slug, el_data.filter_type, el_data_child_parent_depth];
|
341 |
-
check_berocket_aapf_widget_selected_filters[check_berocket_aapf_widget_selected_filters.length] = $el;
|
342 |
-
}
|
343 |
-
}
|
344 |
-
} else if ( $el.is(':checked') || $el.is(':selected') ){
|
345 |
-
el_data = $el.data();
|
346 |
-
el_data_child_parent_depth = $el.parents('.berocket_aapf_widget').data('child_parent_depth') || 0;
|
347 |
-
|
348 |
-
var el_show = true;
|
349 |
-
remove = 0;
|
350 |
-
if (el_data.term_id != undefined && el_show) {
|
351 |
-
check_berocket_aapf_widget_product_filters[check_berocket_aapf_widget_product_filters.length] = [el_data.taxonomy, el_data.term_id, el_data.operator, el_data.term_slug, el_data.filter_type, el_data_child_parent_depth];
|
352 |
-
check_berocket_aapf_widget_selected_filters[check_berocket_aapf_widget_selected_filters.length] = $el;
|
353 |
-
}
|
354 |
-
}
|
355 |
-
});
|
356 |
-
$t = search_block.find('.berocket_filter_slider, .berocket_date_picker');
|
357 |
-
if( $t.hasClass('berocket_filter_slider') || $t.hasClass('berocket_date_picker') ){
|
358 |
-
$t.each(function (i,o){
|
359 |
-
if ( $(o).parents( '.berocket_child_parent_sample' ).length == 0 ) {
|
360 |
-
var all_terms_name = $(o).data('all_terms_name');
|
361 |
-
var string_slider_edited = true;
|
362 |
-
if( $(o).hasClass('berocket_date_picker') ) {
|
363 |
-
val1 = $(o).data('value1');
|
364 |
-
val2 = $(o).data('value2');
|
365 |
-
} else {
|
366 |
-
val1 = $(o).data('value_1');
|
367 |
-
val2 = $(o).data('value_2');
|
368 |
-
}
|
369 |
-
data_child_parent_depth = $(o).parents('.berocket_aapf_widget').data('child_parent_depth') || 0;
|
370 |
-
var min = $(o).data( 'min' );
|
371 |
-
var max = $(o).data( 'max' );
|
372 |
-
if( $(o).hasClass('berocket_date_picker') ) {
|
373 |
-
min = min.replace(/\//g, '');
|
374 |
-
max = max.replace(/\//g, '');
|
375 |
-
}
|
376 |
-
if( all_terms_name != null ){
|
377 |
-
if( ! ( val1 != all_terms_name[ min ] || val2 != all_terms_name[ max ] ) ) {
|
378 |
-
string_slider_edited = false;
|
379 |
-
}
|
380 |
-
min = all_terms_name[ min ];
|
381 |
-
max = all_terms_name[ max ];
|
382 |
-
}
|
383 |
-
var is_changed = false;
|
384 |
-
if( $(o).hasClass('berocket_date_picker') ) {
|
385 |
-
is_changed = ( val1 != min || val2 !=max );
|
386 |
-
} else {
|
387 |
-
is_changed = ( ( val1 != ( min / $(o).data( 'step' ) ) || val2 != ( max / $(o).data( 'step' ) ) ) && ( string_slider_edited || data_child_parent_depth > 0 ) );
|
388 |
-
}
|
389 |
-
if( is_changed ) {
|
390 |
-
check_berocket_aapf_widget_selected_filters[check_berocket_aapf_widget_selected_filters.length] = $(o);
|
391 |
-
}
|
392 |
-
}
|
393 |
-
});
|
394 |
-
}
|
395 |
-
var reset_info = [];
|
396 |
-
if ( typeof check_berocket_aapf_widget_selected_filters != 'undefined' && check_berocket_aapf_widget_selected_filters.length > 0 ) {
|
397 |
-
$(check_berocket_aapf_widget_selected_filters).each(function (i, $el) {
|
398 |
-
if ($el.is('select')) {
|
399 |
-
el_type = 'select';
|
400 |
-
$el.find("option:selected").each(function(i, o) {
|
401 |
-
if( $(o).val() ) {
|
402 |
-
el_id = $(o).val();
|
403 |
-
taxonomy = $(o).data('taxonomy');
|
404 |
-
reset_info.push({type:el_type, id:el_id, taxonomy:taxonomy});
|
405 |
-
}
|
406 |
-
});
|
407 |
-
} else if ($el.is('input')) {
|
408 |
-
el_type = $el.attr('type');
|
409 |
-
el_id = $el.parents('li').first().find('label').data('for');
|
410 |
-
if ( $el.data('taxonomy-type') == 'color' ) {
|
411 |
-
el_type = $el.data('taxonomy-type');
|
412 |
-
}
|
413 |
-
reset_info.push({type:el_type, id:el_id});
|
414 |
-
} else if ($el.hasClass('berocket_filter_slider') || $el.hasClass('berocket_date_picker')) {
|
415 |
-
el_type = 'slider';
|
416 |
-
if ( $el.hasClass('berocket_date_picker') ) {
|
417 |
-
el_type = '_date';
|
418 |
-
}
|
419 |
-
el_id = $el.data('fields_2');
|
420 |
-
reset_info.push({type:el_type, id:el_id});
|
421 |
-
}
|
422 |
-
});
|
423 |
-
}
|
424 |
-
return reset_info;
|
425 |
-
}
|
426 |
-
|
427 |
-
updateProducts = function ( $force , search_box ){
|
428 |
-
$('.berocket_aapf_product_count_desc').remove();
|
429 |
-
if ( berocket_unselect_all ) return false;
|
430 |
-
|
431 |
-
// call user func before_update
|
432 |
-
if ( the_ajax_script.user_func != null )
|
433 |
-
berocket_fire( the_ajax_script.user_func.before_update );
|
434 |
-
|
435 |
-
if ( berocket_aapf_404_jump ) {
|
436 |
-
first_page_404 = the_ajax_script.first_page;
|
437 |
-
the_ajax_script.first_page = true;
|
438 |
-
berocket_aapf_widget_first_page_jump_404 = berocket_aapf_widget_first_page_jump;
|
439 |
-
berocket_aapf_widget_first_page_jump = true;
|
440 |
-
}
|
441 |
-
if ( typeof search_box == 'undefined' ) search_box = false;
|
442 |
-
if( ! search_box ) {
|
443 |
-
update_data_containers();
|
444 |
-
}
|
445 |
-
|
446 |
-
if ( typeof $force == 'undefined' ) $force = false;
|
447 |
-
// if we have update_button on the page we must wait for it to be clicked
|
448 |
-
if ( ! $force && berocket_aapf_widget_wait_for_button && ! the_ajax_script.ub_product_count ) return false;
|
449 |
-
|
450 |
-
args = {
|
451 |
-
current_language: the_ajax_script.current_language,
|
452 |
-
terms: berocket_aapf_widget_product_filters,
|
453 |
-
price: berocket_aapf_widget_product_price_limit,
|
454 |
-
limits: berocket_aapf_widget_product_limits,
|
455 |
-
product_cat: the_ajax_script.product_cat,
|
456 |
-
product_taxonomy: the_ajax_script.product_taxonomy,
|
457 |
-
s: the_ajax_script.s,
|
458 |
-
action: 'berocket_aapf_listener',
|
459 |
-
orderby: $('.woocommerce-ordering select.orderby').val(),
|
460 |
-
attributes: [],
|
461 |
-
cat_limit: [],
|
462 |
-
};
|
463 |
-
var attribute_selected_count_start = get_widget_selected_filters().length;
|
464 |
-
|
465 |
-
if ( ! $force && berocket_aapf_widget_wait_for_button && the_ajax_script.ub_product_count ) {
|
466 |
-
t_args = args;
|
467 |
-
t_args.action = 'berocket_aapf_listener_pc';
|
468 |
-
t_args.location = the_ajax_script.current_page_url;
|
469 |
-
$.post(the_ajax_script.ajaxurl, t_args, function (data) {
|
470 |
-
$('.berocket_aapf_product_count_desc').remove();
|
471 |
-
$widget = $berocket_aapf_last_changed.parents('.berocket_aapf_widget');
|
472 |
-
if( $berocket_aapf_last_changed.is('[type=checkbox], [type=radio]') ) {
|
473 |
-
var toppos = parseInt($berocket_aapf_last_changed.parents('li').first().position().top);
|
474 |
-
} else {
|
475 |
-
var toppos = parseInt($berocket_aapf_last_changed.position().top);
|
476 |
-
}
|
477 |
-
toppos = toppos+parseInt($berocket_aapf_last_changed.parents('.berocket_aapf_widget').first().position().top)-2;
|
478 |
-
if( $berocket_aapf_last_changed.parents('.mCSB_container').length && $berocket_aapf_last_changed.parents('.mCSB_container').first().parents('.berocket_aapf_widget').length ) {
|
479 |
-
toppos = toppos+parseInt($berocket_aapf_last_changed.parents('.mCSB_container').first().position().top);
|
480 |
-
}
|
481 |
-
if ( ( $widget.offset().left + $widget.width() ) < ( $(window).width() / 2 ) ) {
|
482 |
-
var leftpos = $berocket_aapf_last_changed.parents('.berocket_aapf_widget').outerWidth() - $berocket_aapf_last_changed.parents('.berocket_aapf_widget-wrapper').outerWidth();
|
483 |
-
$berocket_aapf_last_changed
|
484 |
-
.parents('.berocket_aapf_widget')
|
485 |
-
.after($('<div class="berocket_aapf_product_count_desc br_aapf_pcd_left"><span></span>'+data.product_count+' '+the_ajax_script.ub_product_text+(the_ajax_script.ub_product_button_text?' <a href="#update" class="berocket_aapf_widget_update_button" >'+the_ajax_script.ub_product_button_text+'</a>':'')+'<a class="berocket_aapf_close_pc" href="#close"><i class="fa fa-times"></i></a></div>').css('top', toppos).css('margin-left', leftpos));
|
486 |
-
} else {
|
487 |
-
var leftpos = -$berocket_aapf_last_changed.parents('.berocket_aapf_widget').position().left;
|
488 |
-
$berocket_aapf_last_changed
|
489 |
-
.parents('.berocket_aapf_widget')
|
490 |
-
.after($('<div class="berocket_aapf_product_count_desc br_aapf_pcd_right"><span></span>'+data.product_count+' '+the_ajax_script.translate.products+(the_ajax_script.ub_product_button_text?' <a href="#update" class="berocket_aapf_widget_update_button" >'+the_ajax_script.ub_product_button_text+'</a>':'')+'<a class="berocket_aapf_close_pc" href="#close"><i class="fa fa-times"></i></a></div>').css('top', toppos).css('margin-right', leftpos));
|
491 |
-
}
|
492 |
-
}, 'json');
|
493 |
-
return false;
|
494 |
-
}
|
495 |
-
var berocket_this_ajax_request_id = berocket_last_ajax_request_id = berocket_last_ajax_request_id + 1;
|
496 |
-
if ( berocket_last_ajax_request == null ) {
|
497 |
-
$(the_ajax_script.products_holder_id).addClass('hide_products').append(the_ajax_script.load_image);
|
498 |
-
} else {
|
499 |
-
berocket_last_ajax_request.abort();
|
500 |
-
berocket_last_ajax_request = null;
|
501 |
-
}
|
502 |
-
$(document).trigger('berocket_ajax_filtering_start');
|
503 |
-
if( the_ajax_script.pos_relative ) {
|
504 |
-
$('.berocket_aapf_widget_loading').parent().css('position', 'relative');
|
505 |
-
}
|
506 |
-
berocket_aapf_widget_loading();
|
507 |
-
|
508 |
-
if( the_ajax_script.seo_friendly_urls && 'history' in window && 'pushState' in history ) {
|
509 |
-
updateLocation(args, true);
|
510 |
-
args.location = location.href;
|
511 |
-
}else{
|
512 |
-
args.location = the_ajax_script.current_page_url;
|
513 |
-
|
514 |
-
cur_page = $(the_ajax_script.pagination_class+' .current').first().text();
|
515 |
-
var paginate_regex = new RegExp(".+\/"+the_ajax_script.pagination_base+"\/([0-9]+).+", "i");
|
516 |
-
if( prev_page = location.href.replace(paginate_regex, "$1") ){
|
517 |
-
if( ! parseInt( cur_page ) ){
|
518 |
-
cur_page = prev_page;
|
519 |
-
}
|
520 |
-
if(berocket_aapf_widget_first_page_jump && the_ajax_script.first_page) {
|
521 |
-
cur_page = 1;
|
522 |
-
}
|
523 |
-
if( $(the_ajax_script.pagination_class+' a').last().length && $(the_ajax_script.pagination_class+' a').last().attr('href').search('product-page=') != -1 ) {
|
524 |
-
args.location = args.location.replace(/\/?/,"") + "/?product-page=" + cur_page + "";
|
525 |
-
} else {
|
526 |
-
args.location = args.location.replace(/\/?/,"") + "/"+the_ajax_script.pagination_base+"/" + cur_page + "/";
|
527 |
-
}
|
528 |
-
}else if( prev_page = location.href.replace(/.+paged?=([0-9]+).+/, "$1") ){
|
529 |
-
if( ! parseInt( cur_page ) ){
|
530 |
-
cur_page = prev_page;
|
531 |
-
}
|
532 |
-
if(berocket_aapf_widget_first_page_jump && the_ajax_script.first_page) {
|
533 |
-
cur_page = 1;
|
534 |
-
}
|
535 |
-
if( $(the_ajax_script.pagination_class+' a').last().length && $(the_ajax_script.pagination_class+' a').last().attr('href').search('product-page=') != -1 ) {
|
536 |
-
args.location = args.location.replace(/\/?/,"") + "/?product-page=" + cur_page + "";
|
537 |
-
} else {
|
538 |
-
args.location = args.location.replace(/\/?/,"") + "/?paged=" + cur_page + "";
|
539 |
-
}
|
540 |
-
}
|
541 |
-
if( the_ajax_script.seo_friendly_urls ) {
|
542 |
-
uri_request = updateLocation(args, false);
|
543 |
-
location.hash = '';
|
544 |
-
if( parseInt( cur_page ) )
|
545 |
-
location.hash = "paged="+parseInt( cur_page )+"&";
|
546 |
-
if( uri_request != "")
|
547 |
-
uri_request = 'filters=' + uri_request;
|
548 |
-
location.hash += 'filters=('+uri_request+')';
|
549 |
-
}
|
550 |
-
}
|
551 |
-
if( jQuery('.berocket_product_table_compat').length ) {
|
552 |
-
berocket_ajax_load_product_table_compat();
|
553 |
-
}
|
554 |
-
|
555 |
-
update_selected_area();
|
556 |
-
|
557 |
-
the_ajax_script.scroll_shop_top = parseInt(the_ajax_script.scroll_shop_top);
|
558 |
-
if( the_ajax_script.scroll_shop_top == 1 || ( $(window).width() <= 767 && the_ajax_script.scroll_shop_top == 2 ) || ( $(window).width() > 767 && the_ajax_script.scroll_shop_top == 3 ) ) {
|
559 |
-
var top_scroll_offset = 0;
|
560 |
-
if( $( the_ajax_script.products_holder_id ).length ) {
|
561 |
-
top_scroll_offset = $( the_ajax_script.products_holder_id ).offset().top + parseInt(the_ajax_script.scroll_shop_top_px);
|
562 |
-
if(top_scroll_offset < 0) top_scroll_offset = 0;
|
563 |
-
}
|
564 |
-
$("html, body").animate({ scrollTop: top_scroll_offset }, "slow");
|
565 |
-
}
|
566 |
-
args.location = updateLocation(args, true, true);
|
567 |
-
if( ! $(the_ajax_script.products_holder_id).length ) {
|
568 |
-
location.href = args.location;
|
569 |
-
return;
|
570 |
-
}
|
571 |
-
if( the_ajax_script.recount_products ) {
|
572 |
-
$('.berocket_aapf_widget').each(function (i,o){
|
573 |
-
args.attributes[i] = $(o).data('attribute');
|
574 |
-
args.cat_limit[i] = $(o).data('cat_limit');
|
575 |
-
});
|
576 |
-
}
|
577 |
-
if(the_ajax_script.ajax_request_load) {
|
578 |
-
if( the_ajax_script.ajax_request_load_style == 'jquery' ) {
|
579 |
-
url = args.location;
|
580 |
-
return_type = 'html';
|
581 |
-
t_args = args;
|
582 |
-
args = {};
|
583 |
-
} else {
|
584 |
-
if( the_ajax_script.ajax_request_load_style == 'js' ) {
|
585 |
-
return_type = 'html';
|
586 |
-
} else {
|
587 |
-
return_type = 'json';
|
588 |
-
}
|
589 |
-
if( args.location.indexOf('?') > 0 ) {
|
590 |
-
url = args.location+'&explode=explode';
|
591 |
-
} else {
|
592 |
-
url = args.location+'/?explode=explode';
|
593 |
-
}
|
594 |
-
t_args = args;
|
595 |
-
args = {
|
596 |
-
location: t_args.location,
|
597 |
-
attributes: t_args.attributes,
|
598 |
-
cat_limit: t_args.cat_limit,
|
599 |
-
};
|
600 |
-
}
|
601 |
-
} else {
|
602 |
-
return_type = 'json';
|
603 |
-
url = the_ajax_script.ajaxurl;
|
604 |
-
}
|
605 |
-
berocket_aapf_attribute_data.loaded = false;
|
606 |
-
var send_type = the_ajax_script.use_request_method;
|
607 |
-
var berocket_this_ajax_request = berocket_last_ajax_request = $[send_type](url, args, function (data) {
|
608 |
-
global_ajax_data = data;
|
609 |
-
berocket_last_ajax_request = null;
|
610 |
-
berocket_last_ajax_request_id = 1;
|
611 |
-
$('.berocket_aapf_product_count_desc').remove();
|
612 |
-
var is_product_table = false;
|
613 |
-
if( jQuery('.berocket_product_table_compat').length ) {
|
614 |
-
var tableid = jQuery('.berocket_product_table_compat .wc-product-table').attr('id');
|
615 |
-
if( typeof(window['config_'+tableid]) != 'undefined' && window['config_'+tableid].serverSide ) {
|
616 |
-
is_product_table = true;
|
617 |
-
}
|
618 |
-
}
|
619 |
-
$('.hide_products').removeClass('hide_products');
|
620 |
-
if( is_product_table ) {
|
621 |
-
$data = $('<div>'+data+'</div>');
|
622 |
-
berocket_aapf_attribute_data.jquery = $data;
|
623 |
-
} else {
|
624 |
-
if( the_ajax_script.ajax_request_load && the_ajax_script.ajax_request_load_style == 'jquery' ) {
|
625 |
-
$data = $('<div>'+data+'</div>');
|
626 |
-
args_ajax = {
|
627 |
-
pagination:$data.find(the_ajax_script.pagination_class).prop('outerHTML'),
|
628 |
-
catalog_ordering:$data.find(the_ajax_script.ordering_class).prop('outerHTML'),
|
629 |
-
result_count:$data.find(the_ajax_script.result_count_class).prop('outerHTML'),
|
630 |
-
}
|
631 |
-
if( $data.find('.woocommerce-info').hasClass('woocommerce-info') && $data.find(the_ajax_script.products_holder_id).length == 0 ) {
|
632 |
-
if( $data.find('.content .woocommerce-info').length > 0 ) {
|
633 |
-
args_ajax.no_products = $data.find('.content .woocommerce-info').prop('outerHTML');
|
634 |
-
} else {
|
635 |
-
args_ajax.no_products = the_ajax_script.no_products;
|
636 |
-
}
|
637 |
-
} else {
|
638 |
-
var $block_products_holder_id;
|
639 |
-
if( $data.find(the_ajax_script.products_holder_id).length > 1 ) {
|
640 |
-
$data.find(the_ajax_script.products_holder_id).each(function () {
|
641 |
-
if( $(this).is('.berocket_aapf_true') || $(this).parents('.berocket_aapf_true').length || $(this).find('.berocket_aapf_true').length ) {
|
642 |
-
$block_products_holder_id = $(this);
|
643 |
-
return false;
|
644 |
-
}
|
645 |
-
if( typeof($block_products_holder_id) == 'undefined' && ! $(this).is('.berocket_aapf_false') && $(this).parents('.berocket_aapf_false').length && $(this).find('.berocket_aapf_false').length ) {
|
646 |
-
$block_products_holder_id = $(this);
|
647 |
-
}
|
648 |
-
});
|
649 |
-
}
|
650 |
-
if( typeof($block_products_holder_id) == 'undefined' ) {
|
651 |
-
$block_products_holder_id = $data.find(the_ajax_script.products_holder_id);
|
652 |
-
}
|
653 |
-
args_ajax.products = $block_products_holder_id.prop('outerHTML');
|
654 |
-
}
|
655 |
-
result = afterAjaxLoad(args_ajax);
|
656 |
-
berocket_aapf_attribute_data.jquery = $data;
|
657 |
-
} else {
|
658 |
-
if( the_ajax_script.ajax_request_load && the_ajax_script.ajax_request_load_style == 'js' ) {
|
659 |
-
if( data.indexOf('||EXPLODE||') > 0 ) {
|
660 |
-
products = data.split('||EXPLODE||');
|
661 |
-
products = products[1];
|
662 |
-
} else {
|
663 |
-
products = false;
|
664 |
-
}
|
665 |
-
json_data = JSON.parse( data.split('||JSON||')[1] );
|
666 |
-
data = json_data;
|
667 |
-
if( ! products ) {
|
668 |
-
data.no_products = the_ajax_script.no_products;
|
669 |
-
} else {
|
670 |
-
data.products = products;
|
671 |
-
}
|
672 |
-
}
|
673 |
-
|
674 |
-
if( ! the_ajax_script.ajax_request_load ) {
|
675 |
-
if( data.products ) {
|
676 |
-
if( jQuery('<div>'+data.products+'</div>').find(the_ajax_script.products_holder_id).length > 0 ) {
|
677 |
-
data.products = jQuery('<div>'+data.products+'</div>').find(the_ajax_script.products_holder_id).prop('outerHTML');
|
678 |
-
}
|
679 |
-
}
|
680 |
-
}
|
681 |
-
result = afterAjaxLoad(data);
|
682 |
-
berocket_aapf_attribute_data.name = data.attributesname;
|
683 |
-
berocket_aapf_attribute_data.data = data.attributes;
|
684 |
-
}
|
685 |
-
}
|
686 |
-
berocket_aapf_attribute_data.loaded = true;
|
687 |
-
berocket_product_recount();
|
688 |
-
berocket_reset_button_hide_not();
|
689 |
-
$('.berocket_aapf_widget_loading').remove();
|
690 |
-
berocket_aapf_widget_first_page_jump = true;
|
691 |
-
berocket_aapf_404_jump_fail = false;
|
692 |
-
berocket_aapf_404_jump = false;
|
693 |
-
if( attribute_selected_count_start != get_widget_selected_filters().length ) {
|
694 |
-
updateProducts();
|
695 |
-
} else {
|
696 |
-
// call user func after_update
|
697 |
-
$(document).trigger('berocket_ajax_products_loaded');
|
698 |
-
$(document).trigger('berocket_ajax_filtering_end');
|
699 |
-
if( the_ajax_script.user_func != null )
|
700 |
-
berocket_fire( the_ajax_script.user_func.after_update );
|
701 |
-
}
|
702 |
-
}, return_type).fail(function() {
|
703 |
-
if ( berocket_last_ajax_request_id == berocket_this_ajax_request_id ) {
|
704 |
-
if( ! berocket_aapf_404_jump_fail ) {
|
705 |
-
berocket_aapf_404_jump = true;
|
706 |
-
berocket_aapf_404_jump_fail = true;
|
707 |
-
updateProducts($force);
|
708 |
-
} else {
|
709 |
-
berocket_aapf_404_jump_fail = false;
|
710 |
-
berocket_aapf_404_jump = false;
|
711 |
-
$(document).trigger('berocket_ajax_filtering_end');
|
712 |
-
}
|
713 |
-
} else {
|
714 |
-
$(document).trigger('berocket_ajax_filtering_end');
|
715 |
-
}
|
716 |
-
});
|
717 |
-
if ( berocket_aapf_404_jump ) {
|
718 |
-
the_ajax_script.first_page = first_page_404;
|
719 |
-
berocket_aapf_widget_first_page_jump = berocket_aapf_widget_first_page_jump_404;
|
720 |
-
first_page_404 = false;
|
721 |
-
}
|
722 |
-
}
|
723 |
-
|
724 |
-
function afterAjaxLoad( args ) {
|
725 |
-
result = {
|
726 |
-
reset_pagination_event:false,
|
727 |
-
}
|
728 |
-
if( ! the_ajax_script.woocommerce_removes.result_count ) {
|
729 |
-
$(the_ajax_script.result_count_class).html( $(args.result_count).html() || '' );
|
730 |
-
}
|
731 |
-
if( ! the_ajax_script.woocommerce_removes.ordering ) {
|
732 |
-
$(the_ajax_script.ordering_class).html( $(args.catalog_ordering).html() || '' );
|
733 |
-
}
|
734 |
-
if( ! the_ajax_script.woocommerce_removes.pagination ) {
|
735 |
-
$(the_ajax_script.pagination_class).html( $(args.pagination).html() || '' );
|
736 |
-
}
|
737 |
-
|
738 |
-
if ( typeof args.products != 'undefined' ) {
|
739 |
-
if( $(the_ajax_script.pagination_class).length == 0 && ! the_ajax_script.woocommerce_removes.pagination ) {
|
740 |
-
args.products = args.products+( args.pagination || '' );
|
741 |
-
result.reset_pagination_event = true;
|
742 |
-
}
|
743 |
-
if( $(the_ajax_script.ordering_class).length == 0 && ! the_ajax_script.woocommerce_removes.ordering ) {
|
744 |
-
args.products = ( args.catalog_ordering || '' )+args.products;
|
745 |
-
}
|
746 |
-
if( $(the_ajax_script.result_count_class).length == 0 && ! the_ajax_script.woocommerce_removes.result_count ) {
|
747 |
-
args.products = ( args.result_count || '' )+args.products;
|
748 |
-
}
|
749 |
-
}
|
750 |
-
// call user func on_update
|
751 |
-
|
752 |
-
$(document).trigger('berocket_ajax_filtering_on_update');
|
753 |
-
if( the_ajax_script.user_func != null )
|
754 |
-
berocket_fire( the_ajax_script.user_func.on_update );
|
755 |
-
|
756 |
-
if ( $('.woocommerce-info').hasClass('woocommerce-info') && ! $(the_ajax_script.products_holder_id).is(':visible') ) {
|
757 |
-
if ( typeof args.products != 'undefined' ) {
|
758 |
-
if( berocket_replace_only_html ) {
|
759 |
-
location.reload();
|
760 |
-
} else {
|
761 |
-
$('.woocommerce-info').replaceWith(args.products);
|
762 |
-
}
|
763 |
-
}
|
764 |
-
} else {
|
765 |
-
var $block_products_holder_id;
|
766 |
-
if( $(the_ajax_script.products_holder_id).length > 1 ) {
|
767 |
-
$(the_ajax_script.products_holder_id).each(function () {
|
768 |
-
if( $(this).is('.berocket_aapf_true') || $(this).parents('.berocket_aapf_true').length || $(this).find('.berocket_aapf_true').length ) {
|
769 |
-
$block_products_holder_id = $(this);
|
770 |
-
return false;
|
771 |
-
}
|
772 |
-
if( typeof($block_products_holder_id) == 'undefined' && ! $(this).is('.berocket_aapf_false') && $(this).parents('.berocket_aapf_false').length && $(this).find('.berocket_aapf_false').length ) {
|
773 |
-
$block_products_holder_id = $(this);
|
774 |
-
}
|
775 |
-
});
|
776 |
-
}
|
777 |
-
if( typeof($block_products_holder_id) == 'undefined' ) {
|
778 |
-
$block_products_holder_id = $(the_ajax_script.products_holder_id);
|
779 |
-
}
|
780 |
-
if ( typeof args.no_products != 'undefined' ) {
|
781 |
-
if( berocket_child_no_products ) {
|
782 |
-
args.no_products = berocket_child_no_products;
|
783 |
-
}
|
784 |
-
if ( $block_products_holder_id.length > 0 ) {
|
785 |
-
$block_products_holder_id.html(args.no_products);
|
786 |
-
} else if ( $('div.woocommerce').length > 0 ) {
|
787 |
-
$('div.woocommerce').html(args.no_products);
|
788 |
-
}
|
789 |
-
} else {
|
790 |
-
var $products = $(args.products);
|
791 |
-
if ( $products.length > 0 ) {
|
792 |
-
if ( $block_products_holder_id.length > 0 ) {
|
793 |
-
if( berocket_replace_only_html ) {
|
794 |
-
$block_products_holder_id.html($products.html());
|
795 |
-
if( typeof($block_products_holder_id.isotope) == 'function' ) {
|
796 |
-
$block_products_holder_id.isotope( 'reloadItems' );
|
797 |
-
$block_products_holder_id.isotope();
|
798 |
-
}
|
799 |
-
jQuery(document).trigger('berocket_aapf_time_to_fix_products_style');
|
800 |
-
jQuery(the_ajax_script.products_holder_id).find("*").filter(function() {return jQuery(this).css("opacity") == "0";}).css("opacity", 1);
|
801 |
-
} else {
|
802 |
-
$block_products_holder_id.replaceWith($products);
|
803 |
-
}
|
804 |
-
} else {
|
805 |
-
if ( $('div.woocommerce').length > 0 ) {
|
806 |
-
$('div.woocommerce').html($products.prop('outerHTML'));
|
807 |
-
}
|
808 |
-
}
|
809 |
-
} else {
|
810 |
-
if ( $products.find(the_ajax_script.products_holder_id).length > 0 ) {
|
811 |
-
if ( $block_products_holder_id.length > 0 ) {
|
812 |
-
$block_products_holder_id.html($products.find(the_ajax_script.products_holder_id).html());
|
813 |
-
} else if ( $('div.woocommerce').length > 0 ) {
|
814 |
-
$('div.woocommerce').html($products.find(the_ajax_script.products_holder_id).prop('outerHTML'));
|
815 |
-
}
|
816 |
-
} else {
|
817 |
-
if ( $block_products_holder_id.length > 0 ) {
|
818 |
-
$block_products_holder_id.html(the_ajax_script.no_products);
|
819 |
-
} else if ( $('div.woocommerce').length > 0 ) {
|
820 |
-
$('div.woocommerce').html('');
|
821 |
-
}
|
822 |
-
}
|
823 |
-
}
|
824 |
-
}
|
825 |
-
}
|
826 |
-
return result;
|
827 |
-
}
|
828 |
-
|
829 |
-
berocket_new_product_recount = function ($data) {
|
830 |
-
$is_berocket_wc_shortcode_fix = $data.is('.berocket_wc_shortcode_fix');
|
831 |
-
$new_widgets_list = [];
|
832 |
-
$data.find('.berocket_single_filter_widget').each(function (i,o) {
|
833 |
-
var showbutton = $('.berocket_single_filter_widget.berocket_single_filter_widget_'+$(o).data('id')).data('showbutton');
|
834 |
-
var $thistitle = $(o).find('.berocket_aapf_widget-title_div');
|
835 |
-
var widget_block = $thistitle.next('.berocket_aapf_widget');
|
836 |
-
if(showbutton == 'hide') {
|
837 |
-
widget_block.slideDown(0, function(){widget_block.find('.mCSB_container').css('width', '');});
|
838 |
-
$thistitle.find('span').removeClass('show_button').addClass('hide_button');
|
839 |
-
} else if( showbutton == 'show' ) {
|
840 |
-
widget_block.slideUp(0);
|
841 |
-
$thistitle.find('span').removeClass('hide_button').addClass('show_button');
|
842 |
-
}
|
843 |
-
var show_child_button = $('.berocket_single_filter_widget.berocket_single_filter_widget_'+$(o).data('id')).find('.br_child_toggle .fa-minus');
|
844 |
-
if( show_child_button.length ) {
|
845 |
-
show_child_button.each(function() {
|
846 |
-
hide_child_attributes($(o).find('.br_child_toggle[data-term_id='+$(this).parents('.br_child_toggle').data('term_id')+']'));
|
847 |
-
});
|
848 |
-
}
|
849 |
-
$html = $(o).html();
|
850 |
-
if( $is_berocket_wc_shortcode_fix ) {
|
851 |
-
$(o).html('');
|
852 |
-
$('.berocket_single_filter_widget.berocket_single_filter_widget_'+$(o).data('id')).not('.berocket_wc_shortcode_fix .berocket_single_filter_widget').html($html);
|
853 |
-
} else {
|
854 |
-
$('.berocket_single_filter_widget.berocket_single_filter_widget_'+$(o).data('id')).html($html);
|
855 |
-
}
|
856 |
-
});
|
857 |
-
$('.berocket_single_filter_widget').each(function(i, o) {
|
858 |
-
var showbutton = $(o).data('showbutton');
|
859 |
-
var $thistitle = $(o).find('.berocket_aapf_widget-title_div');
|
860 |
-
var widget_block = $thistitle.next('.berocket_aapf_widget');
|
861 |
-
if(showbutton == 'hide')
|
862 |
-
{
|
863 |
-
widget_block.parents('.berocket_single_filter_widget').first().removeClass('berocket_single_filter_hidden').addClass('berocket_single_filter_visible');
|
864 |
-
widget_block.slideDown(100, function(){widget_block.find('.mCSB_container').css('width', '');});
|
865 |
-
$thistitle.find('span').removeClass('show_button').addClass('hide_button');
|
866 |
-
$thistitle.parents('.berocket_single_filter_widget').data('showbutton', 'hide');
|
867 |
-
}
|
868 |
-
else if( showbutton == 'show' )
|
869 |
-
{
|
870 |
-
widget_block.parents('.berocket_single_filter_widget').first().removeClass('berocket_single_filter_visible').addClass('berocket_single_filter_hidden');
|
871 |
-
widget_block.slideUp(100);
|
872 |
-
$thistitle.find('span').removeClass('hide_button').addClass('show_button');
|
873 |
-
$thistitle.parents('.berocket_single_filter_widget').data('showbutton', 'show');
|
874 |
-
}
|
875 |
-
berocket_widget_show_values_text($(this));
|
876 |
-
});
|
877 |
-
if( ! $('.berocket_single_filter_widget').length ) {
|
878 |
-
$data.find('.berocket_aapf_widget').each(function (i,o) {
|
879 |
-
$widget_id = $(o).data('widget_id');
|
880 |
-
$new_widgets_list[ $new_widgets_list.length ] = $widget_id;
|
881 |
-
|
882 |
-
if ( $(o).parents('.berocket_search_box_block').hasClass('berocket_search_box_block') ) {
|
883 |
-
var $html = $(o).parents('.widget.widget_berocket_aapf, .widget.widget_berocket_aapf_single').html();
|
884 |
-
$(o).parents('.widget.widget_berocket_aapf, .widget.widget_berocket_aapf_single').html('');
|
885 |
-
$('#'+$widget_id).html($html).show(0);
|
886 |
-
} else {
|
887 |
-
if( $(o).has('.mCSB_container').length) {
|
888 |
-
var $html = $(o).find('.mCSB_container').html();
|
889 |
-
$(o).find('.mCSB_container').html('');
|
890 |
-
} else {
|
891 |
-
var $html = $(o).html();
|
892 |
-
$(o).html('');
|
893 |
-
}
|
894 |
-
if( $('[data-widget_id="'+$widget_id+'"]').has('.mCSB_container').length ) {
|
895 |
-
$('[data-widget_id="'+$widget_id+'"]').find('.mCSB_container').html($html).parents('.widget.widget_berocket_aapf, .widget.widget_berocket_aapf_single').show(0);
|
896 |
-
} else {
|
897 |
-
$('[data-widget_id="'+$widget_id+'"]').html($html).parents('.widget.widget_berocket_aapf, .widget.widget_berocket_aapf_single').show(0);
|
898 |
-
}
|
899 |
-
}
|
900 |
-
});
|
901 |
-
}
|
902 |
-
$( ".berocket_filter_slider" ).each(function (i,o){
|
903 |
-
berocket_set_slider ( i, o );
|
904 |
-
});
|
905 |
-
|
906 |
-
$(".berocket_aapf_widget_height_control").each(function (i,o){
|
907 |
-
if( ! $(o).hasClass('br_height_controled') ) {
|
908 |
-
$(o).css('height', $(o).height()).mCustomScrollbar({
|
909 |
-
axis: "y",
|
910 |
-
theme: $(o).data('scroll_theme'),
|
911 |
-
scrollInertia: 300
|
912 |
-
}).addClass('br_height_controled');
|
913 |
-
berocket_custom_scroll_bar_init();
|
914 |
-
}
|
915 |
-
});
|
916 |
-
|
917 |
-
$('body').find('.berocket_aapf_widget').each(function (i,o) {
|
918 |
-
if( $(o).parents('.berocket_single_filter_widget').length == 0 ) {
|
919 |
-
$remove_it = true;
|
920 |
-
$($new_widgets_list).each(function (ii,oo){
|
921 |
-
if ( $(o).data('widget_id') == oo ) {
|
922 |
-
$remove_it = false;
|
923 |
-
}
|
924 |
-
});
|
925 |
-
|
926 |
-
if ( $remove_it ) {
|
927 |
-
$('#'+$(o).data('widget_id')).hide(0);
|
928 |
-
}
|
929 |
-
}
|
930 |
-
});
|
931 |
-
if( the_ajax_script.use_select2 && $(".berocket_aapf_widget select").length && typeof $(".berocket_aapf_widget select").select2 == 'function' ) {
|
932 |
-
$(".select2-container--open").remove();
|
933 |
-
$(".berocket_aapf_widget select").select2({width:'100%'});
|
934 |
-
}
|
935 |
-
}
|
936 |
-
|
937 |
-
berocket_product_recount = function () {
|
938 |
-
if( berocket_aapf_attribute_data.loaded && berocket_aapf_child_parent_loaded ) {
|
939 |
-
jQuery('.berocket_aapf_widget:not(.berocket_aapf_widget_selected_area)').each(function(i, o) {
|
940 |
-
jQuery(o).parents('.widget.widget_berocket_aapf, .widget.widget_berocket_aapf_single').show();
|
941 |
-
});
|
942 |
-
if ( the_ajax_script.ajax_request_load_style == 'jquery' && the_ajax_script.ajax_request_load ) {
|
943 |
-
var $data = berocket_aapf_attribute_data.jquery;
|
944 |
-
berocket_new_product_recount($data);
|
945 |
-
berocket_aapf_attribute_data.jquery = false;
|
946 |
-
berocket_aapf_attribute_data.loaded = false;
|
947 |
-
} else {
|
948 |
-
var data = {attributesname: berocket_aapf_attribute_data.name, attributes: berocket_aapf_attribute_data.data};
|
949 |
-
if( the_ajax_script.recount_products ) {
|
950 |
-
$('.berocket_aapf_widget').each(function (i,o){
|
951 |
-
if( $(o).data('type') == 'color' || $(o).data('type') == 'checkbox' || $(o).data('type') == 'radio' || $(o).data('type') == 'select' || $(o).data('type') == 'image' || $(o).data('type') == 'ranges' ) {
|
952 |
-
attribute_pos = data.attributesname.indexOf($(o).data('attribute'));
|
953 |
-
if( attribute_pos >= 0 && typeof(data.attributes[attribute_pos]) != 'undefinded' && data.attributes[attribute_pos] != null ) {
|
954 |
-
if( $(o).data('type') == 'color' || $(o).data('type') == 'checkbox' || $(o).data('type') == 'image' ) {
|
955 |
-
data.attributes[attribute_pos].forEach( function(element, index, array) {
|
956 |
-
$(o).find('.checkbox_'+element.term_id+element.taxonomy).each(function( i2, o2 ) {
|
957 |
-
$(o2).data('term_count', element.count).parents('li').first().find('.berocket_aapf_count').text(element.count);
|
958 |
-
hide_show_o_value($(o2), element.count);
|
959 |
-
});
|
960 |
-
});
|
961 |
-
} else if( $(o).data('type') == 'ranges' ) {
|
962 |
-
data.attributes[attribute_pos].forEach( function(element, index, array) {
|
963 |
-
$(o).find('.checkbox_'+element.term_ranges).each(function( i2, o2 ) {
|
964 |
-
$(o2).parents('li').first().find('.berocket_aapf_count').text(element.count);
|
965 |
-
hide_show_o_value($(o2), element.count);
|
966 |
-
});
|
967 |
-
});
|
968 |
-
} else if( $(o).data('type') == 'radio' ) {
|
969 |
-
data.attributes[attribute_pos].forEach( function(element, index, array) {
|
970 |
-
$(o).find('.radio_'+element.term_id+'_'+element.taxonomy).each(function( i2, o2 ) {
|
971 |
-
$(o2).parents('li').first().find('.berocket_aapf_count').text(element.count);
|
972 |
-
hide_show_o_value($(o2), element.count);
|
973 |
-
});
|
974 |
-
});
|
975 |
-
} else if( $(o).data('type') == 'select' ) {
|
976 |
-
data.attributes[attribute_pos].forEach( function(element, index, array) {
|
977 |
-
$(o).find('.select_'+element.term_id).text($(o).find('.select_'+element.term_id).data('term_name')+' ('+element.count+')');
|
978 |
-
hide_show_o_value_select( $('.select_'+$(o).data('term_id')), element.count );
|
979 |
-
});
|
980 |
-
}
|
981 |
-
}
|
982 |
-
}
|
983 |
-
});
|
984 |
-
}
|
985 |
-
berocket_aapf_attribute_data.loaded = false;
|
986 |
-
berocket_aapf_attribute_data.name = [];
|
987 |
-
berocket_aapf_attribute_data.data = [];
|
988 |
-
}
|
989 |
-
}
|
990 |
-
if( the_ajax_script.hide_empty_value ) {
|
991 |
-
jQuery('.berocket_aapf_widget:not(.berocket_aapf_widget_selected_area)').each(function(i, o) {
|
992 |
-
if( jQuery(o).parents('.berocket_search_box_block').parents('.berocket_search_box_block').length == 0 && jQuery(o).parents('.br_child_parent_wrapper').length == 0 ) {
|
993 |
-
if( jQuery(o).find('li').not('.berocket_widget_show_values').length == jQuery(o).find('li.berocket_hide_o_value').length ) {
|
994 |
-
jQuery(o).parents('.berocket_aapf_widget-wrapper').addClass('berocket_hiden_without_visible_values').hide().parents('.widget.widget_berocket_aapf, .widget.widget_berocket_aapf_single').hide();
|
995 |
-
}
|
996 |
-
}
|
997 |
-
});
|
998 |
-
}
|
999 |
-
berocket_reset_button_hide_not();
|
1000 |
-
update_data_containers();
|
1001 |
-
update_selected_area();
|
1002 |
-
}
|
1003 |
-
|
1004 |
-
function hide_show_o_value($block, count) {
|
1005 |
-
if( the_ajax_script.hide_o_value ) {
|
1006 |
-
if( count == 0 ) {
|
1007 |
-
$block.each(function(i, o) {
|
1008 |
-
$(o).parents('li').first().addClass('berocket_hide_o_value');
|
1009 |
-
});
|
1010 |
-
} else {
|
1011 |
-
$block.each(function(i, o) {
|
1012 |
-
$(o).parents('li').first().removeClass('berocket_hide_o_value');
|
1013 |
-
});
|
1014 |
-
}
|
1015 |
-
var $parent = $block.parents('ul.berocket_aapf_widget');
|
1016 |
-
$parent.each( function ( i, o ) {
|
1017 |
-
if( the_ajax_script.hide_o_value && $(o).find('.berocket_hide_o_value').length > 0 ||
|
1018 |
-
the_ajax_script.hide_sel_value && $(o).find('.berocket_hide_sel_value').length > 0 ) {
|
1019 |
-
$(o).find('.berocket_widget_show_values').show();
|
1020 |
-
} else {
|
1021 |
-
$(o).find('.berocket_widget_show_values').hide();
|
1022 |
-
}
|
1023 |
-
});
|
1024 |
-
}
|
1025 |
-
}
|
1026 |
-
|
1027 |
-
function hide_show_o_value_select($block, count) {
|
1028 |
-
if( the_ajax_script.hide_o_value ) {
|
1029 |
-
if( count == 0 ) {
|
1030 |
-
$block.each(function(i, o) {
|
1031 |
-
$(o).addClass('berocket_hide_o_value').prop('hidden', true).prop('disabled', true);
|
1032 |
-
});
|
1033 |
-
} else {
|
1034 |
-
$block.each(function(i, o) {
|
1035 |
-
$(o).removeClass('berocket_hide_o_value').prop('hidden', false).prop('disabled', false);
|
1036 |
-
});
|
1037 |
-
}
|
1038 |
-
}
|
1039 |
-
}
|
1040 |
-
|
1041 |
-
function updateLocation( args, pushstate, return_request ){
|
1042 |
-
if( typeof(newUpdateLocation) == 'function' ) {
|
1043 |
-
return newUpdateLocation(args, pushstate, return_request);
|
1044 |
-
}
|
1045 |
-
if ( typeof return_request == 'undefined' ) return_request = false;
|
1046 |
-
uri_request_array = [];
|
1047 |
-
var uri_request = '';
|
1048 |
-
temp_terms = [];
|
1049 |
-
var taxonomy_sparator = "|", start_terms = "[", end_terms = "]", variable = 'filters';
|
1050 |
-
|
1051 |
-
if (typeof the_ajax_script.nn_url_variable != "undefined" && the_ajax_script.nn_url_variable.length > 0) {
|
1052 |
-
variable = the_ajax_script.nn_url_variable;
|
1053 |
-
}
|
1054 |
-
if (typeof the_ajax_script.nn_url_value_1 != "undefined" && the_ajax_script.nn_url_value_1.length > 0) {
|
1055 |
-
start_terms = the_ajax_script.nn_url_value_1;
|
1056 |
-
end_terms = the_ajax_script.nn_url_value_2;
|
1057 |
-
}
|
1058 |
-
if (typeof the_ajax_script.nn_url_split != "undefined" && the_ajax_script.nn_url_split.length > 0) {
|
1059 |
-
taxonomy_sparator = the_ajax_script.nn_url_split;
|
1060 |
-
}
|
1061 |
-
|
1062 |
-
if( the_ajax_script.nice_urls ) {
|
1063 |
-
taxonomy_sparator = the_ajax_script.nice_url_split;
|
1064 |
-
start_terms = the_ajax_script.nice_url_value_1;
|
1065 |
-
end_terms = the_ajax_script.nice_url_value_2;
|
1066 |
-
variable = the_ajax_script.nice_url_variable;
|
1067 |
-
}
|
1068 |
-
|
1069 |
-
if( args.price ){
|
1070 |
-
$price_obj = $('.berocket_filter_price_slider');
|
1071 |
-
if( ( args.price[0] || args.price[0] === 0 ) && ( args.price[1] || args.price[1] === 0 ) && ( args.price[0] != $price_obj.data('min') || args.price[1] != $price_obj.data('max') ) ){
|
1072 |
-
if( uri_request ) uri_request += taxonomy_sparator;
|
1073 |
-
uri_request += 'price'+start_terms+args.price[0]+'_'+args.price[1]+end_terms;
|
1074 |
-
}
|
1075 |
-
}
|
1076 |
-
|
1077 |
-
if( args.limits ){
|
1078 |
-
$(args.limits).each(function (i,o){
|
1079 |
-
if( o[0].substring(0, 3) == 'pa_' ) {
|
1080 |
-
if( !in_array( o[0].substring(3), temp_terms ) ){
|
1081 |
-
temp_terms[temp_terms.length] = o[0].substring(3);
|
1082 |
-
}
|
1083 |
-
if( typeof uri_request_array[in_array( o[0].substring(3), temp_terms )] == 'undefined' ) {
|
1084 |
-
uri_request_array[in_array(o[0].substring(3), temp_terms)] = [];
|
1085 |
-
}
|
1086 |
-
uri_request_array[in_array( o[0].substring(3), temp_terms )]
|
1087 |
-
[uri_request_array[in_array( o[0].substring(3), temp_terms )].length] = [o[1],o[2]];
|
1088 |
-
} else {
|
1089 |
-
if( !in_array( o[0], temp_terms ) ){
|
1090 |
-
temp_terms[temp_terms.length] = o[0];
|
1091 |
-
}
|
1092 |
-
if( typeof uri_request_array[in_array( o[0], temp_terms )] == 'undefined' ) {
|
1093 |
-
uri_request_array[in_array(o[0], temp_terms)] = [];
|
1094 |
-
}
|
1095 |
-
uri_request_array[in_array( o[0], temp_terms )]
|
1096 |
-
[uri_request_array[in_array( o[0], temp_terms )].length] = [o[1],o[2]];
|
1097 |
-
}
|
1098 |
-
});
|
1099 |
-
}
|
1100 |
-
if( args.terms ){
|
1101 |
-
$(args.terms).each(function (i,o){
|
1102 |
-
if ( the_ajax_script.slug_urls ) {
|
1103 |
-
o[1] = o[3];
|
1104 |
-
}
|
1105 |
-
if( o[0].substring(0, 3) == 'pa_' ) {
|
1106 |
-
if( !in_array( o[0].substring(3), temp_terms ) ){
|
1107 |
-
temp_terms[temp_terms.length] = o[0].substring(3);
|
1108 |
-
}
|
1109 |
-
if( typeof uri_request_array[in_array( o[0].substring(3), temp_terms )] == 'undefined' ) {
|
1110 |
-
uri_request_array[in_array(o[0].substring(3), temp_terms)] = [];
|
1111 |
-
}
|
1112 |
-
uri_request_array[in_array( o[0].substring(3), temp_terms )]
|
1113 |
-
[uri_request_array[in_array( o[0].substring(3), temp_terms )].length] = [o[1],o[2]];
|
1114 |
-
} else {
|
1115 |
-
if( !in_array( o[0], temp_terms ) ){
|
1116 |
-
temp_terms[temp_terms.length] = o[0];
|
1117 |
-
}
|
1118 |
-
if( typeof uri_request_array[in_array( o[0], temp_terms )] == 'undefined' ) {
|
1119 |
-
uri_request_array[in_array(o[0], temp_terms)] = [];
|
1120 |
-
}
|
1121 |
-
uri_request_array[in_array( o[0], temp_terms )]
|
1122 |
-
[uri_request_array[in_array( o[0], temp_terms )].length] = [o[1],o[2]];
|
1123 |
-
}
|
1124 |
-
});
|
1125 |
-
}
|
1126 |
-
|
1127 |
-
if( uri_request_array.length ) {
|
1128 |
-
$(uri_request_array).each(function (i,o){
|
1129 |
-
if( uri_request ) uri_request += taxonomy_sparator;
|
1130 |
-
|
1131 |
-
if( typeof o != 'object' ){
|
1132 |
-
if( the_ajax_script.seo_uri_decode ) {
|
1133 |
-
uri_request += encodeURIComponent( o );
|
1134 |
-
} else {
|
1135 |
-
uri_request += o;
|
1136 |
-
}
|
1137 |
-
}else{
|
1138 |
-
cnt_oo = false;
|
1139 |
-
if( the_ajax_script.seo_uri_decode ) {
|
1140 |
-
uri_request += encodeURIComponent( temp_terms[i] )+start_terms;
|
1141 |
-
} else {
|
1142 |
-
uri_request += temp_terms[i]+start_terms;
|
1143 |
-
}
|
1144 |
-
|
1145 |
-
$(o).each(function (ii,oo){
|
1146 |
-
if( ( oo[1] == 'AND' || oo[1] == 'OR' ) ){
|
1147 |
-
if( cnt_oo ){
|
1148 |
-
if(oo[1] == 'AND'){
|
1149 |
-
if( the_ajax_script.seo_uri_decode ) {
|
1150 |
-
uri_request += encodeURIComponent('+');
|
1151 |
-
} else {
|
1152 |
-
uri_request += '+';
|
1153 |
-
}
|
1154 |
-
}else{
|
1155 |
-
if( the_ajax_script.seo_uri_decode ) {
|
1156 |
-
uri_request += encodeURIComponent('-');
|
1157 |
-
} else {
|
1158 |
-
uri_request += '-';
|
1159 |
-
}
|
1160 |
-
}
|
1161 |
-
}
|
1162 |
-
}else{
|
1163 |
-
oo[0] += '_'+oo[1];
|
1164 |
-
}
|
1165 |
-
if( the_ajax_script.seo_uri_decode ) {
|
1166 |
-
uri_request += encodeURIComponent(oo[0]);
|
1167 |
-
} else {
|
1168 |
-
uri_request += oo[0];
|
1169 |
-
}
|
1170 |
-
cnt_oo = true;
|
1171 |
-
});
|
1172 |
-
uri_request += end_terms;
|
1173 |
-
}
|
1174 |
-
});
|
1175 |
-
}
|
1176 |
-
uri_request = uri_request;
|
1177 |
-
|
1178 |
-
if( !pushstate ) {
|
1179 |
-
return uri_request;
|
1180 |
-
}
|
1181 |
-
if ( the_ajax_script.trailing_slash ) {
|
1182 |
-
if( the_ajax_script.nice_urls && uri_request && uri_request.slice(-1) != '/' ) {
|
1183 |
-
uri_request += '/';
|
1184 |
-
}
|
1185 |
-
}
|
1186 |
-
|
1187 |
-
var uri = the_ajax_script.current_page_url;
|
1188 |
-
if ( /\?/.test(uri) ) {
|
1189 |
-
passed_vars1 = uri.split('?');
|
1190 |
-
uri = passed_vars1[0];
|
1191 |
-
}
|
1192 |
-
if( uri && uri.slice(-1) != '/' && ( the_ajax_script.trailing_slash ) ) {
|
1193 |
-
uri += '/';
|
1194 |
-
}
|
1195 |
-
|
1196 |
-
var cur_page = $(the_ajax_script.pagination_class).find('.current').first().text();
|
1197 |
-
var paginate_regex = new RegExp(".+\/"+the_ajax_script.pagination_base+"\/([0-9]+).+", "i");
|
1198 |
-
if( prev_page = parseInt( location.href.replace(paginate_regex, "$1") ) ) {
|
1199 |
-
if( ! parseInt( cur_page ) ){
|
1200 |
-
cur_page = prev_page;
|
1201 |
-
}
|
1202 |
-
}
|
1203 |
-
if(berocket_aapf_widget_first_page_jump && the_ajax_script.first_page) {
|
1204 |
-
cur_page = 1;
|
1205 |
-
}
|
1206 |
-
cur_page = parseInt( cur_page );
|
1207 |
-
var additional_datas = '';
|
1208 |
-
something_added = false;
|
1209 |
-
if( /\?/.test(location.href) ){
|
1210 |
-
passed_vars1 = location.href;
|
1211 |
-
if ( /\#/.test(passed_vars1) ) {
|
1212 |
-
passed_vars1 = passed_vars1.split('#');
|
1213 |
-
passed_vars1 = passed_vars1[0];
|
1214 |
-
}
|
1215 |
-
passed_vars1 = passed_vars1.split('?');
|
1216 |
-
if( passed_vars1[1] ){
|
1217 |
-
passed_vars2 = [];
|
1218 |
-
if( /&/.test(passed_vars1[1]) ) {
|
1219 |
-
passed_vars2 = passed_vars1[1].split('&');
|
1220 |
-
} else {
|
1221 |
-
passed_vars2[0] = passed_vars1[1];
|
1222 |
-
}
|
1223 |
-
passed_vars2_length = passed_vars2.length;
|
1224 |
-
for ( k = 0; k < passed_vars2.length; k++ ) {
|
1225 |
-
temp = passed_vars2[k].split('=');
|
1226 |
-
passed_vars2[k] = [];
|
1227 |
-
passed_vars2[k][0] = temp.shift();
|
1228 |
-
passed_vars2[k][1] = temp.join("=");
|
1229 |
-
if( passed_vars2[k][0] == variable || passed_vars2[k][0] == 'page' || passed_vars2[k][0] == 'paged' || passed_vars2[k][0] == 'product-page' ) continue;
|
1230 |
-
|
1231 |
-
if( the_ajax_script.control_sorting && passed_vars2[k][0] == 'orderby' ) continue;
|
1232 |
-
|
1233 |
-
if( something_added ) {
|
1234 |
-
additional_datas += '&';
|
1235 |
-
} else {
|
1236 |
-
additional_datas += '?';
|
1237 |
-
}
|
1238 |
-
|
1239 |
-
additional_datas += passed_vars2[k][0]+'='+passed_vars2[k][1];
|
1240 |
-
something_added = true;
|
1241 |
-
}
|
1242 |
-
}
|
1243 |
-
}
|
1244 |
-
var next_symbol_sep = '?';
|
1245 |
-
if( the_ajax_script.nice_urls ) {
|
1246 |
-
if( uri_request ) {
|
1247 |
-
if( uri.slice(-1) != '/' ) {
|
1248 |
-
uri += '/';
|
1249 |
-
}
|
1250 |
-
uri = uri + variable + "/" + uri_request;
|
1251 |
-
}
|
1252 |
-
if( cur_page > 1 && $(the_ajax_script.pagination_class+' a').last().length && $(the_ajax_script.pagination_class+' a').last().attr('href').search('product-page=') == -1 ) {
|
1253 |
-
if( uri.slice(-1) != '/' ) {
|
1254 |
-
uri += '/';
|
1255 |
-
}
|
1256 |
-
uri = uri + the_ajax_script.pagination_base+"/" + cur_page;
|
1257 |
-
if ( the_ajax_script.trailing_slash ) {
|
1258 |
-
uri += '/';
|
1259 |
-
}
|
1260 |
-
}
|
1261 |
-
if( something_added ) {
|
1262 |
-
uri = uri + additional_datas;
|
1263 |
-
next_symbol_sep = '&'
|
1264 |
-
}
|
1265 |
-
} else {
|
1266 |
-
if( something_added ) {
|
1267 |
-
uri = uri + additional_datas;
|
1268 |
-
next_symbol_sep = '&';
|
1269 |
-
}
|
1270 |
-
if( cur_page > 1 && $(the_ajax_script.pagination_class+' a').last().length && $(the_ajax_script.pagination_class+' a').last().attr('href').search('product-page=') == -1 ) {
|
1271 |
-
uri = uri + next_symbol_sep + "paged=" + cur_page;
|
1272 |
-
next_symbol_sep = '&';
|
1273 |
-
}
|
1274 |
-
if( uri_request ) {
|
1275 |
-
uri = uri + next_symbol_sep + variable + "=" + uri_request;
|
1276 |
-
next_symbol_sep = '&';
|
1277 |
-
}
|
1278 |
-
}
|
1279 |
-
|
1280 |
-
if( the_ajax_script.control_sorting && args.orderby && the_ajax_script.default_sorting != args.orderby ){
|
1281 |
-
uri = uri + next_symbol_sep + 'orderby=' + args.orderby;
|
1282 |
-
next_symbol_sep = '&';
|
1283 |
-
}
|
1284 |
-
|
1285 |
-
if( cur_page > 1 && $(the_ajax_script.pagination_class+' a').last().length && $(the_ajax_script.pagination_class+' a').last().attr('href').search('product-page=') != -1 ) {
|
1286 |
-
uri = uri + next_symbol_sep + "product-page=" + cur_page;
|
1287 |
-
}
|
1288 |
-
if ( /\#/.test(location.href) ) {
|
1289 |
-
passed_vars1 = location.href.split('#');
|
1290 |
-
passed_vars1 = passed_vars1[1];
|
1291 |
-
uri += '#'+passed_vars1;
|
1292 |
-
}
|
1293 |
-
|
1294 |
-
if( return_request ) {
|
1295 |
-
return uri;
|
1296 |
-
} else {
|
1297 |
-
var stateParameters = { BeRocket: "Rules" };
|
1298 |
-
history.replaceState(stateParameters, "");
|
1299 |
-
history.pushState(stateParameters, "", uri);
|
1300 |
-
history.pathname = uri;
|
1301 |
-
}
|
1302 |
-
}
|
1303 |
-
// Take control over (default) pagination and sorting, make it AJAXy and work with filters
|
1304 |
-
if( ! the_ajax_script.woocommerce_removes.pagination_ajax ) {
|
1305 |
-
$(document).on('click', the_ajax_script.pagination_class+' a', function (event) {
|
1306 |
-
var permalink_page = /\/page\/(\d+)/;
|
1307 |
-
var non_permalink_page = /paged=(\d+)/;
|
1308 |
-
var href = $(this).attr('href');
|
1309 |
-
if( permalink_page.test(href) ) {
|
1310 |
-
_next_page = href.match(permalink_page);
|
1311 |
-
_next_page = _next_page[1];
|
1312 |
-
} else if( non_permalink_page.test(href) ) {
|
1313 |
-
_next_page = href.match(non_permalink_page);
|
1314 |
-
_next_page = _next_page[1];
|
1315 |
-
} else if ( $(this).hasClass('next') || $(this).parent().hasClass('next') ) {
|
1316 |
-
_next_page = $(the_ajax_script.pagination_class+' .current').first().text();
|
1317 |
-
_next_page = _next_page.replace(/\D/g,'');
|
1318 |
-
_next_page = parseInt( _next_page ) + 1;
|
1319 |
-
} else if ( $(this).hasClass('prev') || $(this).parent().hasClass('prev') ) {
|
1320 |
-
_next_page = $(the_ajax_script.pagination_class+' .current').first().text();
|
1321 |
-
_next_page = _next_page.replace(/\D/g,'');
|
1322 |
-
_next_page = parseInt( _next_page ) - 1;
|
1323 |
-
} else {
|
1324 |
-
_next_page = $(this).text();
|
1325 |
-
_next_page = _next_page.replace(/\D/g,'');
|
1326 |
-
_next_page = parseInt(_next_page);
|
1327 |
-
}
|
1328 |
-
if( typeof(_next_page) == 'undefined' || _next_page <= 0 ) {
|
1329 |
-
_next_page = 1;
|
1330 |
-
}
|
1331 |
-
event.preventDefault();
|
1332 |
-
$(the_ajax_script.pagination_class+' .current').removeClass('current');
|
1333 |
-
$(this).after("<span class='page-numbers current' style='display:none;'>"+_next_page+"</span>");
|
1334 |
-
if( the_ajax_script.first_page ) {
|
1335 |
-
berocket_aapf_widget_first_page_jump = false;
|
1336 |
-
}
|
1337 |
-
updateProducts(true);
|
1338 |
-
});
|
1339 |
-
}
|
1340 |
-
|
1341 |
-
function in_array(needle, haystack, strict) {
|
1342 |
-
var found = false, key, strict = !!strict;
|
1343 |
-
for (key in haystack) {
|
1344 |
-
if ((strict && haystack[key] === needle) || (!strict && haystack[key] == needle)) {
|
1345 |
-
found = key;
|
1346 |
-
break;
|
1347 |
-
}
|
1348 |
-
}
|
1349 |
-
return found;
|
1350 |
-
}
|
1351 |
-
berocket_in_array = in_array;
|
1352 |
-
|
1353 |
-
$(document).on("mousedown", ".berocket_aapf_widget input[type=radio]", function(event){
|
1354 |
-
if ( $(this).prop('checked') ) {
|
1355 |
-
$(this).addClass('radio_is_checked');
|
1356 |
-
} else {
|
1357 |
-
$(this).removeClass('radio_is_checked');
|
1358 |
-
}
|
1359 |
-
});
|
1360 |
-
$(document).on("click", ".berocket_aapf_widget input[type=radio]", function(event){
|
1361 |
-
if ( $(this).is('.radio_is_checked') ) {
|
1362 |
-
$label = $(this).parents('li').first().find('.berocket_label_widgets');
|
1363 |
-
setTimeout(function() {
|
1364 |
-
$label.click();
|
1365 |
-
}, 5);
|
1366 |
-
}
|
1367 |
-
});
|
1368 |
-
|
1369 |
-
$(document).on("select2:close", ".berocket_aapf_widget select", function(){
|
1370 |
-
if( $(this).is('.select2changed') ) {
|
1371 |
-
$(this).removeClass('select2changed');
|
1372 |
-
berocket_on_change_inputs_selects($(this));
|
1373 |
-
}
|
1374 |
-
});
|
1375 |
-
$(document).on("change", ".berocket_aapf_widget input, .berocket_aapf_widget select", function(){
|
1376 |
-
if( $(this).is('.select2-hidden-accessible') ) {
|
1377 |
-
$(this).addClass('select2changed');
|
1378 |
-
return 0;
|
1379 |
-
}
|
1380 |
-
berocket_on_change_inputs_selects($(this));
|
1381 |
-
});
|
1382 |
-
function berocket_on_change_inputs_selects(element) {
|
1383 |
-
var $this = $(element);
|
1384 |
-
if( $this.parents('.berocket_disabled_filter_element').length ) {
|
1385 |
-
return;
|
1386 |
-
}
|
1387 |
-
var $parent_for = $(document);
|
1388 |
-
if( $this.parents('.berocket_search_box_block').length > 0 ) {
|
1389 |
-
$parent_for = $this.parents('.berocket_search_box_block');
|
1390 |
-
search_url = $parent_for.find('.berocket_search_box_button').data('url');
|
1391 |
-
if( the_ajax_script.current_page_url == search_url
|
1392 |
-
|| the_ajax_script.current_page_url.slice(-1) == '/'
|
1393 |
-
&& the_ajax_script.current_page_url.slice(0, -1) == search_url
|
1394 |
-
|| search_url.slice(-1) == '/'
|
1395 |
-
&& the_ajax_script.current_page_url == search_url.slice(0, -1) ) {
|
1396 |
-
$parent_for = $(document);
|
1397 |
-
}
|
1398 |
-
}
|
1399 |
-
current_value = [];
|
1400 |
-
$berocket_aapf_last_changed = $this;
|
1401 |
-
berocket_child_no_products = '';
|
1402 |
-
if( $this.parents('.berocket_aapf_widget-wrapper').find('.berocket_child_no_products').length > 0 &&
|
1403 |
-
$this.parents('.berocket_aapf_widget-wrapper').find('.berocket_child_no_products').text() ) {
|
1404 |
-
berocket_child_no_products = $this.parents('.berocket_aapf_widget-wrapper').find('.berocket_child_no_products').text();
|
1405 |
-
}
|
1406 |
-
if($this.attr('type') == 'checkbox' || $this.attr('type') == 'radio')
|
1407 |
-
{
|
1408 |
-
$label = $this.parents('li').first().find('.berocket_label_widgets');
|
1409 |
-
if( $label.hasClass('berocket_checked')) {
|
1410 |
-
$parent_for.find('.'+$label.data('for')).prop('checked', false).removeAttr('checked').trigger('refresh');
|
1411 |
-
$parent_for.find('.'+$label.data('for')).each(function( i2, o2 ) {
|
1412 |
-
$(o2).parents('li').first().removeClass('berocket_hide_sel_value').find('.berocket_label_widgets').removeClass('berocket_checked');
|
1413 |
-
});
|
1414 |
-
$label.removeClass('berocket_checked');
|
1415 |
-
} else {
|
1416 |
-
$parent_for.find('.'+$label.data('for')).prop('checked', true).trigger('refresh');
|
1417 |
-
if( $label.parents('li').first().find('input').attr('type') == 'radio' ) {
|
1418 |
-
$parent_for.find('.'+$label.data('for')).parents('.berocket_aapf_widget').find('li').removeClass('berocket_hide_sel_value').find('.berocket_label_widgets').removeClass('berocket_checked');
|
1419 |
-
}
|
1420 |
-
$parent_for.find('.'+$label.data('for')).each(function( i2, o2 ) {
|
1421 |
-
$(o2).parents('li').first().find('.berocket_label_widgets').addClass('berocket_checked');
|
1422 |
-
if( the_ajax_script.hide_sel_value ) {
|
1423 |
-
$(o2).parents('li').first().addClass('berocket_hide_sel_value');
|
1424 |
-
}
|
1425 |
-
});
|
1426 |
-
$label.addClass('berocket_checked');
|
1427 |
-
}
|
1428 |
-
$parent_for.find('.'+$label.data('for')).parents('ul').find('input').trigger('refresh');
|
1429 |
-
if( the_ajax_script.hide_sel_value ) {
|
1430 |
-
$for_objects = $parent_for.find('.'+$label.data('for')).parents('.berocket_aapf_widget');
|
1431 |
-
$for_objects.each(function (i,o){
|
1432 |
-
$hiden_objects = $(o).find('.berocket_hide_o_value, .berocket_hide_sel_value');
|
1433 |
-
if( $hiden_objects.length == 0 ) {
|
1434 |
-
$(o).find('.berocket_widget_show_values').hide();
|
1435 |
-
} else {
|
1436 |
-
$(o).find('.berocket_widget_show_values').show();
|
1437 |
-
}
|
1438 |
-
});
|
1439 |
-
}
|
1440 |
-
|
1441 |
-
if($this.prop('checked'))
|
1442 |
-
{
|
1443 |
-
$parent_for.find('.'+$label.data('for')).prop('checked', true).trigger('refresh');
|
1444 |
-
if( the_ajax_script.hide_sel_value ) {
|
1445 |
-
$('.'+$label.data('for')).each(function( i2, o2 ) {
|
1446 |
-
$(o2).parents('li').first().addClass('berocket_hide_sel_value');
|
1447 |
-
});
|
1448 |
-
}
|
1449 |
-
}
|
1450 |
-
else
|
1451 |
-
{
|
1452 |
-
$parent_for.find('.'+$label.data('for')).prop('checked', false).removeAttr('checked').trigger('refresh').each(function( i2, o2 ) {
|
1453 |
-
$(o2).parents('li').removeClass('berocket_hide_sel_value');
|
1454 |
-
});
|
1455 |
-
}
|
1456 |
-
$this.parents('.berocket_aapf_widget').find('input').each( function ( i, o ) {
|
1457 |
-
if ( $(o).prop('checked') ) {
|
1458 |
-
current_value.push( parseInt( $(o).data('term_id') ) );
|
1459 |
-
}
|
1460 |
-
});
|
1461 |
-
} else if($this.is('select')) {
|
1462 |
-
var selected_val = [];
|
1463 |
-
$(element).find('option:selected').each(function(i, o) {
|
1464 |
-
selected_val.push($(o).val());
|
1465 |
-
});
|
1466 |
-
if( $this.parents('.berocket_aapf_widget').data('child_parent') != 'child' ) {
|
1467 |
-
$parent_for.find('select.'+$this.data('taxonomy')).val(selected_val).trigger('refresh');
|
1468 |
-
}
|
1469 |
-
current_value = selected_val;
|
1470 |
-
if( ! selected_val.length ) {
|
1471 |
-
current_value = false;
|
1472 |
-
}
|
1473 |
-
}
|
1474 |
-
if( $this.parents('.berocket_search_box_block').length == 0 ) {
|
1475 |
-
var $widget_child = '';
|
1476 |
-
if ( $this.parents('.berocket_aapf_widget').data('child_parent') == 'parent' || $this.parents('.berocket_aapf_widget').data('child_parent') == 'child' ) {
|
1477 |
-
berocket_aapf_child_parent_loaded = false;
|
1478 |
-
$widget_child = '.'+$this.parents('.berocket_aapf_widget').data('attribute')+'_child_';
|
1479 |
-
if ( $this.parents('.berocket_aapf_widget').data('child_parent') == 'parent' ) {
|
1480 |
-
$widget_child += '1';
|
1481 |
-
} else {
|
1482 |
-
$widget_child += ( parseInt( $this.parents('.berocket_aapf_widget').data('child_parent_depth') ) + 1 );
|
1483 |
-
}
|
1484 |
-
$widget_child = $($widget_child);
|
1485 |
-
berocket_remove_child ( $widget_child );
|
1486 |
-
}
|
1487 |
-
updateProducts();
|
1488 |
-
if ( $this.parents('.berocket_aapf_widget').data('child_parent') == 'parent' || $this.parents('.berocket_aapf_widget').data('child_parent') == 'child' ) {
|
1489 |
-
berocket_child_load ( $widget_child, $this.parents('.berocket_aapf_widget').data('attribute'), current_value, 'default' );
|
1490 |
-
}
|
1491 |
-
if( !berocket_aapf_child_parent_loaded ) {
|
1492 |
-
berocket_aapf_child_parent_loaded = true;
|
1493 |
-
berocket_product_recount();
|
1494 |
-
}
|
1495 |
-
berocket_reset_button_hide_not();
|
1496 |
-
}
|
1497 |
-
}
|
1498 |
-
|
1499 |
-
berocket_set_slider = function ( i, o ) {
|
1500 |
-
if( ! $(o).hasClass('berocket_slidered') ) {
|
1501 |
-
var all_terms_name;
|
1502 |
-
var all_terms_slug;
|
1503 |
-
var slider_disabled = $(o).data('disabled');
|
1504 |
-
if( slider_disabled ) {
|
1505 |
-
slider_disabled = true;
|
1506 |
-
} else {
|
1507 |
-
slider_disabled = false;
|
1508 |
-
}
|
1509 |
-
$(o).addClass('berocket_slidered').slider({
|
1510 |
-
range: true,
|
1511 |
-
min: parseFloat($(o).data('min')),
|
1512 |
-
max: parseFloat($(o).data('max')),
|
1513 |
-
values: [$(o).data('value1'),$(o).data('value2')],
|
1514 |
-
disabled: slider_disabled,
|
1515 |
-
create: function( event, ui ) {
|
1516 |
-
all_terms_name = $(o).data('all_terms_name');
|
1517 |
-
all_terms_slug = $(o).data('all_terms_slug');
|
1518 |
-
$o = $(o);
|
1519 |
-
var number_style = $(o).data('number_style');
|
1520 |
-
if( ! number_style ) {
|
1521 |
-
number_style = the_ajax_script.number_style;
|
1522 |
-
}
|
1523 |
-
if( $(o).data('all_terms_name') == null ) {
|
1524 |
-
$( '#'+$o.data('fields_1') ).val( berocket_format_number ($(o).data('value1') / $(o).data( 'step' ), number_style ) );
|
1525 |
-
$( '#'+$o.data('fields_2') ).val( berocket_format_number ($(o).data('value2') / $(o).data( 'step' ), number_style ) );
|
1526 |
-
$(o).data('value_1', $(o).data('value1') / $(o).data( 'step' ) );
|
1527 |
-
$(o).data('value_2', $(o).data('value2') / $(o).data( 'step' ) );
|
1528 |
-
} else {
|
1529 |
-
$( '#'+$o.data('fields_1') ).val( all_terms_slug[ $(o).data('value1')>>0 ] );
|
1530 |
-
$( '#'+$o.data('fields_2') ).val( all_terms_slug[ $(o).data('value2')>>0 ] );
|
1531 |
-
$(o).data('value_1', all_terms_name[ $(o).data('value1')>>0 ] );
|
1532 |
-
$(o).data('value_2', all_terms_name[ $(o).data('value2')>>0 ] );
|
1533 |
-
}
|
1534 |
-
}
|
1535 |
-
}).on('slidestop', function( event ){
|
1536 |
-
var $widget_child = '', current_value = false;
|
1537 |
-
if ( $(o).data('min') != $(o).data('value1') || $(o).data('max') != $(o).data('value2') ) {
|
1538 |
-
current_value = [$(o).data('value1'), $(o).data('value2')];
|
1539 |
-
}
|
1540 |
-
if( $(this).parents('.berocket_search_box_block').length == 0 ) {
|
1541 |
-
if ( $(o).parents('.berocket_aapf_widget').data('child_parent') == 'parent' || $(o).parents('.berocket_aapf_widget').data('child_parent') == 'child' ) {
|
1542 |
-
|
1543 |
-
$widget_child = '.'+$(o).parents('.berocket_aapf_widget').data('attribute')+'_child_';
|
1544 |
-
if ( $(o).parents('.berocket_aapf_widget').data('child_parent') == 'parent' ) {
|
1545 |
-
$widget_child += '1';
|
1546 |
-
} else {
|
1547 |
-
$widget_child += ( parseInt( $(o).parents('.berocket_aapf_widget').data('child_parent_depth') ) + 1 );
|
1548 |
-
}
|
1549 |
-
$widget_child = $($widget_child);
|
1550 |
-
berocket_remove_child ( $widget_child );
|
1551 |
-
}
|
1552 |
-
$berocket_aapf_last_changed = $(o);
|
1553 |
-
updateProducts();
|
1554 |
-
if ( $(o).parents('.berocket_aapf_widget').data('child_parent') == 'parent' || $(o).parents('.berocket_aapf_widget').data('child_parent') == 'child' ) {
|
1555 |
-
berocket_child_load ( $widget_child, $(o).parents('.berocket_aapf_widget').data('attribute'), current_value, 'slider' );
|
1556 |
-
}
|
1557 |
-
if( !berocket_aapf_child_parent_loaded ) {
|
1558 |
-
berocket_aapf_child_parent_loaded = true;
|
1559 |
-
berocket_product_recount();
|
1560 |
-
}
|
1561 |
-
berocket_reset_button_hide_not();
|
1562 |
-
}
|
1563 |
-
}).on('slide', function( event, ui ) {
|
1564 |
-
$o = $(ui.handle).parents('div.berocket_filter_slider');
|
1565 |
-
vals = ui.values;
|
1566 |
-
var number_style = $(o).data('number_style');
|
1567 |
-
if( ! number_style ) {
|
1568 |
-
number_style = the_ajax_script.number_style;
|
1569 |
-
}
|
1570 |
-
if( $(o).data('all_terms_name') == null ) {
|
1571 |
-
$( '#'+$o.data('fields_1') ).val( berocket_format_number (vals[0]/$(o).data('step'), number_style) );
|
1572 |
-
$( '#'+$o.data('fields_2') ).val( berocket_format_number (vals[1]/$(o).data('step'), number_style) );
|
1573 |
-
$o.data('value_1', (vals[0]/$(o).data('step')));
|
1574 |
-
$o.data('value_2', (vals[1]/$(o).data('step')));
|
1575 |
-
} else {
|
1576 |
-
$( '#'+$o.data('fields_1') ).val( all_terms_slug[vals[0]] );
|
1577 |
-
$( '#'+$o.data('fields_2') ).val( all_terms_slug[vals[1]] );
|
1578 |
-
$o.data('value_1', all_terms_name[vals[0]]);
|
1579 |
-
$o.data('value_2', all_terms_name[vals[1]]);
|
1580 |
-
}
|
1581 |
-
|
1582 |
-
if ( $o.data('child_parent') != 'child' && $o.data('child_parent') != 'parent' ) {
|
1583 |
-
$('.slide div').each(function( i, obj ) {
|
1584 |
-
if( $(obj).data('taxonomy') == $(o).data('taxonomy') ) {
|
1585 |
-
$(obj).slider("values", vals);
|
1586 |
-
var number_style = $(obj).data('number_style');
|
1587 |
-
if( ! number_style ) {
|
1588 |
-
number_style = the_ajax_script.number_style;
|
1589 |
-
}
|
1590 |
-
if( $(o).data('all_terms_name') == null ) {
|
1591 |
-
$( '#'+$(obj).data('fields_1') ).val( berocket_format_number (vals[0] / $(obj).data( 'step' ), number_style ) );
|
1592 |
-
$( '#'+$(obj).data('fields_2') ).val( berocket_format_number (vals[1] / $(obj).data( 'step' ), number_style ) );
|
1593 |
-
$(obj).data('value_1', (vals[0]/$(o).data('step')));
|
1594 |
-
$(obj).data('value_2', (vals[1]/$(o).data('step')));
|
1595 |
-
} else {
|
1596 |
-
$( '#'+$(obj).data('fields_1') ).val( all_terms_slug[ vals[0] ] );
|
1597 |
-
$( '#'+$(obj).data('fields_2') ).val( all_terms_slug[ vals[1] ] );
|
1598 |
-
$(obj).data('value_1', all_terms_name[vals[0]]);
|
1599 |
-
$(obj).data('value_2', all_terms_name[vals[1]]);
|
1600 |
-
}
|
1601 |
-
}
|
1602 |
-
});
|
1603 |
-
}
|
1604 |
-
});
|
1605 |
-
}
|
1606 |
-
}
|
1607 |
-
berocket_slider_input_val_started = false;
|
1608 |
-
$(document).on('focus', '.berocket_slider_start_val, .berocket_slider_end_val', function() {
|
1609 |
-
if ( ! $(this).is(':disabled') ) {
|
1610 |
-
var slider = $(this).parents('.berocket_aapf_widget').find('.berocket_filter_slider');
|
1611 |
-
var values = slider.slider( "option", "values" );
|
1612 |
-
|
1613 |
-
if( $(this).is('.berocket_slider_start_val') ) {
|
1614 |
-
$(this).val( values[0] ).data('save_val', values[0]);
|
1615 |
-
} else {
|
1616 |
-
$(this).val( values[1] ).data('save_val', values[1]);
|
1617 |
-
}
|
1618 |
-
}
|
1619 |
-
});
|
1620 |
-
$(document).on('focusout', '.berocket_slider_start_val, .berocket_slider_end_val', function() {
|
1621 |
-
if ( ! $(this).is(':disabled') && $(this).data('save_val') == $(this).val() ) {
|
1622 |
-
var slider = $(this).parents('.berocket_aapf_widget').find('.berocket_filter_slider');
|
1623 |
-
var number_style = slider.data('number_style');
|
1624 |
-
if( ! number_style ) {
|
1625 |
-
number_style = the_ajax_script.number_style;
|
1626 |
-
}
|
1627 |
-
|
1628 |
-
$val = $(this).val();
|
1629 |
-
$(this).val( berocket_format_number( $val*1, number_style) );
|
1630 |
-
}
|
1631 |
-
});
|
1632 |
-
$(document).on('change', '.berocket_slider_start_val, .berocket_slider_end_val', function() {
|
1633 |
-
if( ! berocket_slider_input_val_started ) {
|
1634 |
-
berocket_slider_input_val_started = true;
|
1635 |
-
var slider = $(this).parents('.berocket_aapf_widget').find('.berocket_filter_slider');
|
1636 |
-
var values = slider.slider( "option", "values" );
|
1637 |
-
if( $(this).is('.berocket_slider_start_val') ) {
|
1638 |
-
values[0] = $(this).val();
|
1639 |
-
} else {
|
1640 |
-
values[1] = $(this).val();
|
1641 |
-
}
|
1642 |
-
slider.slider( "option", "values", values );
|
1643 |
-
slider
|
1644 |
-
.trigger('slide', {handle:slider.find('.ui-slider-handle').first(), value: values[0], values: values})
|
1645 |
-
.trigger('slide', {handle:slider.find('.ui-slider-handle').last(), value: values[1], values: values})
|
1646 |
-
.trigger('slidestop');
|
1647 |
-
berocket_slider_input_val_started = false;
|
1648 |
-
}
|
1649 |
-
});
|
1650 |
-
|
1651 |
-
$(document).on('click', '.berocket_aapf_widget_selected_area .br_unselect_all', function (event){
|
1652 |
-
event.preventDefault();
|
1653 |
-
br_reset_all_filters();
|
1654 |
-
});
|
1655 |
-
|
1656 |
-
$(document).on('mouseenter', '.berocket_aapf_widget_selected_area a, .berocket_aapf_widget a', function (event){
|
1657 |
-
$(this).addClass('br_hover');
|
1658 |
-
});
|
1659 |
-
|
1660 |
-
$(document).on('mouseleave', '.berocket_aapf_widget_selected_area a, .berocket_aapf_widget a', function (event){
|
1661 |
-
$(this).removeClass('br_hover');
|
1662 |
-
});
|
1663 |
-
|
1664 |
-
$(document).on('click', '.berocket_aapf_widget_selected_area a:not(.br_unselect_all)', function (event){
|
1665 |
-
event.preventDefault();
|
1666 |
-
$obj = $(this);
|
1667 |
-
berocket_unselect_all = true;
|
1668 |
-
var el_type = $obj.data('el_type');
|
1669 |
-
var el_id = $obj.data('el_id');
|
1670 |
-
var taxonomy = $obj.data('el_taxonomy');
|
1671 |
-
reset_filter(el_type, el_id, taxonomy);
|
1672 |
-
berocket_unselect_all = false;
|
1673 |
-
updateProducts(true);
|
1674 |
-
});
|
1675 |
-
|
1676 |
-
$(document).on('click', '.berocket_aapf_reset_button', function() {
|
1677 |
-
br_reset_all_filters();
|
1678 |
-
});
|
1679 |
-
|
1680 |
-
br_reset_all_filters = function () {
|
1681 |
-
berocket_unselect_all = true;
|
1682 |
-
reset_info = get_widget_selected_filters();
|
1683 |
-
reset_info.forEach(function(element) {
|
1684 |
-
reset_filter(element.type, element.id, element.taxonomy);
|
1685 |
-
});
|
1686 |
-
berocket_unselect_all = false;
|
1687 |
-
updateProducts(true);
|
1688 |
-
}
|
1689 |
-
|
1690 |
-
function reset_filter(el_type, el_id, taxonomy) {
|
1691 |
-
$berocket_aapf_last_changed = $('.berocket_aapf_widget li').first();
|
1692 |
-
if ( el_type == 'checkbox' || el_type == 'color' || el_type == 'radio' ) {
|
1693 |
-
if( $('.' + el_id).prop('checked') ) {
|
1694 |
-
$('.' + el_id).first().parents('li').first().find('label').trigger('click');
|
1695 |
-
}
|
1696 |
-
} else if ( el_type == 'select' ) {
|
1697 |
-
$( 'select.'+taxonomy ).find('option.select_'+el_id).prop('selected', false);
|
1698 |
-
$( 'select.'+taxonomy ).trigger('change.select2');
|
1699 |
-
updateProducts();
|
1700 |
-
} else if ( el_type == 'slider' ) {
|
1701 |
-
$slider = $('#'+el_id).closest('li').find('.berocket_filter_slider');
|
1702 |
-
|
1703 |
-
var val1 = parseFloat($slider.data('min'));
|
1704 |
-
var val2 = parseFloat($slider.data('max'));
|
1705 |
-
|
1706 |
-
ui = {handle:$slider.children(), values:[val1,val2]};
|
1707 |
-
$slider.slider( "values", [ val1, val2 ] ).trigger('slide', ui);
|
1708 |
-
|
1709 |
-
updateProducts();
|
1710 |
-
} else if ( el_type == '_date' ) {
|
1711 |
-
$date = $('.'+el_id+'.berocket_date_picker');
|
1712 |
-
|
1713 |
-
var val1 = $date.data('min');
|
1714 |
-
var val2 = $date.data('max');
|
1715 |
-
|
1716 |
-
berocket_unselect_all = true;
|
1717 |
-
$('.'+el_id+'.br_start_date').val(val1).trigger('change');
|
1718 |
-
$('.'+el_id+'.br_end_date').val(val2).trigger('change');
|
1719 |
-
berocket_unselect_all = false;
|
1720 |
-
|
1721 |
-
updateProducts();
|
1722 |
-
}
|
1723 |
-
}
|
1724 |
-
|
1725 |
-
$(document).on('click', '.berocket_aapf_widget_update_button', function (event) {
|
1726 |
-
event.preventDefault();
|
1727 |
-
updateProducts(true);
|
1728 |
-
});
|
1729 |
-
|
1730 |
-
$(document).on('click', '.berocket_label_widgets', function(event) {
|
1731 |
-
if( $(this).parents('li').first().find('input').attr('type') == 'checkbox' || $(this).parents('li').first().find('input').attr('type') == 'radio' ) {
|
1732 |
-
event.preventDefault();
|
1733 |
-
event.stopPropagation();
|
1734 |
-
$(this).parents('span').first().find('input').trigger('change');
|
1735 |
-
}
|
1736 |
-
});
|
1737 |
-
|
1738 |
-
$(document).on( 'click', '.berocket_aapf_widget-title_div:not(".disable_collapse")', function( event ) {
|
1739 |
-
event.preventDefault();
|
1740 |
-
if( $(window).width() > 768 && $(this).parents('.berocket_inline_clickable_hover.berocket_single_filter_visible').length ) {
|
1741 |
-
return false;
|
1742 |
-
}
|
1743 |
-
$(this).trigger('br_showhide');
|
1744 |
-
});
|
1745 |
-
|
1746 |
-
$(document).on( 'br_showhide', '.berocket_aapf_widget-title_div:not(".disable_collapse")', function( event ) {
|
1747 |
-
var widget_block = $(this).next('.berocket_aapf_widget');
|
1748 |
-
$(this).parents('.berocket_single_filter_widget').data('showbutton', widget_block.css('display') == 'none');
|
1749 |
-
if(widget_block.css('display') == 'none')
|
1750 |
-
{
|
1751 |
-
widget_block.parents('.berocket_single_filter_widget').first().removeClass('berocket_single_filter_hidden').addClass('berocket_single_filter_visible');
|
1752 |
-
widget_block.slideDown(0, function(){widget_block.find('.mCSB_container').css('width', '');});
|
1753 |
-
$(this).find('span').removeClass('show_button').addClass('hide_button');
|
1754 |
-
$(this).parents('.berocket_single_filter_widget').data('showbutton', 'hide');
|
1755 |
-
}
|
1756 |
-
else
|
1757 |
-
{
|
1758 |
-
widget_block.parents('.berocket_single_filter_widget').first().removeClass('berocket_single_filter_visible').addClass('berocket_single_filter_hidden');
|
1759 |
-
widget_block.slideUp(0);
|
1760 |
-
if( typeof(widget_block.find('select').select2) == 'function' && widget_block.find('select').data('select2') ) {
|
1761 |
-
widget_block.find('select').select2("close");
|
1762 |
-
}
|
1763 |
-
$(this).find('span').removeClass('hide_button').addClass('show_button');
|
1764 |
-
$(this).parents('.berocket_single_filter_widget').data('showbutton', 'show');
|
1765 |
-
}
|
1766 |
-
});
|
1767 |
-
$(document).on( 'click', '.berocket_aapf_widget .berocket_widget_show_values', function( event ) {
|
1768 |
-
event.preventDefault();
|
1769 |
-
var widget_block = $(this).parents('.berocket_single_filter_widget');
|
1770 |
-
if(widget_block.hasClass('show_o_sel_values'))
|
1771 |
-
{
|
1772 |
-
widget_block.removeClass('show_o_sel_values');
|
1773 |
-
}
|
1774 |
-
else
|
1775 |
-
{
|
1776 |
-
widget_block.addClass('show_o_sel_values');
|
1777 |
-
}
|
1778 |
-
berocket_widget_show_values_text(widget_block);
|
1779 |
-
});
|
1780 |
-
|
1781 |
-
function berocket_widget_show_values_text($widget) {
|
1782 |
-
var $this = $widget.find('.berocket_widget_show_values');
|
1783 |
-
var widget_block = $this.parents('.berocket_single_filter_widget');
|
1784 |
-
if(widget_block.hasClass('show_o_sel_values')) {
|
1785 |
-
$this.html(the_ajax_script.translate.hide_value+'<span class="hide_button fa"></span>');
|
1786 |
-
} else {
|
1787 |
-
$this.html(the_ajax_script.translate.show_value+'<span class="show_button fa"></span>');
|
1788 |
-
}
|
1789 |
-
}
|
1790 |
-
|
1791 |
-
$(document).on( the_ajax_script.description_show, '.berocket_aapf_widget-title_div .berocket_aapf_description i', function( event ) {
|
1792 |
-
event.preventDefault();
|
1793 |
-
event.stopPropagation();
|
1794 |
-
$('.berocket_aapf_description_div').remove();
|
1795 |
-
if( $('.berocket_aapf_description_div').length == 0 ) {
|
1796 |
-
$block = $(this).next().clone();
|
1797 |
-
$block.addClass( 'berocket_aapf_description_div' ).hide();
|
1798 |
-
$('body').append($block);
|
1799 |
-
i_top = ( $(this).offset().top - $(document).scrollTop() ) + ( $(this).height() / 2 );
|
1800 |
-
i_left = $(this).offset().left;
|
1801 |
-
top_px = parseInt( i_top + $( document ).scrollTop() );
|
1802 |
-
if( i_top >= (window.innerHeight / 2) ) {
|
1803 |
-
top_px -= ( $block.outerHeight() );
|
1804 |
-
top_px += 22;
|
1805 |
-
top_side = 'bottom';
|
1806 |
-
} else {
|
1807 |
-
top_side = 'top';
|
1808 |
-
top_px -= 22;
|
1809 |
-
}
|
1810 |
-
|
1811 |
-
side_px = i_left;
|
1812 |
-
if( i_left < (window.innerWidth / 2) ) {
|
1813 |
-
side_px += $(this).width();
|
1814 |
-
side = 'left';
|
1815 |
-
deside = 'right';
|
1816 |
-
bottom_side = 'top';
|
1817 |
-
side_px += 9;
|
1818 |
-
} else {
|
1819 |
-
side = 'right';
|
1820 |
-
deside = 'left';
|
1821 |
-
bottom_side = 'bottom';
|
1822 |
-
side_px = (window.innerWidth - side_px) - 3;
|
1823 |
-
}
|
1824 |
-
$block.addClass( 'berocket_aapf_description_div_'+top_side+'_'+side ).addClass( 'berocket_aapf_description_div' ).css( 'top', top_px ).css( side, side_px );
|
1825 |
-
$block.find('.berocket_aapf_description_arrow').css('border-'+deside, '0').css('border-'+bottom_side, '0');
|
1826 |
-
$block.show();
|
1827 |
-
}
|
1828 |
-
});
|
1829 |
-
|
1830 |
-
$(document).on( the_ajax_script.description_hide, '.berocket_aapf_widget-title_div .berocket_aapf_description i', function( event ) {
|
1831 |
-
event.preventDefault();
|
1832 |
-
event.stopPropagation();
|
1833 |
-
to_element = event.toElement || event.relatedTarget;
|
1834 |
-
if ( the_ajax_script.description_hide == 'mouseleave' && $(to_element).parents('.berocket_aapf_description_div').length == 0) {
|
1835 |
-
$('.berocket_aapf_description_div').remove();
|
1836 |
-
}
|
1837 |
-
});
|
1838 |
-
|
1839 |
-
$(document).on(the_ajax_script.description_hide, '.berocket_aapf_description_div', function( event ) {
|
1840 |
-
event.preventDefault();
|
1841 |
-
event.stopPropagation();
|
1842 |
-
if ( the_ajax_script.description_hide == 'mouseleave' ) {
|
1843 |
-
$(this).remove();
|
1844 |
-
}
|
1845 |
-
});
|
1846 |
-
|
1847 |
-
$(document).on(the_ajax_script.description_hide, function() {
|
1848 |
-
$('.berocket_aapf_description_div').remove();
|
1849 |
-
});
|
1850 |
-
|
1851 |
-
function berocket_aapf_widget_loading() {
|
1852 |
-
if( $('.berocket_aapf_widget_loading').length > 0 ) {
|
1853 |
-
loading_top = ( ( $(document).scrollTop() + ( window.innerHeight / 2 ) ) - $('.berocket_aapf_widget_loading').offset().top );
|
1854 |
-
if ( loading_top < 100 || $('.berocket_aapf_widget_loading').height() < 200 ) {
|
1855 |
-
loading_top = 100;
|
1856 |
-
} else if ( loading_top > ( $('.berocket_aapf_widget_loading').height() - $('.berocket_aapf_widget_loading_container').height() ) ) {
|
1857 |
-
loading_top = $('.berocket_aapf_widget_loading').height() - $('.berocket_aapf_widget_loading_container').height();
|
1858 |
-
}
|
1859 |
-
$('.berocket_aapf_widget_loading_container').css('top', loading_top);
|
1860 |
-
}
|
1861 |
-
$('.berocket_aapf_description_div').remove();
|
1862 |
-
}
|
1863 |
-
$(document).scroll( berocket_aapf_widget_loading );
|
1864 |
-
$(document).on( 'click', function( event ) {
|
1865 |
-
$('.berocket_aapf_product_count_desc').remove();
|
1866 |
-
});
|
1867 |
-
|
1868 |
-
window.onpopstate = function(event) {
|
1869 |
-
if ( event.state != null && event.state.BeRocket == 'Rules' ) {
|
1870 |
-
location.reload();
|
1871 |
-
}
|
1872 |
-
};
|
1873 |
-
$(document).on('click', '.berocket_search_box_button', function() {
|
1874 |
-
var search_url = $(this).data('url');
|
1875 |
-
if( the_ajax_script.current_page_url == search_url
|
1876 |
-
|| the_ajax_script.current_page_url.slice(-1) == '/'
|
1877 |
-
&& the_ajax_script.current_page_url.slice(0, -1) == search_url
|
1878 |
-
|| search_url.slice(-1) == '/'
|
1879 |
-
&& the_ajax_script.current_page_url == search_url.slice(0, -1) ) {
|
1880 |
-
update_data_containers();
|
1881 |
-
updateProducts(true, true);
|
1882 |
-
} else {
|
1883 |
-
update_data_containers(true, $(this).parents('.berocket_search_box_block'));
|
1884 |
-
args = {
|
1885 |
-
current_language: the_ajax_script.current_language,
|
1886 |
-
terms: berocket_aapf_widget_product_filters,
|
1887 |
-
price: berocket_aapf_widget_product_price_limit,
|
1888 |
-
limits: berocket_aapf_widget_product_limits,
|
1889 |
-
product_cat: the_ajax_script.product_cat,
|
1890 |
-
product_taxonomy: the_ajax_script.product_taxonomy,
|
1891 |
-
action: 'berocket_aapf_listener',
|
1892 |
-
orderby: $('.woocommerce-ordering select.orderby').val(),
|
1893 |
-
attributes: [],
|
1894 |
-
cat_limit: [],
|
1895 |
-
location: $(this).data('url'),
|
1896 |
-
};
|
1897 |
-
the_ajax_script.current_page_url = search_url;
|
1898 |
-
location.href = updateLocation(args, true, true);
|
1899 |
-
}
|
1900 |
-
});
|
1901 |
-
|
1902 |
-
// Option to take control over (default) sorting, make it AJAXy and work with filters
|
1903 |
-
if( the_ajax_script.control_sorting ) {
|
1904 |
-
$(document).on('submit', 'form.woocommerce-ordering', function (event) {
|
1905 |
-
event.preventDefault();
|
1906 |
-
});
|
1907 |
-
$(document).on('change', 'select.orderby', function (event) {
|
1908 |
-
event.preventDefault();
|
1909 |
-
$('select.orderby').val($(this).val());
|
1910 |
-
updateProducts(true);
|
1911 |
-
});
|
1912 |
-
}
|
1913 |
-
|
1914 |
-
berocket_reset_button_hide_not = function() {
|
1915 |
-
jQuery('.berocket_single_filter_widget .berocket_aapf_reset_button').parents('.berocket_aapf_widget').show();
|
1916 |
-
if( ! jQuery('.berocket_aapf_widget-wrapper:not(".berocket_hiden_without_visible_values")').length ) {
|
1917 |
-
jQuery('.berocket_single_filter_widget.berocket_no_filters .berocket_aapf_reset_button').parents('.berocket_aapf_widget').hide();
|
1918 |
-
}
|
1919 |
-
if( get_widget_selected_filters().length ) {
|
1920 |
-
jQuery('.berocket_single_filter_widget .berocket_aapf_reset_button').parents('.berocket_aapf_widget').show();
|
1921 |
-
} else {
|
1922 |
-
jQuery('.berocket_single_filter_widget.berocket_not_selected .berocket_aapf_reset_button').parents('.berocket_aapf_widget').hide();
|
1923 |
-
}
|
1924 |
-
}
|
1925 |
-
|
1926 |
-
berocket_filters_first_load = function() {
|
1927 |
-
if( $(window).width() <= 767 ) {
|
1928 |
-
$('.bapf_sngl_hd_mobile').remove();
|
1929 |
-
}
|
1930 |
-
if( $(window).width() > 767 && $(window).width() <= 1024 ) {
|
1931 |
-
$('.bapf_sngl_hd_tablet').remove();
|
1932 |
-
}
|
1933 |
-
if( $(window).width() > 1024 ) {
|
1934 |
-
$('.bapf_sngl_hd_desktop').remove();
|
1935 |
-
}
|
1936 |
-
if( $('.berocket_wc_shortcode_fix').length ) {
|
1937 |
-
berocket_new_product_recount($('.berocket_wc_shortcode_fix'));
|
1938 |
-
$('.berocket_wc_shortcode_fix').html('');
|
1939 |
-
}
|
1940 |
-
if( $(the_ajax_script.pagination_class).length > 0 ){
|
1941 |
-
woocommerce_pagination_page = parseInt( $(the_ajax_script.pagination_class+' .current').first().text() );
|
1942 |
-
if( woocommerce_pagination_page < 1 ) woocommerce_pagination_page = 1;
|
1943 |
-
}
|
1944 |
-
|
1945 |
-
if( $('.berocket_aapf_widget_update_button').hasClass('berocket_aapf_widget_update_button') ){
|
1946 |
-
berocket_aapf_widget_wait_for_button = true;
|
1947 |
-
} else {
|
1948 |
-
berocket_aapf_widget_wait_for_button = false;
|
1949 |
-
}
|
1950 |
-
|
1951 |
-
$( ".berocket_filter_slider" ).each(function (i,o){
|
1952 |
-
berocket_set_slider ( i, o );
|
1953 |
-
});
|
1954 |
-
|
1955 |
-
$(".berocket_aapf_widget_height_control").each(function (i,o){
|
1956 |
-
if( ! $(o).hasClass('br_height_controled') ) {
|
1957 |
-
$(o).css('height', $(o).height()).mCustomScrollbar({
|
1958 |
-
axis: "y",
|
1959 |
-
theme: $(o).data('scroll_theme'),
|
1960 |
-
scrollInertia: 300
|
1961 |
-
}).addClass('br_height_controled');
|
1962 |
-
berocket_custom_scroll_bar_init();
|
1963 |
-
}
|
1964 |
-
});
|
1965 |
-
|
1966 |
-
update_data_containers();
|
1967 |
-
update_selected_area();
|
1968 |
-
|
1969 |
-
if( the_ajax_script.hide_empty_value ) {
|
1970 |
-
jQuery('.berocket_aapf_widget:not(.berocket_aapf_widget_selected_area)').each(function(i, o) {
|
1971 |
-
if( jQuery(o).parents('.berocket_search_box_block').parents('.berocket_search_box_block').length == 0 && jQuery(o).parents('.br_child_parent_wrapper').length == 0 ) {
|
1972 |
-
if( jQuery(o).find('li').not('.berocket_widget_show_values').length == jQuery(o).find('li.berocket_hide_o_value').length ) {
|
1973 |
-
jQuery(o).parents('.berocket_aapf_widget-wrapper').addClass('berocket_hiden_without_visible_values').hide();
|
1974 |
-
} else {
|
1975 |
-
jQuery(o).parents('.berocket_aapf_widget-wrapper').removeClass('berocket_hiden_without_visible_values').show();
|
1976 |
-
}
|
1977 |
-
}
|
1978 |
-
});
|
1979 |
-
}
|
1980 |
-
if( the_ajax_script.use_select2 && $(".berocket_aapf_widget select").length && typeof $(".berocket_aapf_widget select").select2 == 'function' ) {
|
1981 |
-
$(".berocket_aapf_widget select").select2({width:'100%'});
|
1982 |
-
}
|
1983 |
-
berocket_reset_button_hide_not();
|
1984 |
-
$(document).trigger('berocket_filters_first_load');
|
1985 |
-
}
|
1986 |
-
berocket_filters_first_load();
|
1987 |
-
$(document).on('click', '.br_child_toggle', function() {
|
1988 |
-
hide_child_attributes($(this));
|
1989 |
-
});
|
1990 |
-
function hide_child_attributes($button, show_child) {
|
1991 |
-
var term_id = $button.data('term_id');
|
1992 |
-
var $blocks = $button.parents('.berocket_aapf_widget').find('.berocket_term_parent_' + term_id);
|
1993 |
-
if( typeof(show_child) == 'undefined' ) {
|
1994 |
-
show_child = false;
|
1995 |
-
if( $blocks.is('.berocket_hide_child_attributes') ) {
|
1996 |
-
show_child = true;
|
1997 |
-
}
|
1998 |
-
}
|
1999 |
-
$blocks.each(function(i, o) {
|
2000 |
-
if( show_child ) {
|
2001 |
-
$(o).removeClass('berocket_hide_child_attributes');
|
2002 |
-
} else {
|
2003 |
-
$(o).addClass('berocket_hide_child_attributes');
|
2004 |
-
hide_child_attributes($(o).find('.br_child_toggle'), show_child);
|
2005 |
-
}
|
2006 |
-
});
|
2007 |
-
$button.find('.fa').removeClass('fa-plus').removeClass('fa-minus');
|
2008 |
-
if( show_child ) {
|
2009 |
-
$button.find('.fa').addClass('fa-minus');
|
2010 |
-
} else {
|
2011 |
-
$button.find('.fa').addClass('fa-plus');
|
2012 |
-
}
|
2013 |
-
}
|
2014 |
-
});
|
2015 |
-
})(jQuery);
|
2016 |
-
|
2017 |
-
function berocket_format_number (number, number_style) {
|
2018 |
-
if( typeof number_style == 'undefined' ) {
|
2019 |
-
number_style = the_ajax_script.number_style;
|
2020 |
-
}
|
2021 |
-
var num = number.toFixed(number_style[2]);
|
2022 |
-
num = num.toString();
|
2023 |
-
var decimal = num.split('.');
|
2024 |
-
var new_number = decimal[0];
|
2025 |
-
if(num.indexOf('.') != -1)
|
2026 |
-
{
|
2027 |
-
decimal = decimal[1];
|
2028 |
-
}
|
2029 |
-
new_number = new_number.replace(/\d(?=(?:\d{3})+(?:$))/g, function($0, i){
|
2030 |
-
return $0+number_style[0];
|
2031 |
-
});
|
2032 |
-
if(num.indexOf('.') != -1)
|
2033 |
-
{
|
2034 |
-
new_number = new_number+number_style[1]+decimal;
|
2035 |
-
}
|
2036 |
-
return new_number;
|
2037 |
-
}
|
2038 |
-
function berocket_remove_child( $widget, show_previous ) {
|
2039 |
-
if( typeof(show_previous) == 'undefined' ) {
|
2040 |
-
show_previous = true;
|
2041 |
-
}
|
2042 |
-
$widget_child = '.'+jQuery($widget).data('attribute')+'_child_';
|
2043 |
-
$place = $widget.find('.berocket_child_parent_sample');
|
2044 |
-
$widget_child_number = parseInt( jQuery($widget).data('child_parent_depth') ) ;
|
2045 |
-
while( jQuery( $widget_child + $widget_child_number ).length > 0 ) {
|
2046 |
-
$widget_removed = $widget_child + $widget_child_number;
|
2047 |
-
jQuery( $widget_removed ).find('.berocket_widget_show_values').hide();
|
2048 |
-
jQuery( $widget_removed ).find( 'li' ).each( function ( i, o ) {
|
2049 |
-
if( ! jQuery(o).is('.berocket_child_parent_sample') && jQuery(o).parents('.berocket_child_parent_sample').length == 0 && ! jQuery(o).is('.berocket_widget_show_values') ) {
|
2050 |
-
jQuery(o).remove();
|
2051 |
-
}
|
2052 |
-
});
|
2053 |
-
$widget_child_number++;
|
2054 |
-
if( show_previous ) {
|
2055 |
-
var previous = jQuery( $widget_removed ).parents('.berocket_aapf_widget-wrapper').find('.berocket_child_previous');
|
2056 |
-
var $place = jQuery( $widget_removed ).find('.berocket_child_parent_sample');
|
2057 |
-
previous = '<li>'+previous.html()+'</li>';
|
2058 |
-
$place.after(previous);
|
2059 |
-
} else {
|
2060 |
-
break;
|
2061 |
-
}
|
2062 |
-
}
|
2063 |
-
}
|
2064 |
-
|
2065 |
-
function berocket_child_load ( $widget, taxonomy, term_id, type ) {
|
2066 |
-
if( term_id !== false && (term_id.length > 1 || term_id[0]) != false && $widget.length > 0 && term_id.length > 0 ) {
|
2067 |
-
term_id = JSON.stringify(term_id);
|
2068 |
-
data = {action: 'br_aapf_get_child',taxonomy: taxonomy, term_id: term_id, type: type};
|
2069 |
-
terms = false;
|
2070 |
-
jQuery.ajax({
|
2071 |
-
url: the_ajax_script.ajaxurl,
|
2072 |
-
data: data,
|
2073 |
-
type: 'POST',
|
2074 |
-
success: function (data) {
|
2075 |
-
terms = data;
|
2076 |
-
},
|
2077 |
-
dataType: 'json',
|
2078 |
-
async: false
|
2079 |
-
});
|
2080 |
-
berocket_remove_child( $widget, false );
|
2081 |
-
berocket_child_replace ( $widget, terms );
|
2082 |
-
if( the_ajax_script.use_select2 && jQuery(".berocket_aapf_widget select").length && typeof jQuery(".berocket_aapf_widget select").select2 == 'function' ) {
|
2083 |
-
jQuery(".berocket_aapf_widget select").select2({width:'100%'});
|
2084 |
-
}
|
2085 |
-
}
|
2086 |
-
}
|
2087 |
-
|
2088 |
-
function berocket_child_replace ( $widget, terms ) {
|
2089 |
-
$widget = jQuery($widget);
|
2090 |
-
var html_sample = $widget.find('.berocket_child_parent_sample ul').html();
|
2091 |
-
var $place = $widget.find('.berocket_child_parent_sample');
|
2092 |
-
var select = false;
|
2093 |
-
var html_single = '';
|
2094 |
-
if( terms.length > 0 ) {
|
2095 |
-
if ( $widget.data('type') == 'slider' ) {
|
2096 |
-
if( terms.length > 1 ) {
|
2097 |
-
var element = html_sample.replace( /R__term_id__R/g, terms[0].term_id );
|
2098 |
-
element = element.replace( /R__count__R/g, terms[0].count );
|
2099 |
-
element = element.replace( /R__slug__R/g, terms[0].slug );
|
2100 |
-
element = element.replace( /R__name__R/g, terms[0].name );
|
2101 |
-
element = element.replace( /R__taxonomy__R/g, terms[0].taxonomy );
|
2102 |
-
element = element.replace( /R__class__R/g, terms[0].r_class );
|
2103 |
-
allterms = [];
|
2104 |
-
for ( i = 0; i < terms.length; i++ ) {
|
2105 |
-
allterms.push(terms[i].name);
|
2106 |
-
}
|
2107 |
-
element = element.replace( /R__min__R/g, 0 );
|
2108 |
-
element = element.replace( /R__value1__R/g, 0 );
|
2109 |
-
element = element.replace( /R__max__R/g, ( allterms.length - 1 ) );
|
2110 |
-
element = element.replace( /R__value2__R/g, ( allterms.length - 1 ) );
|
2111 |
-
element = element.replace( /"R__allterm__R"/g, "'"+JSON.stringify(allterms)+"'" );
|
2112 |
-
$element = jQuery(element);
|
2113 |
-
$place.after($element);
|
2114 |
-
|
2115 |
-
berocket_set_slider ( 0, $widget.find('.berocket_filter_slider').last() );
|
2116 |
-
}
|
2117 |
-
} else {
|
2118 |
-
if ( $widget.find('.berocket_child_parent_sample').is('.select') ) {
|
2119 |
-
multiple = false;
|
2120 |
-
if( $widget.find('.berocket_child_parent_sample').is('.multiple') ) {
|
2121 |
-
multiple = true;
|
2122 |
-
}
|
2123 |
-
select = true;
|
2124 |
-
html_sample = html_sample.replace( /<ul/g, '<select' );
|
2125 |
-
html_sample = html_sample.replace( /<\/ul>/g, '</select>' );
|
2126 |
-
html_sample = html_sample.replace( /<li/g, '<option' );
|
2127 |
-
html_sample = html_sample.replace( /<\/li>/g, '</option>' );
|
2128 |
-
html_sample = '<li>' + html_sample + '</li>';
|
2129 |
-
if( multiple ) {
|
2130 |
-
html_single = html_sample.split('<option')[1];
|
2131 |
-
html_single = html_single.split('</option>')[0];
|
2132 |
-
html_single = '<option' + html_single + '</option>';
|
2133 |
-
} else {
|
2134 |
-
html_single = html_sample.split('</option>')[1]+'</option>';
|
2135 |
-
}
|
2136 |
-
}
|
2137 |
-
for( i = 0; i < terms.length; i++ ) {
|
2138 |
-
var element = html_sample;
|
2139 |
-
element = element.replace( /R__term_id__R/g, terms[i].term_id );
|
2140 |
-
element = element.replace( /R__count__R/g, terms[i].count );
|
2141 |
-
element = element.replace( /R__slug__R/g, terms[i].slug );
|
2142 |
-
element = element.replace( /R__name__R/g, terms[i].name );
|
2143 |
-
element = element.replace( /R__taxonomy__R/g, terms[i].taxonomy );
|
2144 |
-
element = element.replace( /R__class__R/g, terms[i].r_class );
|
2145 |
-
element = element.replace( /#R/g, '#'+terms[i].color );
|
2146 |
-
$element = jQuery(element);
|
2147 |
-
$place.after($element);
|
2148 |
-
if ( select && i == 0 ) {
|
2149 |
-
html_sample = html_single;
|
2150 |
-
$place = $widget.find('select option').last();
|
2151 |
-
}
|
2152 |
-
}
|
2153 |
-
}
|
2154 |
-
} else {
|
2155 |
-
var no_values = $widget.parents('.berocket_aapf_widget-wrapper').find('.berocket_child_no_values').html();
|
2156 |
-
no_values = '<li>'+no_values+'</li>';
|
2157 |
-
$place.after(no_values);
|
2158 |
-
}
|
2159 |
-
}
|
2160 |
-
|
2161 |
-
function load_hash_test() {
|
2162 |
-
hash = location.hash;
|
2163 |
-
test_loc = location.href;
|
2164 |
-
if( test_loc.indexOf('#') != -1 ) {
|
2165 |
-
test_loc = test_loc.split('#');
|
2166 |
-
test_loc = test_loc[0];
|
2167 |
-
}
|
2168 |
-
reload = false;
|
2169 |
-
var filtersRegex = /filters=\((.*)\)/;
|
2170 |
-
if( ( filters_hash = filtersRegex.exec(hash) ) != null ) {
|
2171 |
-
if( test_loc.indexOf('?') != -1 ) {
|
2172 |
-
href_param = test_loc.split('?');
|
2173 |
-
if(href_param[1].indexOf('filters=') != -1) {
|
2174 |
-
href_params_array = href_param[1].split('&');
|
2175 |
-
for( var i = 0; i < href_params_array.length; i++ ) {
|
2176 |
-
if( href_params_array[i].indexOf('filters=') != -1) {
|
2177 |
-
test_loc = test_loc.replace(href_params_array[i],filters_hash[1]).replace('&&','&');
|
2178 |
-
}
|
2179 |
-
}
|
2180 |
-
} else {
|
2181 |
-
test_loc = test_loc+"&"+filters_hash[1];
|
2182 |
-
}
|
2183 |
-
} else {
|
2184 |
-
test_loc = test_loc+"?"+filters_hash[1];
|
2185 |
-
}
|
2186 |
-
reload = true;
|
2187 |
-
}
|
2188 |
-
var filtersRegex = /paged=([0-9]+)/;
|
2189 |
-
if( ( filters_hash = filtersRegex.exec(hash) ) != null ) {
|
2190 |
-
if( location.hash != "") {
|
2191 |
-
location.hash = "";
|
2192 |
-
test_loc = location.href;
|
2193 |
-
}
|
2194 |
-
if( test_loc.indexOf('?') != -1 ) {
|
2195 |
-
href_param = test_loc.split('?');
|
2196 |
-
if(href_param[1].indexOf('paged=') != -1) {
|
2197 |
-
href_params_array = href_param[1].split('&');
|
2198 |
-
for( var i = 0; i < href_params_array.length; i++ ) {
|
2199 |
-
if( href_params_array[i].indexOf('filters=') != -1) {
|
2200 |
-
test_loc = test_loc.replace(href_params_array[i],filters_hash[0]).replace('&&','&');
|
2201 |
-
}
|
2202 |
-
}
|
2203 |
-
} else {
|
2204 |
-
test_loc = test_loc+"&"+filters_hash[0];
|
2205 |
-
}
|
2206 |
-
} else {
|
2207 |
-
test_loc = test_loc+"?"+filters_hash[0];
|
2208 |
-
}
|
2209 |
-
reload = true;
|
2210 |
-
}
|
2211 |
-
if(reload) {
|
2212 |
-
location.href = test_loc;
|
2213 |
-
}
|
2214 |
-
}
|
2215 |
-
load_hash_test();
|
2216 |
-
(function ($){
|
2217 |
-
function berocket_rewidth_inline_filters(cfunc) {
|
2218 |
-
$('.berocket_single_filter_widget.berocket_hidden_clickable').each(function() {
|
2219 |
-
$(this).removeClass('berocket_hidden_clickable_left').removeClass('berocket_hidden_clickable_right');
|
2220 |
-
var position = $(this).offset().left + $(this).outerWidth();
|
2221 |
-
var width = $(window).width();
|
2222 |
-
if( position < width/2 ) {
|
2223 |
-
$(this).addClass('berocket_hidden_clickable_left');
|
2224 |
-
} else {
|
2225 |
-
$(this).addClass('berocket_hidden_clickable_right');
|
2226 |
-
}
|
2227 |
-
});
|
2228 |
-
while( $('.berocket_single_filter_widget.berocket_inline_filters:not(".berocket_inline_filters_rewidth")').length ) {
|
2229 |
-
$element = $('.berocket_single_filter_widget.berocket_inline_filters:not(".berocket_inline_filters_rewidth")').first();
|
2230 |
-
width_to_set = '12.5%!important';
|
2231 |
-
$style = $element.attr('style');
|
2232 |
-
if( typeof($style) == 'undefined' ) {
|
2233 |
-
$style = '';
|
2234 |
-
}
|
2235 |
-
$style = $style.replace(/width:\s?(\d|\.)+%!important;/g, '');
|
2236 |
-
$style = $style.replace(/clear:both!important;/g, '');
|
2237 |
-
$style = $style.replace(/opacity:0!important;/g, '');
|
2238 |
-
$element.attr('style', $style);
|
2239 |
-
min_width = 200;
|
2240 |
-
var min_filter_width_inline = $element.data('min_filter_width_inline');
|
2241 |
-
if( min_filter_width_inline ) {
|
2242 |
-
min_width = parseInt(min_filter_width_inline);
|
2243 |
-
}
|
2244 |
-
every_clear = 9;
|
2245 |
-
$(document).trigger('berocket_inline_before_width_calculate');
|
2246 |
-
var check_array = [];
|
2247 |
-
check_array.push({clear:2, size:(min_width/4), width:100, block:'.berocket_inline_filters_count_1'});
|
2248 |
-
check_array.push({clear:3, size:(min_width/2.5), width:50, block:'.berocket_inline_filters_count_2'});
|
2249 |
-
check_array.push({clear:4, size:(min_width/2), width:33.333, block:'.berocket_inline_filters_count_3'});
|
2250 |
-
check_array.push({clear:5, size:(min_width/1.6), width:25, block:'.berocket_inline_filters_count_4'});
|
2251 |
-
check_array.push({clear:6, size:(min_width/1.32), width:20, block:'.berocket_inline_filters_count_5'});
|
2252 |
-
check_array.push({clear:7, size:(min_width/1.14), width:16.666, block:'.berocket_inline_filters_count_6'});
|
2253 |
-
check_array.push({clear:8, size:(min_width), width:14.285, block:'.berocket_inline_filters_count_7'});
|
2254 |
-
check_array.some(function(element) {
|
2255 |
-
if( $element.outerWidth() < element.size || $element.is(element.block) ) {
|
2256 |
-
every_clear = element.clear;
|
2257 |
-
width_to_set = element.width+'%!important';
|
2258 |
-
return true;
|
2259 |
-
}
|
2260 |
-
});
|
2261 |
-
$(document).trigger('berocket_inline_after_width_calculate');
|
2262 |
-
var element_i = 0;
|
2263 |
-
while($element.is('.berocket_single_filter_widget.berocket_inline_filters:not(".berocket_inline_filters_rewidth")') ) {
|
2264 |
-
$style = $element.attr('style');
|
2265 |
-
if(typeof($style) == 'undefined' ) {
|
2266 |
-
$style = '';
|
2267 |
-
}
|
2268 |
-
$style = $style.replace(/width:\s?(\d|\.)+%\s?!important;/g, '');
|
2269 |
-
$style = $style.replace(/clear:\s?both\s?!important;/g, '');
|
2270 |
-
$style = $style.replace(/opacity:\s?0\s?!important;/g, '');
|
2271 |
-
$style = $style+'width:'+width_to_set+';';
|
2272 |
-
element_i++;
|
2273 |
-
if( element_i == every_clear ) {
|
2274 |
-
$style = $style+'clear:both!important;';
|
2275 |
-
element_i = 1;
|
2276 |
-
}
|
2277 |
-
$element.attr('style', $style+'width:'+width_to_set+';').addClass('berocket_inline_filters_rewidth');
|
2278 |
-
$element = $element.next();
|
2279 |
-
}
|
2280 |
-
}
|
2281 |
-
if ( typeof cfunc == "function" ) {
|
2282 |
-
cfunc();
|
2283 |
-
}
|
2284 |
-
}
|
2285 |
-
berocket_rewidth_inline_filters();
|
2286 |
-
$(document).ready(function (){
|
2287 |
-
berocket_rewidth_inline_filters();
|
2288 |
-
$(window).on('resize berocket_ajax_filtering_end', function() {
|
2289 |
-
$('.berocket_single_filter_widget.berocket_inline_filters.berocket_inline_filters_rewidth').removeClass('berocket_inline_filters_rewidth');
|
2290 |
-
berocket_rewidth_inline_filters();
|
2291 |
-
});
|
2292 |
-
});
|
2293 |
-
$(document).on('mousedown', function(event) {
|
2294 |
-
if( ! $(event.target).parents('.berocket_aapf_widget').length
|
2295 |
-
|| ! $(event.target).parents('.berocket_single_filter_widget.berocket_hidden_clickable').length ) {
|
2296 |
-
$filter = $('.berocket_single_filter_widget.berocket_hidden_clickable').not($(event.target).parents('.berocket_single_filter_widget.berocket_hidden_clickable'));
|
2297 |
-
$filter.removeClass('berocket_single_filter_visible').addClass('berocket_single_filter_hidden');
|
2298 |
-
$filter.find('.berocket_aapf_widget').slideUp(40);
|
2299 |
-
$filter.find('.berocket_aapf_widget-title_div').find('span').removeClass('hide_button').addClass('show_button');
|
2300 |
-
$filter.find('.berocket_aapf_widget-title_div').parents('.berocket_single_filter_widget').data('showbutton', 'show');
|
2301 |
-
}
|
2302 |
-
});
|
2303 |
-
var berocket_hidden_clickable_mouseenter = setTimeout(function(){},0);
|
2304 |
-
var berocket_hidden_clickable_mouseleave = setTimeout(function(){},0);
|
2305 |
-
$(document).on('mouseenter', '.berocket_hidden_clickable .berocket_aapf_widget-title_div', function() {
|
2306 |
-
$this = $(this);
|
2307 |
-
clearTimeout(berocket_hidden_clickable_mouseenter);
|
2308 |
-
berocket_hidden_clickable_mouseenter = setTimeout( function() {
|
2309 |
-
if( $('.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible').not($this.parents('.berocket_single_filter_widget.berocket_hidden_clickable')).length
|
2310 |
-
|| ($this.parents('.berocket_single_filter_widget.berocket_hidden_clickable.berocket_inline_clickable_hover').length && ! $this.parents('.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible').length ) ) {
|
2311 |
-
if( $(window).width() > 768 ) {
|
2312 |
-
$('.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_widget-title_div').trigger('br_showhide');
|
2313 |
-
$this.trigger('br_showhide');
|
2314 |
-
}
|
2315 |
-
}
|
2316 |
-
}, 100);
|
2317 |
-
});
|
2318 |
-
$(document).on('mouseenter', '.berocket_single_filter_widget.berocket_hidden_clickable.berocket_inline_clickable_hover, body > .select2-container', function() {
|
2319 |
-
clearTimeout(berocket_hidden_clickable_mouseleave);
|
2320 |
-
});
|
2321 |
-
$(document).on('mouseleave', '.berocket_single_filter_widget.berocket_hidden_clickable.berocket_inline_clickable_hover, body > .select2-container', function() {
|
2322 |
-
if( $(window).width() > 768 ) {
|
2323 |
-
clearTimeout(berocket_hidden_clickable_mouseleave);
|
2324 |
-
berocket_hidden_clickable_mouseleave = setTimeout(function() {
|
2325 |
-
$('.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_widget-title_div').trigger('br_showhide');
|
2326 |
-
}, 100);
|
2327 |
-
}
|
2328 |
-
});
|
2329 |
-
$(document).on('mouseleave', '.berocket_hidden_clickable .berocket_aapf_widget-title_div', function() {
|
2330 |
-
clearTimeout(berocket_hidden_clickable_mouseenter);
|
2331 |
-
});
|
2332 |
-
$(document).on('mousedown', '.wc-product-table-reset a', function() {
|
2333 |
-
$(this).remove();
|
2334 |
-
br_reset_all_filters();
|
2335 |
-
});
|
2336 |
-
$(document).on('click', '.berocket_element_above_products_is_hide_toggle', function (e){
|
2337 |
-
e.preventDefault();
|
2338 |
-
$(this).toggleClass( "active" ).next().slideToggle(200, 'linear');
|
2339 |
-
});
|
2340 |
-
$(document).on('berocket_filters_first_load', function (){
|
2341 |
-
berocket_rewidth_inline_filters(function (){
|
2342 |
-
$('.berocket_element_above_products_is_hide').hide(0).removeClass('br_is_hidden');
|
2343 |
-
});
|
2344 |
-
});
|
2345 |
-
})(jQuery);
|
2346 |
-
function berocket_ajax_load_product_table_compat() {
|
2347 |
-
if( jQuery('.berocket_product_table_compat .dataTables_length select').length ) {
|
2348 |
-
jQuery('.berocket_product_table_compat .wc-product-table').dataTable()._fnSaveState();
|
2349 |
-
}
|
2350 |
-
var tableid = jQuery('.berocket_product_table_compat .wc-product-table').attr('id');
|
2351 |
-
if( typeof(window['config_'+tableid]) != 'undefined' && window['config_'+tableid].serverSide ) {
|
2352 |
-
jQuery('.berocket_product_table_compat .wc-product-table').DataTable().destroy();
|
2353 |
-
var table_html = jQuery('.berocket_product_table_compat').html();
|
2354 |
-
jQuery('.berocket_product_table_compat').html('');
|
2355 |
-
jQuery('.berocket_product_table_compat').html(table_html);
|
2356 |
-
jQuery('.berocket_product_table_compat .blockUI.blockOverlay').remove();
|
2357 |
-
jQuery('.berocket_product_table_compat .wc-product-table').productTable();
|
2358 |
-
}
|
2359 |
-
}
|
2360 |
-
function berocket_custom_scroll_bar_init() {
|
2361 |
-
jQuery('.mCustomScrollBox').on('wheel', function (e){ e.stopPropagation; e.preventDefault(); });
|
2362 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
addons/separate_link/separate_vars.php
CHANGED
@@ -2,12 +2,6 @@
|
|
2 |
class BeRocket_AAPF_lp_separate_vars extends BeRocket_AAPF_link_parser {
|
3 |
function __construct() {
|
4 |
parent::__construct();
|
5 |
-
if( ! is_admin() ) {
|
6 |
-
add_filter('brapf_args_converter_get_string', array($this, 'php_parse_inside_filters'), 9000000);
|
7 |
-
add_filter('berocket_aapf_is_filtered_page_check', array($this, 'php_parse_inside_test'), 9000000);
|
8 |
-
add_action('wp_footer', array($this, 'js_footer_new_func'));
|
9 |
-
add_action( 'braapf_wp_enqueue_script_after', array($this, 'js_generate_new'), 10, 1 );
|
10 |
-
}
|
11 |
$BeRocket_AAPF = BeRocket_AAPF::getInstance();
|
12 |
$option = $BeRocket_AAPF->get_option();
|
13 |
add_filter('brfr_data_ajax_filters', array($this, 'brfr_data'), 50, 1);
|
@@ -15,6 +9,66 @@ class BeRocket_AAPF_lp_separate_vars extends BeRocket_AAPF_link_parser {
|
|
15 |
add_action( 'current_screen', array( $this, 'register_permalink_option' ), 50 );
|
16 |
}
|
17 |
add_filter('aapf_localize_widget_script', array($this, 'localize_widget_script'), 900);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
}
|
19 |
function register_permalink_option() {
|
20 |
global $wp_settings_sections;
|
@@ -42,6 +96,68 @@ class BeRocket_AAPF_lp_separate_vars extends BeRocket_AAPF_link_parser {
|
|
42 |
);
|
43 |
return $data;
|
44 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
function add_filter_to_link($current_url = FALSE, $args = array()) {
|
46 |
$args = array_merge(array(
|
47 |
'attribute' => '',
|
@@ -101,358 +217,8 @@ class BeRocket_AAPF_lp_separate_vars extends BeRocket_AAPF_link_parser {
|
|
101 |
}
|
102 |
return $new_url;
|
103 |
}
|
104 |
-
function
|
105 |
-
return $data;
|
106 |
-
}
|
107 |
-
function js_footer_new_func() {
|
108 |
-
echo '<script>function newUpdateLocation( args, pushstate, return_request ){';
|
109 |
-
echo $this->js_generate_inside('');
|
110 |
-
echo '}</script>';
|
111 |
-
}
|
112 |
-
function js_generate_inside($data, $args = array()) {
|
113 |
-
$BeRocket_AAPF = BeRocket_AAPF::getInstance();
|
114 |
-
$options = $BeRocket_AAPF->get_option();
|
115 |
-
ob_start();
|
116 |
?>
|
117 |
-
if ( typeof return_request == 'undefined' ) return_request = false;
|
118 |
-
uri_request_array = [];
|
119 |
-
var uri_request = '';
|
120 |
-
temp_terms = [];
|
121 |
-
var taxonomy_sparator = "|", start_terms = "[", end_terms = "]", variable = 'filters';
|
122 |
-
|
123 |
-
if (typeof the_ajax_script.nn_url_variable != "undefined" && the_ajax_script.nn_url_variable.length > 0) {
|
124 |
-
variable = the_ajax_script.nn_url_variable;
|
125 |
-
}
|
126 |
-
if (typeof the_ajax_script.nn_url_value_1 != "undefined" && the_ajax_script.nn_url_value_1.length > 0) {
|
127 |
-
start_terms = the_ajax_script.nn_url_value_1;
|
128 |
-
end_terms = the_ajax_script.nn_url_value_2;
|
129 |
-
}
|
130 |
-
if (typeof the_ajax_script.nn_url_split != "undefined" && the_ajax_script.nn_url_split.length > 0) {
|
131 |
-
taxonomy_sparator = the_ajax_script.nn_url_split;
|
132 |
-
}
|
133 |
-
|
134 |
-
if( the_ajax_script.nice_urls ) {
|
135 |
-
taxonomy_sparator = the_ajax_script.nice_url_split;
|
136 |
-
start_terms = the_ajax_script.nice_url_value_1;
|
137 |
-
end_terms = the_ajax_script.nice_url_value_2;
|
138 |
-
variable = the_ajax_script.nice_url_variable;
|
139 |
-
}
|
140 |
-
|
141 |
-
if( args.price ){
|
142 |
-
$price_obj = jQuery('.berocket_filter_price_slider');
|
143 |
-
if( ( args.price[0] || args.price[0] === 0 ) && ( args.price[1] || args.price[1] === 0 ) && ( args.price[0] != $price_obj.data('min') || args.price[1] != $price_obj.data('max') ) ){
|
144 |
-
if( uri_request ) uri_request += taxonomy_sparator;
|
145 |
-
uri_request += 'pa-price_from='+args.price[0]+'&pa-price_to='+args.price[1];
|
146 |
-
}
|
147 |
-
}
|
148 |
-
|
149 |
-
if( args.limits ){
|
150 |
-
jQuery(args.limits).each(function (i,o){
|
151 |
-
if( o[0].substring(0, 3) == 'pa_' ) {
|
152 |
-
if( !berocket_in_array( o[0].substring(3), temp_terms ) ){
|
153 |
-
temp_terms[temp_terms.length] = o[0].substring(3);
|
154 |
-
}
|
155 |
-
if( typeof uri_request_array[berocket_in_array( o[0].substring(3), temp_terms )] == 'undefined' ) {
|
156 |
-
uri_request_array[berocket_in_array(o[0].substring(3), temp_terms)] = [];
|
157 |
-
}
|
158 |
-
uri_request_array[berocket_in_array( o[0].substring(3), temp_terms )]
|
159 |
-
[uri_request_array[berocket_in_array( o[0].substring(3), temp_terms )].length] = [o[1],o[2]];
|
160 |
-
} else {
|
161 |
-
if( !berocket_in_array( o[0], temp_terms ) ){
|
162 |
-
temp_terms[temp_terms.length] = o[0];
|
163 |
-
}
|
164 |
-
if( typeof uri_request_array[berocket_in_array( o[0], temp_terms )] == 'undefined' ) {
|
165 |
-
uri_request_array[berocket_in_array(o[0], temp_terms)] = [];
|
166 |
-
}
|
167 |
-
uri_request_array[berocket_in_array( o[0], temp_terms )]
|
168 |
-
[uri_request_array[berocket_in_array( o[0], temp_terms )].length] = [o[1],o[2]];
|
169 |
-
}
|
170 |
-
});
|
171 |
-
}
|
172 |
-
if( args.terms ){
|
173 |
-
jQuery(args.terms).each(function (i,o){
|
174 |
-
if ( the_ajax_script.slug_urls ) {
|
175 |
-
o[1] = o[3];
|
176 |
-
}
|
177 |
-
if( o[0].substring(0, 3) == 'pa_' ) {
|
178 |
-
if( !berocket_in_array( o[0].substring(3), temp_terms ) ){
|
179 |
-
temp_terms[temp_terms.length] = o[0].substring(3);
|
180 |
-
}
|
181 |
-
if( typeof uri_request_array[berocket_in_array( o[0].substring(3), temp_terms )] == 'undefined' ) {
|
182 |
-
uri_request_array[berocket_in_array(o[0].substring(3), temp_terms)] = [];
|
183 |
-
}
|
184 |
-
uri_request_array[berocket_in_array( o[0].substring(3), temp_terms )]
|
185 |
-
[uri_request_array[berocket_in_array( o[0].substring(3), temp_terms )].length] = [o[1],o[2]];
|
186 |
-
} else {
|
187 |
-
if( !berocket_in_array( o[0], temp_terms ) ){
|
188 |
-
temp_terms[temp_terms.length] = o[0];
|
189 |
-
}
|
190 |
-
if( typeof uri_request_array[berocket_in_array( o[0], temp_terms )] == 'undefined' ) {
|
191 |
-
uri_request_array[berocket_in_array(o[0], temp_terms)] = [];
|
192 |
-
}
|
193 |
-
uri_request_array[berocket_in_array( o[0], temp_terms )]
|
194 |
-
[uri_request_array[berocket_in_array( o[0], temp_terms )].length] = [o[1],o[2]];
|
195 |
-
}
|
196 |
-
});
|
197 |
-
}
|
198 |
-
|
199 |
-
if( uri_request_array.length ) {
|
200 |
-
jQuery(uri_request_array).each(function (i,o){
|
201 |
-
if( uri_request ) uri_request += '&';
|
202 |
-
|
203 |
-
if( typeof o != 'object' ){
|
204 |
-
if( the_ajax_script.seo_uri_decode ) {
|
205 |
-
uri_request += encodeURIComponent( o );
|
206 |
-
} else {
|
207 |
-
uri_request += o;
|
208 |
-
}
|
209 |
-
}else{
|
210 |
-
cnt_oo = false;
|
211 |
-
var element_uri_request = '';
|
212 |
-
var temp_term_name = temp_terms[i];
|
213 |
-
if( the_ajax_script.seo_uri_decode ) {
|
214 |
-
temp_term_name = encodeURIComponent( temp_term_name );
|
215 |
-
}
|
216 |
-
temp_term_name = 'pa-'+temp_term_name;
|
217 |
-
|
218 |
-
jQuery(o).each(function (ii,oo){
|
219 |
-
if( ( oo[1] == 'AND' || oo[1] == 'OR' ) ){
|
220 |
-
if (! element_uri_request) {
|
221 |
-
if(oo[1] == '<?php echo (empty($options['default_operator_and']) ? 'AND' : 'OR'); ?>'){
|
222 |
-
element_uri_request += temp_term_name+'_operator=<?php echo (empty($options['default_operator_and']) ? 'and' : 'or'); ?>&';
|
223 |
-
}
|
224 |
-
element_uri_request += temp_term_name + '=';
|
225 |
-
}
|
226 |
-
if( cnt_oo ){
|
227 |
-
if( the_ajax_script.seo_uri_decode ) {
|
228 |
-
element_uri_request += encodeURIComponent(',');
|
229 |
-
} else {
|
230 |
-
element_uri_request += ',';
|
231 |
-
}
|
232 |
-
}
|
233 |
-
if( the_ajax_script.seo_uri_decode ) {
|
234 |
-
element_uri_request += encodeURIComponent(oo[0]);
|
235 |
-
} else {
|
236 |
-
element_uri_request += oo[0];
|
237 |
-
}
|
238 |
-
}else{
|
239 |
-
element_uri_request += temp_term_name+'_from='+oo[0]+'&'+temp_term_name+'_to='+oo[1];
|
240 |
-
}
|
241 |
-
cnt_oo = true;
|
242 |
-
});
|
243 |
-
uri_request += element_uri_request;
|
244 |
-
}
|
245 |
-
});
|
246 |
-
}
|
247 |
-
uri_request = uri_request;
|
248 |
-
|
249 |
-
if( !pushstate ) {
|
250 |
-
return uri_request;
|
251 |
-
}
|
252 |
-
|
253 |
-
var uri = the_ajax_script.current_page_url;
|
254 |
-
if ( /\?/.test(uri) ) {
|
255 |
-
passed_vars1 = uri.split('?');
|
256 |
-
uri = passed_vars1[0];
|
257 |
-
}
|
258 |
-
if( uri && uri.slice(-1) != '/' && ( the_ajax_script.trailing_slash ) ) {
|
259 |
-
uri += '/';
|
260 |
-
}
|
261 |
-
|
262 |
-
var cur_page = jQuery(the_ajax_script.pagination_class).find('.current').first().text();
|
263 |
-
var paginate_regex = new RegExp(".+\/"+the_ajax_script.pagination_base+"\/([0-9]+).+", "i");
|
264 |
-
if( prev_page = parseInt( location.href.replace(paginate_regex, "$1") ) ) {
|
265 |
-
if( ! parseInt( cur_page ) ){
|
266 |
-
cur_page = prev_page;
|
267 |
-
}
|
268 |
-
}
|
269 |
-
if(berocket_aapf_widget_first_page_jump && the_ajax_script.first_page) {
|
270 |
-
cur_page = 1;
|
271 |
-
}
|
272 |
-
cur_page = parseInt( cur_page );
|
273 |
-
var additional_datas = '';
|
274 |
-
something_added = false;
|
275 |
-
if( /\?/.test(location.href) ){
|
276 |
-
passed_vars1 = location.href;
|
277 |
-
if ( /\#/.test(passed_vars1) ) {
|
278 |
-
passed_vars1 = passed_vars1.split('#');
|
279 |
-
passed_vars1 = passed_vars1[0];
|
280 |
-
}
|
281 |
-
passed_vars1 = passed_vars1.split('?');
|
282 |
-
if( passed_vars1[1] ){
|
283 |
-
passed_vars2 = [];
|
284 |
-
if( /&/.test(passed_vars1[1]) ) {
|
285 |
-
passed_vars2 = passed_vars1[1].split('&');
|
286 |
-
} else {
|
287 |
-
passed_vars2[0] = passed_vars1[1];
|
288 |
-
}
|
289 |
-
passed_vars2_length = passed_vars2.length;
|
290 |
-
for ( k = 0; k < passed_vars2.length; k++ ) {
|
291 |
-
temp = passed_vars2[k].split('=');
|
292 |
-
passed_vars2[k] = [];
|
293 |
-
passed_vars2[k][0] = temp.shift();
|
294 |
-
passed_vars2[k][1] = temp.join("=");
|
295 |
-
if( passed_vars2[k][0].substr(0, 3) == 'pa-' || passed_vars2[k][0] == 'page' || passed_vars2[k][0] == 'paged' || passed_vars2[k][0] == 'product-page' ) continue;
|
296 |
-
|
297 |
-
if( the_ajax_script.control_sorting && passed_vars2[k][0] == 'orderby' ) continue;
|
298 |
-
|
299 |
-
if( something_added ) {
|
300 |
-
additional_datas += '&';
|
301 |
-
} else {
|
302 |
-
additional_datas += '?';
|
303 |
-
}
|
304 |
-
|
305 |
-
additional_datas += passed_vars2[k][0]+'='+passed_vars2[k][1];
|
306 |
-
something_added = true;
|
307 |
-
}
|
308 |
-
}
|
309 |
-
}
|
310 |
-
var next_symbol_sep = '?';
|
311 |
-
if( something_added ) {
|
312 |
-
uri = uri + additional_datas;
|
313 |
-
next_symbol_sep = '&';
|
314 |
-
}
|
315 |
-
if( cur_page > 1 && jQuery(the_ajax_script.pagination_class+' a').last().length && jQuery(the_ajax_script.pagination_class+' a').last().attr('href').search('product-page=') == -1 ) {
|
316 |
-
uri = uri + next_symbol_sep + "paged=" + cur_page;
|
317 |
-
next_symbol_sep = '&';
|
318 |
-
}
|
319 |
-
if( uri_request ) {
|
320 |
-
uri = uri + next_symbol_sep + uri_request;
|
321 |
-
next_symbol_sep = '&';
|
322 |
-
}
|
323 |
-
|
324 |
-
if( the_ajax_script.control_sorting && args.orderby && the_ajax_script.default_sorting != args.orderby ){
|
325 |
-
uri = uri + next_symbol_sep + 'orderby=' + args.orderby;
|
326 |
-
next_symbol_sep = '&';
|
327 |
-
}
|
328 |
-
|
329 |
-
if( cur_page > 1 && jQuery(the_ajax_script.pagination_class+' a').last().length && jQuery(the_ajax_script.pagination_class+' a').last().attr('href').search('product-page=') != -1 ) {
|
330 |
-
uri = uri + next_symbol_sep + "product-page=" + cur_page;
|
331 |
-
}
|
332 |
-
if ( /\#/.test(location.href) ) {
|
333 |
-
passed_vars1 = location.href.split('#');
|
334 |
-
passed_vars1 = passed_vars1[1];
|
335 |
-
uri += '#'+passed_vars1;
|
336 |
-
}
|
337 |
-
|
338 |
-
if( return_request ) {
|
339 |
-
return uri;
|
340 |
-
} else {
|
341 |
-
var stateParameters = { BeRocket: "Rules" };
|
342 |
-
history.replaceState(stateParameters, "BeRocket Rules");
|
343 |
-
history.pushState(stateParameters, "BeRocket Rules", uri);
|
344 |
-
history.pathname = uri;
|
345 |
-
}
|
346 |
-
<?php
|
347 |
-
return ob_get_clean();
|
348 |
-
}
|
349 |
-
function php_parse_inside_test($isset) {
|
350 |
-
$link_data = $this->php_parse(array());
|
351 |
-
if( ! empty($link_data['taxonomy']) && is_array($link_data['taxonomy']) && count($link_data['taxonomy']) ) {
|
352 |
-
return true;
|
353 |
-
}
|
354 |
-
return $isset;
|
355 |
-
}
|
356 |
-
function php_parse_inside_filters($base_filters) {
|
357 |
-
$link_data = $this->php_parse(array());
|
358 |
-
$filters = array();
|
359 |
-
if( ! empty($link_data['taxonomy']) && is_array($link_data['taxonomy']) ) {
|
360 |
-
foreach($link_data['taxonomy'] as $taxonomy) {
|
361 |
-
if( $taxonomy['type'] == 'single' ) {
|
362 |
-
$filters[] = $taxonomy['taxonomy'].'['.implode(($taxonomy['data']['operator'] == 'OR' ? '-' : '+'), explode(',', $taxonomy['data']['terms'])).']';
|
363 |
-
} elseif( $taxonomy['type'] == 'from_to' ) {
|
364 |
-
$filters[] = $taxonomy['taxonomy'].'['.$taxonomy['data']['from']. '_' . $taxonomy['data']['to'] .']';
|
365 |
-
}
|
366 |
-
}
|
367 |
-
}
|
368 |
-
if( count($filters) ) {
|
369 |
-
$filters = implode('|', $filters);
|
370 |
-
return $filters;
|
371 |
-
}
|
372 |
-
return $base_filters;
|
373 |
-
}
|
374 |
-
function php_parse_inside($data, $args = array()) {
|
375 |
-
$link_data = $this->get_query_vars_name();
|
376 |
-
return $link_data;
|
377 |
-
}
|
378 |
-
function php_generate_inside($data, $args = array()) {
|
379 |
-
return $data;
|
380 |
-
}
|
381 |
-
function get_query_vars_name($link = false) {
|
382 |
-
$BeRocket_AAPF = BeRocket_AAPF::getInstance();
|
383 |
-
$options = $BeRocket_AAPF->get_option();
|
384 |
-
$link = $this->get_query_vars_name_link($link);
|
385 |
-
$parts = wp_parse_url($link);
|
386 |
-
$link_data = array(
|
387 |
-
'var_names' => array(),
|
388 |
-
'taxonomy' => array()
|
389 |
-
);
|
390 |
-
if( ! empty($parts['query']) ) {
|
391 |
-
parse_str($parts['query'], $query_vars);
|
392 |
-
if( is_array($query_vars) ) {
|
393 |
-
$skip = array();
|
394 |
-
foreach($query_vars as $get_key => $get_value) {
|
395 |
-
if( substr($get_key, 0, 3) == 'pa-' ) {
|
396 |
-
$get_key = substr($get_key, 3);
|
397 |
-
} else {
|
398 |
-
continue;
|
399 |
-
}
|
400 |
-
if( in_array($get_key, $link_data['var_names']) ) continue;
|
401 |
-
if( ($taxonomy = $this->check_taxonomy($get_key)) !== false ) {
|
402 |
-
$link_data['var_names'][] = $get_key;
|
403 |
-
$operator = (empty($options['default_operator_and']) ? 'OR' : 'AND');
|
404 |
-
$operator_var = 'pa-'.$get_key . '_operator';
|
405 |
-
if( ! empty($query_vars[$operator_var]) ) {
|
406 |
-
$operator = $query_vars[$operator_var];
|
407 |
-
$link_data['var_names'][] = $operator_var;
|
408 |
-
}
|
409 |
-
$link_data['taxonomy'][] = array(
|
410 |
-
'taxonomy' => $taxonomy,
|
411 |
-
'get_key' => $get_key,
|
412 |
-
'data' => array(
|
413 |
-
'terms' => $get_value,
|
414 |
-
'operator' => strtoupper($operator)
|
415 |
-
),
|
416 |
-
'type' => 'single'
|
417 |
-
);
|
418 |
-
} elseif( strlen($get_key) > 5 && substr($get_key, -5) == '_from' && ! empty($query_vars['pa-'.substr_replace($get_key, '_to', -5)]) ) {
|
419 |
-
if( $taxonomy = $this->check_taxonomy(substr_replace($get_key, '', -5)) ) {
|
420 |
-
$link_data['var_names'][] = $get_key;
|
421 |
-
$link_data['var_names'][] = substr_replace($get_key, '_to', -5);
|
422 |
-
$link_data['taxonomy'][] = array(
|
423 |
-
'taxonomy' => $taxonomy,
|
424 |
-
'get_key' => $get_key,
|
425 |
-
'data' => array(
|
426 |
-
'from' => $get_value,
|
427 |
-
'to' => $query_vars['pa-'.substr_replace($get_key, '_to', -5)]
|
428 |
-
),
|
429 |
-
'type' => 'from_to'
|
430 |
-
);
|
431 |
-
}
|
432 |
-
} elseif( strlen($get_key) > 3 && substr($get_key, -3) == '_to' && ! empty($query_vars['pa-'.substr_replace($get_key, '_from', -3)]) ) {
|
433 |
-
if( $taxonomy = $this->check_taxonomy(substr_replace($get_key, '', -3)) ) {
|
434 |
-
$link_data['var_names'][] = $get_key;
|
435 |
-
$link_data['var_names'][] = substr_replace($get_key, '_from', -3);
|
436 |
-
$link_data['taxonomy'][] = array(
|
437 |
-
'taxonomy' => $taxonomy,
|
438 |
-
'get_key' => $get_key,
|
439 |
-
'data' => array(
|
440 |
-
'to' => $get_value,
|
441 |
-
'from' => $query_vars['pa-'.substr_replace($get_key, '_from', -3)]
|
442 |
-
),
|
443 |
-
'type' => 'from_to'
|
444 |
-
);
|
445 |
-
}
|
446 |
-
}
|
447 |
-
}
|
448 |
-
}
|
449 |
-
}
|
450 |
-
return $link_data;
|
451 |
-
}
|
452 |
-
function js_generate_new($handle) {
|
453 |
-
if( $handle == 'berocket_aapf_widget-script' ) {
|
454 |
-
ob_start();
|
455 |
-
?>
|
456 |
//Link Like Woocommerce
|
457 |
var braapf_get_current_filters_separate_link,
|
458 |
braapf_glue_by_operator_separate_link,
|
@@ -520,37 +286,14 @@ braapf_compat_filters_result_separate_link;
|
|
520 |
}
|
521 |
})(jQuery);
|
522 |
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
}
|
532 |
-
|
533 |
-
function brapf_separate_link_add_filters() {
|
534 |
-
//Remove filters
|
535 |
-
berocket_add_filter('get_current_url_data', braapf_get_current_filters_separate_link);
|
536 |
-
//Add filters
|
537 |
-
berocket_add_filter('glue_by_operator', braapf_glue_by_operator_separate_link, 1);
|
538 |
-
berocket_add_filter('compat_filters_result_single', braapf_compat_filters_result_separate_link, 20);
|
539 |
-
berocket_add_filter('compat_filters_to_string_single', braapf_compat_filters_to_string_single_separate_link);
|
540 |
-
berocket_add_filter('url_from_urldata_linkget', braapf_set_filters_to_link_separate_link);
|
541 |
-
}
|
542 |
-
|
543 |
-
if( typeof(berocket_add_filter) != 'undefined' ) {
|
544 |
-
brapf_separate_link_add_filters();
|
545 |
-
} else {
|
546 |
-
jQuery(document).on('berocket_hooks_ready', brapf_separate_link_add_filters);
|
547 |
-
}
|
548 |
-
<?php
|
549 |
-
$script = ob_get_clean();
|
550 |
-
wp_add_inline_script('berocket_aapf_widget-script', $script);
|
551 |
-
remove_action('wp_footer', array($this, 'js_footer_new_func'));
|
552 |
-
remove_action( 'braapf_wp_enqueue_script_after', array($this, 'js_generate_new'), 10, 1 );
|
553 |
-
}
|
554 |
}
|
555 |
function localize_widget_script($localization) {
|
556 |
$BeRocket_AAPF = BeRocket_AAPF::getInstance();
|
2 |
class BeRocket_AAPF_lp_separate_vars extends BeRocket_AAPF_link_parser {
|
3 |
function __construct() {
|
4 |
parent::__construct();
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
$BeRocket_AAPF = BeRocket_AAPF::getInstance();
|
6 |
$option = $BeRocket_AAPF->get_option();
|
7 |
add_filter('brfr_data_ajax_filters', array($this, 'brfr_data'), 50, 1);
|
9 |
add_action( 'current_screen', array( $this, 'register_permalink_option' ), 50 );
|
10 |
}
|
11 |
add_filter('aapf_localize_widget_script', array($this, 'localize_widget_script'), 900);
|
12 |
+
add_filter('bapf_uparse_generate_filter_link_each_taxval_delimiters', array($this, 'each_taxval_delimiters'), 1000, 4);
|
13 |
+
add_filter('bapf_uparse_generate_filter_link_each_values_line', array($this, 'generate_filter_link_each_values_line'), 1000, 6);
|
14 |
+
add_filter('bapf_uparse_generate_filter_val_arr', array($this, 'generate_filter_val_arr'), 1000, 6);
|
15 |
+
add_filter('bapf_uparse_generate_filter_link_delimiter', array($this, 'generate_filter_link_delimiter'), 1000);
|
16 |
+
add_filter('bapf_uparse_add_filters_to_link', array($this, 'add_filters_to_link'), 1000, 4);
|
17 |
+
add_filter('bapf_uparse_remove_filters_from_link', array($this, 'remove_filters_from_link'), 1000, 3);
|
18 |
+
add_filter('bapf_url_parse_page_price_range_implode_values', array($this, 'price_range_implode_values'), 1000, 5);
|
19 |
+
}
|
20 |
+
function get_filter_line($result, $instance, $link = false) {
|
21 |
+
$query_vars = array();
|
22 |
+
if( $link !== false ) {
|
23 |
+
$query_vars = array();
|
24 |
+
$parsed_link = wp_parse_url($link);
|
25 |
+
if( ! empty($parsed_link['query']) ) {
|
26 |
+
parse_str($parts['query'], $query_vars);
|
27 |
+
}
|
28 |
+
} else {
|
29 |
+
$query_vars = $_GET;
|
30 |
+
}
|
31 |
+
$var_names = array();
|
32 |
+
$skip = array();
|
33 |
+
$values = array();
|
34 |
+
foreach($query_vars as $get_key => $get_value) {
|
35 |
+
if( substr($get_key, 0, 3) == 'pa-' ) {
|
36 |
+
$get_key = substr($get_key, 3);
|
37 |
+
} else {
|
38 |
+
continue;
|
39 |
+
}
|
40 |
+
$permalink_data = apply_filters('bapf_niceurl_get_permalinks_options', array(
|
41 |
+
'variable' => 'filters',
|
42 |
+
'values' => '[values]',
|
43 |
+
'split' => '|'
|
44 |
+
));
|
45 |
+
$permalink_values = explode('values', $permalink_data['value']);
|
46 |
+
if( in_array($get_key, $var_names) ) continue;
|
47 |
+
$attr = $attr_val = $attr_line = false;
|
48 |
+
if( ($taxonomy = $this->check_taxonomy($get_key)) !== false ) {
|
49 |
+
$var_names[] = $get_key;
|
50 |
+
$operator = (empty($options['default_operator_and']) ? 'OR' : 'AND');
|
51 |
+
$operator_var = 'pa-'.$get_key . '_operator';
|
52 |
+
if( ! empty($query_vars[$operator_var]) ) {
|
53 |
+
$operator = $query_vars[$operator_var];
|
54 |
+
$var_names[] = $operator_var;
|
55 |
+
}
|
56 |
+
$delimiter = $instance->func_operator_to_delimiter($operator);
|
57 |
+
$attr_val = explode(',', $get_value);
|
58 |
+
$values[] = $get_key . $permalink_values[0] . implode($delimiter, $attr_val) . $permalink_values[1];
|
59 |
+
} elseif( (strlen($get_key) > 5 && substr($get_key, -5) == '_from' && ! empty($query_vars['pa-'.substr_replace($get_key, '_to' , -5)]))
|
60 |
+
|| (strlen($get_key) > 3 && substr($get_key, -3) == '_to' && ! empty($query_vars['pa-'.substr_replace($get_key, '_from', -3)]))
|
61 |
+
) {
|
62 |
+
$taxonomy_key = substr_replace($get_key, '', (substr($get_key, -3) == '_to' ? -3 : -5));
|
63 |
+
if( $taxonomy = $this->check_taxonomy($taxonomy_key) ) {
|
64 |
+
$var_names[] = $taxonomy_key.'_from';
|
65 |
+
$var_names[] = $taxonomy_key.'_to';
|
66 |
+
$values[] = $taxonomy_key . $permalink_values[0] . $query_vars['pa-'.$taxonomy_key.'_from'] . '_' . $query_vars['pa-'.$taxonomy_key.'_to'] . $permalink_values[1];
|
67 |
+
}
|
68 |
+
}
|
69 |
+
$result = implode($permalink_data['split'], $values);
|
70 |
+
}
|
71 |
+
return $result;
|
72 |
}
|
73 |
function register_permalink_option() {
|
74 |
global $wp_settings_sections;
|
96 |
);
|
97 |
return $data;
|
98 |
}
|
99 |
+
function each_taxval_delimiters($delimiter, $instance, $filter, $data) {
|
100 |
+
$delimiter['before_values'] = '=';
|
101 |
+
$delimiter['after_values'] = '';
|
102 |
+
return $delimiter;
|
103 |
+
}
|
104 |
+
function generate_filter_link_each_values_line($values_line, $instance, $filter, $data, $link_elements, $elements) {
|
105 |
+
extract($elements);
|
106 |
+
$BeRocket_AAPF = BeRocket_AAPF::getInstance();
|
107 |
+
$options = $BeRocket_AAPF->get_option();
|
108 |
+
if(! empty($filter['val_arr']['op']) && $filter['val_arr']['op'] == 'SLIDER') {
|
109 |
+
$values_line = 'pa-'.$taxonomy_name.'_from='.$filter['val_arr']['from'];
|
110 |
+
$values_line .='&pa-'.$taxonomy_name.'_to='.$filter['val_arr']['to'];
|
111 |
+
} else {
|
112 |
+
$operator = ( empty($filter['val_arr']['op']) ? 'OR' : $filter['val_arr']['op'] );
|
113 |
+
$values_line = 'pa-'.$taxonomy_name.'='.$filter_line;
|
114 |
+
if( $operator != (empty($options['default_operator_and']) ? 'OR' : 'AND') ) {
|
115 |
+
$values_line .= 'pa-'.$taxonomy_name.'_operator='.$operator;
|
116 |
+
}
|
117 |
+
}
|
118 |
+
return $values_line;
|
119 |
+
}
|
120 |
+
function generate_filter_val_arr($result, $instance, $val_arr, $filter) {
|
121 |
+
if( isset($val_arr['op']) ) {
|
122 |
+
unset($val_arr['op']);
|
123 |
+
}
|
124 |
+
$delimiter = ',';
|
125 |
+
$values_lines = array();
|
126 |
+
$values = array();
|
127 |
+
foreach($val_arr as $value) {
|
128 |
+
if( is_array($value) ) {
|
129 |
+
$values_lines_add = $this->generate_filter_val_arr($value, $filter);
|
130 |
+
$values_lines = array_merge($values_lines, $values_lines_add);
|
131 |
+
} else {
|
132 |
+
$values[] = $value;
|
133 |
+
}
|
134 |
+
}
|
135 |
+
$values_lines[] = implode($delimiter, $values);
|
136 |
+
return $values_lines;
|
137 |
+
}
|
138 |
+
function generate_filter_link_delimiter($delimiter) {
|
139 |
+
return '&';
|
140 |
+
}
|
141 |
+
function add_filters_to_link($result, $instance, $link, $filters_line) {
|
142 |
+
parse_str($filters_line, $query_vars);
|
143 |
+
$link = add_query_arg($query_vars, $link);
|
144 |
+
return $link;
|
145 |
+
}
|
146 |
+
function remove_filters_from_link($result, $instance, $link) {
|
147 |
+
$parsed_link = wp_parse_url($link);
|
148 |
+
if( ! empty($parsed_link['query']) ) {
|
149 |
+
parse_str($parsed_link['query'], $query_vars);
|
150 |
+
foreach($query_vars as $query_var => $query_val) {
|
151 |
+
if( substr($query_var, 0, 3) == 'pa-' ) {
|
152 |
+
$link = remove_query_arg( $query_var, $link );
|
153 |
+
}
|
154 |
+
}
|
155 |
+
}
|
156 |
+
return $result;
|
157 |
+
}
|
158 |
+
function price_range_implode_values($values_line, $instance, $values, $filter, $data) {
|
159 |
+
return implode(',', $values);
|
160 |
+
}
|
161 |
function add_filter_to_link($current_url = FALSE, $args = array()) {
|
162 |
$args = array_merge(array(
|
163 |
'attribute' => '',
|
217 |
}
|
218 |
return $new_url;
|
219 |
}
|
220 |
+
function js_generate_inside() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
221 |
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
222 |
//Link Like Woocommerce
|
223 |
var braapf_get_current_filters_separate_link,
|
224 |
braapf_glue_by_operator_separate_link,
|
286 |
}
|
287 |
})(jQuery);
|
288 |
|
289 |
+
//Remove filters
|
290 |
+
berocket_add_filter('get_current_url_data', braapf_get_current_filters_separate_link);
|
291 |
+
//Add filters
|
292 |
+
berocket_add_filter('glue_by_operator', braapf_glue_by_operator_separate_link, 1);
|
293 |
+
berocket_add_filter('compat_filters_result_single', braapf_compat_filters_result_separate_link, 20);
|
294 |
+
berocket_add_filter('compat_filters_to_string_single', braapf_compat_filters_to_string_single_separate_link);
|
295 |
+
berocket_add_filter('url_from_urldata_linkget', braapf_set_filters_to_link_separate_link);
|
296 |
+
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
297 |
}
|
298 |
function localize_widget_script($localization) {
|
299 |
$BeRocket_AAPF = BeRocket_AAPF::getInstance();
|
assets/frontend/css/fullmain.min.css
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
.select2-container .select2-search--inline,.select2-container--default[dir=rtl] .select2-selection--single .select2-selection__clear{float:left}.select2-container{box-sizing:border-box;display:inline-block;margin:0;position:relative;vertical-align:middle}.select2-container .select2-selection--single{box-sizing:border-box;cursor:pointer;display:block;height:28px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--single .select2-selection__rendered{display:block;padding-left:8px;padding-right:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-selection--single .select2-selection__clear{position:relative}.select2-container[dir=rtl] .select2-selection--single .select2-selection__rendered{padding-right:8px;padding-left:20px}.select2-container .select2-selection--multiple{box-sizing:border-box;cursor:pointer;display:block;min-height:32px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--multiple .select2-selection__rendered{display:inline-block;overflow:hidden;padding-left:8px;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-search--inline .select2-search__field{box-sizing:border-box;border:none;font-size:100%;margin-top:5px;padding:0}.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-dropdown{background-color:#fff;border:1px solid #aaa;border-radius:4px;box-sizing:border-box;display:block;position:absolute;left:-100000px;width:100%;z-index:1051}.select2-results{display:block}.select2-results__options{list-style:none;margin:0;padding:0}.select2-results__option{padding:6px;user-select:none;-webkit-user-select:none}.select2-results__option[aria-selected]{cursor:pointer}.select2-container--open .select2-dropdown{left:0}.select2-container--open .select2-dropdown--above{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--open .select2-dropdown--below{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-search--dropdown{display:block;padding:4px}.select2-search--dropdown .select2-search__field{padding:4px;width:100%;box-sizing:border-box}.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-search--dropdown.select2-search--hide{display:none}.select2-close-mask{border:0;margin:0;padding:0;display:block;position:fixed;left:0;top:0;min-height:100%;min-width:100%;height:auto;width:auto;opacity:0;z-index:99;background-color:#fff;filter:alpha(opacity=0)}.select2-hidden-accessible{border:0!important;clip:rect(0 0 0 0)!important;-webkit-clip-path:inset(50%)!important;clip-path:inset(50%)!important;height:1px!important;overflow:hidden!important;padding:0!important;position:absolute!important;width:1px!important;white-space:nowrap!important}.select2-container--classic .select2-results>.select2-results__options,.select2-container--default .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--default .select2-selection--single{background-color:#fff;border:1px solid #aaa;border-radius:4px}.select2-container--default .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--default .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:700}.select2-container--default .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--default .select2-selection--single .select2-selection__arrow{height:26px;position:absolute;top:1px;right:1px;width:20px}.select2-container--default .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent;border-style:solid;border-width:5px 4px 0;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--default[dir=rtl] .select2-selection--single .select2-selection__arrow{left:1px;right:auto}.select2-container--default.select2-container--disabled .select2-selection--single{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear{display:none}.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888;border-width:0 4px 5px}.select2-container--default .select2-selection--multiple{background-color:#fff;border:1px solid #aaa;border-radius:4px;cursor:text}.select2-container--default .select2-selection--multiple .select2-selection__rendered{box-sizing:border-box;list-style:none;margin:0;padding:0 5px;width:100%}.select2-container--default .select2-selection--multiple .select2-selection__rendered li{list-style:none}.select2-container--default .select2-selection--multiple .select2-selection__clear{cursor:pointer;float:right;font-weight:700;margin-top:5px;margin-right:10px;padding:1px}.select2-container--default .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{color:#999;cursor:pointer;display:inline-block;font-weight:700;margin-right:2px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover{color:#333}.select2-container--default[dir=rtl] .select2-selection--multiple .select2-search--inline,.select2-container--default[dir=rtl] .select2-selection--multiple .select2-selection__choice{float:right}.select2-container--default[dir=rtl] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--default[dir=rtl] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--default.select2-container--focus .select2-selection--multiple{border:1px solid #000;outline:0}.select2-container--default.select2-container--disabled .select2-selection--multiple{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection__choice__remove{display:none}.select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple,.select2-container--default.select2-container--open.select2-container--above .select2-selection--single{border-top-left-radius:0;border-top-right-radius:0}.select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple,.select2-container--default.select2-container--open.select2-container--below .select2-selection--single{border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--default .select2-search--dropdown .select2-search__field{border:1px solid #aaa}.select2-container--default .select2-search--inline .select2-search__field{background:0 0;border:none;outline:0;box-shadow:none;-webkit-appearance:textfield}.select2-container--default .select2-results__option[role=group]{padding:0}.select2-container--default .select2-results__option[aria-disabled=true]{color:#999}.select2-container--default .select2-results__option[aria-selected=true]{background-color:#ddd}.select2-container--default .select2-results__option .select2-results__option{padding-left:1em}.select2-container--default .select2-results__option .select2-results__option .select2-results__group{padding-left:0}.select2-container--default .select2-results__option .select2-results__option .select2-results__option{margin-left:-1em;padding-left:2em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-2em;padding-left:3em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-3em;padding-left:4em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-4em;padding-left:5em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-5em;padding-left:6em}.select2-container--default .select2-results__option--highlighted[aria-selected]{background-color:#5897fb;color:#fff}.select2-container--default .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic .select2-selection--single{background-color:#f7f7f7;border:1px solid #aaa;border-radius:4px;outline:0;background-image:-webkit-linear-gradient(top,#fff 50%,#eee 100%);background-image:-o-linear-gradient(top,#fff 50%,#eee 100%);background-image:linear-gradient(to bottom,#fff 50%,#eee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic .select2-selection--single:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--classic .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:700;margin-right:10px}.select2-container--classic .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--classic .select2-selection--single .select2-selection__arrow{background-color:#ddd;border:none;border-left:1px solid #aaa;border-top-right-radius:4px;border-bottom-right-radius:4px;height:26px;position:absolute;top:1px;right:1px;width:20px;background-image:-webkit-linear-gradient(top,#eee 50%,#ccc 100%);background-image:-o-linear-gradient(top,#eee 50%,#ccc 100%);background-image:linear-gradient(to bottom,#eee 50%,#ccc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0)}.select2-container--classic .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent;border-style:solid;border-width:5px 4px 0;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--classic[dir=rtl] .select2-selection--single .select2-selection__clear{float:left}.select2-container--classic[dir=rtl] .select2-selection--single .select2-selection__arrow{border:none;border-right:1px solid #aaa;border-radius:4px 0 0 4px;left:1px;right:auto}.select2-container--classic.select2-container--open .select2-selection--single{border:1px solid #5897fb}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow{background:0 0;border:none}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888;border-width:0 4px 5px}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single{border-top:none;border-top-left-radius:0;border-top-right-radius:0;background-image:-webkit-linear-gradient(top,#fff 0,#eee 50%);background-image:-o-linear-gradient(top,#fff 0,#eee 50%);background-image:linear-gradient(to bottom,#fff 0,#eee 50%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;background-image:-webkit-linear-gradient(top,#eee 50%,#fff 100%);background-image:-o-linear-gradient(top,#eee 50%,#fff 100%);background-image:linear-gradient(to bottom,#eee 50%,#fff 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0)}.select2-container--classic .select2-selection--multiple{background-color:#fff;border:1px solid #aaa;border-radius:4px;cursor:text;outline:0}.select2-container--classic .select2-selection--multiple:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--multiple .select2-selection__rendered{list-style:none;margin:0;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__clear{display:none}.select2-container--classic .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove{color:#888;cursor:pointer;display:inline-block;font-weight:700;margin-right:2px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover{color:#555}.select2-container--classic[dir=rtl] .select2-selection--multiple .select2-selection__choice{float:right;margin-left:5px;margin-right:auto}.select2-container--classic[dir=rtl] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--classic.select2-container--open .select2-selection--multiple{border:1px solid #5897fb}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--classic .select2-search--dropdown .select2-search__field{border:1px solid #aaa;outline:0}.select2-container--classic .select2-search--inline .select2-search__field{outline:0;box-shadow:none}.select2-container--classic .select2-dropdown{background-color:#fff;border:1px solid transparent}.select2-container--classic .select2-dropdown--above{border-bottom:none}.select2-container--classic .select2-dropdown--below{border-top:none}.select2-container--classic .select2-results__option[role=group]{padding:0}.select2-container--classic .select2-results__option[aria-disabled=true]{color:grey}.select2-container--classic .select2-results__option--highlighted[aria-selected]{background-color:#3875d7;color:#fff}.select2-container--classic .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic.select2-container--open .select2-dropdown{border-color:#5897fb}.bapf_sfilter .bapf_button,.bapf_sfilter label{cursor:pointer;display:inline-block!important}.bapf_sfilter ul li{list-style:none!important;margin:0!important;padding:0!important;max-width:100%;text-align:left!important}.rtl .bapf_sfilter ul li{text-align:right!important}.bapf_sfilter .bapf_body ul li ul{margin-left:15px}.bapf_slidr_main.ui-widget-content,.berocket_filter_price_slider.ui-widget-content{background:#b0b5b9;border:0;border-radius:0;height:4px;padding:0}.bapf_slidr_main.ui-widget-content .ui-slider-range,.berocket_filter_price_slider.ui-widget-content .ui-slider-range{background:#000}.slide.default .bapf_slidr_main.ui-widget-content .ui-slider-range,.slide.default .berocket_filter_price_slider.ui-widget-content .ui-slider-range{background:#222}.slide.default .bapf_slidr_main.ui-widget-content,.slide.default .berocket_filter_price_slider.ui-widget-content{height:4px;border:1px solid #555;font-size:10px}.bapf_slidr_main.ui-widget-content .ui-slider-handle,.berocket_filter_price_slider.ui-widget-content .ui-slider-handle,.slide.default .bapf_slidr_main .ui-state-default,.slide.default .bapf_slidr_main .ui-widget-header .ui-state-default,.slide.default .bapf_slidr_main.ui-widget-content .ui-state-default,.slide.default .berocket_filter_price_slider .ui-state-default,.slide.default .berocket_filter_price_slider .ui-widget-header .ui-state-default,.slide.default .berocket_filter_price_slider.ui-widget-content .ui-state-default{background:#ddd;font-size:14px;width:1em;height:1em;border:1px solid #555;top:-6px;border-radius:2em}.berocket_aapf_widget li.slider div.slide{clear:both;height:auto;text-align:right;line-height:0}.bapf_slidr_jqrui .bapf_from,.ui-slider{text-align:left}.ui-slider{position:relative}.ui-slider .ui-slider-handle{position:absolute;z-index:2;width:1.2em;height:1.2em;cursor:pointer;-ms-touch-action:none;touch-action:none}.ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;background-position:0 0}.ui-slider.ui-state-disabled .ui-slider-handle,.ui-slider.ui-state-disabled .ui-slider-range{filter:inherit}.ui-slider-horizontal{height:.8em}.ui-slider-horizontal .ui-slider-handle{top:-.3em;margin-left:-.6em}.bapf_slidr_main>a:last-child{margin-left:-12px}.ui-slider-horizontal .ui-slider-range{top:0;height:100%}.ui-slider-horizontal .ui-slider-range-min{left:0}.ui-slider-horizontal .ui-slider-range-max{right:0}.ui-slider-vertical{width:.8em;height:100px}.ui-slider-vertical .ui-slider-handle{left:-.3em;margin-left:0;margin-bottom:-.6em}.ui-slider-vertical .ui-slider-range{left:0;width:100%}#berocket-ajax-filters-sidebar .berocket_single_filter_widget.berocket_hidden_clickable.berocket_hidden_clickable_left .bapf_sfilter.bapf_ccolaps .bapf_body,.berocket_single_filter_widget.berocket_hidden_clickable.berocket_hidden_clickable_left .bapf_sfilter.bapf_ccolaps .bapf_body,.berocket_single_filter_widget.berocket_hidden_clickable.berocket_hidden_clickable_left .berocket_aapf_widget{left:0!important}.ui-slider-vertical .ui-slider-range-min{bottom:0}.ui-slider-vertical .ui-slider-range-max{top:0}.slide .ui-corner-all,.slide .ui-corner-bottom,.slide .ui-corner-br,.slide .ui-corner-right{border-bottom-right-radius:4px}.slide .ui-corner-all,.slide .ui-corner-bl,.slide .ui-corner-bottom,.slide .ui-corner-left{border-bottom-left-radius:4px}.slide .ui-corner-all,.slide .ui-corner-right,.slide .ui-corner-top,.slide .ui-corner-tr{border-top-right-radius:4px}.slide .ui-corner-all,.slide .ui-corner-left,.slide .ui-corner-tl,.slide .ui-corner-top{border-top-left-radius:4px}ul.berocket_aapf_widget li.slider>span{cursor:initial}ul.berocket_aapf_widget li.slider .bapf_slidr_main{cursor:pointer}.slide .ui-widget-content{background:#fff;border:1px solid #aaa;color:#222}.slide .ui-state-default,.slide .ui-widget-content .ui-state-default,.slide .ui-widget-header .ui-state-default{background:#e6e6e6;border:1px solid #d3d3d3;color:#555;font-weight:400}.ui-widget.ui-datepicker{font-size:14px;z-index:9000!important}.bapf_sfilter .ui-button,.bapf_sfilter .ui-state-default,.bapf_sfilter .ui-widget-content .ui-state-default,.bapf_sfilter .ui-widget-header .ui-state-default,.bapf_sfilter .ui-widget.ui-widget-content,html .bapf_sfilter .ui-button.ui-state-disabled:active,html .bapf_sfilter .ui-button.ui-state-disabled:hover{border:0}.bapf_slidr_jqrui .bapf_slidr_all:after{content:"";display:block;clear:both}.bapf_slidr_jqrui .bapf_slidr_main{margin-bottom:10px}.bapf_slidr_jqrui .bapf_from,.bapf_slidr_jqrui .bapf_to{width:49%;display:inline-block;margin-bottom:10px;vertical-align:middle}.bapf_slidr_jqrui .bapf_from input,.bapf_slidr_jqrui .bapf_to input{width:50%;vertical-align:middle;font-size:1em;padding:0;margin:0;line-height:1em}.bapf_slidr_jqrui .bapf_to{text-align:right}.bapf_sfilter{margin-bottom:20px}.berocket_single_filter_widget.berocket_inline_clickable,.berocket_single_filter_widget.berocket_inline_filters{float:left!important;padding-right:15px!important}.berocket_single_filter_widget.berocket_inline_filters{width:12.5%!important}#berocket-ajax-filters-sidebar .berocket_single_filter_widget.berocket_hidden_clickable .berocket_aapf_widget-title_div,.berocket_single_filter_widget.berocket_hidden_clickable .berocket_aapf_widget-title_div{border:2px solid #333!important;background-color:#333!important;color:#ccc!important;padding:5px 35px 5px 5px!important;border-radius:5px!important}.berocket_single_filter_widget.berocket_hidden_clickable .berocket_widget_has_description .berocket_aapf_widget-title_div{padding-right:55px!important}.berocket_single_filter_widget.berocket_hidden_clickable .berocket_aapf_widget-wrapper{padding-bottom:5px!important}.berocket_single_filter_widget.berocket_hidden_clickable .berocket_aapf_widget-title_div h3{margin:0!important;padding:0!important;font-size:inherit!important;color:inherit!important}.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_widget-title_div{border:2px solid #ccc!important;color:#000!important;background-color:#ccc!important;border-radius:5px 5px 0 0!important;padding-bottom:10px!important}.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_widget-wrapper{padding-bottom:0!important}.berocket_single_filter_widget.berocket_hidden_clickable .berocket_aapf_widget{position:absolute!important;top:100%!important;width:100%!important;background-color:#fff!important;z-index:800!important;margin:0!important;border:2px solid #ccc!important;padding:5px!important;display:none}.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_widget{z-index:900!important}.berocket_single_filter_widget.berocket_hidden_clickable.berocket_hidden_clickable_right .berocket_aapf_widget{right:0!important}@media screen and (max-width:767px){.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible{position:fixed!important;top:0!important;left:0!important;bottom:0!important;right:0!important;z-index:9000000000!important;background-color:#fff!important;overflow:auto!important}.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_widget{border:0!important;width:100%!important;max-width:100%!important}.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_widget_show.mobile_hide{display:block!important}.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_widget_show.mobile_hide .fa-angle-left:before,.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_widget_show.mobile_hide .fa-angle-right:before{content:"\f00d"!important}.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_description{display:none!important}body .select2-container,body .ui-widget.ui-datepicker{z-index:9000000009!important}.bapf_sngl_hd_mobile{display:none!important}}.bapf_sfilter.bapf_fhide .bapf_body ul li.bapf_hide,.bapf_sfilter.bapf_fhide.bapf_filter_hide,.berocket_single_filter_widget.bapf_mt_none{display:none!important}.berocket_element_above_products{clear:both!important;overflow:visible!important}div.berocket_single_filter_widget div.berocket_aapf_widget-wrapper *{opacity:1}@media screen and (min-width:768px) and (max-width:1024px){.bapf_sngl_hd_tablet{display:none!important}}@media screen and (min-width:1025px){.bapf_sngl_hd_desktop{display:none!important}}.berocket_aapf_widget select{overflow:auto!important}.berocket_element_above_products_after{clear:both}ul.berocket_aapf_widget li>span>input+.berocket_label_widgets::before{margin-right:6px}.berocket_ajax_filters_sidebar_toggle,.berocket_element_above_products_is_hide_toggle{width:200px!important;margin:40px 0;position:relative;padding-left:25px;font-size:16px;font-weight:600;outline:0!important}.berocket_element_above_products_is_hide{overflow:visible!important}.berocket_element_above_products_is_hide:after{content:"";display:block;clear:both}.berocket_element_above_products_is_hide.br_is_hidden{opacity:0;max-height:1px;position:relative}.berocket_element_above_products_is_hide_toggle{height:20px;display:inline-block;color:#2a2a2a}body{transition:margin-left .2s}body.berocket_ajax_filters_sidebar_active{margin-left:200px}.berocket_ajax_filters_sidebar_toggle{height:26px;display:inline-block;text-decoration:none!important;box-sizing:border-box!important}#berocket-ajax-filters-sidebar{display:block;position:fixed;top:0;left:-400px;bottom:0;width:350px;max-width:100%;background:#fff;transition:all .2s;z-index:100000;box-sizing:border-box;overflow:auto!important}#berocket-ajax-filters-sidebar-shadow{content:"";display:none;position:fixed;top:0;left:0;bottom:0;right:0;z-index:99999;background:#000;opacity:.7}.admin-bar #berocket-ajax-filters-sidebar{top:32px}#berocket-ajax-filters-sidebar.active,#berocket-ajax-filters-sidebar.active+#berocket-ajax-filters-sidebar-shadow{left:0;display:block;visibility:visible}#berocket-ajax-filters-sidebar .berocket_ajax_group_filter_title{padding:15px 88px 15px 15px!important;font-weight:500!important;font-size:24px!important;color:#333!important;border-bottom:1px solid #ccc!important}#berocket-ajax-filters-sidebar>div{padding:15px!important}#berocket-ajax-filters-sidebar .berocket_aapf_widget-title_div{color:#333!important;font-size:19px!important;font-weight:600!important}#berocket-ajax-filters-sidebar .berocket_aapf_widget,#berocket-ajax-filters-sidebar .berocket_aapf_widget li{margin:0!important}#berocket-ajax-filters-sidebar .berocket_aapf_widget .berocket_checkbox_color .berocket_label_widgets{margin:0 .6em .6em 0!important}#berocket-ajax-filters-sidebar-close{position:absolute!important;right:0!important;line-height:39px;padding:17px 15px 13px!important;font-family:Arial,serif!important;color:#a2a2a2}#berocket-ajax-filters-sidebar-close+*{margin-top:70px!important}#berocket-ajax-filters-sidebar-close+.berocket_ajax_group_filter_title{margin-top:0!important}@media screen and (max-width:782px){.admin-bar #berocket-ajax-filters-sidebar{top:46px}}@media screen and (max-width:600px){.admin-bar #berocket-ajax-filters-sidebar{top:0}}.berocket_aapf_widget-wrapper .slider:not(.flickity-enabled){overflow:initial;white-space:initial}.select2-container{z-index:999}.bapf_sfilter .bapf_body .mCSB_container>ul,.bapf_sfilter .bapf_body>ul{margin-left:0;margin-top:0!important;margin-bottom:0!important}.bapf_sfilter.bapf_vpr_1 .bapf_body ul,.bapf_sfilter.bapf_vpr_2 .bapf_body ul,.bapf_sfilter.bapf_vpr_3 .bapf_body ul,.bapf_sfilter.bapf_vpr_4 .bapf_body ul{display:flex;flex-wrap:wrap}.bapf_sfilter.bapf_vpr_1 .bapf_body ul>li,.bapf_sfilter.bapf_vpr_2 .bapf_body ul>li,.bapf_sfilter.bapf_vpr_3 .bapf_body ul>li,.bapf_sfilter.bapf_vpr_4 .bapf_body ul>li{white-space:nowrap;flex-grow:1}.bapf_sfilter.bapf_vpr_1 .bapf_body ul>li{flex-basis:100%}.bapf_sfilter.bapf_vpr_2 .bapf_body ul>li{flex-basis:50%}.bapf_sfilter.bapf_vpr_3 .bapf_body ul>li{flex-basis:33%}.bapf_sfilter.bapf_vpr_4 .bapf_body ul>li{flex-basis:25%}.bapf_sfilter.bapf_vpr_1 .bapf_body ul>li label,.bapf_sfilter.bapf_vpr_2 .bapf_body ul>li label,.bapf_sfilter.bapf_vpr_3 .bapf_body ul>li label,.bapf_sfilter.bapf_vpr_4 .bapf_body ul>li label{white-space:initial}.bapf_sfilter .bapf_hascolarr,.bapf_sfilter .bapf_hasdesc{position:relative;padding-right:25px;display:flex;align-items:center}.bapf_sfilter .bapf_hascolarr.bapf_hasdesc{padding-right:45px}.bapf_sfilter .bapf_colaps_smb,.bapf_sfilter .bapf_desci{position:absolute;right:0;line-height:inherit;font-size:16px;cursor:pointer}.bapf_sfilter .bapf_desci{padding:4px 8px}.bapf_sfilter .bapf_hasdesc .bapf_colaps_smb{right:25px}.bapf_sfilter .bapf_cchild,.bapf_sfilter .bapf_ochild{cursor:pointer;padding:0 5px}#berocket-ajax-filters-sidebar .berocket_single_filter_widget.berocket_hidden_clickable .bapf_sfilter .bapf_head,.berocket_single_filter_widget.berocket_hidden_clickable .bapf_sfilter .bapf_head{border:2px solid #333!important;background-color:#333!important;color:#ccc!important;padding:5px!important;border-radius:5px!important;cursor:pointer}#berocket-ajax-filters-sidebar .berocket_single_filter_widget.berocket_hidden_clickable .berocket_widget_has_description .berocket_aapf_widget-title_div,.berocket_single_filter_widget.berocket_hidden_clickable .berocket_widget_has_description .berocket_aapf_widget-title_div{padding-right:55px!important}#berocket-ajax-filters-sidebar .berocket_single_filter_widget.berocket_hidden_clickable .berocket_aapf_widget-wrapper,.berocket_single_filter_widget.berocket_hidden_clickable .berocket_aapf_widget-wrapper{padding-bottom:5px!important}#berocket-ajax-filters-sidebar .berocket_single_filter_widget.berocket_hidden_clickable .bapf_sfilter .bapf_head h3,.berocket_single_filter_widget.berocket_hidden_clickable .bapf_sfilter .bapf_head h3{margin:0;font-size:inherit!important;color:inherit!important}#berocket-ajax-filters-sidebar .berocket_single_filter_widget.berocket_hidden_clickable .bapf_sfilter,.berocket_single_filter_widget.berocket_hidden_clickable .bapf_sfilter{position:relative!important}#berocket-ajax-filters-sidebar .berocket_single_filter_widget.berocket_hidden_clickable .bapf_sfilter.bapf_ccolaps .bapf_head,.berocket_single_filter_widget.berocket_hidden_clickable .bapf_sfilter.bapf_ccolaps .bapf_head{border:2px solid #ccc!important;color:#000!important;background-color:#ccc!important;border-radius:5px 5px 0 0!important;padding-bottom:5px!important}#berocket-ajax-filters-sidebar .berocket_single_filter_widget.berocket_hidden_clickable .bapf_sfilter .bapf_body,.berocket_single_filter_widget.berocket_hidden_clickable .bapf_sfilter .bapf_body{position:absolute!important;top:100%!important;width:100%!important;background-color:#fff!important;z-index:800!important;margin:0!important;border:2px solid #ccc!important;padding:5px!important}#berocket-ajax-filters-sidebar .berocket_single_filter_widget.berocket_hidden_clickable.berocket_hidden_clickable_right .bapf_sfilter.bapf_ccolaps .bapf_body,.berocket_single_filter_widget.berocket_hidden_clickable.berocket_hidden_clickable_right .bapf_sfilter.bapf_ccolaps .bapf_body{right:0!important}@media screen and (max-width:767px){#berocket-ajax-filters-sidebar .berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible,.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible{position:fixed!important;top:0!important;left:0!important;bottom:0!important;right:0!important;z-index:9000000000!important;background-color:#fff!important;overflow:auto!important}#berocket-ajax-filters-sidebar .berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_widget,.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_widget{border:0!important;width:100%!important;max-width:100%!important}#berocket-ajax-filters-sidebar .berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_widget_show.mobile_hide,.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_widget_show.mobile_hide{display:block!important}#berocket-ajax-filters-sidebar .berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_widget_show.mobile_hide .fa-angle-left:before,#berocket-ajax-filters-sidebar .berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_widget_show.mobile_hide .fa-angle-right:before,.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_widget_show.mobile_hide .fa-angle-left:before,.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_widget_show.mobile_hide .fa-angle-right:before{content:"\f00d"!important}#berocket-ajax-filters-sidebar .berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_description,.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_description{display:none!important}body .select2-container,body .ui-widget.ui-datepicker{z-index:9000000009!important}}@keyframes bapf_loader{from{transform:rotate(0)}to{transform:rotate(360deg)}}.bapf_loader_page{position:fixed;top:0;left:0;bottom:0;right:0;background-color:rgba(255,255,255,.5);z-index:9999}.bapf_lcontainer{position:absolute;top:50%;margin:-20px 0 0 -20px;left:50%;width:30px;height:30px;padding:0}.bapf_lcontainer .bapf_loader{width:100%;height:100%;display:block;transform:rotate(0);animation:1s linear 0s infinite bapf_loader;position:relative}.bapf_lcontainer .bapf_loader .bapf_lfirst,.bapf_lcontainer .bapf_loader .bapf_lsecond{position:absolute;width:10px;height:10px;background:#000;background:linear-gradient(45deg,#000,transparent);display:block;border-radius:6px}.bapf_lcontainer .bapf_loader .bapf_lfirst{bottom:0;right:0}.bapf_lcontainer .bapf_loader .bapf_lsecond{top:0;left:0;transform:rotate(180deg)}.bapf_lcontainer .bapf_labove,.bapf_lcontainer .bapf_lbelow{position:absolute;display:block;text-align:center;width:80vw;left:calc(15px - 40vw)}.bapf_lcontainer .bapf_labove{bottom:120%}.bapf_lcontainer .bapf_lbelow{top:120%}.bapf_lcontainer .bapf_lafter,.bapf_lcontainer .bapf_lbefore{position:absolute;top:50%;margin-top:-15px;height:30px;line-height:30px;vertical-align:middle;white-space:nowrap}.bapf_lcontainer .bapf_lbefore{right:120%}.bapf_lcontainer .bapf_lafter{left:120%}.bapf_lcontainer .bapf_limg{width:100%;height:100%}.berocket_single_filter_widget .tippy-tooltip,.berocket_single_filter_widget .tippy-tooltip .tippy-content{font-size:1em}@media only screen and (max-device-width:767px){.bapf_hide_mobile{display:none!important}}.bapf_sfilter .bapf_button{font-size:1em}.bapf_sfilter .rightpcs{float:right}.bapf_sfilter .right2empcs{padding-left:10px}#bapf_footer_clrimg>div,#bapf_footer_count_before>div,#bapf_footer_description>div{z-index:999999999999!important}.bapf_sfilter.bapf_ckbox input[type=checkbox]{margin-right:5px;cursor:pointer}.bapf_sfilter.bapf_ckbox input[type=checkbox],.bapf_sfilter.bapf_ckbox label,.bapf_sfilter.bapf_ckbox label+span,.bapf_sfilter.bapf_ckbox label>span{vertical-align:middle}.select2-container--classic input[type=search],.select2-container--classic input[type=search]:focus{background-color:initial}.berocket_search_box_block{position:relative;padding:.5em}.berocket_search_box_block .berocket_search_box_background_all{position:relative;z-index:200}.berocket_search_box_block .berocket_search_box_background{z-index:100;position:absolute;top:0;bottom:0;left:0;right:0}.berocket_search_box_block select{min-width:100%}.berocket_search_box_button{cursor:pointer;display:block;text-align:center;padding:5px 0}.berocket_search_box_block .berocket_aapf_widget-wrapper ul{margin:0}.berocket_search_box_block .berocket_aapf_widget-wrapper{margin:1em 0}.bapf_show_hide{cursor:pointer}.bapf_hideckbox li input[type=checkbox],.bapf_hideckbox li input[type=checkbox]:after,.bapf_hideckbox li input[type=checkbox]:before{display:none!important}.bapf_hideckbox li label,.bapf_hideckbox li label a{color:#428bca}.bapf_hideckbox li input:checked+label:hover,.bapf_hideckbox li input:checked+label:hover a,.bapf_hideckbox li label:hover,.bapf_hideckbox li label:hover a{color:#2a6496}.bapf_hideckbox li input:checked+label,.bapf_hideckbox li input:checked+label a{color:#222}.bapf_sfilter.bapf_clr_txt_left .bapf_body ul,.bapf_sfilter.bapf_clr_txt_right .bapf_body ul{width:100%;flex-basis:100%}.bapf_sfilter.bapf_clr_txt_left .bapf_body ul li,.bapf_sfilter.bapf_clr_txt_right .bapf_body ul li{display:flex;align-items:center;flex-wrap:wrap}.bapf_sfilter.bapf_clr_txt_left .bapf_body ul li label,.bapf_sfilter.bapf_clr_txt_right .bapf_body ul li label{display:flex!important;flex-direction:row!important;align-items:center!important}.bapf_sfilter.bapf_clr_txt_left .bapf_body ul li label .bapf_clr_span,.bapf_sfilter.bapf_clr_txt_left .bapf_body ul li label .bapf_img_span,.bapf_sfilter.bapf_clr_txt_right .bapf_body ul li label .bapf_clr_span,.bapf_sfilter.bapf_clr_txt_right .bapf_body ul li label .bapf_img_span{flex-shrink:0}.bapf_sfilter.bapf_button_berocket .bapf_button{font-size:20px;padding:8px 30px;border:0;line-height:28px;font-weight:600;display:inline-block;color:#fff;text-transform:uppercase;text-align:center;text-decoration:none;background-color:#f16543}.bapf_sfilter.bapf_button_berocket .bapf_button:hover{background-color:#d94825}.bapf_sfilter.bapf_colorinline li{display:inline-block!important}.bapf_sfilter .bapf_clr_span,.bapf_sfilter .bapf_img_span{display:inline-block!important;position:relative;overflow:hidden;margin:5px;height:2em;width:2em;line-height:2em;border:2px solid #000;text-align:center;vertical-align:middle;color:#222!important;text-shadow:0 0 3px #FFF,1px 0 2px #FFF,0 1px 2px #FFF,-1px 0 2px #FFF,0 -1px 2px #FFF,1px 1px 2px #FFF,1px -1px 2px #FFF,-1px 1px 2px #FFF,-1px -1px 2px #FFF;-webkit-transition:all .2s ease-out .1s;-moz-transition:all .2s ease-out .1s;-o-transition:all .2s ease-out .1s;transition:all .2s ease-out .1s}.bapf_sfilter .bapf_clr_span.h1em,.bapf_sfilter .bapf_img_span.h1em{height:1em;line-height:1em}.bapf_sfilter .bapf_clr_span.h2em,.bapf_sfilter .bapf_img_span.h2em{height:2em;line-height:2em}.bapf_sfilter .bapf_clr_span.h3em,.bapf_sfilter .bapf_img_span.h3em{height:3em;line-height:3em}.bapf_sfilter .bapf_clr_span.h4em,.bapf_sfilter .bapf_img_span.h4em{height:4em;line-height:4em}.bapf_sfilter .bapf_clr_span.h5em,.bapf_sfilter .bapf_img_span.h5em{height:5em;line-height:5em}.bapf_sfilter .bapf_clr_span.w1em,.bapf_sfilter .bapf_img_span.w1em{width:1em}.bapf_sfilter .bapf_clr_span.w2em,.bapf_sfilter .bapf_img_span.w2em{width:2em}.bapf_sfilter .bapf_clr_span.w3em,.bapf_sfilter .bapf_img_span.w3em{width:3em}.bapf_sfilter .bapf_clr_span.w4em,.bapf_sfilter .bapf_img_span.w4em{width:4em}.bapf_sfilter .bapf_clr_span.w5em,.bapf_sfilter .bapf_img_span.w5em{width:5em}.bapf_sfilter .bapf_img_span.w1em.h1em .fa,.bapf_sfilter .bapf_img_span.w1em.h2em .fa,.bapf_sfilter .bapf_img_span.w1em.h3em .fa,.bapf_sfilter .bapf_img_span.w1em.h4em .fa,.bapf_sfilter .bapf_img_span.w1em.h5em .fa,.bapf_sfilter .bapf_img_span.w2em.h1em .fa,.bapf_sfilter .bapf_img_span.w3em.h1em .fa,.bapf_sfilter .bapf_img_span.w4em.h1em .fa,.bapf_sfilter .bapf_img_span.w5em.h1em .fa{font-size:.8em}.bapf_sfilter .bapf_img_span.w2em.h2em .fa,.bapf_sfilter .bapf_img_span.w2em.h3em .fa,.bapf_sfilter .bapf_img_span.w2em.h4em .fa,.bapf_sfilter .bapf_img_span.w2em.h5em .fa,.bapf_sfilter .bapf_img_span.w3em.h2em .fa,.bapf_sfilter .bapf_img_span.w4em.h2em .fa,.bapf_sfilter .bapf_img_span.w5em.h2em .fa{font-size:1.6em}.bapf_sfilter .bapf_img_span.w3em.h3em .fa,.bapf_sfilter .bapf_img_span.w3em.h4em .fa,.bapf_sfilter .bapf_img_span.w3em.h5em .fa,.bapf_sfilter .bapf_img_span.w4em.h3em .fa,.bapf_sfilter .bapf_img_span.w5em.h3em .fa{font-size:2.4em}.bapf_sfilter .bapf_img_span.w4em.h4em .fa,.bapf_sfilter .bapf_img_span.w4em.h5em .fa,.bapf_sfilter .bapf_img_span.w5em.h4em .fa{font-size:3.2em}.bapf_sfilter .bapf_img_span.w5em.h5em .fa{font-size:4em}.bapf_sfilter .bapf_clr_span .bapf_clr_span_abslt{position:relative;z-index:100}.bapf_sfilter.brchecked_default input:checked+label .bapf_clr_span,.bapf_sfilter.brchecked_default input:checked+label .bapf_img_span,.bapf_sfilter.brchecked_rotate input:checked+label .bapf_clr_span,.bapf_sfilter.brchecked_rotate input:checked+label .bapf_img_span{-webkit-transform:rotate(15deg);-moz-transform:rotate(15deg);-ms-transform:rotate(15deg);-o-transform:rotate(15deg);transform:rotate(15deg)}.bapf_sfilter.brchecked_scale input:checked+label .bapf_clr_span,.bapf_sfilter.brchecked_scale input:checked+label .bapf_img_span{transform:scale(1.1)}.bapf_sfilter.brchecked_image_shadow input:checked+label .bapf_clr_span,.bapf_sfilter.brchecked_shadow input:checked+label .bapf_clr_span,.bapf_sfilter.brchecked_shadow input:checked+label .bapf_img_span{box-shadow:0 0 1px 3px #88F}.bapf_sfilter.brchecked_image_shadow input:checked+label .bapf_img_span{-webkit-filter:drop-shadow(0 0 2px);-moz-filter:drop-shadow(0 0 2px);-o-filter:drop-shadow(0 0 2px);filter:drop-shadow(0 0 2px)}.bapf_sfilter.brchecked_hue_rotate input:checked+label .bapf_clr_span,.bapf_sfilter.brchecked_hue_rotate input:checked+label .bapf_img_span{-webkit-filter:hue-rotate(90deg);-moz-filter:hue-rotate(90deg);-o-filter:hue-rotate(90deg);filter:hue-rotate(90deg)}.bapf_sfilter .bapf_clr_multi{position:absolute;top:0;bottom:0;left:0;right:0;z-index:2;transform:rotateZ(45deg);padding:0;margin:-2em 0;box-sizing:border-box}.bapf_sfilter .bapf_clr_multi .bapf_clr_multi_singl{position:absolute;top:-50%;bottom:-50%;padding:0;margin:0;box-shadow:none;box-sizing:border-box;border:0}.bapf_sfilter .bapf_clr_multi_2 .bapf_clr_multi_singl,.bapf_sfilter .bapf_clr_multi_3 .bapf_clr_multi_singl{width:100%}.bapf_sfilter .bapf_clr_multi_3 .bapf_clr_multi_singl_1{width:34%}.bapf_sfilter .bapf_clr_multi_3 .bapf_clr_multi_singl_0,.bapf_sfilter .bapf_clr_multi_3 .bapf_clr_multi_singl_2{width:83%}.bapf_sfilter .bapf_clr_multi_4 .bapf_clr_multi_singl{width:25%}.bapf_sfilter .bapf_clr_multi_4 .bapf_clr_multi_singl_0,.bapf_sfilter .bapf_clr_multi_4 .bapf_clr_multi_singl_3{width:75%}.bapf_sfilter .bapf_clr_multi .bapf_clr_multi_singl_0{left:-50%}.bapf_sfilter .bapf_clr_multi_2 .bapf_clr_multi_singl_1{left:50%}.bapf_sfilter .bapf_clr_multi_3 .bapf_clr_multi_singl_1{left:33%}.bapf_sfilter .bapf_clr_multi_4 .bapf_clr_multi_singl_1{left:25%}.bapf_sfilter .bapf_clr_multi_3 .bapf_clr_multi_singl_2{left:67%}.bapf_sfilter .bapf_clr_multi_4 .bapf_clr_multi_singl_2{left:50%}.bapf_sfilter .bapf_clr_multi_4 .bapf_clr_multi_singl_3{left:75%}.bapf_sfilter.bapf_clr_txt_left .bapf_img_span{margin:5px 0 5px 10px}.bapf_sfilter.bapf_clr_txt_right .bapf_img_span{margin:5px 10px 5px 0}.bapf_sfilter.bapf_clr_txt_bottom .bapf_img_span,.bapf_sfilter.bapf_clr_txt_top .bapf_img_span{margin:5px 10px}.bapf_sfilter.bapf_colorinline.bapf_clr_txt_bottom li label,.bapf_sfilter.bapf_colorinline.bapf_clr_txt_top li label{display:inline-block!important;text-align:center}.bapf_sfilter.bapf_clr_txt_bottom .bapf_clr_text,.bapf_sfilter.bapf_clr_txt_top .bapf_clr_text{display:block;margin-right:10px;margin-left:10px}.bapf_colorinline .bapf_body li{text-align:center}.bapf_img_woborder.bapf_sfilter .bapf_img_span{border:none;overflow:visible}.bapf_clr_woborder.bapf_sfilter .bapf_clr_span{border:none}.bapf_radio_chck ul li input[type=checkbox]{-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;appearance:none;display:inline-block;vertical-align:middle;border:2px solid #555;width:15px;height:15px;outline:0;border-radius:10px;padding:2px;margin-right:5px;position:relative}.bapf_radio_chck ul li input[type=checkbox]:checked:after{content:"";width:8px;height:12px;border-bottom:2px solid #333;border-right:2px solid #333;display:block;position:absolute;top:-4px;left:3px;transform:rotate(45deg)}.bapf_asradio2 ul li input[type=checkbox]{-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;appearance:none;display:inline-block;vertical-align:middle;border:2px solid #555;width:15px;height:15px;outline:0;border-radius:10px;padding:2px;margin-right:5px}.bapf_asradio2 ul li input[type=checkbox]:checked{background:#555;background-clip:content-box}.bapf_slct select{width:100%;font-size:1em}.bapf_slct .select2 .select2-search__field{width:auto!important}#bapf-select2-high-zindex .select2-container{z-index:999999999!important}.bapf_sfa_inline .berocket_aapf_widget_selected_area ul li{display:inline-block;margin-left:3px!important;margin-right:3px!important}.bapf_ckbox_sqchck input[type=checkbox]{-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;appearance:none;display:inline-block;vertical-align:middle;border:2px solid #555;width:20px;height:20px;outline:0;padding:4px;margin-right:5px;position:relative}.bapf_ckbox_sqchck input[type=checkbox]:checked:after{content:"";width:8px;height:12px;border-bottom:2px solid #333;border-right:2px solid #333;display:block;position:absolute;top:0;left:4px;transform:rotate(45deg)}.bapf_ckbox_square input[type=checkbox]{-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;appearance:none;display:inline-block;vertical-align:middle;border:2px solid #555;width:20px;height:20px;outline:0;padding:4px;margin-right:5px}.bapf_ckbox_square input[type=checkbox]:checked{background:#555;background-clip:content-box}/*! jQuery UI - v1.12.1 - 2020-08-04
|
2 |
* http://jqueryui.com
|
3 |
* Includes: core.css, datepicker.css, slider.css, theme.css
|
4 |
* To view and modify this theme, visit http://jqueryui.com/themeroller/?scope=.bapfdpapcss&folderName=bapfdpapcss&cornerRadiusShadow=8px&offsetLeftShadow=0px&offsetTopShadow=0px&thicknessShadow=5px&opacityShadow=30&bgImgOpacityShadow=0&bgTextureShadow=flat&bgColorShadow=666666&opacityOverlay=30&bgImgOpacityOverlay=0&bgTextureOverlay=flat&bgColorOverlay=aaaaaa&iconColorError=cc0000&fcError=5f3f3f&borderColorError=f1a899&bgTextureError=flat&bgColorError=fddfdf&iconColorHighlight=777620&fcHighlight=777620&borderColorHighlight=dad55e&bgTextureHighlight=flat&bgColorHighlight=fffa90&iconColorActive=ffffff&fcActive=ffffff&borderColorActive=003eff&bgTextureActive=flat&bgColorActive=007fff&iconColorHover=555555&fcHover=2b2b2b&borderColorHover=cccccc&bgTextureHover=flat&bgColorHover=ededed&iconColorDefault=777777&fcDefault=454545&borderColorDefault=c5c5c5&bgTextureDefault=flat&bgColorDefault=f6f6f6&iconColorContent=444444&fcContent=333333&borderColorContent=dddddd&bgTextureContent=flat&bgColorContent=ffffff&iconColorHeader=444444&fcHeader=333333&borderColorHeader=dddddd&bgTextureHeader=flat&bgColorHeader=e9e9e9&cornerRadius=3px&fwDefault=normal&fsDefault=1em&ffDefault=Arial%2CHelvetica%2Csans-serif
|
1 |
+
.select2-container{box-sizing:border-box;display:inline-block;margin:0;position:relative;vertical-align:middle}.select2-container .select2-selection--single{box-sizing:border-box;cursor:pointer;display:block;height:28px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--single .select2-selection__rendered{display:block;padding-left:8px;padding-right:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-selection--single .select2-selection__clear{position:relative}.select2-container[dir=rtl] .select2-selection--single .select2-selection__rendered{padding-right:8px;padding-left:20px}.select2-container .select2-selection--multiple{box-sizing:border-box;cursor:pointer;display:block;min-height:32px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--multiple .select2-selection__rendered{display:inline-block;overflow:hidden;padding-left:8px;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-search--inline{float:left}.select2-container .select2-search--inline .select2-search__field{box-sizing:border-box;border:none;font-size:100%;margin-top:5px;padding:0}.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-dropdown{background-color:#fff;border:1px solid #aaa;border-radius:4px;box-sizing:border-box;display:block;position:absolute;left:-100000px;width:100%;z-index:1051}.select2-results{display:block}.select2-results__options{list-style:none;margin:0;padding:0}.select2-results__option{padding:6px;user-select:none;-webkit-user-select:none}.select2-results__option[aria-selected]{cursor:pointer}.select2-container--open .select2-dropdown{left:0}.select2-container--open .select2-dropdown--above{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--open .select2-dropdown--below{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-search--dropdown{display:block;padding:4px}.select2-search--dropdown .select2-search__field{padding:4px;width:100%;box-sizing:border-box}.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-search--dropdown.select2-search--hide{display:none}.select2-close-mask{border:0;margin:0;padding:0;display:block;position:fixed;left:0;top:0;min-height:100%;min-width:100%;height:auto;width:auto;opacity:0;z-index:99;background-color:#fff;filter:alpha(opacity=0)}.select2-hidden-accessible{border:0!important;clip:rect(0 0 0 0)!important;-webkit-clip-path:inset(50%)!important;clip-path:inset(50%)!important;height:1px!important;overflow:hidden!important;padding:0!important;position:absolute!important;width:1px!important;white-space:nowrap!important}.select2-container--default .select2-selection--single{background-color:#fff;border:1px solid #aaa;border-radius:4px}.select2-container--default .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--default .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:700}.select2-container--default .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--default .select2-selection--single .select2-selection__arrow{height:26px;position:absolute;top:1px;right:1px;width:20px}.select2-container--default .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent;border-style:solid;border-width:5px 4px 0;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--default[dir=rtl] .select2-selection--single .select2-selection__clear{float:left}.select2-container--default[dir=rtl] .select2-selection--single .select2-selection__arrow{left:1px;right:auto}.select2-container--default.select2-container--disabled .select2-selection--single{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear{display:none}.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888;border-width:0 4px 5px}.select2-container--default .select2-selection--multiple{background-color:#fff;border:1px solid #aaa;border-radius:4px;cursor:text}.select2-container--default .select2-selection--multiple .select2-selection__rendered{box-sizing:border-box;list-style:none;margin:0;padding:0 5px;width:100%}.select2-container--default .select2-selection--multiple .select2-selection__rendered li{list-style:none}.select2-container--default .select2-selection--multiple .select2-selection__clear{cursor:pointer;float:right;font-weight:700;margin-top:5px;margin-right:10px;padding:1px}.select2-container--default .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{color:#999;cursor:pointer;display:inline-block;font-weight:700;margin-right:2px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover{color:#333}.select2-container--default[dir=rtl] .select2-selection--multiple .select2-search--inline,.select2-container--default[dir=rtl] .select2-selection--multiple .select2-selection__choice{float:right}.select2-container--default[dir=rtl] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--default[dir=rtl] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--default.select2-container--focus .select2-selection--multiple{border:1px solid #000;outline:0}.select2-container--default.select2-container--disabled .select2-selection--multiple{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection__choice__remove{display:none}.select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple,.select2-container--default.select2-container--open.select2-container--above .select2-selection--single{border-top-left-radius:0;border-top-right-radius:0}.select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple,.select2-container--default.select2-container--open.select2-container--below .select2-selection--single{border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--default .select2-search--dropdown .select2-search__field{border:1px solid #aaa}.select2-container--default .select2-search--inline .select2-search__field{background:0 0;border:none;outline:0;box-shadow:none;-webkit-appearance:textfield}.select2-container--default .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--default .select2-results__option[role=group]{padding:0}.select2-container--default .select2-results__option[aria-disabled=true]{color:#999}.select2-container--default .select2-results__option[aria-selected=true]{background-color:#ddd}.select2-container--default .select2-results__option .select2-results__option{padding-left:1em}.select2-container--default .select2-results__option .select2-results__option .select2-results__group{padding-left:0}.select2-container--default .select2-results__option .select2-results__option .select2-results__option{margin-left:-1em;padding-left:2em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-2em;padding-left:3em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-3em;padding-left:4em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-4em;padding-left:5em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-5em;padding-left:6em}.select2-container--default .select2-results__option--highlighted[aria-selected]{background-color:#5897fb;color:#fff}.select2-container--default .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic .select2-selection--single{background-color:#f7f7f7;border:1px solid #aaa;border-radius:4px;outline:0;background-image:-webkit-linear-gradient(top,#fff 50%,#eee 100%);background-image:-o-linear-gradient(top,#fff 50%,#eee 100%);background-image:linear-gradient(to bottom,#fff 50%,#eee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic .select2-selection--single:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--classic .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:700;margin-right:10px}.select2-container--classic .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--classic .select2-selection--single .select2-selection__arrow{background-color:#ddd;border:none;border-left:1px solid #aaa;border-top-right-radius:4px;border-bottom-right-radius:4px;height:26px;position:absolute;top:1px;right:1px;width:20px;background-image:-webkit-linear-gradient(top,#eee 50%,#ccc 100%);background-image:-o-linear-gradient(top,#eee 50%,#ccc 100%);background-image:linear-gradient(to bottom,#eee 50%,#ccc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0)}.select2-container--classic .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent;border-style:solid;border-width:5px 4px 0;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--classic[dir=rtl] .select2-selection--single .select2-selection__clear{float:left}.select2-container--classic[dir=rtl] .select2-selection--single .select2-selection__arrow{border:none;border-right:1px solid #aaa;border-radius:4px 0 0 4px;left:1px;right:auto}.select2-container--classic.select2-container--open .select2-selection--single{border:1px solid #5897fb}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow{background:0 0;border:none}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888;border-width:0 4px 5px}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single{border-top:none;border-top-left-radius:0;border-top-right-radius:0;background-image:-webkit-linear-gradient(top,#fff 0,#eee 50%);background-image:-o-linear-gradient(top,#fff 0,#eee 50%);background-image:linear-gradient(to bottom,#fff 0,#eee 50%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;background-image:-webkit-linear-gradient(top,#eee 50%,#fff 100%);background-image:-o-linear-gradient(top,#eee 50%,#fff 100%);background-image:linear-gradient(to bottom,#eee 50%,#fff 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0)}.select2-container--classic .select2-selection--multiple{background-color:#fff;border:1px solid #aaa;border-radius:4px;cursor:text;outline:0}.select2-container--classic .select2-selection--multiple:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--multiple .select2-selection__rendered{list-style:none;margin:0;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__clear{display:none}.select2-container--classic .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove{color:#888;cursor:pointer;display:inline-block;font-weight:700;margin-right:2px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover{color:#555}.select2-container--classic[dir=rtl] .select2-selection--multiple .select2-selection__choice{float:right;margin-left:5px;margin-right:auto}.select2-container--classic[dir=rtl] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--classic.select2-container--open .select2-selection--multiple{border:1px solid #5897fb}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--classic .select2-search--dropdown .select2-search__field{border:1px solid #aaa;outline:0}.select2-container--classic .select2-search--inline .select2-search__field{outline:0;box-shadow:none}.select2-container--classic .select2-dropdown{background-color:#fff;border:1px solid transparent}.select2-container--classic .select2-dropdown--above{border-bottom:none}.select2-container--classic .select2-dropdown--below{border-top:none}.select2-container--classic .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--classic .select2-results__option[role=group]{padding:0}.select2-container--classic .select2-results__option[aria-disabled=true]{color:grey}.select2-container--classic .select2-results__option--highlighted[aria-selected]{background-color:#3875d7;color:#fff}.select2-container--classic .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic.select2-container--open .select2-dropdown{border-color:#5897fb}.bapf_sfilter .bapf_button,.bapf_sfilter label{cursor:pointer;display:inline-block!important}.bapf_sfilter ul li{list-style:none!important;margin:0!important;padding:0!important;max-width:100%;text-align:left!important}.rtl .bapf_sfilter ul li{text-align:right!important}.bapf_sfilter .bapf_body ul li ul{margin-left:15px}.bapf_slidr_main.ui-widget-content,.berocket_filter_price_slider.ui-widget-content{background:#b0b5b9;border:0;border-radius:0;height:4px;padding:0}.bapf_slidr_main.ui-widget-content .ui-slider-range,.berocket_filter_price_slider.ui-widget-content .ui-slider-range{background:#000}.slide.default .bapf_slidr_main.ui-widget-content .ui-slider-range,.slide.default .berocket_filter_price_slider.ui-widget-content .ui-slider-range{background:#222}.slide.default .bapf_slidr_main.ui-widget-content,.slide.default .berocket_filter_price_slider.ui-widget-content{height:4px;border:1px solid #555;font-size:10px}.bapf_slidr_main.ui-widget-content .ui-slider-handle,.berocket_filter_price_slider.ui-widget-content .ui-slider-handle,.slide.default .bapf_slidr_main .ui-state-default,.slide.default .bapf_slidr_main .ui-widget-header .ui-state-default,.slide.default .bapf_slidr_main.ui-widget-content .ui-state-default,.slide.default .berocket_filter_price_slider .ui-state-default,.slide.default .berocket_filter_price_slider .ui-widget-header .ui-state-default,.slide.default .berocket_filter_price_slider.ui-widget-content .ui-state-default{background:#ddd;font-size:14px;width:1em;height:1em;border:1px solid #555;top:-6px;border-radius:2em}.berocket_aapf_widget li.slider div.slide{clear:both;height:auto;text-align:right;line-height:0}.bapf_slidr_jqrui .bapf_from,.ui-slider{text-align:left}.ui-slider{position:relative}.ui-slider .ui-slider-handle{position:absolute;z-index:2;width:1.2em;height:1.2em;cursor:pointer;-ms-touch-action:none;touch-action:none}.ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;background-position:0 0}.ui-slider.ui-state-disabled .ui-slider-handle,.ui-slider.ui-state-disabled .ui-slider-range{filter:inherit}.ui-slider-horizontal{height:.8em}.ui-slider-horizontal .ui-slider-handle{top:-.3em;margin-left:-.6em}.bapf_slidr_main>a:last-child{margin-left:-12px}.ui-slider-horizontal .ui-slider-range{top:0;height:100%}.ui-slider-horizontal .ui-slider-range-min{left:0}.ui-slider-horizontal .ui-slider-range-max{right:0}.ui-slider-vertical{width:.8em;height:100px}.ui-slider-vertical .ui-slider-handle{left:-.3em;margin-left:0;margin-bottom:-.6em}.ui-slider-vertical .ui-slider-range{left:0;width:100%}#berocket-ajax-filters-sidebar .berocket_single_filter_widget.berocket_hidden_clickable.berocket_hidden_clickable_left .bapf_sfilter.bapf_ccolaps .bapf_body,.berocket_single_filter_widget.berocket_hidden_clickable.berocket_hidden_clickable_left .bapf_sfilter.bapf_ccolaps .bapf_body,.berocket_single_filter_widget.berocket_hidden_clickable.berocket_hidden_clickable_left .berocket_aapf_widget{left:0!important}.ui-slider-vertical .ui-slider-range-min{bottom:0}.ui-slider-vertical .ui-slider-range-max{top:0}.slide .ui-corner-all,.slide .ui-corner-bottom,.slide .ui-corner-br,.slide .ui-corner-right{border-bottom-right-radius:4px}.slide .ui-corner-all,.slide .ui-corner-bl,.slide .ui-corner-bottom,.slide .ui-corner-left{border-bottom-left-radius:4px}.slide .ui-corner-all,.slide .ui-corner-right,.slide .ui-corner-top,.slide .ui-corner-tr{border-top-right-radius:4px}.slide .ui-corner-all,.slide .ui-corner-left,.slide .ui-corner-tl,.slide .ui-corner-top{border-top-left-radius:4px}ul.berocket_aapf_widget li.slider>span{cursor:initial}ul.berocket_aapf_widget li.slider .bapf_slidr_main{cursor:pointer}.slide .ui-widget-content{background:#fff;border:1px solid #aaa;color:#222}.slide .ui-state-default,.slide .ui-widget-content .ui-state-default,.slide .ui-widget-header .ui-state-default{background:#e6e6e6;border:1px solid #d3d3d3;color:#555;font-weight:400}.ui-widget.ui-datepicker{font-size:14px;z-index:9000!important}.bapf_sfilter .ui-button,.bapf_sfilter .ui-state-default,.bapf_sfilter .ui-widget-content .ui-state-default,.bapf_sfilter .ui-widget-header .ui-state-default,.bapf_sfilter .ui-widget.ui-widget-content,html .bapf_sfilter .ui-button.ui-state-disabled:active,html .bapf_sfilter .ui-button.ui-state-disabled:hover{border:0}.bapf_slidr_jqrui .bapf_slidr_all:after{content:"";display:block;clear:both}.bapf_slidr_jqrui .bapf_slidr_main{margin-bottom:10px}.bapf_slidr_jqrui .bapf_from,.bapf_slidr_jqrui .bapf_to{width:49%;display:inline-block;margin-bottom:10px;vertical-align:middle}.bapf_slidr_jqrui .bapf_from input,.bapf_slidr_jqrui .bapf_to input{width:50%;vertical-align:middle;font-size:1em;padding:0;margin:0;line-height:1em}.bapf_slidr_jqrui .bapf_to{text-align:right}.bapf_sfilter{margin-bottom:20px}.berocket_single_filter_widget.berocket_inline_clickable,.berocket_single_filter_widget.berocket_inline_filters{float:left!important;padding-right:15px!important}.berocket_single_filter_widget.berocket_inline_filters{width:12.5%!important}#berocket-ajax-filters-sidebar .berocket_single_filter_widget.berocket_hidden_clickable .berocket_aapf_widget-title_div,.berocket_single_filter_widget.berocket_hidden_clickable .berocket_aapf_widget-title_div{border:2px solid #333!important;background-color:#333!important;color:#ccc!important;padding:5px 35px 5px 5px!important;border-radius:5px!important}.berocket_single_filter_widget.berocket_hidden_clickable .berocket_widget_has_description .berocket_aapf_widget-title_div{padding-right:55px!important}.berocket_single_filter_widget.berocket_hidden_clickable .berocket_aapf_widget-wrapper{padding-bottom:5px!important}.berocket_single_filter_widget.berocket_hidden_clickable .berocket_aapf_widget-title_div h3{margin:0!important;padding:0!important;font-size:inherit!important;color:inherit!important}.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_widget-title_div{border:2px solid #ccc!important;color:#000!important;background-color:#ccc!important;border-radius:5px 5px 0 0!important;padding-bottom:10px!important}.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_widget-wrapper{padding-bottom:0!important}.berocket_single_filter_widget.berocket_hidden_clickable .berocket_aapf_widget{position:absolute!important;top:100%!important;width:100%!important;background-color:#fff!important;z-index:800!important;margin:0!important;border:2px solid #ccc!important;padding:5px!important;display:none}.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_widget{z-index:900!important}.berocket_single_filter_widget.berocket_hidden_clickable.berocket_hidden_clickable_right .berocket_aapf_widget{right:0!important}@media screen and (max-width:767px){.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible{position:fixed!important;top:0!important;left:0!important;bottom:0!important;right:0!important;z-index:9000000000!important;background-color:#fff!important;overflow:auto!important}.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_widget{border:0!important;width:100%!important;max-width:100%!important}.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_widget_show.mobile_hide{display:block!important}.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_widget_show.mobile_hide .fa-angle-left:before,.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_widget_show.mobile_hide .fa-angle-right:before{content:"\f00d"!important}.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_description{display:none!important}body .select2-container,body .ui-widget.ui-datepicker{z-index:9000000009!important}.bapf_sngl_hd_mobile{display:none!important}}.bapf_sfilter.bapf_fhide .bapf_body ul li.bapf_hide,.bapf_sfilter.bapf_fhide.bapf_filter_hide,.berocket_single_filter_widget.bapf_mt_none{display:none!important}.berocket_element_above_products{clear:both!important;overflow:visible!important}div.berocket_single_filter_widget div.berocket_aapf_widget-wrapper *{opacity:1}@media screen and (min-width:768px) and (max-width:1024px){.bapf_sngl_hd_tablet{display:none!important}}@media screen and (min-width:1025px){.bapf_sngl_hd_desktop{display:none!important}}.berocket_aapf_widget select{overflow:auto!important}.berocket_element_above_products_after{clear:both}ul.berocket_aapf_widget li>span>input+.berocket_label_widgets::before{margin-right:6px}.berocket_element_above_products_is_hide{overflow:visible!important}.berocket_element_above_products_is_hide:after{content:"";display:block;clear:both}.berocket_ajax_filters_sidebar_toggle,.berocket_element_above_products_is_hide_toggle{display:inline-block;position:relative;padding-left:25px;font-size:16px;font-weight:600;outline:0!important}.berocket_element_above_products_is_hide.br_is_hidden{opacity:0;max-height:1px;position:relative}.berocket_element_above_products_is_hide_toggle{height:20px;width:200px!important;margin:40px 0;color:#2a2a2a}body{transition:margin-left .2s}body.berocket_ajax_filters_sidebar_active{margin-left:200px}.berocket_ajax_filters_sidebar_toggle{height:26px;width:200px!important;margin:40px 0;text-decoration:none!important;box-sizing:border-box!important}#berocket-ajax-filters-sidebar{display:block;position:fixed;top:0;left:-400px;bottom:0;width:350px;max-width:100%;background:#fff;transition:all .2s;z-index:100000;box-sizing:border-box;overflow:auto!important}#berocket-ajax-filters-sidebar-shadow{content:"";display:none;position:fixed;top:0;left:0;bottom:0;right:0;z-index:99999;background:#000;opacity:.7}.admin-bar #berocket-ajax-filters-sidebar{top:32px}#berocket-ajax-filters-sidebar.active,#berocket-ajax-filters-sidebar.active+#berocket-ajax-filters-sidebar-shadow{left:0;display:block;visibility:visible}#berocket-ajax-filters-sidebar .berocket_ajax_group_filter_title{padding:15px 88px 15px 15px!important;font-weight:500!important;font-size:24px!important;color:#333!important;border-bottom:1px solid #ccc!important}#berocket-ajax-filters-sidebar>div{padding:15px!important}#berocket-ajax-filters-sidebar .berocket_aapf_widget-title_div{color:#333!important;font-size:19px!important;font-weight:600!important}#berocket-ajax-filters-sidebar .berocket_aapf_widget,#berocket-ajax-filters-sidebar .berocket_aapf_widget li{margin:0!important}#berocket-ajax-filters-sidebar .berocket_aapf_widget .berocket_checkbox_color .berocket_label_widgets{margin:0 .6em .6em 0!important}#berocket-ajax-filters-sidebar-close{position:absolute!important;right:0!important;line-height:39px;padding:17px 15px 13px!important;font-family:Arial,serif!important;color:#a2a2a2}#berocket-ajax-filters-sidebar-close+*{margin-top:70px!important}#berocket-ajax-filters-sidebar-close+.berocket_ajax_group_filter_title{margin-top:0!important}@media screen and (max-width:782px){.admin-bar #berocket-ajax-filters-sidebar{top:46px}}@media screen and (max-width:600px){.admin-bar #berocket-ajax-filters-sidebar{top:0}}.berocket_aapf_widget-wrapper .slider:not(.flickity-enabled){overflow:initial;white-space:initial}.select2-container{z-index:999}.bapf_sfilter .bapf_body .mCSB_container>ul,.bapf_sfilter .bapf_body>ul{margin-left:0;margin-top:0!important;margin-bottom:0!important}.bapf_sfilter.bapf_vpr_1 .bapf_body ul,.bapf_sfilter.bapf_vpr_2 .bapf_body ul,.bapf_sfilter.bapf_vpr_3 .bapf_body ul,.bapf_sfilter.bapf_vpr_4 .bapf_body ul{display:flex;flex-wrap:wrap}.bapf_sfilter.bapf_vpr_1 .bapf_body ul>li,.bapf_sfilter.bapf_vpr_2 .bapf_body ul>li,.bapf_sfilter.bapf_vpr_3 .bapf_body ul>li,.bapf_sfilter.bapf_vpr_4 .bapf_body ul>li{white-space:nowrap;flex-grow:1}.bapf_sfilter.bapf_vpr_1 .bapf_body ul>li{flex-basis:100%}.bapf_sfilter.bapf_vpr_2 .bapf_body ul>li{flex-basis:50%}.bapf_sfilter.bapf_vpr_3 .bapf_body ul>li{flex-basis:33%}.bapf_sfilter.bapf_vpr_4 .bapf_body ul>li{flex-basis:25%}.bapf_sfilter.bapf_vpr_1 .bapf_body ul>li label,.bapf_sfilter.bapf_vpr_2 .bapf_body ul>li label,.bapf_sfilter.bapf_vpr_3 .bapf_body ul>li label,.bapf_sfilter.bapf_vpr_4 .bapf_body ul>li label{white-space:initial}.bapf_sfilter .bapf_hascolarr,.bapf_sfilter .bapf_hasdesc{position:relative;padding-right:25px;display:flex;align-items:center}.bapf_sfilter .bapf_hascolarr.bapf_hasdesc{padding-right:45px}.bapf_sfilter .bapf_colaps_smb,.bapf_sfilter .bapf_desci{position:absolute;right:0;line-height:inherit;font-size:16px;cursor:pointer}.bapf_sfilter .bapf_desci{padding:4px 8px}.bapf_sfilter .bapf_hasdesc .bapf_colaps_smb{right:25px}.bapf_sfilter .bapf_cchild,.bapf_sfilter .bapf_ochild{cursor:pointer;padding:0 5px}#berocket-ajax-filters-sidebar .berocket_single_filter_widget.berocket_hidden_clickable .bapf_sfilter .bapf_head,.berocket_single_filter_widget.berocket_hidden_clickable .bapf_sfilter .bapf_head{border:2px solid #333!important;background-color:#333!important;color:#ccc!important;padding:5px!important;border-radius:5px!important;cursor:pointer}#berocket-ajax-filters-sidebar .berocket_single_filter_widget.berocket_hidden_clickable .berocket_widget_has_description .berocket_aapf_widget-title_div,.berocket_single_filter_widget.berocket_hidden_clickable .berocket_widget_has_description .berocket_aapf_widget-title_div{padding-right:55px!important}#berocket-ajax-filters-sidebar .berocket_single_filter_widget.berocket_hidden_clickable .berocket_aapf_widget-wrapper,.berocket_single_filter_widget.berocket_hidden_clickable .berocket_aapf_widget-wrapper{padding-bottom:5px!important}#berocket-ajax-filters-sidebar .berocket_single_filter_widget.berocket_hidden_clickable .bapf_sfilter .bapf_head h3,.berocket_single_filter_widget.berocket_hidden_clickable .bapf_sfilter .bapf_head h3{margin:0;font-size:inherit!important;color:inherit!important}#berocket-ajax-filters-sidebar .berocket_single_filter_widget.berocket_hidden_clickable .bapf_sfilter,.berocket_single_filter_widget.berocket_hidden_clickable .bapf_sfilter{position:relative!important}#berocket-ajax-filters-sidebar .berocket_single_filter_widget.berocket_hidden_clickable .bapf_sfilter.bapf_ccolaps .bapf_head,.berocket_single_filter_widget.berocket_hidden_clickable .bapf_sfilter.bapf_ccolaps .bapf_head{border:2px solid #ccc!important;color:#000!important;background-color:#ccc!important;border-radius:5px 5px 0 0!important;padding-bottom:5px!important}#berocket-ajax-filters-sidebar .berocket_single_filter_widget.berocket_hidden_clickable .bapf_sfilter .bapf_body,.berocket_single_filter_widget.berocket_hidden_clickable .bapf_sfilter .bapf_body{position:absolute!important;top:100%!important;width:100%!important;background-color:#fff!important;z-index:800!important;margin:0!important;border:2px solid #ccc!important;padding:5px!important}#berocket-ajax-filters-sidebar .berocket_single_filter_widget.berocket_hidden_clickable.berocket_hidden_clickable_right .bapf_sfilter.bapf_ccolaps .bapf_body,.berocket_single_filter_widget.berocket_hidden_clickable.berocket_hidden_clickable_right .bapf_sfilter.bapf_ccolaps .bapf_body{right:0!important}@media screen and (max-width:767px){#berocket-ajax-filters-sidebar .berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible,.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible{position:fixed!important;top:0!important;left:0!important;bottom:0!important;right:0!important;z-index:9000000000!important;background-color:#fff!important;overflow:auto!important}#berocket-ajax-filters-sidebar .berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_widget,.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_widget{border:0!important;width:100%!important;max-width:100%!important}#berocket-ajax-filters-sidebar .berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_widget_show.mobile_hide,.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_widget_show.mobile_hide{display:block!important}#berocket-ajax-filters-sidebar .berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_widget_show.mobile_hide .fa-angle-left:before,#berocket-ajax-filters-sidebar .berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_widget_show.mobile_hide .fa-angle-right:before,.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_widget_show.mobile_hide .fa-angle-left:before,.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_widget_show.mobile_hide .fa-angle-right:before{content:"\f00d"!important}#berocket-ajax-filters-sidebar .berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_description,.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_description{display:none!important}body .select2-container,body .ui-widget.ui-datepicker{z-index:9000000009!important}}@keyframes bapf_loader{from{transform:rotate(0)}to{transform:rotate(360deg)}}.bapf_loader_page{position:fixed;top:0;left:0;bottom:0;right:0;background-color:rgba(255,255,255,.5);z-index:9999}.bapf_lcontainer{position:absolute;top:50%;margin:-20px 0 0 -20px;left:50%;width:30px;height:30px;padding:0}.bapf_lcontainer .bapf_loader{width:100%;height:100%;display:block;transform:rotate(0);animation:1s linear 0s infinite bapf_loader;position:relative}.bapf_lcontainer .bapf_loader .bapf_lfirst,.bapf_lcontainer .bapf_loader .bapf_lsecond{position:absolute;width:10px;height:10px;background:#000;background:linear-gradient(45deg,#000,transparent);display:block;border-radius:6px}.bapf_lcontainer .bapf_loader .bapf_lfirst{bottom:0;right:0}.bapf_lcontainer .bapf_loader .bapf_lsecond{top:0;left:0;transform:rotate(180deg)}.bapf_lcontainer .bapf_labove,.bapf_lcontainer .bapf_lbelow{position:absolute;display:block;text-align:center;width:80vw;left:calc(15px - 40vw)}.bapf_lcontainer .bapf_labove{bottom:120%}.bapf_lcontainer .bapf_lbelow{top:120%}.bapf_lcontainer .bapf_lafter,.bapf_lcontainer .bapf_lbefore{position:absolute;top:50%;margin-top:-15px;height:30px;line-height:30px;vertical-align:middle;white-space:nowrap}.bapf_lcontainer .bapf_lbefore{right:120%}.bapf_lcontainer .bapf_lafter{left:120%}.bapf_lcontainer .bapf_limg{width:100%;height:100%}.berocket_single_filter_widget .tippy-tooltip,.berocket_single_filter_widget .tippy-tooltip .tippy-content{font-size:1em}@media only screen and (max-device-width:767px){.bapf_hide_mobile{display:none!important}}.bapf_sfilter .bapf_button{font-size:1em}.bapf_sfilter .rightpcs{float:right}.bapf_sfilter .right2empcs{padding-left:10px}#bapf_footer_clrimg>div,#bapf_footer_count_before>div,#bapf_footer_description>div{z-index:999999999999!important}.bapf_sfilter.bapf_ckbox input[type=checkbox]{margin-right:5px;cursor:pointer}.bapf_sfilter.bapf_ckbox input[type=checkbox],.bapf_sfilter.bapf_ckbox label,.bapf_sfilter.bapf_ckbox label+span,.bapf_sfilter.bapf_ckbox label>span{vertical-align:middle}.select2-container--classic input[type=search],.select2-container--classic input[type=search]:focus{background-color:initial}.berocket_search_box_block{position:relative;padding:.5em}.berocket_search_box_block .berocket_search_box_background_all{position:relative;z-index:200}.berocket_search_box_block .berocket_search_box_background{z-index:100;position:absolute;top:0;bottom:0;left:0;right:0}.berocket_search_box_block select{min-width:100%}.berocket_search_box_button{cursor:pointer;display:block;text-align:center;padding:5px 0}.berocket_search_box_block .berocket_aapf_widget-wrapper ul{margin:0}.berocket_search_box_block .berocket_aapf_widget-wrapper{margin:1em 0}.bapf_show_hide{cursor:pointer}.bapf_hideckbox li input[type=checkbox],.bapf_hideckbox li input[type=checkbox]:after,.bapf_hideckbox li input[type=checkbox]:before{display:none!important}.bapf_hideckbox li label,.bapf_hideckbox li label a{color:#428bca}.bapf_hideckbox li input:checked+label:hover,.bapf_hideckbox li input:checked+label:hover a,.bapf_hideckbox li label:hover,.bapf_hideckbox li label:hover a{color:#2a6496}.bapf_hideckbox li input:checked+label,.bapf_hideckbox li input:checked+label a{color:#222}.bapf_sfilter.bapf_clr_txt_left .bapf_body ul,.bapf_sfilter.bapf_clr_txt_right .bapf_body ul{width:100%;flex-basis:100%}.bapf_sfilter.bapf_clr_txt_left .bapf_body ul li,.bapf_sfilter.bapf_clr_txt_right .bapf_body ul li{display:flex;align-items:center;flex-wrap:wrap}.bapf_sfilter.bapf_clr_txt_left .bapf_body ul li label,.bapf_sfilter.bapf_clr_txt_right .bapf_body ul li label{display:flex!important;flex-direction:row!important;align-items:center!important}.bapf_sfilter.bapf_clr_txt_left .bapf_body ul li label .bapf_clr_span,.bapf_sfilter.bapf_clr_txt_left .bapf_body ul li label .bapf_img_span,.bapf_sfilter.bapf_clr_txt_right .bapf_body ul li label .bapf_clr_span,.bapf_sfilter.bapf_clr_txt_right .bapf_body ul li label .bapf_img_span{flex-shrink:0}.bapf_sfilter.bapf_button_berocket .bapf_button{font-size:20px;padding:8px 30px;border:0;line-height:28px;font-weight:600;display:inline-block;color:#fff;text-transform:uppercase;text-align:center;text-decoration:none;background-color:#f16543}.bapf_sfilter.bapf_button_berocket .bapf_button:hover{background-color:#d94825}.bapf_sfilter.bapf_colorinline li{display:inline-block!important}.bapf_sfilter .bapf_clr_span,.bapf_sfilter .bapf_img_span{display:inline-block!important;position:relative;overflow:hidden;margin:5px;height:2em;width:2em;line-height:2em;border:2px solid #000;text-align:center;vertical-align:middle;color:#222!important;text-shadow:0 0 3px #FFF,1px 0 2px #FFF,0 1px 2px #FFF,-1px 0 2px #FFF,0 -1px 2px #FFF,1px 1px 2px #FFF,1px -1px 2px #FFF,-1px 1px 2px #FFF,-1px -1px 2px #FFF;-webkit-transition:all .2s ease-out .1s;-moz-transition:all .2s ease-out .1s;-o-transition:all .2s ease-out .1s;transition:all .2s ease-out .1s}.bapf_sfilter .bapf_clr_span.h1em,.bapf_sfilter .bapf_img_span.h1em{height:1em;line-height:1em}.bapf_sfilter .bapf_clr_span.h2em,.bapf_sfilter .bapf_img_span.h2em{height:2em;line-height:2em}.bapf_sfilter .bapf_clr_span.h3em,.bapf_sfilter .bapf_img_span.h3em{height:3em;line-height:3em}.bapf_sfilter .bapf_clr_span.h4em,.bapf_sfilter .bapf_img_span.h4em{height:4em;line-height:4em}.bapf_sfilter .bapf_clr_span.h5em,.bapf_sfilter .bapf_img_span.h5em{height:5em;line-height:5em}.bapf_sfilter .bapf_clr_span.w1em,.bapf_sfilter .bapf_img_span.w1em{width:1em}.bapf_sfilter .bapf_clr_span.w2em,.bapf_sfilter .bapf_img_span.w2em{width:2em}.bapf_sfilter .bapf_clr_span.w3em,.bapf_sfilter .bapf_img_span.w3em{width:3em}.bapf_sfilter .bapf_clr_span.w4em,.bapf_sfilter .bapf_img_span.w4em{width:4em}.bapf_sfilter .bapf_clr_span.w5em,.bapf_sfilter .bapf_img_span.w5em{width:5em}.bapf_sfilter .bapf_img_span.w1em.h1em .fa,.bapf_sfilter .bapf_img_span.w1em.h2em .fa,.bapf_sfilter .bapf_img_span.w1em.h3em .fa,.bapf_sfilter .bapf_img_span.w1em.h4em .fa,.bapf_sfilter .bapf_img_span.w1em.h5em .fa,.bapf_sfilter .bapf_img_span.w2em.h1em .fa,.bapf_sfilter .bapf_img_span.w3em.h1em .fa,.bapf_sfilter .bapf_img_span.w4em.h1em .fa,.bapf_sfilter .bapf_img_span.w5em.h1em .fa{font-size:.8em}.bapf_sfilter .bapf_img_span.w2em.h2em .fa,.bapf_sfilter .bapf_img_span.w2em.h3em .fa,.bapf_sfilter .bapf_img_span.w2em.h4em .fa,.bapf_sfilter .bapf_img_span.w2em.h5em .fa,.bapf_sfilter .bapf_img_span.w3em.h2em .fa,.bapf_sfilter .bapf_img_span.w4em.h2em .fa,.bapf_sfilter .bapf_img_span.w5em.h2em .fa{font-size:1.6em}.bapf_sfilter .bapf_img_span.w3em.h3em .fa,.bapf_sfilter .bapf_img_span.w3em.h4em .fa,.bapf_sfilter .bapf_img_span.w3em.h5em .fa,.bapf_sfilter .bapf_img_span.w4em.h3em .fa,.bapf_sfilter .bapf_img_span.w5em.h3em .fa{font-size:2.4em}.bapf_sfilter .bapf_img_span.w4em.h4em .fa,.bapf_sfilter .bapf_img_span.w4em.h5em .fa,.bapf_sfilter .bapf_img_span.w5em.h4em .fa{font-size:3.2em}.bapf_sfilter .bapf_img_span.w5em.h5em .fa{font-size:4em}.bapf_sfilter .bapf_clr_span .bapf_clr_span_abslt{position:relative;z-index:100}.bapf_sfilter .bapf_img_span .bapf_clr_span_abslt{position:absolute;top:0;left:0;right:0;bottom:0}.bapf_sfilter.brchecked_default input:checked+label .bapf_clr_span,.bapf_sfilter.brchecked_default input:checked+label .bapf_img_span,.bapf_sfilter.brchecked_rotate input:checked+label .bapf_clr_span,.bapf_sfilter.brchecked_rotate input:checked+label .bapf_img_span{-webkit-transform:rotate(15deg);-moz-transform:rotate(15deg);-ms-transform:rotate(15deg);-o-transform:rotate(15deg);transform:rotate(15deg)}.bapf_sfilter.brchecked_scale input:checked+label .bapf_clr_span,.bapf_sfilter.brchecked_scale input:checked+label .bapf_img_span{transform:scale(1.1)}.bapf_sfilter.brchecked_image_shadow input:checked+label .bapf_clr_span,.bapf_sfilter.brchecked_shadow input:checked+label .bapf_clr_span,.bapf_sfilter.brchecked_shadow input:checked+label .bapf_img_span{box-shadow:0 0 1px 3px #88F}.bapf_sfilter.brchecked_image_shadow input:checked+label .bapf_img_span{-webkit-filter:drop-shadow(0 0 2px);-moz-filter:drop-shadow(0 0 2px);-o-filter:drop-shadow(0 0 2px);filter:drop-shadow(0 0 2px)}.bapf_sfilter.brchecked_hue_rotate input:checked+label .bapf_clr_span,.bapf_sfilter.brchecked_hue_rotate input:checked+label .bapf_img_span{-webkit-filter:hue-rotate(90deg);-moz-filter:hue-rotate(90deg);-o-filter:hue-rotate(90deg);filter:hue-rotate(90deg)}.bapf_sfilter .bapf_clr_multi{position:absolute;top:0;bottom:0;left:0;right:0;z-index:2;transform:rotateZ(45deg);padding:0;margin:-2em 0;box-sizing:border-box}.bapf_sfilter .bapf_clr_multi .bapf_clr_multi_singl{position:absolute;top:-50%;bottom:-50%;padding:0;margin:0;box-shadow:none;box-sizing:border-box;border:0}.bapf_sfilter .bapf_clr_multi_2 .bapf_clr_multi_singl,.bapf_sfilter .bapf_clr_multi_3 .bapf_clr_multi_singl{width:100%}.bapf_sfilter .bapf_clr_multi_3 .bapf_clr_multi_singl_1{width:34%}.bapf_sfilter .bapf_clr_multi_3 .bapf_clr_multi_singl_0,.bapf_sfilter .bapf_clr_multi_3 .bapf_clr_multi_singl_2{width:83%}.bapf_sfilter .bapf_clr_multi_4 .bapf_clr_multi_singl{width:25%}.bapf_sfilter .bapf_clr_multi_4 .bapf_clr_multi_singl_0,.bapf_sfilter .bapf_clr_multi_4 .bapf_clr_multi_singl_3{width:75%}.bapf_sfilter .bapf_clr_multi .bapf_clr_multi_singl_0{left:-50%}.bapf_sfilter .bapf_clr_multi_2 .bapf_clr_multi_singl_1{left:50%}.bapf_sfilter .bapf_clr_multi_3 .bapf_clr_multi_singl_1{left:33%}.bapf_sfilter .bapf_clr_multi_4 .bapf_clr_multi_singl_1{left:25%}.bapf_sfilter .bapf_clr_multi_3 .bapf_clr_multi_singl_2{left:67%}.bapf_sfilter .bapf_clr_multi_4 .bapf_clr_multi_singl_2{left:50%}.bapf_sfilter .bapf_clr_multi_4 .bapf_clr_multi_singl_3{left:75%}.bapf_sfilter.bapf_clr_txt_left .bapf_img_span{margin:5px 0 5px 10px}.bapf_sfilter.bapf_clr_txt_right .bapf_img_span{margin:5px 10px 5px 0}.bapf_sfilter.bapf_clr_txt_bottom .bapf_img_span,.bapf_sfilter.bapf_clr_txt_top .bapf_img_span{margin:5px 10px}.bapf_sfilter.bapf_colorinline.bapf_clr_txt_bottom li label,.bapf_sfilter.bapf_colorinline.bapf_clr_txt_top li label{display:inline-block!important;text-align:center}.bapf_sfilter.bapf_clr_txt_bottom .bapf_clr_text,.bapf_sfilter.bapf_clr_txt_top .bapf_clr_text{display:block;margin-right:10px;margin-left:10px}.bapf_colorinline .bapf_body li{text-align:center}.bapf_img_woborder.bapf_sfilter .bapf_img_span{border:none;overflow:visible}.bapf_clr_woborder.bapf_sfilter .bapf_clr_span{border:none}.bapf_radio_chck ul li input[type=checkbox]{-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;appearance:none;display:inline-block;vertical-align:middle;border:2px solid #555;width:15px;height:15px;outline:0;border-radius:10px;padding:2px;margin-right:5px;position:relative}.bapf_radio_chck ul li input[type=checkbox]:checked:after{content:"";width:8px;height:12px;border-bottom:2px solid #333;border-right:2px solid #333;display:block;position:absolute;top:-4px;left:3px;transform:rotate(45deg)}.bapf_asradio2 ul li input[type=checkbox]{-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;appearance:none;display:inline-block;vertical-align:middle;border:2px solid #555;width:15px;height:15px;outline:0;border-radius:10px;padding:2px;margin-right:5px}.bapf_asradio2 ul li input[type=checkbox]:checked{background:#555;background-clip:content-box}.bapf_slct select{width:100%;font-size:1em}.bapf_slct .select2 .select2-search__field{width:auto!important}#bapf-select2-high-zindex .select2-container{z-index:999999999!important}.bapf_sfa_inline .berocket_aapf_widget_selected_area ul li{display:inline-block;margin-left:3px!important;margin-right:3px!important}.bapf_ckbox_sqchck input[type=checkbox]{-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;appearance:none;display:inline-block;vertical-align:middle;border:2px solid #555;width:20px;height:20px;outline:0;padding:4px;margin-right:5px;position:relative}.bapf_ckbox_sqchck input[type=checkbox]:checked:after{content:"";width:8px;height:12px;border-bottom:2px solid #333;border-right:2px solid #333;display:block;position:absolute;top:0;left:4px;transform:rotate(45deg)}.bapf_ckbox_square input[type=checkbox]{-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;appearance:none;display:inline-block;vertical-align:middle;border:2px solid #555;width:20px;height:20px;outline:0;padding:4px;margin-right:5px}.bapf_ckbox_square input[type=checkbox]:checked{background:#555;background-clip:content-box}/*! jQuery UI - v1.12.1 - 2020-08-04
|
2 |
* http://jqueryui.com
|
3 |
* Includes: core.css, datepicker.css, slider.css, theme.css
|
4 |
* To view and modify this theme, visit http://jqueryui.com/themeroller/?scope=.bapfdpapcss&folderName=bapfdpapcss&cornerRadiusShadow=8px&offsetLeftShadow=0px&offsetTopShadow=0px&thicknessShadow=5px&opacityShadow=30&bgImgOpacityShadow=0&bgTextureShadow=flat&bgColorShadow=666666&opacityOverlay=30&bgImgOpacityOverlay=0&bgTextureOverlay=flat&bgColorOverlay=aaaaaa&iconColorError=cc0000&fcError=5f3f3f&borderColorError=f1a899&bgTextureError=flat&bgColorError=fddfdf&iconColorHighlight=777620&fcHighlight=777620&borderColorHighlight=dad55e&bgTextureHighlight=flat&bgColorHighlight=fffa90&iconColorActive=ffffff&fcActive=ffffff&borderColorActive=003eff&bgTextureActive=flat&bgColorActive=007fff&iconColorHover=555555&fcHover=2b2b2b&borderColorHover=cccccc&bgTextureHover=flat&bgColorHover=ededed&iconColorDefault=777777&fcDefault=454545&borderColorDefault=c5c5c5&bgTextureDefault=flat&bgColorDefault=f6f6f6&iconColorContent=444444&fcContent=333333&borderColorContent=dddddd&bgTextureContent=flat&bgColorContent=ffffff&iconColorHeader=444444&fcHeader=333333&borderColorHeader=dddddd&bgTextureHeader=flat&bgColorHeader=e9e9e9&cornerRadius=3px&fwDefault=normal&fsDefault=1em&ffDefault=Arial%2CHelvetica%2Csans-serif
|
assets/frontend/css/main.css
CHANGED
@@ -1003,6 +1003,13 @@ body.berocket_ajax_filters_sidebar_active {
|
|
1003 |
position: relative;
|
1004 |
z-index: 100;
|
1005 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1006 |
|
1007 |
.bapf_sfilter.brchecked_default input:checked + label .bapf_clr_span,
|
1008 |
.bapf_sfilter.brchecked_default input:checked + label .bapf_img_span,
|
1003 |
position: relative;
|
1004 |
z-index: 100;
|
1005 |
}
|
1006 |
+
.bapf_sfilter .bapf_img_span .bapf_clr_span_abslt {
|
1007 |
+
position: absolute;
|
1008 |
+
top: 0;
|
1009 |
+
left: 0;
|
1010 |
+
right: 0;
|
1011 |
+
bottom: 0;
|
1012 |
+
}
|
1013 |
|
1014 |
.bapf_sfilter.brchecked_default input:checked + label .bapf_clr_span,
|
1015 |
.bapf_sfilter.brchecked_default input:checked + label .bapf_img_span,
|
assets/frontend/css/main.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.bapf_sfilter .bapf_button,.bapf_sfilter label{cursor:pointer;display:inline-block!important}.bapf_sfilter ul li{list-style:none!important;margin:0!important;padding:0!important;max-width:100%;text-align:left!important}.rtl .bapf_sfilter ul li{text-align:right!important}.bapf_sfilter .bapf_body ul li ul{margin-left:15px}.bapf_slidr_main.ui-widget-content,.berocket_filter_price_slider.ui-widget-content{background:#b0b5b9;border:0;border-radius:0;height:4px;padding:0}.bapf_slidr_main.ui-widget-content .ui-slider-range,.berocket_filter_price_slider.ui-widget-content .ui-slider-range{background:#000}.slide.default .bapf_slidr_main.ui-widget-content .ui-slider-range,.slide.default .berocket_filter_price_slider.ui-widget-content .ui-slider-range{background:#222}.slide.default .bapf_slidr_main.ui-widget-content,.slide.default .berocket_filter_price_slider.ui-widget-content{height:4px;border:1px solid #555;font-size:10px}.bapf_slidr_main.ui-widget-content .ui-slider-handle,.berocket_filter_price_slider.ui-widget-content .ui-slider-handle,.slide.default .bapf_slidr_main .ui-state-default,.slide.default .bapf_slidr_main .ui-widget-header .ui-state-default,.slide.default .bapf_slidr_main.ui-widget-content .ui-state-default,.slide.default .berocket_filter_price_slider .ui-state-default,.slide.default .berocket_filter_price_slider .ui-widget-header .ui-state-default,.slide.default .berocket_filter_price_slider.ui-widget-content .ui-state-default{background:#ddd;font-size:14px;width:1em;height:1em;border:1px solid #555;top:-6px;border-radius:2em}.berocket_aapf_widget li.slider div.slide{clear:both;height:auto;text-align:right;line-height:0}.bapf_slidr_jqrui .bapf_from,.ui-slider{text-align:left}.ui-slider{position:relative}.ui-slider .ui-slider-handle{position:absolute;z-index:2;width:1.2em;height:1.2em;cursor:pointer;-ms-touch-action:none;touch-action:none}.ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;background-position:0 0}.ui-slider.ui-state-disabled .ui-slider-handle,.ui-slider.ui-state-disabled .ui-slider-range{filter:inherit}.ui-slider-horizontal{height:.8em}.ui-slider-horizontal .ui-slider-handle{top:-.3em;margin-left:-.6em}.bapf_slidr_main>a:last-child{margin-left:-12px}.ui-slider-horizontal .ui-slider-range{top:0;height:100%}.ui-slider-horizontal .ui-slider-range-min{left:0}.ui-slider-horizontal .ui-slider-range-max{right:0}.ui-slider-vertical{width:.8em;height:100px}.ui-slider-vertical .ui-slider-handle{left:-.3em;margin-left:0;margin-bottom:-.6em}.ui-slider-vertical .ui-slider-range{left:0;width:100%}#berocket-ajax-filters-sidebar .berocket_single_filter_widget.berocket_hidden_clickable.berocket_hidden_clickable_left .bapf_sfilter.bapf_ccolaps .bapf_body,.berocket_single_filter_widget.berocket_hidden_clickable.berocket_hidden_clickable_left .bapf_sfilter.bapf_ccolaps .bapf_body,.berocket_single_filter_widget.berocket_hidden_clickable.berocket_hidden_clickable_left .berocket_aapf_widget{left:0!important}.ui-slider-vertical .ui-slider-range-min{bottom:0}.ui-slider-vertical .ui-slider-range-max{top:0}.slide .ui-corner-all,.slide .ui-corner-bottom,.slide .ui-corner-br,.slide .ui-corner-right{border-bottom-right-radius:4px}.slide .ui-corner-all,.slide .ui-corner-bl,.slide .ui-corner-bottom,.slide .ui-corner-left{border-bottom-left-radius:4px}.slide .ui-corner-all,.slide .ui-corner-right,.slide .ui-corner-top,.slide .ui-corner-tr{border-top-right-radius:4px}.slide .ui-corner-all,.slide .ui-corner-left,.slide .ui-corner-tl,.slide .ui-corner-top{border-top-left-radius:4px}ul.berocket_aapf_widget li.slider>span{cursor:initial}ul.berocket_aapf_widget li.slider .bapf_slidr_main{cursor:pointer}.slide .ui-widget-content{background:#fff;border:1px solid #aaa;color:#222}.slide .ui-state-default,.slide .ui-widget-content .ui-state-default,.slide .ui-widget-header .ui-state-default{background:#e6e6e6;border:1px solid #d3d3d3;color:#555;font-weight:400}.ui-widget.ui-datepicker{font-size:14px;z-index:9000!important}.bapf_sfilter .ui-button,.bapf_sfilter .ui-state-default,.bapf_sfilter .ui-widget-content .ui-state-default,.bapf_sfilter .ui-widget-header .ui-state-default,.bapf_sfilter .ui-widget.ui-widget-content,html .bapf_sfilter .ui-button.ui-state-disabled:active,html .bapf_sfilter .ui-button.ui-state-disabled:hover{border:0}.bapf_slidr_jqrui .bapf_slidr_all:after{content:"";display:block;clear:both}.bapf_slidr_jqrui .bapf_slidr_main{margin-bottom:10px}.bapf_slidr_jqrui .bapf_from,.bapf_slidr_jqrui .bapf_to{width:49%;display:inline-block;margin-bottom:10px;vertical-align:middle}.bapf_slidr_jqrui .bapf_from input,.bapf_slidr_jqrui .bapf_to input{width:50%;vertical-align:middle;font-size:1em;padding:0;margin:0;line-height:1em}.bapf_slidr_jqrui .bapf_to{text-align:right}.bapf_sfilter{margin-bottom:20px}.berocket_single_filter_widget.berocket_inline_clickable,.berocket_single_filter_widget.berocket_inline_filters{float:left!important;padding-right:15px!important}.berocket_single_filter_widget.berocket_inline_filters{width:12.5%!important}#berocket-ajax-filters-sidebar .berocket_single_filter_widget.berocket_hidden_clickable .berocket_aapf_widget-title_div,.berocket_single_filter_widget.berocket_hidden_clickable .berocket_aapf_widget-title_div{border:2px solid #333!important;background-color:#333!important;color:#ccc!important;padding:5px 35px 5px 5px!important;border-radius:5px!important}.berocket_single_filter_widget.berocket_hidden_clickable .berocket_widget_has_description .berocket_aapf_widget-title_div{padding-right:55px!important}.berocket_single_filter_widget.berocket_hidden_clickable .berocket_aapf_widget-wrapper{padding-bottom:5px!important}.berocket_single_filter_widget.berocket_hidden_clickable .berocket_aapf_widget-title_div h3{margin:0!important;padding:0!important;font-size:inherit!important;color:inherit!important}.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_widget-title_div{border:2px solid #ccc!important;color:#000!important;background-color:#ccc!important;border-radius:5px 5px 0 0!important;padding-bottom:10px!important}.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_widget-wrapper{padding-bottom:0!important}.berocket_single_filter_widget.berocket_hidden_clickable .berocket_aapf_widget{position:absolute!important;top:100%!important;width:100%!important;background-color:#fff!important;z-index:800!important;margin:0!important;border:2px solid #ccc!important;padding:5px!important;display:none}.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_widget{z-index:900!important}.berocket_single_filter_widget.berocket_hidden_clickable.berocket_hidden_clickable_right .berocket_aapf_widget{right:0!important}@media screen and (max-width:767px){.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible{position:fixed!important;top:0!important;left:0!important;bottom:0!important;right:0!important;z-index:9000000000!important;background-color:#fff!important;overflow:auto!important}.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_widget{border:0!important;width:100%!important;max-width:100%!important}.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_widget_show.mobile_hide{display:block!important}.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_widget_show.mobile_hide .fa-angle-left:before,.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_widget_show.mobile_hide .fa-angle-right:before{content:"\f00d"!important}.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_description{display:none!important}body .select2-container,body .ui-widget.ui-datepicker{z-index:9000000009!important}.bapf_sngl_hd_mobile{display:none!important}}.berocket_ajax_filters_sidebar_toggle,.berocket_element_above_products_is_hide_toggle{width:200px!important;position:relative;padding-left:25px;outline:0!important;font-size:16px;font-weight:600}.bapf_sfilter.bapf_fhide .bapf_body ul li.bapf_hide,.bapf_sfilter.bapf_fhide.bapf_filter_hide,.berocket_single_filter_widget.bapf_mt_none{display:none!important}.berocket_element_above_products{clear:both!important;overflow:visible!important}div.berocket_single_filter_widget div.berocket_aapf_widget-wrapper *{opacity:1}@media screen and (min-width:768px) and (max-width:1024px){.bapf_sngl_hd_tablet{display:none!important}}@media screen and (min-width:1025px){.bapf_sngl_hd_desktop{display:none!important}}.berocket_aapf_widget select{overflow:auto!important}.berocket_element_above_products_after{clear:both}ul.berocket_aapf_widget li>span>input+.berocket_label_widgets::before{margin-right:6px}.berocket_element_above_products_is_hide{overflow:visible!important}.berocket_element_above_products_is_hide:after{content:"";display:block;clear:both}.berocket_element_above_products_is_hide.br_is_hidden{opacity:0;max-height:1px;position:relative}.berocket_element_above_products_is_hide_toggle{height:20px;margin:40px 0;display:inline-block;color:#2a2a2a}body{transition:margin-left .2s}body.berocket_ajax_filters_sidebar_active{margin-left:200px}.berocket_ajax_filters_sidebar_toggle{height:26px;margin:40px 0;display:inline-block;text-decoration:none!important;box-sizing:border-box!important}#berocket-ajax-filters-sidebar{display:block;position:fixed;top:0;left:-400px;bottom:0;width:350px;max-width:100%;background:#fff;transition:all .2s;z-index:100000;box-sizing:border-box;overflow:auto!important}#berocket-ajax-filters-sidebar-shadow{content:"";display:none;position:fixed;top:0;left:0;bottom:0;right:0;z-index:99999;background:#000;opacity:.7}.admin-bar #berocket-ajax-filters-sidebar{top:32px}#berocket-ajax-filters-sidebar.active,#berocket-ajax-filters-sidebar.active+#berocket-ajax-filters-sidebar-shadow{left:0;display:block;visibility:visible}#berocket-ajax-filters-sidebar .berocket_ajax_group_filter_title{padding:15px 88px 15px 15px!important;font-weight:500!important;font-size:24px!important;color:#333!important;border-bottom:1px solid #ccc!important}#berocket-ajax-filters-sidebar>div{padding:15px!important}#berocket-ajax-filters-sidebar .berocket_aapf_widget-title_div{color:#333!important;font-size:19px!important;font-weight:600!important}#berocket-ajax-filters-sidebar .berocket_aapf_widget,#berocket-ajax-filters-sidebar .berocket_aapf_widget li{margin:0!important}#berocket-ajax-filters-sidebar .berocket_aapf_widget .berocket_checkbox_color .berocket_label_widgets{margin:0 .6em .6em 0!important}#berocket-ajax-filters-sidebar-close{position:absolute!important;right:0!important;line-height:39px;padding:17px 15px 13px!important;font-family:Arial,serif!important;color:#a2a2a2}#berocket-ajax-filters-sidebar-close+*{margin-top:70px!important}#berocket-ajax-filters-sidebar-close+.berocket_ajax_group_filter_title{margin-top:0!important}@media screen and (max-width:782px){.admin-bar #berocket-ajax-filters-sidebar{top:46px}}@media screen and (max-width:600px){.admin-bar #berocket-ajax-filters-sidebar{top:0}}.berocket_aapf_widget-wrapper .slider:not(.flickity-enabled){overflow:initial;white-space:initial}.select2-container{z-index:999}.bapf_sfilter .bapf_body .mCSB_container>ul,.bapf_sfilter .bapf_body>ul{margin-left:0;margin-top:0!important;margin-bottom:0!important}.bapf_sfilter.bapf_vpr_1 .bapf_body ul,.bapf_sfilter.bapf_vpr_2 .bapf_body ul,.bapf_sfilter.bapf_vpr_3 .bapf_body ul,.bapf_sfilter.bapf_vpr_4 .bapf_body ul{display:flex;flex-wrap:wrap}.bapf_sfilter.bapf_vpr_1 .bapf_body ul>li,.bapf_sfilter.bapf_vpr_2 .bapf_body ul>li,.bapf_sfilter.bapf_vpr_3 .bapf_body ul>li,.bapf_sfilter.bapf_vpr_4 .bapf_body ul>li{white-space:nowrap;flex-grow:1}.bapf_sfilter.bapf_vpr_1 .bapf_body ul>li{flex-basis:100%}.bapf_sfilter.bapf_vpr_2 .bapf_body ul>li{flex-basis:50%}.bapf_sfilter.bapf_vpr_3 .bapf_body ul>li{flex-basis:33%}.bapf_sfilter.bapf_vpr_4 .bapf_body ul>li{flex-basis:25%}.bapf_sfilter.bapf_vpr_1 .bapf_body ul>li label,.bapf_sfilter.bapf_vpr_2 .bapf_body ul>li label,.bapf_sfilter.bapf_vpr_3 .bapf_body ul>li label,.bapf_sfilter.bapf_vpr_4 .bapf_body ul>li label{white-space:initial}.bapf_sfilter .bapf_hascolarr,.bapf_sfilter .bapf_hasdesc{position:relative;padding-right:25px;display:flex;align-items:center}.bapf_sfilter .bapf_hascolarr.bapf_hasdesc{padding-right:45px}.bapf_sfilter .bapf_colaps_smb,.bapf_sfilter .bapf_desci{position:absolute;right:0;line-height:inherit;font-size:16px;cursor:pointer}.bapf_sfilter .bapf_desci{padding:4px 8px}.bapf_sfilter .bapf_hasdesc .bapf_colaps_smb{right:25px}.bapf_sfilter .bapf_cchild,.bapf_sfilter .bapf_ochild{cursor:pointer;padding:0 5px}#berocket-ajax-filters-sidebar .berocket_single_filter_widget.berocket_hidden_clickable .bapf_sfilter .bapf_head,.berocket_single_filter_widget.berocket_hidden_clickable .bapf_sfilter .bapf_head{border:2px solid #333!important;background-color:#333!important;color:#ccc!important;padding:5px!important;border-radius:5px!important;cursor:pointer}#berocket-ajax-filters-sidebar .berocket_single_filter_widget.berocket_hidden_clickable .berocket_widget_has_description .berocket_aapf_widget-title_div,.berocket_single_filter_widget.berocket_hidden_clickable .berocket_widget_has_description .berocket_aapf_widget-title_div{padding-right:55px!important}#berocket-ajax-filters-sidebar .berocket_single_filter_widget.berocket_hidden_clickable .berocket_aapf_widget-wrapper,.berocket_single_filter_widget.berocket_hidden_clickable .berocket_aapf_widget-wrapper{padding-bottom:5px!important}#berocket-ajax-filters-sidebar .berocket_single_filter_widget.berocket_hidden_clickable .bapf_sfilter .bapf_head h3,.berocket_single_filter_widget.berocket_hidden_clickable .bapf_sfilter .bapf_head h3{margin:0;font-size:inherit!important;color:inherit!important}#berocket-ajax-filters-sidebar .berocket_single_filter_widget.berocket_hidden_clickable .bapf_sfilter,.berocket_single_filter_widget.berocket_hidden_clickable .bapf_sfilter{position:relative!important}#berocket-ajax-filters-sidebar .berocket_single_filter_widget.berocket_hidden_clickable .bapf_sfilter.bapf_ccolaps .bapf_head,.berocket_single_filter_widget.berocket_hidden_clickable .bapf_sfilter.bapf_ccolaps .bapf_head{border:2px solid #ccc!important;color:#000!important;background-color:#ccc!important;border-radius:5px 5px 0 0!important;padding-bottom:5px!important}#berocket-ajax-filters-sidebar .berocket_single_filter_widget.berocket_hidden_clickable .bapf_sfilter .bapf_body,.berocket_single_filter_widget.berocket_hidden_clickable .bapf_sfilter .bapf_body{position:absolute!important;top:100%!important;width:100%!important;background-color:#fff!important;z-index:800!important;margin:0!important;border:2px solid #ccc!important;padding:5px!important}#berocket-ajax-filters-sidebar .berocket_single_filter_widget.berocket_hidden_clickable.berocket_hidden_clickable_right .bapf_sfilter.bapf_ccolaps .bapf_body,.berocket_single_filter_widget.berocket_hidden_clickable.berocket_hidden_clickable_right .bapf_sfilter.bapf_ccolaps .bapf_body{right:0!important}@media screen and (max-width:767px){#berocket-ajax-filters-sidebar .berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible,.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible{position:fixed!important;top:0!important;left:0!important;bottom:0!important;right:0!important;z-index:9000000000!important;background-color:#fff!important;overflow:auto!important}#berocket-ajax-filters-sidebar .berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_widget,.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_widget{border:0!important;width:100%!important;max-width:100%!important}#berocket-ajax-filters-sidebar .berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_widget_show.mobile_hide,.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_widget_show.mobile_hide{display:block!important}#berocket-ajax-filters-sidebar .berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_widget_show.mobile_hide .fa-angle-left:before,#berocket-ajax-filters-sidebar .berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_widget_show.mobile_hide .fa-angle-right:before,.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_widget_show.mobile_hide .fa-angle-left:before,.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_widget_show.mobile_hide .fa-angle-right:before{content:"\f00d"!important}#berocket-ajax-filters-sidebar .berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_description,.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_description{display:none!important}body .select2-container,body .ui-widget.ui-datepicker{z-index:9000000009!important}}@keyframes bapf_loader{from{transform:rotate(0)}to{transform:rotate(360deg)}}.bapf_loader_page{position:fixed;top:0;left:0;bottom:0;right:0;background-color:rgba(255,255,255,.5);z-index:9999}.bapf_lcontainer{position:absolute;top:50%;margin:-20px 0 0 -20px;left:50%;width:30px;height:30px;padding:0}.bapf_lcontainer .bapf_loader{width:100%;height:100%;display:block;transform:rotate(0);animation:1s linear 0s infinite bapf_loader;position:relative}.bapf_lcontainer .bapf_loader .bapf_lfirst,.bapf_lcontainer .bapf_loader .bapf_lsecond{position:absolute;width:10px;height:10px;background:#000;background:linear-gradient(45deg,#000,transparent);display:block;border-radius:6px}.bapf_lcontainer .bapf_loader .bapf_lfirst{bottom:0;right:0}.bapf_lcontainer .bapf_loader .bapf_lsecond{top:0;left:0;transform:rotate(180deg)}.bapf_lcontainer .bapf_labove,.bapf_lcontainer .bapf_lbelow{position:absolute;display:block;text-align:center;width:80vw;left:calc(15px - 40vw)}.bapf_lcontainer .bapf_labove{bottom:120%}.bapf_lcontainer .bapf_lbelow{top:120%}.bapf_lcontainer .bapf_lafter,.bapf_lcontainer .bapf_lbefore{position:absolute;top:50%;margin-top:-15px;height:30px;line-height:30px;vertical-align:middle;white-space:nowrap}.bapf_lcontainer .bapf_lbefore{right:120%}.bapf_lcontainer .bapf_lafter{left:120%}.bapf_lcontainer .bapf_limg{width:100%;height:100%}.berocket_single_filter_widget .tippy-tooltip,.berocket_single_filter_widget .tippy-tooltip .tippy-content{font-size:1em}@media only screen and (max-device-width:767px){.bapf_hide_mobile{display:none!important}}.bapf_sfilter .bapf_button{font-size:1em}.bapf_sfilter .rightpcs{float:right}.bapf_sfilter .right2empcs{padding-left:10px}#bapf_footer_clrimg>div,#bapf_footer_count_before>div,#bapf_footer_description>div{z-index:999999999999!important}.bapf_sfilter.bapf_ckbox input[type=checkbox]{margin-right:5px;cursor:pointer}.bapf_sfilter.bapf_ckbox input[type=checkbox],.bapf_sfilter.bapf_ckbox label,.bapf_sfilter.bapf_ckbox label+span,.bapf_sfilter.bapf_ckbox label>span{vertical-align:middle}.select2-container--classic input[type=search],.select2-container--classic input[type=search]:focus{background-color:initial}.berocket_search_box_block{position:relative;padding:.5em}.berocket_search_box_block .berocket_search_box_background_all{position:relative;z-index:200}.berocket_search_box_block .berocket_search_box_background{z-index:100;position:absolute;top:0;bottom:0;left:0;right:0}.berocket_search_box_block select{min-width:100%}.berocket_search_box_button{cursor:pointer;display:block;text-align:center;padding:5px 0}.berocket_search_box_block .berocket_aapf_widget-wrapper ul{margin:0}.berocket_search_box_block .berocket_aapf_widget-wrapper{margin:1em 0}.bapf_show_hide{cursor:pointer}.bapf_hideckbox li input[type=checkbox],.bapf_hideckbox li input[type=checkbox]:after,.bapf_hideckbox li input[type=checkbox]:before{display:none!important}.bapf_hideckbox li label,.bapf_hideckbox li label a{color:#428bca}.bapf_hideckbox li input:checked+label:hover,.bapf_hideckbox li input:checked+label:hover a,.bapf_hideckbox li label:hover,.bapf_hideckbox li label:hover a{color:#2a6496}.bapf_hideckbox li input:checked+label,.bapf_hideckbox li input:checked+label a{color:#222}.bapf_sfilter.bapf_clr_txt_left .bapf_body ul,.bapf_sfilter.bapf_clr_txt_right .bapf_body ul{width:100%;flex-basis:100%}.bapf_sfilter.bapf_clr_txt_left .bapf_body ul li,.bapf_sfilter.bapf_clr_txt_right .bapf_body ul li{display:flex;align-items:center;flex-wrap:wrap}.bapf_sfilter.bapf_clr_txt_left .bapf_body ul li label,.bapf_sfilter.bapf_clr_txt_right .bapf_body ul li label{display:flex!important;flex-direction:row!important;align-items:center!important}.bapf_sfilter.bapf_clr_txt_left .bapf_body ul li label .bapf_clr_span,.bapf_sfilter.bapf_clr_txt_left .bapf_body ul li label .bapf_img_span,.bapf_sfilter.bapf_clr_txt_right .bapf_body ul li label .bapf_clr_span,.bapf_sfilter.bapf_clr_txt_right .bapf_body ul li label .bapf_img_span{flex-shrink:0}.bapf_sfilter.bapf_button_berocket .bapf_button{font-size:20px;padding:8px 30px;border:0;line-height:28px;font-weight:600;display:inline-block;color:#fff;text-transform:uppercase;text-align:center;text-decoration:none;background-color:#f16543}.bapf_sfilter.bapf_button_berocket .bapf_button:hover{background-color:#d94825}.bapf_sfilter.bapf_colorinline li{display:inline-block!important}.bapf_sfilter .bapf_clr_span,.bapf_sfilter .bapf_img_span{display:inline-block!important;position:relative;overflow:hidden;margin:5px;height:2em;width:2em;line-height:2em;border:2px solid #000;text-align:center;vertical-align:middle;color:#222!important;text-shadow:0 0 3px #FFF,1px 0 2px #FFF,0 1px 2px #FFF,-1px 0 2px #FFF,0 -1px 2px #FFF,1px 1px 2px #FFF,1px -1px 2px #FFF,-1px 1px 2px #FFF,-1px -1px 2px #FFF;-webkit-transition:all .2s ease-out .1s;-moz-transition:all .2s ease-out .1s;-o-transition:all .2s ease-out .1s;transition:all .2s ease-out .1s}.bapf_sfilter .bapf_clr_span.h1em,.bapf_sfilter .bapf_img_span.h1em{height:1em;line-height:1em}.bapf_sfilter .bapf_clr_span.h2em,.bapf_sfilter .bapf_img_span.h2em{height:2em;line-height:2em}.bapf_sfilter .bapf_clr_span.h3em,.bapf_sfilter .bapf_img_span.h3em{height:3em;line-height:3em}.bapf_sfilter .bapf_clr_span.h4em,.bapf_sfilter .bapf_img_span.h4em{height:4em;line-height:4em}.bapf_sfilter .bapf_clr_span.h5em,.bapf_sfilter .bapf_img_span.h5em{height:5em;line-height:5em}.bapf_sfilter .bapf_clr_span.w1em,.bapf_sfilter .bapf_img_span.w1em{width:1em}.bapf_sfilter .bapf_clr_span.w2em,.bapf_sfilter .bapf_img_span.w2em{width:2em}.bapf_sfilter .bapf_clr_span.w3em,.bapf_sfilter .bapf_img_span.w3em{width:3em}.bapf_sfilter .bapf_clr_span.w4em,.bapf_sfilter .bapf_img_span.w4em{width:4em}.bapf_sfilter .bapf_clr_span.w5em,.bapf_sfilter .bapf_img_span.w5em{width:5em}.bapf_sfilter .bapf_img_span.w1em.h1em .fa,.bapf_sfilter .bapf_img_span.w1em.h2em .fa,.bapf_sfilter .bapf_img_span.w1em.h3em .fa,.bapf_sfilter .bapf_img_span.w1em.h4em .fa,.bapf_sfilter .bapf_img_span.w1em.h5em .fa,.bapf_sfilter .bapf_img_span.w2em.h1em .fa,.bapf_sfilter .bapf_img_span.w3em.h1em .fa,.bapf_sfilter .bapf_img_span.w4em.h1em .fa,.bapf_sfilter .bapf_img_span.w5em.h1em .fa{font-size:.8em}.bapf_sfilter .bapf_img_span.w2em.h2em .fa,.bapf_sfilter .bapf_img_span.w2em.h3em .fa,.bapf_sfilter .bapf_img_span.w2em.h4em .fa,.bapf_sfilter .bapf_img_span.w2em.h5em .fa,.bapf_sfilter .bapf_img_span.w3em.h2em .fa,.bapf_sfilter .bapf_img_span.w4em.h2em .fa,.bapf_sfilter .bapf_img_span.w5em.h2em .fa{font-size:1.6em}.bapf_sfilter .bapf_img_span.w3em.h3em .fa,.bapf_sfilter .bapf_img_span.w3em.h4em .fa,.bapf_sfilter .bapf_img_span.w3em.h5em .fa,.bapf_sfilter .bapf_img_span.w4em.h3em .fa,.bapf_sfilter .bapf_img_span.w5em.h3em .fa{font-size:2.4em}.bapf_sfilter .bapf_img_span.w4em.h4em .fa,.bapf_sfilter .bapf_img_span.w4em.h5em .fa,.bapf_sfilter .bapf_img_span.w5em.h4em .fa{font-size:3.2em}.bapf_sfilter .bapf_img_span.w5em.h5em .fa{font-size:4em}.bapf_sfilter .bapf_clr_span .bapf_clr_span_abslt{position:relative;z-index:100}.bapf_sfilter.brchecked_default input:checked+label .bapf_clr_span,.bapf_sfilter.brchecked_default input:checked+label .bapf_img_span,.bapf_sfilter.brchecked_rotate input:checked+label .bapf_clr_span,.bapf_sfilter.brchecked_rotate input:checked+label .bapf_img_span{-webkit-transform:rotate(15deg);-moz-transform:rotate(15deg);-ms-transform:rotate(15deg);-o-transform:rotate(15deg);transform:rotate(15deg)}.bapf_sfilter.brchecked_scale input:checked+label .bapf_clr_span,.bapf_sfilter.brchecked_scale input:checked+label .bapf_img_span{transform:scale(1.1)}.bapf_sfilter.brchecked_image_shadow input:checked+label .bapf_clr_span,.bapf_sfilter.brchecked_shadow input:checked+label .bapf_clr_span,.bapf_sfilter.brchecked_shadow input:checked+label .bapf_img_span{box-shadow:0 0 1px 3px #88F}.bapf_sfilter.brchecked_image_shadow input:checked+label .bapf_img_span{-webkit-filter:drop-shadow(0 0 2px);-moz-filter:drop-shadow(0 0 2px);-o-filter:drop-shadow(0 0 2px);filter:drop-shadow(0 0 2px)}.bapf_sfilter.brchecked_hue_rotate input:checked+label .bapf_clr_span,.bapf_sfilter.brchecked_hue_rotate input:checked+label .bapf_img_span{-webkit-filter:hue-rotate(90deg);-moz-filter:hue-rotate(90deg);-o-filter:hue-rotate(90deg);filter:hue-rotate(90deg)}.bapf_sfilter .bapf_clr_multi{position:absolute;top:0;bottom:0;left:0;right:0;z-index:2;transform:rotateZ(45deg);padding:0;margin:-2em 0;box-sizing:border-box}.bapf_sfilter .bapf_clr_multi .bapf_clr_multi_singl{position:absolute;top:-50%;bottom:-50%;padding:0;margin:0;box-shadow:none;box-sizing:border-box;border:0}.bapf_sfilter .bapf_clr_multi_2 .bapf_clr_multi_singl,.bapf_sfilter .bapf_clr_multi_3 .bapf_clr_multi_singl{width:100%}.bapf_sfilter .bapf_clr_multi_3 .bapf_clr_multi_singl_1{width:34%}.bapf_sfilter .bapf_clr_multi_3 .bapf_clr_multi_singl_0,.bapf_sfilter .bapf_clr_multi_3 .bapf_clr_multi_singl_2{width:83%}.bapf_sfilter .bapf_clr_multi_4 .bapf_clr_multi_singl{width:25%}.bapf_sfilter .bapf_clr_multi_4 .bapf_clr_multi_singl_0,.bapf_sfilter .bapf_clr_multi_4 .bapf_clr_multi_singl_3{width:75%}.bapf_sfilter .bapf_clr_multi .bapf_clr_multi_singl_0{left:-50%}.bapf_sfilter .bapf_clr_multi_2 .bapf_clr_multi_singl_1{left:50%}.bapf_sfilter .bapf_clr_multi_3 .bapf_clr_multi_singl_1{left:33%}.bapf_sfilter .bapf_clr_multi_4 .bapf_clr_multi_singl_1{left:25%}.bapf_sfilter .bapf_clr_multi_3 .bapf_clr_multi_singl_2{left:67%}.bapf_sfilter .bapf_clr_multi_4 .bapf_clr_multi_singl_2{left:50%}.bapf_sfilter .bapf_clr_multi_4 .bapf_clr_multi_singl_3{left:75%}.bapf_sfilter.bapf_clr_txt_left .bapf_img_span{margin:5px 0 5px 10px}.bapf_sfilter.bapf_clr_txt_right .bapf_img_span{margin:5px 10px 5px 0}.bapf_sfilter.bapf_clr_txt_bottom .bapf_img_span,.bapf_sfilter.bapf_clr_txt_top .bapf_img_span{margin:5px 10px}.bapf_sfilter.bapf_colorinline.bapf_clr_txt_bottom li label,.bapf_sfilter.bapf_colorinline.bapf_clr_txt_top li label{display:inline-block!important;text-align:center}.bapf_sfilter.bapf_clr_txt_bottom .bapf_clr_text,.bapf_sfilter.bapf_clr_txt_top .bapf_clr_text{display:block;margin-right:10px;margin-left:10px}.bapf_colorinline .bapf_body li{text-align:center}.bapf_img_woborder.bapf_sfilter .bapf_img_span{border:none;overflow:visible}.bapf_clr_woborder.bapf_sfilter .bapf_clr_span{border:none}.bapf_radio_chck ul li input[type=checkbox]{-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;appearance:none;display:inline-block;vertical-align:middle;border:2px solid #555;width:15px;height:15px;outline:0;border-radius:10px;padding:2px;margin-right:5px;position:relative}.bapf_radio_chck ul li input[type=checkbox]:checked:after{content:"";width:8px;height:12px;border-bottom:2px solid #333;border-right:2px solid #333;display:block;position:absolute;top:-4px;left:3px;transform:rotate(45deg)}.bapf_asradio2 ul li input[type=checkbox]{-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;appearance:none;display:inline-block;vertical-align:middle;border:2px solid #555;width:15px;height:15px;outline:0;border-radius:10px;padding:2px;margin-right:5px}.bapf_asradio2 ul li input[type=checkbox]:checked{background:#555;background-clip:content-box}.bapf_slct select{width:100%;font-size:1em}.bapf_slct .select2 .select2-search__field{width:auto!important}#bapf-select2-high-zindex .select2-container{z-index:999999999!important}.bapf_sfa_inline .berocket_aapf_widget_selected_area ul li{display:inline-block;margin-left:3px!important;margin-right:3px!important}.bapf_ckbox_sqchck input[type=checkbox]{-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;appearance:none;display:inline-block;vertical-align:middle;border:2px solid #555;width:20px;height:20px;outline:0;padding:4px;margin-right:5px;position:relative}.bapf_ckbox_sqchck input[type=checkbox]:checked:after{content:"";width:8px;height:12px;border-bottom:2px solid #333;border-right:2px solid #333;display:block;position:absolute;top:0;left:4px;transform:rotate(45deg)}.bapf_ckbox_square input[type=checkbox]{-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;appearance:none;display:inline-block;vertical-align:middle;border:2px solid #555;width:20px;height:20px;outline:0;padding:4px;margin-right:5px}.bapf_ckbox_square input[type=checkbox]:checked{background:#555;background-clip:content-box}
|
1 |
+
.bapf_sfilter .bapf_button,.bapf_sfilter label{cursor:pointer;display:inline-block!important}.bapf_sfilter ul li{list-style:none!important;margin:0!important;padding:0!important;max-width:100%;text-align:left!important}.rtl .bapf_sfilter ul li{text-align:right!important}.bapf_sfilter .bapf_body ul li ul{margin-left:15px}.bapf_slidr_main.ui-widget-content,.berocket_filter_price_slider.ui-widget-content{background:#b0b5b9;border:0;border-radius:0;height:4px;padding:0}.bapf_slidr_main.ui-widget-content .ui-slider-range,.berocket_filter_price_slider.ui-widget-content .ui-slider-range{background:#000}.slide.default .bapf_slidr_main.ui-widget-content .ui-slider-range,.slide.default .berocket_filter_price_slider.ui-widget-content .ui-slider-range{background:#222}.slide.default .bapf_slidr_main.ui-widget-content,.slide.default .berocket_filter_price_slider.ui-widget-content{height:4px;border:1px solid #555;font-size:10px}.bapf_slidr_main.ui-widget-content .ui-slider-handle,.berocket_filter_price_slider.ui-widget-content .ui-slider-handle,.slide.default .bapf_slidr_main .ui-state-default,.slide.default .bapf_slidr_main .ui-widget-header .ui-state-default,.slide.default .bapf_slidr_main.ui-widget-content .ui-state-default,.slide.default .berocket_filter_price_slider .ui-state-default,.slide.default .berocket_filter_price_slider .ui-widget-header .ui-state-default,.slide.default .berocket_filter_price_slider.ui-widget-content .ui-state-default{background:#ddd;font-size:14px;width:1em;height:1em;border:1px solid #555;top:-6px;border-radius:2em}.berocket_aapf_widget li.slider div.slide{clear:both;height:auto;text-align:right;line-height:0}.bapf_slidr_jqrui .bapf_from,.ui-slider{text-align:left}.ui-slider{position:relative}.ui-slider .ui-slider-handle{position:absolute;z-index:2;width:1.2em;height:1.2em;cursor:pointer;-ms-touch-action:none;touch-action:none}.ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;background-position:0 0}.ui-slider.ui-state-disabled .ui-slider-handle,.ui-slider.ui-state-disabled .ui-slider-range{filter:inherit}.ui-slider-horizontal{height:.8em}.ui-slider-horizontal .ui-slider-handle{top:-.3em;margin-left:-.6em}.bapf_slidr_main>a:last-child{margin-left:-12px}.ui-slider-horizontal .ui-slider-range{top:0;height:100%}.ui-slider-horizontal .ui-slider-range-min{left:0}.ui-slider-horizontal .ui-slider-range-max{right:0}.ui-slider-vertical{width:.8em;height:100px}.ui-slider-vertical .ui-slider-handle{left:-.3em;margin-left:0;margin-bottom:-.6em}.ui-slider-vertical .ui-slider-range{left:0;width:100%}#berocket-ajax-filters-sidebar .berocket_single_filter_widget.berocket_hidden_clickable.berocket_hidden_clickable_left .bapf_sfilter.bapf_ccolaps .bapf_body,.berocket_single_filter_widget.berocket_hidden_clickable.berocket_hidden_clickable_left .bapf_sfilter.bapf_ccolaps .bapf_body,.berocket_single_filter_widget.berocket_hidden_clickable.berocket_hidden_clickable_left .berocket_aapf_widget{left:0!important}.ui-slider-vertical .ui-slider-range-min{bottom:0}.ui-slider-vertical .ui-slider-range-max{top:0}.slide .ui-corner-all,.slide .ui-corner-bottom,.slide .ui-corner-br,.slide .ui-corner-right{border-bottom-right-radius:4px}.slide .ui-corner-all,.slide .ui-corner-bl,.slide .ui-corner-bottom,.slide .ui-corner-left{border-bottom-left-radius:4px}.slide .ui-corner-all,.slide .ui-corner-right,.slide .ui-corner-top,.slide .ui-corner-tr{border-top-right-radius:4px}.slide .ui-corner-all,.slide .ui-corner-left,.slide .ui-corner-tl,.slide .ui-corner-top{border-top-left-radius:4px}ul.berocket_aapf_widget li.slider>span{cursor:initial}ul.berocket_aapf_widget li.slider .bapf_slidr_main{cursor:pointer}.slide .ui-widget-content{background:#fff;border:1px solid #aaa;color:#222}.slide .ui-state-default,.slide .ui-widget-content .ui-state-default,.slide .ui-widget-header .ui-state-default{background:#e6e6e6;border:1px solid #d3d3d3;color:#555;font-weight:400}.ui-widget.ui-datepicker{font-size:14px;z-index:9000!important}.bapf_sfilter .ui-button,.bapf_sfilter .ui-state-default,.bapf_sfilter .ui-widget-content .ui-state-default,.bapf_sfilter .ui-widget-header .ui-state-default,.bapf_sfilter .ui-widget.ui-widget-content,html .bapf_sfilter .ui-button.ui-state-disabled:active,html .bapf_sfilter .ui-button.ui-state-disabled:hover{border:0}.bapf_slidr_jqrui .bapf_slidr_all:after{content:"";display:block;clear:both}.bapf_slidr_jqrui .bapf_slidr_main{margin-bottom:10px}.bapf_slidr_jqrui .bapf_from,.bapf_slidr_jqrui .bapf_to{width:49%;display:inline-block;margin-bottom:10px;vertical-align:middle}.bapf_slidr_jqrui .bapf_from input,.bapf_slidr_jqrui .bapf_to input{width:50%;vertical-align:middle;font-size:1em;padding:0;margin:0;line-height:1em}.bapf_slidr_jqrui .bapf_to{text-align:right}.bapf_sfilter{margin-bottom:20px}.berocket_single_filter_widget.berocket_inline_clickable,.berocket_single_filter_widget.berocket_inline_filters{float:left!important;padding-right:15px!important}.berocket_single_filter_widget.berocket_inline_filters{width:12.5%!important}#berocket-ajax-filters-sidebar .berocket_single_filter_widget.berocket_hidden_clickable .berocket_aapf_widget-title_div,.berocket_single_filter_widget.berocket_hidden_clickable .berocket_aapf_widget-title_div{border:2px solid #333!important;background-color:#333!important;color:#ccc!important;padding:5px 35px 5px 5px!important;border-radius:5px!important}.berocket_single_filter_widget.berocket_hidden_clickable .berocket_widget_has_description .berocket_aapf_widget-title_div{padding-right:55px!important}.berocket_single_filter_widget.berocket_hidden_clickable .berocket_aapf_widget-wrapper{padding-bottom:5px!important}.berocket_single_filter_widget.berocket_hidden_clickable .berocket_aapf_widget-title_div h3{margin:0!important;padding:0!important;font-size:inherit!important;color:inherit!important}.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_widget-title_div{border:2px solid #ccc!important;color:#000!important;background-color:#ccc!important;border-radius:5px 5px 0 0!important;padding-bottom:10px!important}.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_widget-wrapper{padding-bottom:0!important}.berocket_single_filter_widget.berocket_hidden_clickable .berocket_aapf_widget{position:absolute!important;top:100%!important;width:100%!important;background-color:#fff!important;z-index:800!important;margin:0!important;border:2px solid #ccc!important;padding:5px!important;display:none}.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_widget{z-index:900!important}.berocket_single_filter_widget.berocket_hidden_clickable.berocket_hidden_clickable_right .berocket_aapf_widget{right:0!important}@media screen and (max-width:767px){.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible{position:fixed!important;top:0!important;left:0!important;bottom:0!important;right:0!important;z-index:9000000000!important;background-color:#fff!important;overflow:auto!important}.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_widget{border:0!important;width:100%!important;max-width:100%!important}.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_widget_show.mobile_hide{display:block!important}.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_widget_show.mobile_hide .fa-angle-left:before,.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_widget_show.mobile_hide .fa-angle-right:before{content:"\f00d"!important}.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_description{display:none!important}body .select2-container,body .ui-widget.ui-datepicker{z-index:9000000009!important}.bapf_sngl_hd_mobile{display:none!important}}.bapf_sfilter.bapf_fhide .bapf_body ul li.bapf_hide,.bapf_sfilter.bapf_fhide.bapf_filter_hide,.berocket_single_filter_widget.bapf_mt_none{display:none!important}.berocket_element_above_products{clear:both!important;overflow:visible!important}div.berocket_single_filter_widget div.berocket_aapf_widget-wrapper *{opacity:1}@media screen and (min-width:768px) and (max-width:1024px){.bapf_sngl_hd_tablet{display:none!important}}@media screen and (min-width:1025px){.bapf_sngl_hd_desktop{display:none!important}}.berocket_aapf_widget select{overflow:auto!important}.berocket_element_above_products_after{clear:both}ul.berocket_aapf_widget li>span>input+.berocket_label_widgets::before{margin-right:6px}.berocket_element_above_products_is_hide{overflow:visible!important}.berocket_element_above_products_is_hide:after{content:"";display:block;clear:both}.berocket_ajax_filters_sidebar_toggle,.berocket_element_above_products_is_hide_toggle{width:200px!important;display:inline-block;position:relative;padding-left:25px;outline:0!important;font-size:16px;font-weight:600}.berocket_element_above_products_is_hide.br_is_hidden{opacity:0;max-height:1px;position:relative}.berocket_element_above_products_is_hide_toggle{height:20px;margin:40px 0;color:#2a2a2a}body{transition:margin-left .2s}body.berocket_ajax_filters_sidebar_active{margin-left:200px}.berocket_ajax_filters_sidebar_toggle{height:26px;margin:40px 0;text-decoration:none!important;box-sizing:border-box!important}#berocket-ajax-filters-sidebar{display:block;position:fixed;top:0;left:-400px;bottom:0;width:350px;max-width:100%;background:#fff;transition:all .2s;z-index:100000;box-sizing:border-box;overflow:auto!important}#berocket-ajax-filters-sidebar-shadow{content:"";display:none;position:fixed;top:0;left:0;bottom:0;right:0;z-index:99999;background:#000;opacity:.7}.admin-bar #berocket-ajax-filters-sidebar{top:32px}#berocket-ajax-filters-sidebar.active,#berocket-ajax-filters-sidebar.active+#berocket-ajax-filters-sidebar-shadow{left:0;display:block;visibility:visible}#berocket-ajax-filters-sidebar .berocket_ajax_group_filter_title{padding:15px 88px 15px 15px!important;font-weight:500!important;font-size:24px!important;color:#333!important;border-bottom:1px solid #ccc!important}#berocket-ajax-filters-sidebar>div{padding:15px!important}#berocket-ajax-filters-sidebar .berocket_aapf_widget-title_div{color:#333!important;font-size:19px!important;font-weight:600!important}#berocket-ajax-filters-sidebar .berocket_aapf_widget,#berocket-ajax-filters-sidebar .berocket_aapf_widget li{margin:0!important}#berocket-ajax-filters-sidebar .berocket_aapf_widget .berocket_checkbox_color .berocket_label_widgets{margin:0 .6em .6em 0!important}#berocket-ajax-filters-sidebar-close{position:absolute!important;right:0!important;line-height:39px;padding:17px 15px 13px!important;font-family:Arial,serif!important;color:#a2a2a2}#berocket-ajax-filters-sidebar-close+*{margin-top:70px!important}#berocket-ajax-filters-sidebar-close+.berocket_ajax_group_filter_title{margin-top:0!important}@media screen and (max-width:782px){.admin-bar #berocket-ajax-filters-sidebar{top:46px}}@media screen and (max-width:600px){.admin-bar #berocket-ajax-filters-sidebar{top:0}}.berocket_aapf_widget-wrapper .slider:not(.flickity-enabled){overflow:initial;white-space:initial}.select2-container{z-index:999}.bapf_sfilter .bapf_body .mCSB_container>ul,.bapf_sfilter .bapf_body>ul{margin-left:0;margin-top:0!important;margin-bottom:0!important}.bapf_sfilter.bapf_vpr_1 .bapf_body ul,.bapf_sfilter.bapf_vpr_2 .bapf_body ul,.bapf_sfilter.bapf_vpr_3 .bapf_body ul,.bapf_sfilter.bapf_vpr_4 .bapf_body ul{display:flex;flex-wrap:wrap}.bapf_sfilter.bapf_vpr_1 .bapf_body ul>li,.bapf_sfilter.bapf_vpr_2 .bapf_body ul>li,.bapf_sfilter.bapf_vpr_3 .bapf_body ul>li,.bapf_sfilter.bapf_vpr_4 .bapf_body ul>li{white-space:nowrap;flex-grow:1}.bapf_sfilter.bapf_vpr_1 .bapf_body ul>li{flex-basis:100%}.bapf_sfilter.bapf_vpr_2 .bapf_body ul>li{flex-basis:50%}.bapf_sfilter.bapf_vpr_3 .bapf_body ul>li{flex-basis:33%}.bapf_sfilter.bapf_vpr_4 .bapf_body ul>li{flex-basis:25%}.bapf_sfilter.bapf_vpr_1 .bapf_body ul>li label,.bapf_sfilter.bapf_vpr_2 .bapf_body ul>li label,.bapf_sfilter.bapf_vpr_3 .bapf_body ul>li label,.bapf_sfilter.bapf_vpr_4 .bapf_body ul>li label{white-space:initial}.bapf_sfilter .bapf_hascolarr,.bapf_sfilter .bapf_hasdesc{position:relative;padding-right:25px;display:flex;align-items:center}.bapf_sfilter .bapf_hascolarr.bapf_hasdesc{padding-right:45px}.bapf_sfilter .bapf_colaps_smb,.bapf_sfilter .bapf_desci{position:absolute;right:0;line-height:inherit;font-size:16px;cursor:pointer}.bapf_sfilter .bapf_desci{padding:4px 8px}.bapf_sfilter .bapf_hasdesc .bapf_colaps_smb{right:25px}.bapf_sfilter .bapf_cchild,.bapf_sfilter .bapf_ochild{cursor:pointer;padding:0 5px}#berocket-ajax-filters-sidebar .berocket_single_filter_widget.berocket_hidden_clickable .bapf_sfilter .bapf_head,.berocket_single_filter_widget.berocket_hidden_clickable .bapf_sfilter .bapf_head{border:2px solid #333!important;background-color:#333!important;color:#ccc!important;padding:5px!important;border-radius:5px!important;cursor:pointer}#berocket-ajax-filters-sidebar .berocket_single_filter_widget.berocket_hidden_clickable .berocket_widget_has_description .berocket_aapf_widget-title_div,.berocket_single_filter_widget.berocket_hidden_clickable .berocket_widget_has_description .berocket_aapf_widget-title_div{padding-right:55px!important}#berocket-ajax-filters-sidebar .berocket_single_filter_widget.berocket_hidden_clickable .berocket_aapf_widget-wrapper,.berocket_single_filter_widget.berocket_hidden_clickable .berocket_aapf_widget-wrapper{padding-bottom:5px!important}#berocket-ajax-filters-sidebar .berocket_single_filter_widget.berocket_hidden_clickable .bapf_sfilter .bapf_head h3,.berocket_single_filter_widget.berocket_hidden_clickable .bapf_sfilter .bapf_head h3{margin:0;font-size:inherit!important;color:inherit!important}#berocket-ajax-filters-sidebar .berocket_single_filter_widget.berocket_hidden_clickable .bapf_sfilter,.berocket_single_filter_widget.berocket_hidden_clickable .bapf_sfilter{position:relative!important}#berocket-ajax-filters-sidebar .berocket_single_filter_widget.berocket_hidden_clickable .bapf_sfilter.bapf_ccolaps .bapf_head,.berocket_single_filter_widget.berocket_hidden_clickable .bapf_sfilter.bapf_ccolaps .bapf_head{border:2px solid #ccc!important;color:#000!important;background-color:#ccc!important;border-radius:5px 5px 0 0!important;padding-bottom:5px!important}#berocket-ajax-filters-sidebar .berocket_single_filter_widget.berocket_hidden_clickable .bapf_sfilter .bapf_body,.berocket_single_filter_widget.berocket_hidden_clickable .bapf_sfilter .bapf_body{position:absolute!important;top:100%!important;width:100%!important;background-color:#fff!important;z-index:800!important;margin:0!important;border:2px solid #ccc!important;padding:5px!important}#berocket-ajax-filters-sidebar .berocket_single_filter_widget.berocket_hidden_clickable.berocket_hidden_clickable_right .bapf_sfilter.bapf_ccolaps .bapf_body,.berocket_single_filter_widget.berocket_hidden_clickable.berocket_hidden_clickable_right .bapf_sfilter.bapf_ccolaps .bapf_body{right:0!important}@media screen and (max-width:767px){#berocket-ajax-filters-sidebar .berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible,.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible{position:fixed!important;top:0!important;left:0!important;bottom:0!important;right:0!important;z-index:9000000000!important;background-color:#fff!important;overflow:auto!important}#berocket-ajax-filters-sidebar .berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_widget,.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_widget{border:0!important;width:100%!important;max-width:100%!important}#berocket-ajax-filters-sidebar .berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_widget_show.mobile_hide,.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_widget_show.mobile_hide{display:block!important}#berocket-ajax-filters-sidebar .berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_widget_show.mobile_hide .fa-angle-left:before,#berocket-ajax-filters-sidebar .berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_widget_show.mobile_hide .fa-angle-right:before,.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_widget_show.mobile_hide .fa-angle-left:before,.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_widget_show.mobile_hide .fa-angle-right:before{content:"\f00d"!important}#berocket-ajax-filters-sidebar .berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_description,.berocket_single_filter_widget.berocket_hidden_clickable.berocket_single_filter_visible .berocket_aapf_description{display:none!important}body .select2-container,body .ui-widget.ui-datepicker{z-index:9000000009!important}}@keyframes bapf_loader{from{transform:rotate(0)}to{transform:rotate(360deg)}}.bapf_loader_page{position:fixed;top:0;left:0;bottom:0;right:0;background-color:rgba(255,255,255,.5);z-index:9999}.bapf_lcontainer{position:absolute;top:50%;margin:-20px 0 0 -20px;left:50%;width:30px;height:30px;padding:0}.bapf_lcontainer .bapf_loader{width:100%;height:100%;display:block;transform:rotate(0);animation:1s linear 0s infinite bapf_loader;position:relative}.bapf_lcontainer .bapf_loader .bapf_lfirst,.bapf_lcontainer .bapf_loader .bapf_lsecond{position:absolute;width:10px;height:10px;background:#000;background:linear-gradient(45deg,#000,transparent);display:block;border-radius:6px}.bapf_lcontainer .bapf_loader .bapf_lfirst{bottom:0;right:0}.bapf_lcontainer .bapf_loader .bapf_lsecond{top:0;left:0;transform:rotate(180deg)}.bapf_lcontainer .bapf_labove,.bapf_lcontainer .bapf_lbelow{position:absolute;display:block;text-align:center;width:80vw;left:calc(15px - 40vw)}.bapf_lcontainer .bapf_labove{bottom:120%}.bapf_lcontainer .bapf_lbelow{top:120%}.bapf_lcontainer .bapf_lafter,.bapf_lcontainer .bapf_lbefore{position:absolute;top:50%;margin-top:-15px;height:30px;line-height:30px;vertical-align:middle;white-space:nowrap}.bapf_lcontainer .bapf_lbefore{right:120%}.bapf_lcontainer .bapf_lafter{left:120%}.bapf_lcontainer .bapf_limg{width:100%;height:100%}.berocket_single_filter_widget .tippy-tooltip,.berocket_single_filter_widget .tippy-tooltip .tippy-content{font-size:1em}@media only screen and (max-device-width:767px){.bapf_hide_mobile{display:none!important}}.bapf_sfilter .bapf_button{font-size:1em}.bapf_sfilter .rightpcs{float:right}.bapf_sfilter .right2empcs{padding-left:10px}#bapf_footer_clrimg>div,#bapf_footer_count_before>div,#bapf_footer_description>div{z-index:999999999999!important}.bapf_sfilter.bapf_ckbox input[type=checkbox]{margin-right:5px;cursor:pointer}.bapf_sfilter.bapf_ckbox input[type=checkbox],.bapf_sfilter.bapf_ckbox label,.bapf_sfilter.bapf_ckbox label+span,.bapf_sfilter.bapf_ckbox label>span{vertical-align:middle}.select2-container--classic input[type=search],.select2-container--classic input[type=search]:focus{background-color:initial}.berocket_search_box_block{position:relative;padding:.5em}.berocket_search_box_block .berocket_search_box_background_all{position:relative;z-index:200}.berocket_search_box_block .berocket_search_box_background{z-index:100;position:absolute;top:0;bottom:0;left:0;right:0}.berocket_search_box_block select{min-width:100%}.berocket_search_box_button{cursor:pointer;display:block;text-align:center;padding:5px 0}.berocket_search_box_block .berocket_aapf_widget-wrapper ul{margin:0}.berocket_search_box_block .berocket_aapf_widget-wrapper{margin:1em 0}.bapf_show_hide{cursor:pointer}.bapf_hideckbox li input[type=checkbox],.bapf_hideckbox li input[type=checkbox]:after,.bapf_hideckbox li input[type=checkbox]:before{display:none!important}.bapf_hideckbox li label,.bapf_hideckbox li label a{color:#428bca}.bapf_hideckbox li input:checked+label:hover,.bapf_hideckbox li input:checked+label:hover a,.bapf_hideckbox li label:hover,.bapf_hideckbox li label:hover a{color:#2a6496}.bapf_hideckbox li input:checked+label,.bapf_hideckbox li input:checked+label a{color:#222}.bapf_sfilter.bapf_clr_txt_left .bapf_body ul,.bapf_sfilter.bapf_clr_txt_right .bapf_body ul{width:100%;flex-basis:100%}.bapf_sfilter.bapf_clr_txt_left .bapf_body ul li,.bapf_sfilter.bapf_clr_txt_right .bapf_body ul li{display:flex;align-items:center;flex-wrap:wrap}.bapf_sfilter.bapf_clr_txt_left .bapf_body ul li label,.bapf_sfilter.bapf_clr_txt_right .bapf_body ul li label{display:flex!important;flex-direction:row!important;align-items:center!important}.bapf_sfilter.bapf_clr_txt_left .bapf_body ul li label .bapf_clr_span,.bapf_sfilter.bapf_clr_txt_left .bapf_body ul li label .bapf_img_span,.bapf_sfilter.bapf_clr_txt_right .bapf_body ul li label .bapf_clr_span,.bapf_sfilter.bapf_clr_txt_right .bapf_body ul li label .bapf_img_span{flex-shrink:0}.bapf_sfilter.bapf_button_berocket .bapf_button{font-size:20px;padding:8px 30px;border:0;line-height:28px;font-weight:600;display:inline-block;color:#fff;text-transform:uppercase;text-align:center;text-decoration:none;background-color:#f16543}.bapf_sfilter.bapf_button_berocket .bapf_button:hover{background-color:#d94825}.bapf_sfilter.bapf_colorinline li{display:inline-block!important}.bapf_sfilter .bapf_clr_span,.bapf_sfilter .bapf_img_span{display:inline-block!important;position:relative;overflow:hidden;margin:5px;height:2em;width:2em;line-height:2em;border:2px solid #000;text-align:center;vertical-align:middle;color:#222!important;text-shadow:0 0 3px #FFF,1px 0 2px #FFF,0 1px 2px #FFF,-1px 0 2px #FFF,0 -1px 2px #FFF,1px 1px 2px #FFF,1px -1px 2px #FFF,-1px 1px 2px #FFF,-1px -1px 2px #FFF;-webkit-transition:all .2s ease-out .1s;-moz-transition:all .2s ease-out .1s;-o-transition:all .2s ease-out .1s;transition:all .2s ease-out .1s}.bapf_sfilter .bapf_clr_span.h1em,.bapf_sfilter .bapf_img_span.h1em{height:1em;line-height:1em}.bapf_sfilter .bapf_clr_span.h2em,.bapf_sfilter .bapf_img_span.h2em{height:2em;line-height:2em}.bapf_sfilter .bapf_clr_span.h3em,.bapf_sfilter .bapf_img_span.h3em{height:3em;line-height:3em}.bapf_sfilter .bapf_clr_span.h4em,.bapf_sfilter .bapf_img_span.h4em{height:4em;line-height:4em}.bapf_sfilter .bapf_clr_span.h5em,.bapf_sfilter .bapf_img_span.h5em{height:5em;line-height:5em}.bapf_sfilter .bapf_clr_span.w1em,.bapf_sfilter .bapf_img_span.w1em{width:1em}.bapf_sfilter .bapf_clr_span.w2em,.bapf_sfilter .bapf_img_span.w2em{width:2em}.bapf_sfilter .bapf_clr_span.w3em,.bapf_sfilter .bapf_img_span.w3em{width:3em}.bapf_sfilter .bapf_clr_span.w4em,.bapf_sfilter .bapf_img_span.w4em{width:4em}.bapf_sfilter .bapf_clr_span.w5em,.bapf_sfilter .bapf_img_span.w5em{width:5em}.bapf_sfilter .bapf_img_span.w1em.h1em .fa,.bapf_sfilter .bapf_img_span.w1em.h2em .fa,.bapf_sfilter .bapf_img_span.w1em.h3em .fa,.bapf_sfilter .bapf_img_span.w1em.h4em .fa,.bapf_sfilter .bapf_img_span.w1em.h5em .fa,.bapf_sfilter .bapf_img_span.w2em.h1em .fa,.bapf_sfilter .bapf_img_span.w3em.h1em .fa,.bapf_sfilter .bapf_img_span.w4em.h1em .fa,.bapf_sfilter .bapf_img_span.w5em.h1em .fa{font-size:.8em}.bapf_sfilter .bapf_img_span.w2em.h2em .fa,.bapf_sfilter .bapf_img_span.w2em.h3em .fa,.bapf_sfilter .bapf_img_span.w2em.h4em .fa,.bapf_sfilter .bapf_img_span.w2em.h5em .fa,.bapf_sfilter .bapf_img_span.w3em.h2em .fa,.bapf_sfilter .bapf_img_span.w4em.h2em .fa,.bapf_sfilter .bapf_img_span.w5em.h2em .fa{font-size:1.6em}.bapf_sfilter .bapf_img_span.w3em.h3em .fa,.bapf_sfilter .bapf_img_span.w3em.h4em .fa,.bapf_sfilter .bapf_img_span.w3em.h5em .fa,.bapf_sfilter .bapf_img_span.w4em.h3em .fa,.bapf_sfilter .bapf_img_span.w5em.h3em .fa{font-size:2.4em}.bapf_sfilter .bapf_img_span.w4em.h4em .fa,.bapf_sfilter .bapf_img_span.w4em.h5em .fa,.bapf_sfilter .bapf_img_span.w5em.h4em .fa{font-size:3.2em}.bapf_sfilter .bapf_img_span.w5em.h5em .fa{font-size:4em}.bapf_sfilter .bapf_clr_span .bapf_clr_span_abslt{position:relative;z-index:100}.bapf_sfilter .bapf_img_span .bapf_clr_span_abslt{position:absolute;top:0;left:0;right:0;bottom:0}.bapf_sfilter.brchecked_default input:checked+label .bapf_clr_span,.bapf_sfilter.brchecked_default input:checked+label .bapf_img_span,.bapf_sfilter.brchecked_rotate input:checked+label .bapf_clr_span,.bapf_sfilter.brchecked_rotate input:checked+label .bapf_img_span{-webkit-transform:rotate(15deg);-moz-transform:rotate(15deg);-ms-transform:rotate(15deg);-o-transform:rotate(15deg);transform:rotate(15deg)}.bapf_sfilter.brchecked_scale input:checked+label .bapf_clr_span,.bapf_sfilter.brchecked_scale input:checked+label .bapf_img_span{transform:scale(1.1)}.bapf_sfilter.brchecked_image_shadow input:checked+label .bapf_clr_span,.bapf_sfilter.brchecked_shadow input:checked+label .bapf_clr_span,.bapf_sfilter.brchecked_shadow input:checked+label .bapf_img_span{box-shadow:0 0 1px 3px #88F}.bapf_sfilter.brchecked_image_shadow input:checked+label .bapf_img_span{-webkit-filter:drop-shadow(0 0 2px);-moz-filter:drop-shadow(0 0 2px);-o-filter:drop-shadow(0 0 2px);filter:drop-shadow(0 0 2px)}.bapf_sfilter.brchecked_hue_rotate input:checked+label .bapf_clr_span,.bapf_sfilter.brchecked_hue_rotate input:checked+label .bapf_img_span{-webkit-filter:hue-rotate(90deg);-moz-filter:hue-rotate(90deg);-o-filter:hue-rotate(90deg);filter:hue-rotate(90deg)}.bapf_sfilter .bapf_clr_multi{position:absolute;top:0;bottom:0;left:0;right:0;z-index:2;transform:rotateZ(45deg);padding:0;margin:-2em 0;box-sizing:border-box}.bapf_sfilter .bapf_clr_multi .bapf_clr_multi_singl{position:absolute;top:-50%;bottom:-50%;padding:0;margin:0;box-shadow:none;box-sizing:border-box;border:0}.bapf_sfilter .bapf_clr_multi_2 .bapf_clr_multi_singl,.bapf_sfilter .bapf_clr_multi_3 .bapf_clr_multi_singl{width:100%}.bapf_sfilter .bapf_clr_multi_3 .bapf_clr_multi_singl_1{width:34%}.bapf_sfilter .bapf_clr_multi_3 .bapf_clr_multi_singl_0,.bapf_sfilter .bapf_clr_multi_3 .bapf_clr_multi_singl_2{width:83%}.bapf_sfilter .bapf_clr_multi_4 .bapf_clr_multi_singl{width:25%}.bapf_sfilter .bapf_clr_multi_4 .bapf_clr_multi_singl_0,.bapf_sfilter .bapf_clr_multi_4 .bapf_clr_multi_singl_3{width:75%}.bapf_sfilter .bapf_clr_multi .bapf_clr_multi_singl_0{left:-50%}.bapf_sfilter .bapf_clr_multi_2 .bapf_clr_multi_singl_1{left:50%}.bapf_sfilter .bapf_clr_multi_3 .bapf_clr_multi_singl_1{left:33%}.bapf_sfilter .bapf_clr_multi_4 .bapf_clr_multi_singl_1{left:25%}.bapf_sfilter .bapf_clr_multi_3 .bapf_clr_multi_singl_2{left:67%}.bapf_sfilter .bapf_clr_multi_4 .bapf_clr_multi_singl_2{left:50%}.bapf_sfilter .bapf_clr_multi_4 .bapf_clr_multi_singl_3{left:75%}.bapf_sfilter.bapf_clr_txt_left .bapf_img_span{margin:5px 0 5px 10px}.bapf_sfilter.bapf_clr_txt_right .bapf_img_span{margin:5px 10px 5px 0}.bapf_sfilter.bapf_clr_txt_bottom .bapf_img_span,.bapf_sfilter.bapf_clr_txt_top .bapf_img_span{margin:5px 10px}.bapf_sfilter.bapf_colorinline.bapf_clr_txt_bottom li label,.bapf_sfilter.bapf_colorinline.bapf_clr_txt_top li label{display:inline-block!important;text-align:center}.bapf_sfilter.bapf_clr_txt_bottom .bapf_clr_text,.bapf_sfilter.bapf_clr_txt_top .bapf_clr_text{display:block;margin-right:10px;margin-left:10px}.bapf_colorinline .bapf_body li{text-align:center}.bapf_img_woborder.bapf_sfilter .bapf_img_span{border:none;overflow:visible}.bapf_clr_woborder.bapf_sfilter .bapf_clr_span{border:none}.bapf_radio_chck ul li input[type=checkbox]{-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;appearance:none;display:inline-block;vertical-align:middle;border:2px solid #555;width:15px;height:15px;outline:0;border-radius:10px;padding:2px;margin-right:5px;position:relative}.bapf_radio_chck ul li input[type=checkbox]:checked:after{content:"";width:8px;height:12px;border-bottom:2px solid #333;border-right:2px solid #333;display:block;position:absolute;top:-4px;left:3px;transform:rotate(45deg)}.bapf_asradio2 ul li input[type=checkbox]{-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;appearance:none;display:inline-block;vertical-align:middle;border:2px solid #555;width:15px;height:15px;outline:0;border-radius:10px;padding:2px;margin-right:5px}.bapf_asradio2 ul li input[type=checkbox]:checked{background:#555;background-clip:content-box}.bapf_slct select{width:100%;font-size:1em}.bapf_slct .select2 .select2-search__field{width:auto!important}#bapf-select2-high-zindex .select2-container{z-index:999999999!important}.bapf_sfa_inline .berocket_aapf_widget_selected_area ul li{display:inline-block;margin-left:3px!important;margin-right:3px!important}.bapf_ckbox_sqchck input[type=checkbox]{-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;appearance:none;display:inline-block;vertical-align:middle;border:2px solid #555;width:20px;height:20px;outline:0;padding:4px;margin-right:5px;position:relative}.bapf_ckbox_sqchck input[type=checkbox]:checked:after{content:"";width:8px;height:12px;border-bottom:2px solid #333;border-right:2px solid #333;display:block;position:absolute;top:0;left:4px;transform:rotate(45deg)}.bapf_ckbox_square input[type=checkbox]{-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;appearance:none;display:inline-block;vertical-align:middle;border:2px solid #555;width:20px;height:20px;outline:0;padding:4px;margin-right:5px}.bapf_ckbox_square input[type=checkbox]:checked{background:#555;background-clip:content-box}
|
includes/addons/new-woocommerce-variation.php
ADDED
@@ -0,0 +1,310 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class BeRocket_AAPF_compat_woocommerce_variation_new {
|
3 |
+
public $limit_post__not_in_where_array = array();
|
4 |
+
public $is_apply = true;
|
5 |
+
function __construct() {
|
6 |
+
$BeRocket_AAPF = BeRocket_AAPF::getInstance();
|
7 |
+
$options = $BeRocket_AAPF->get_option();
|
8 |
+
if( berocket_isset($options['out_of_stock_variable']) == 2 ) {
|
9 |
+
$this->is_apply = false;
|
10 |
+
add_filter('bapf_uparse_generate_tax_query_each', array($this, 'is_out_of_stock'), 101, 4);
|
11 |
+
}
|
12 |
+
if( ! empty($options['out_of_stock_variable_reload']) ) {
|
13 |
+
add_action('bapf_faster_recount_before_recount_terms', array($this, 'before_recount'), 10, 2 );
|
14 |
+
add_action('bapf_faster_recount_after_recount_terms', array($this, 'after_recount'), 10, 2 );
|
15 |
+
} else {
|
16 |
+
add_filter('bapf_faster_recount_get_query_for_calculate', array($this, 'modify_query_vars'), 9000, 2);
|
17 |
+
}
|
18 |
+
add_filter('bapf_uparse_query_vars_apply_filters', array($this, 'apply_filter'), 9000, 3);
|
19 |
+
}
|
20 |
+
function is_out_of_stock($result, $instance, $filter, $data) {
|
21 |
+
if( ! $this->is_apply && $result !== null && isset($filter['type']) && $filter['type'] == 'stock_status' && ! empty($result['tax_query']) ) {
|
22 |
+
foreach($result['tax_query'] as $tax_data) {
|
23 |
+
if( is_array($tax_data) && isset($tax_data['operator']) && $tax_data['operator'] == 'NOT IN' ) {
|
24 |
+
$this->is_apply = true;
|
25 |
+
}
|
26 |
+
}
|
27 |
+
}
|
28 |
+
return $result;
|
29 |
+
}
|
30 |
+
function check_is_taxonomy_variable($taxonomy) {
|
31 |
+
return apply_filters('bapf_wcvariation_check_is_taxonomy_variable', (substr($taxonomy, 0, 3) == 'pa_'), $taxonomy);
|
32 |
+
}
|
33 |
+
public $attribute_recount_enable = false;
|
34 |
+
function before_recount($terms, $taxonomy_data) {
|
35 |
+
if( $this->is_apply && ! empty($taxonomy_data) && ! empty($taxonomy_data['taxonomy']) && $this->check_is_taxonomy_variable($taxonomy_data['taxonomy']) ) {
|
36 |
+
$this->attribute_recount_enable = true;
|
37 |
+
add_filter('berocket_posts_clauses_recount', array($this, 'apply_recount'), 9000, 3);
|
38 |
+
}
|
39 |
+
}
|
40 |
+
function after_recount($terms, $taxonomy_data) {
|
41 |
+
if( $this->attribute_recount_enable ) {
|
42 |
+
remove_filter('berocket_posts_clauses_recount', array($this, 'apply_recount'), 9000, 3);
|
43 |
+
}
|
44 |
+
}
|
45 |
+
function modify_query_vars($query_vars, $data) {
|
46 |
+
$args = $this->apply_filter(array(), $query_vars, $data);
|
47 |
+
$query_vars = array_merge($query_vars, $args);
|
48 |
+
return $query_vars;
|
49 |
+
}
|
50 |
+
function apply_filter($args, $query_vars, $data) {
|
51 |
+
if( ! $this->is_apply ) return $args;
|
52 |
+
global $bapf_test_count;
|
53 |
+
if( ! isset($bapf_test_count) ) {
|
54 |
+
$bapf_test_count = 1;
|
55 |
+
} else {
|
56 |
+
$bapf_test_count++;
|
57 |
+
}
|
58 |
+
$post_not_in = self::out_of_stock_variable(array(), $data, false);
|
59 |
+
if( is_array($post_not_in) && count($post_not_in) ) {
|
60 |
+
if( ! empty($query_vars['post__not_in']) && is_array($query_vars['post__not_in']) ) {
|
61 |
+
$post_not_in = array_merge($post_not_in, $query_vars['post__not_in']);
|
62 |
+
}
|
63 |
+
$args['post__not_in'] = $post_not_in;
|
64 |
+
if( ! empty($query_vars['post__in']) && is_array($query_vars['post__in']) ) {
|
65 |
+
$posts_in = array_diff($query_vars['post__in'], $post_not_in);
|
66 |
+
$args['post__in'] = $posts_in;
|
67 |
+
}
|
68 |
+
}
|
69 |
+
return $args;
|
70 |
+
}
|
71 |
+
function apply_recount($query, $terms, $taxonomy_data) {
|
72 |
+
if( $terms !== FALSE && $taxonomy_data !== FALSE ) {
|
73 |
+
global $berocket_parse_page_obj, $wpdb;
|
74 |
+
$terms = $berocket_parse_page_obj->func_get_terms_slug_id($taxonomy_data['taxonomy']);
|
75 |
+
$modify_values = array();
|
76 |
+
foreach($terms as $term) {
|
77 |
+
$modify_values[] = array(
|
78 |
+
'taxonomy' => $taxonomy_data['taxonomy'],
|
79 |
+
'value' => $term
|
80 |
+
);
|
81 |
+
}
|
82 |
+
$data = $berocket_parse_page_obj->modify_data(array('values' => $modify_values, 'type' => 'add', 'op' => 'OR', 'calculate' => TRUE));
|
83 |
+
list($current_terms, $current_attributes) = self::current_selected_data($data);
|
84 |
+
$variation_query = self::out_of_stock_sql_array($data, false);
|
85 |
+
$partial_data = $data;
|
86 |
+
foreach($partial_data['filters'] as $filter) {
|
87 |
+
if( $taxonomy_data['taxonomy'] != $filter['taxonomy'] ) {
|
88 |
+
$partial_data = $berocket_parse_page_obj->remove_taxonomy(array('taxonomy' => $filter['taxonomy']), $partial_data);
|
89 |
+
}
|
90 |
+
}
|
91 |
+
list($current_terms_part, $current_attributes_part) = self::current_selected_data($partial_data);
|
92 |
+
$variation_query = $variation_query['subquery'];
|
93 |
+
$variation_query['group'] = 'GROUP BY var_id';
|
94 |
+
$variation_query = self::implode_recursive($variation_query);
|
95 |
+
$variation_query = self::replace_query_elements($variation_query, $current_attributes, $current_terms);
|
96 |
+
$query_filtered_posts = apply_filters( 'berocket_aapf_wcvariation_filtering_single_attribute', array(
|
97 |
+
'select' => 'SELECT %1$s.post_parent as ID, '.$wpdb->term_taxonomy.'.term_taxonomy_id as term_id, min(out_of_stock_var.out_of_stock) AS out_of_stock',
|
98 |
+
'from' => 'FROM %1$s',
|
99 |
+
'join' => 'INNER JOIN %2$s AS pf1 ON (%1$s.ID = pf1.post_id)',
|
100 |
+
'join2' => "INNER JOIN {$wpdb->terms} AS term_ids ON term_ids.slug = pf1.meta_value",
|
101 |
+
'join3_start' => "LEFT JOIN (",
|
102 |
+
'join3_select' => "{$variation_query}",
|
103 |
+
'join3_end' => ') AS out_of_stock_var ON %1$s.ID = out_of_stock_var.var_id',
|
104 |
+
'join4' => "INNER JOIN {$wpdb->term_taxonomy} on term_ids.term_id = {$wpdb->term_taxonomy}.term_id",
|
105 |
+
'where' => 'WHERE %1$s.post_type = "product_variation"',
|
106 |
+
'and1' => 'AND %1$s.post_status != "trash"',
|
107 |
+
'and2' => 'AND pf1.meta_key IN ("%4$s")',
|
108 |
+
'and3' => 'AND pf1.meta_value IN ("%5$s")',
|
109 |
+
'group' => 'GROUP BY ID, term_id',
|
110 |
+
'having' => 'HAVING out_of_stock = 1'
|
111 |
+
), $partial_data, $current_attributes_part, $current_terms_part);
|
112 |
+
$query_filtered_posts = self::implode_recursive($query_filtered_posts);
|
113 |
+
$query_filtered_posts = self::replace_query_elements($query_filtered_posts, $current_attributes_part, $current_terms_part);
|
114 |
+
$query['join'] .= " LEFT JOIN ({$query_filtered_posts}) as out_of_stock_variable on {$wpdb->posts}.ID = out_of_stock_variable.ID AND term_relationships.term_taxonomy_id = out_of_stock_variable.term_id";
|
115 |
+
$query['where'] .= ' AND out_of_stock_variable.term_id IS NULL';
|
116 |
+
}
|
117 |
+
return $query;
|
118 |
+
}
|
119 |
+
public function filter_hooks($add = true) {
|
120 |
+
$action = ($add ? 'add_filter' : 'remove_filter');
|
121 |
+
}
|
122 |
+
public function bapf_uparse($data, $instance) {
|
123 |
+
|
124 |
+
return $data;
|
125 |
+
}
|
126 |
+
public static function current_selected_data($data, $query = false) {
|
127 |
+
if( $query === false ) {
|
128 |
+
$get_queried_object = get_queried_object();
|
129 |
+
} else {
|
130 |
+
$get_queried_object = $query->get_queried_object();
|
131 |
+
}
|
132 |
+
$current_terms = array();
|
133 |
+
$current_attributes = array();
|
134 |
+
if( is_a($get_queried_object, 'WP_Term') && strpos($get_queried_object->taxonomy, 'pa_') !== FALSE ) {
|
135 |
+
$current_attributes[] = sanitize_title('attribute_' . $get_queried_object->taxonomy);
|
136 |
+
$current_terms[] = sanitize_title($get_queried_object->slug);
|
137 |
+
}
|
138 |
+
foreach($data['filters'] as $filter) {
|
139 |
+
if( substr( $filter['taxonomy'], 0, 3 ) == 'pa_' && ! empty($filter['terms']) ) {
|
140 |
+
$current_attributes[] = sanitize_title('attribute_' . $filter['taxonomy']);
|
141 |
+
foreach($filter['terms'] as $term) {
|
142 |
+
$current_terms[] = sanitize_title($term->slug);
|
143 |
+
}
|
144 |
+
}
|
145 |
+
}
|
146 |
+
$current_terms = array_unique($current_terms);
|
147 |
+
$current_attributes = array_unique($current_attributes);
|
148 |
+
sort($current_terms);
|
149 |
+
sort($current_attributes);
|
150 |
+
$current_terms = implode('","', $current_terms);
|
151 |
+
$current_attributes = implode('","', $current_attributes);
|
152 |
+
return array($current_terms, $current_attributes);
|
153 |
+
}
|
154 |
+
public static function out_of_stock_sql_array($data, $query = false, $current_attributes = false, $current_terms = false) {
|
155 |
+
if( $current_attributes === false && $current_terms === false ) {
|
156 |
+
list($current_terms, $current_attributes) = self::current_selected_data($data, $query);
|
157 |
+
}
|
158 |
+
$outofstock = wc_get_product_visibility_term_ids();
|
159 |
+
if( empty($outofstock['outofstock']) ) {
|
160 |
+
$outofstock = get_term_by( 'slug', 'outofstock', 'product_visibility' );
|
161 |
+
$outofstock = $outofstock->term_taxonomy_id;
|
162 |
+
} else {
|
163 |
+
$outofstock = $outofstock['outofstock'];
|
164 |
+
}
|
165 |
+
$query_filtered_posts = apply_filters( 'berocket_aapf_wcvariation_filtering_main_query', array(
|
166 |
+
'select' => 'SELECT %1$s.id as var_id, %1$s.post_parent as ID, COUNT(%1$s.id) as meta_count',
|
167 |
+
'from' => 'FROM %1$s',
|
168 |
+
'join' => 'INNER JOIN %2$s AS pf1 ON (%1$s.ID = pf1.post_id)',
|
169 |
+
'where' => 'WHERE %1$s.post_type = "product_variation"',
|
170 |
+
'and1' => 'AND %1$s.post_status != "trash"',
|
171 |
+
'and2' => 'AND pf1.meta_key IN ("%4$s")',
|
172 |
+
'and3' => 'AND pf1.meta_value IN ("%5$s")',
|
173 |
+
'group' => 'GROUP BY %1$s.id'
|
174 |
+
), $data, $current_attributes, $current_terms);
|
175 |
+
$query = array(
|
176 |
+
'select' => 'SELECT filtered_post.id, MIN(filtered_post.out_of_stock) as out_of_stock, COUNT(filtered_post.ID) as post_count',
|
177 |
+
'from_open' => 'FROM (',
|
178 |
+
'subquery' => array(
|
179 |
+
'select' => 'SELECT filtered_post.*, max_filtered_post.max_meta_count, stock_table.out_of_stock_init as out_of_stock',
|
180 |
+
'from_open' => 'FROM (',
|
181 |
+
'subquery_1' => $query_filtered_posts,
|
182 |
+
'from_close' => ') as filtered_post',
|
183 |
+
'join_open_1' => 'INNER JOIN (',
|
184 |
+
'subquery_2' => array(
|
185 |
+
'select' => 'SELECT ID, MAX(meta_count) as max_meta_count',
|
186 |
+
'from_open' => 'FROM (',
|
187 |
+
'subquery' => $query_filtered_posts,
|
188 |
+
'from_close' => ') as max_filtered_post',
|
189 |
+
'group' => 'GROUP BY ID'
|
190 |
+
),
|
191 |
+
'join_close_1' => ') as max_filtered_post ON max_filtered_post.ID = filtered_post.ID AND max_filtered_post.max_meta_count = filtered_post.meta_count',
|
192 |
+
'join_open_2' => 'LEFT JOIN (',
|
193 |
+
'subquery_3' => array(
|
194 |
+
'select' => 'SELECT %1$s .id as id, IF(%1$s.post_status = "private", 1, COALESCE(stock_table_init.out_of_stock_init1, "0")) as out_of_stock_init',
|
195 |
+
'from' => 'FROM %1$s',
|
196 |
+
'join_open' => 'LEFT JOIN (',
|
197 |
+
'subquery' => array(
|
198 |
+
'select' => 'SELECT %1$s.id as id, "1" as out_of_stock_init1',
|
199 |
+
'from' => 'FROM %1$s',
|
200 |
+
'where' => apply_filters('brAAPFcompat_WCvariation_out_of_stock_where', 'WHERE %1$s.id IN
|
201 |
+
(
|
202 |
+
SELECT object_id FROM %3$s
|
203 |
+
WHERE term_taxonomy_id IN ( '.$outofstock.' )
|
204 |
+
) '
|
205 |
+
)
|
206 |
+
),
|
207 |
+
'join_close' => ') as stock_table_init on %1$s.id = stock_table_init.id',
|
208 |
+
'group' => 'GROUP BY id',
|
209 |
+
),
|
210 |
+
'join_close_2' => ') as stock_table ON filtered_post.var_id = stock_table.id',
|
211 |
+
'group' => 'GROUP BY filtered_post.ID, out_of_stock',
|
212 |
+
),
|
213 |
+
'from_close' => ') as filtered_post',
|
214 |
+
'group' => 'GROUP BY filtered_post.ID',
|
215 |
+
'having' => 'HAVING out_of_stock = 1',
|
216 |
+
);
|
217 |
+
$query = apply_filters('berocket_aapf_wcvariation_filtering_total_query', $query, $data, $current_attributes, $current_terms);
|
218 |
+
return $query;
|
219 |
+
}
|
220 |
+
public static function out_of_stock_variable($input, $data, $query = false) {
|
221 |
+
global $wpdb;
|
222 |
+
list($current_terms, $current_attributes) = self::current_selected_data($data, $query);
|
223 |
+
if( empty($current_terms) && empty($current_attributes) ) return array();
|
224 |
+
$out_of_stock_variable = br_get_cache(apply_filters('berocket_variation_cache_key', md5($current_terms.$current_attributes)), 'berocket_variation');
|
225 |
+
if( $out_of_stock_variable === false ) {
|
226 |
+
$query = self::out_of_stock_sql_array($data, $query, $current_attributes, $current_terms);
|
227 |
+
$query = self::implode_recursive($query);
|
228 |
+
$query = str_replace(
|
229 |
+
array( '%1$s', '%2$s', '%3$s', '%4$s', '%5$s' ),
|
230 |
+
array( $wpdb->posts, $wpdb->postmeta, $wpdb->term_relationships, $current_attributes, $current_terms ),
|
231 |
+
$query
|
232 |
+
);
|
233 |
+
$out_of_stock_variable = $wpdb->get_results( $query, ARRAY_N );
|
234 |
+
br_set_cache(apply_filters('berocket_variation_cache_key', md5($current_terms.$current_attributes)), $out_of_stock_variable, 'berocket_variation', HOUR_IN_SECONDS);
|
235 |
+
}
|
236 |
+
if( BeRocket_AAPF::$debug_mode ) {
|
237 |
+
if( ! isset(BeRocket_AAPF::$error_log['_addons_variations_query']) || ! is_array(BeRocket_AAPF::$error_log['_addons_variations_query']) ) {
|
238 |
+
BeRocket_AAPF::$error_log['_addons_variations_query'] = array();
|
239 |
+
}
|
240 |
+
BeRocket_AAPF::$error_log['_addons_variations_query'][] = array(
|
241 |
+
'query' => $query,
|
242 |
+
'result' => $out_of_stock_variable,
|
243 |
+
'terms' => $data
|
244 |
+
);
|
245 |
+
}
|
246 |
+
$post_not_in = array();
|
247 |
+
if( is_array($out_of_stock_variable) && count($out_of_stock_variable) ) {
|
248 |
+
foreach($out_of_stock_variable as $out_of_stock) {
|
249 |
+
$post_not_in[] = $out_of_stock[0];
|
250 |
+
}
|
251 |
+
}
|
252 |
+
return $post_not_in;
|
253 |
+
}
|
254 |
+
public static function implode_recursive($array, $glue = ' ') {
|
255 |
+
foreach($array as &$element) {
|
256 |
+
if( is_array($element) ) {
|
257 |
+
$element = self::implode_recursive($element, $glue);
|
258 |
+
}
|
259 |
+
}
|
260 |
+
return implode($glue, $array);
|
261 |
+
}
|
262 |
+
public function faster_recount_add_data($query, $taxonomy_data, $terms) {
|
263 |
+
global $wpdb;
|
264 |
+
extract($taxonomy_data);
|
265 |
+
if( ! $use_filters ) return $query;
|
266 |
+
$br_options = BeRocket_AAPF::get_aapf_option();
|
267 |
+
if( ! empty($br_options['out_of_stock_variable_reload']) ) {
|
268 |
+
global $berocket_parse_page_obj;
|
269 |
+
$current_filter_data = $berocket_parse_page_obj->get_current();
|
270 |
+
$filter_data = $berocket_parse_page_obj->remove_taxonomy(array('taxonomy' => $taxonomy));
|
271 |
+
$limit_post__not_in = array();
|
272 |
+
foreach($terms as $term_data) {
|
273 |
+
$new_filter_data = $berocket_parse_page_obj->modify_data(array(
|
274 |
+
'values' => array(array('value' => intval($term_data->term_id), 'taxonomy' => $taxonomy)), 'type' => 'add', 'op' => 'AND'
|
275 |
+
), $filter_data);
|
276 |
+
$berocket_parse_page_obj->set_default_data($new_filter_data);
|
277 |
+
$limit_post__not_in[$term_data->term_taxonomy_id] = apply_filters('berocket_add_out_of_stock_variable', array(), $new_filter_data);
|
278 |
+
}
|
279 |
+
$berocket_parse_page_obj->set_default_data($current_filter_data);
|
280 |
+
|
281 |
+
$limit_post__not_in_where_array = array();
|
282 |
+
if( is_array($limit_post__not_in) && count($limit_post__not_in) ) {
|
283 |
+
$limit_post__term_id_without_product = array();
|
284 |
+
foreach($limit_post__not_in as $wp_terms_id => $limit_post) {
|
285 |
+
if( is_array($limit_post) && count($limit_post) ) {
|
286 |
+
$limit_post__not_in_where_array[$wp_terms_id] = "({$wpdb->posts}.ID NOT IN (\"" . implode('","', $limit_post) . "\") AND term_relationships.term_taxonomy_id = {$wp_terms_id})";
|
287 |
+
} else {
|
288 |
+
$limit_post__term_id_without_product[] = $wp_terms_id;
|
289 |
+
}
|
290 |
+
}
|
291 |
+
if( count($limit_post__term_id_without_product) ) {
|
292 |
+
$limit_post__not_in_where_array[] = "(term_relationships.term_taxonomy_id IN (".implode(', ', $limit_post__term_id_without_product)."))";
|
293 |
+
}
|
294 |
+
$limit_post__not_in_where = implode(' OR ', $limit_post__not_in_where_array);
|
295 |
+
}
|
296 |
+
$this->limit_post__not_in_where_array = $limit_post__not_in_where_array;
|
297 |
+
}
|
298 |
+
return $query;
|
299 |
+
}
|
300 |
+
public static function replace_query_elements($query, $current_attributes, $current_terms) {
|
301 |
+
global $wpdb;
|
302 |
+
$query = str_replace(
|
303 |
+
array( '%1$s', '%2$s', '%3$s', '%4$s', '%5$s' ),
|
304 |
+
array( $wpdb->posts, $wpdb->postmeta, $wpdb->term_relationships, $current_attributes, $current_terms ),
|
305 |
+
$query
|
306 |
+
);
|
307 |
+
return $query;
|
308 |
+
}
|
309 |
+
}
|
310 |
+
new BeRocket_AAPF_compat_woocommerce_variation_new();
|
includes/addons/seo_meta_title.php
CHANGED
@@ -143,73 +143,93 @@ if( ! class_exists('BeRocket_AAPF_addon_woocommerce_seo_title') ) {
|
|
143 |
}
|
144 |
function get_header() {
|
145 |
global $wp_query;
|
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 |
-
if( isset($_POST['price']) && is_array($_POST['price']) && count($_POST['price']) > 1 ) {
|
175 |
-
$min_price = $this->wc_price($_POST['price'][0]);
|
176 |
-
$max_price = $this->wc_price($_POST['price'][1]);
|
177 |
-
$terms_name['wc_price'] = array(
|
178 |
-
'name' => apply_filters('berocket_aapf_seo_meta_filtered_taxonomy_price_label', __('Price', 'woocommerce')),
|
179 |
-
'values' => array(
|
180 |
-
'price' => apply_filters('berocket_aapf_seo_meta_filtered_price_label', wc_format_price_range($min_price, $max_price), $_POST['price'], array($min_price, $max_price))
|
181 |
-
),
|
182 |
-
'is_price' => TRUE
|
183 |
-
);
|
184 |
-
}
|
185 |
-
if( isset($_POST['limits']) && is_array($_POST['limits']) ) {
|
186 |
-
foreach($_POST['limits'] as $term_parsed) {
|
187 |
-
if( apply_filters('berocket_aapf_seo_meta_filtered_term_continue', false, $term_parsed) ) continue;
|
188 |
-
$taxonomy = get_taxonomy($term_parsed[0]);
|
189 |
-
if( ! empty($taxonomy->labels->singular_name) ) {
|
190 |
-
$taxonomy_label = $taxonomy->labels->singular_name;
|
191 |
-
} else {
|
192 |
-
$taxonomy_label = $taxonomy->label;
|
193 |
}
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
'
|
200 |
-
'
|
201 |
);
|
202 |
}
|
203 |
-
if( ! $
|
204 |
-
$
|
205 |
-
|
206 |
-
|
207 |
}
|
208 |
-
$terms_name[$taxonomy->name]['has_slider'] = TRUE;
|
209 |
}
|
210 |
}
|
211 |
-
$this->terms_filtered = apply_filters('berocket_aapf_seo_meta_filtered_terms', $terms_name);
|
212 |
}
|
|
|
213 |
}
|
214 |
public static function wc_price($price) {
|
215 |
$decimal_separator = wc_get_price_decimal_separator();
|
@@ -233,7 +253,7 @@ if( ! class_exists('BeRocket_AAPF_addon_woocommerce_seo_title') ) {
|
|
233 |
return apply_filters('berocket_aapf_seo_meta_filters_text_return', $filters, $text, $section, $this->terms_filtered);
|
234 |
}
|
235 |
function the_title($title, $id = 0) {
|
236 |
-
if( get_queried_object_id() === $id ) {
|
237 |
$title = $this->get_filters_string($title, 'header');
|
238 |
remove_filter('the_title', array($this, 'the_title'), 10, 2);
|
239 |
remove_filter('woocommerce_page_title', array($this, 'woocommerce_page_title'), 10, 2);
|
@@ -241,6 +261,19 @@ if( ! class_exists('BeRocket_AAPF_addon_woocommerce_seo_title') ) {
|
|
241 |
}
|
242 |
return $title;
|
243 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
244 |
function woocommerce_page_title($title) {
|
245 |
$title = $this->get_filters_string($title, 'header');
|
246 |
remove_filter('the_title', array($this, 'the_title'), 10, 2);
|
143 |
}
|
144 |
function get_header() {
|
145 |
global $wp_query;
|
146 |
+
global $berocket_parse_page_obj;
|
147 |
+
$data = $berocket_parse_page_obj->get_current();
|
148 |
+
$terms_name = array();
|
149 |
+
if( isset($data['filters']) && is_array($data['filters']) ) {
|
150 |
+
foreach($data['filters'] as $filter) {
|
151 |
+
if( in_array($filter['type'], array('taxonomy', 'attribute')) ) {
|
152 |
+
if( ! isset($terms_name[$filter['taxonomy']]) ) {
|
153 |
+
$taxonomy = get_taxonomy($filter['taxonomy']);
|
154 |
+
if( ! empty($taxonomy->labels->singular_name) ) {
|
155 |
+
$taxonomy_label = $taxonomy->labels->singular_name;
|
156 |
+
} else {
|
157 |
+
$taxonomy_label = $taxonomy->label;
|
158 |
+
}
|
159 |
+
$terms_name[$filter['taxonomy']] = array(
|
160 |
+
'name' => apply_filters('berocket_aapf_seo_meta_filtered_taxonomy_label', $taxonomy_label, $taxonomy, $filter),
|
161 |
+
'values' => array(),
|
162 |
+
'operator' => ( empty($filter['val_arr']['op']) ? 'OR' : $filter['val_arr']['op'] )
|
163 |
+
);
|
164 |
}
|
165 |
+
if( ! empty($filter['val_arr']['op']) && $filter['val_arr']['op'] == 'SLIDER' && isset($filter['val_arr']['from']) && isset($filter['val_arr']['to']) ) {
|
166 |
+
$from = $filter['val_arr']['from'];
|
167 |
+
$to = $filter['val_arr']['to'];
|
168 |
+
$from = ( isset($filter['val_ids'][$from]) && isset($filter['terms'][$filter['val_ids'][$from]])
|
169 |
+
? apply_filters('berocket_aapf_seo_meta_filtered_term_label', $filter['terms'][$filter['val_ids'][$from]]->name, $filter['terms'][$filter['val_ids'][$from]], $filter)
|
170 |
+
: $from
|
171 |
+
);
|
172 |
+
$to = ( isset($filter['val_ids'][$to]) && isset($filter['terms'][$filter['val_ids'][$to]])
|
173 |
+
? apply_filters('berocket_aapf_seo_meta_filtered_term_label', $filter['terms'][$filter['val_ids'][$to]]->name, $filter['terms'][$filter['val_ids'][$to]], $filter)
|
174 |
+
: $to
|
175 |
+
);
|
176 |
+
$terms_name[$filter['taxonomy']]['values'][] = $from.' - '.$to;
|
177 |
+
} else {
|
178 |
+
if( ! empty($filter['terms']) && is_array($filter['terms']) ) {
|
179 |
+
foreach($filter['terms'] as $term) {
|
180 |
+
$terms_name[$filter['taxonomy']]['values'][$term->slug] = apply_filters('berocket_aapf_seo_meta_filtered_term_label', $term->name, $term, $filter);
|
181 |
+
}
|
182 |
+
}
|
183 |
}
|
184 |
+
} elseif($filter['type'] == 'price') {
|
185 |
+
$new_terms_name = array(
|
186 |
+
'name' => apply_filters('berocket_aapf_seo_meta_filtered_taxonomy_price_label', __('Price', 'woocommerce')),
|
187 |
+
'is_price' => TRUE
|
188 |
+
);
|
189 |
+
if( isset($filter['val_arr']['from']) && isset($filter['val_arr']['to']) ) {
|
190 |
+
$from = $this->wc_price($filter['val_arr']['from']);
|
191 |
+
$to = $this->wc_price($filter['val_arr']['to']);
|
192 |
+
$new_terms_name['values'] = array(
|
193 |
+
'price' => apply_filters('berocket_aapf_seo_meta_filtered_price_label', wc_format_price_range($from, $to), $filter, array($filter['val_arr']['from'], $filter['val_arr']['to']))
|
194 |
);
|
195 |
+
} elseif( ! empty($filter['val_arr']) && is_array($filter['val_arr']) ) {
|
196 |
+
$new_terms_name['values'] = ( empty($filter['val_arr']['op']) ? 'OR' : $filter['val_arr']['op'] );
|
197 |
+
if( isset($filter['val_arr']['op']) ) {
|
198 |
+
unset($filter['val_arr']['op']);
|
199 |
+
}
|
200 |
+
$values = array();
|
201 |
+
foreach($filter['val_arr'] as $val_arr) {
|
202 |
+
if( isset($val_arr['from']) && isset($val_arr['to']) ) {
|
203 |
+
$from = $this->wc_price($val_arr['from']);
|
204 |
+
$to = $this->wc_price($val_arr['to']);
|
205 |
+
$values[] = apply_filters('berocket_aapf_seo_meta_filtered_price_label', wc_format_price_range($from, $to), $filter, array($val_arr['from'], $val_arr['to']));
|
206 |
+
}
|
207 |
+
}
|
208 |
+
if( ! empty($values ) ) {
|
209 |
+
$new_terms_name['values'] = $values;
|
210 |
+
}
|
211 |
}
|
212 |
+
if( ! empty($new_terms_name['values']) ) {
|
213 |
+
$terms_name['wc_price'] = $new_terms_name;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
214 |
}
|
215 |
+
} elseif(in_array($filter['type'], array('sale', 'stock_status'))) {
|
216 |
+
if( ! isset($terms_name[$filter['taxonomy']]) ) {
|
217 |
+
$terms_name[$filter['taxonomy']] = array(
|
218 |
+
'name' => '',
|
219 |
+
'values' => array(),
|
220 |
+
'operator' => ( empty($filter['val_arr']['op']) ? 'OR' : $filter['val_arr']['op'] ),
|
221 |
+
'is_price' => true
|
222 |
);
|
223 |
}
|
224 |
+
if( ! empty($filter['terms']) && is_array($filter['terms']) ) {
|
225 |
+
foreach($filter['terms'] as $term) {
|
226 |
+
$terms_name[$filter['taxonomy']]['values'][$term->slug] = apply_filters('berocket_aapf_seo_meta_filtered_term_label', $term->name, $term, $filter);
|
227 |
+
}
|
228 |
}
|
|
|
229 |
}
|
230 |
}
|
|
|
231 |
}
|
232 |
+
$this->terms_filtered = apply_filters('berocket_aapf_seo_meta_filtered_terms', $terms_name);
|
233 |
}
|
234 |
public static function wc_price($price) {
|
235 |
$decimal_separator = wc_get_price_decimal_separator();
|
253 |
return apply_filters('berocket_aapf_seo_meta_filters_text_return', $filters, $text, $section, $this->terms_filtered);
|
254 |
}
|
255 |
function the_title($title, $id = 0) {
|
256 |
+
if( get_queried_object_id() === $id && ! $this->the_title_backtrace_exclude() ) {
|
257 |
$title = $this->get_filters_string($title, 'header');
|
258 |
remove_filter('the_title', array($this, 'the_title'), 10, 2);
|
259 |
remove_filter('woocommerce_page_title', array($this, 'woocommerce_page_title'), 10, 2);
|
261 |
}
|
262 |
return $title;
|
263 |
}
|
264 |
+
function the_title_backtrace_exclude() {
|
265 |
+
$exclude_functions = array(
|
266 |
+
'wp_setup_nav_menu_item',
|
267 |
+
'wp_nav_menu'
|
268 |
+
);
|
269 |
+
$backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
|
270 |
+
foreach($backtrace as $call_func) {
|
271 |
+
if( isset($call_func['function']) && in_array($call_func['function'], $exclude_functions) ) {
|
272 |
+
return true;
|
273 |
+
}
|
274 |
+
}
|
275 |
+
return false;
|
276 |
+
}
|
277 |
function woocommerce_page_title($title) {
|
278 |
$title = $this->get_filters_string($title, 'header');
|
279 |
remove_filter('the_title', array($this, 'the_title'), 10, 2);
|
includes/addons/woocommerce-variation.php
DELETED
@@ -1,379 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
class BeRocket_AAPF_compat_woocommerce_variation {
|
3 |
-
public $limit_post__not_in_where_array = array();
|
4 |
-
public $is_init = false;
|
5 |
-
function __construct() {
|
6 |
-
$BeRocket_AAPF = BeRocket_AAPF::getInstance();
|
7 |
-
$options = $BeRocket_AAPF->get_option();
|
8 |
-
if( berocket_isset($options['out_of_stock_variable']) == 1 ) {
|
9 |
-
$this->add_filter();
|
10 |
-
} else {
|
11 |
-
add_action('br_aapf_args_converter_after', array($this, 'br_aapf_args_converter_after'));
|
12 |
-
}
|
13 |
-
}
|
14 |
-
function br_aapf_args_converter_after() {
|
15 |
-
if( ! $this->is_init ) {
|
16 |
-
$BeRocket_AAPF = BeRocket_AAPF::getInstance();
|
17 |
-
$options = $BeRocket_AAPF->get_option();
|
18 |
-
global $br_url_parser_middle_result;
|
19 |
-
$is_woocommerce_variation_enabled = apply_filters(
|
20 |
-
'berocket_compat_woocommerce_variation_enabled',
|
21 |
-
(berocket_isset($options['out_of_stock_variable']) == 2
|
22 |
-
&& ! empty($br_url_parser_middle_result['_stock_status'])
|
23 |
-
&& is_array($br_url_parser_middle_result['_stock_status'])
|
24 |
-
&& ( in_array('1', $br_url_parser_middle_result['_stock_status']) || in_array('instock', $br_url_parser_middle_result['_stock_status']) )
|
25 |
-
),
|
26 |
-
$options
|
27 |
-
);
|
28 |
-
if( $is_woocommerce_variation_enabled ) {
|
29 |
-
$this->add_filter();
|
30 |
-
} else {
|
31 |
-
add_action('berocket_term_recount_before_action', array($this, 'start_stock_status'), 10, 2);
|
32 |
-
add_action('berocket_term_recount_after_action', array($this, 'stop_stock_status'), 10, 3);
|
33 |
-
}
|
34 |
-
}
|
35 |
-
}
|
36 |
-
public function add_filter() {
|
37 |
-
if( ! $this->is_init ) {
|
38 |
-
$this->is_init = true;
|
39 |
-
$this->filter_hooks();
|
40 |
-
}
|
41 |
-
}
|
42 |
-
public function filter_hooks($add = true) {
|
43 |
-
$action = ($add ? 'add_filter' : 'remove_filter');
|
44 |
-
$action('berocket_filters_query_already_filtered', array(__CLASS__, 'query_already_filtered'), 10, 3);
|
45 |
-
$action('berocket_add_out_of_stock_variable', array(__CLASS__, 'out_of_stock_variable'), 10, 3);
|
46 |
-
$action('brAAPFcompat_WCvariation_out_of_stock_where', array(__CLASS__, 'out_of_stock_where'), 10, 1);
|
47 |
-
$action('berocket_aapf_recount_terms_query', array($this, 'faster_recount_add_data'), 60, 3);
|
48 |
-
$action('berocket_query_result_recount', array($this, 'faster_recount_query_result'), 60, 3);
|
49 |
-
$action('berocket_recount_cache_key', array($this, 'faster_recount_cache_key'), 60);
|
50 |
-
$action('berocket_aapf_get_advanced_price_temp_table', array($this, 'advanced_price_temp_table'), 60, 4);
|
51 |
-
}
|
52 |
-
public function advanced_price_temp_table($query_price, $where, $taxonomy_data, $terms_additional) {
|
53 |
-
global $wpdb;
|
54 |
-
$terms = br_get_value_from_array($_POST,'terms');
|
55 |
-
if( !empty($taxonomy_data) && ! empty($terms_additional) ) {
|
56 |
-
if( ! is_array($terms) ) {
|
57 |
-
$terms = array();
|
58 |
-
}
|
59 |
-
foreach($terms as $i => $term) {
|
60 |
-
if( $term[0] == $taxonomy_data['taxonomy'] ) {
|
61 |
-
unset($terms[$i]);
|
62 |
-
}
|
63 |
-
}
|
64 |
-
foreach($terms_additional as $add_terms) {
|
65 |
-
$terms[] = array(
|
66 |
-
$taxonomy_data['taxonomy'],
|
67 |
-
$add_terms->term_id,
|
68 |
-
$taxonomy_data['operator'],
|
69 |
-
$add_terms->slug,
|
70 |
-
'custom_taxonomy'
|
71 |
-
);
|
72 |
-
}
|
73 |
-
}
|
74 |
-
$limits_arr = br_get_value_from_array($_POST,'limits_arr');
|
75 |
-
list($terms, $current_terms, $current_attributes) = self::current_selected_data($terms, $limits_arr);
|
76 |
-
$query = self::out_of_stock_sql_array(array(), $terms, $limits_arr, false, $current_terms, $current_attributes);
|
77 |
-
$query = $query['subquery'];
|
78 |
-
unset($query['group']);
|
79 |
-
$query = self::implode_recursive($query);
|
80 |
-
$query = 'SELECT %1$s.ID as var_id, %1$s.post_parent as ID, IFNULL(variation_post.out_of_stock, 0) as out_of_stock from %1$s LEFT JOIN ('. $query . ') as variation_post ON (%1$s.ID = variation_post.var_id OR %1$s.post_parent = variation_post.ID)
|
81 |
-
WHERE %1$s.post_parent != 0 AND (variation_post.ID IS NULL OR %1$s.ID = variation_post.var_id)';
|
82 |
-
$query = str_replace(
|
83 |
-
array( '%1$s', '%2$s', '%3$s', '%4$s', '%5$s' ),
|
84 |
-
array( $wpdb->posts, $wpdb->postmeta, $wpdb->term_relationships, $current_attributes, $current_terms ),
|
85 |
-
$query
|
86 |
-
);
|
87 |
-
$query_price['join'] .= ' LEFT JOIN ('.$query.') as variation_check ON bapf_price_post.ID = variation_check.var_id';
|
88 |
-
$query_price['where'] .= ' AND ( bapf_price_post.post_parent = 0 OR variation_check.out_of_stock != 1)';
|
89 |
-
|
90 |
-
return $query_price;
|
91 |
-
}
|
92 |
-
public function start_stock_status($terms, $taxonomy_data) {
|
93 |
-
if( ! $this->is_init && $taxonomy_data['taxonomy'] == '_stock_status' ) {
|
94 |
-
$this->filter_hooks();
|
95 |
-
}
|
96 |
-
}
|
97 |
-
public function stop_stock_status($terms, $taxonomy_data) {
|
98 |
-
if( ! $this->is_init && $taxonomy_data['taxonomy'] == '_stock_status' ) {
|
99 |
-
$this->filter_hooks(false);
|
100 |
-
}
|
101 |
-
}
|
102 |
-
public static function query_already_filtered($query, $terms, $limits) {
|
103 |
-
$post_not_in = self::out_of_stock_variable(array(), $terms, $limits, $query);
|
104 |
-
if( is_array($post_not_in) && count($post_not_in) ) {
|
105 |
-
$post__not_in = $query->get('post__not_in');
|
106 |
-
$post__not_in = array_merge($post__not_in, $post_not_in);
|
107 |
-
$post__in = $query->get('post__in');
|
108 |
-
$post__in = array_diff($post__in, $post__not_in);
|
109 |
-
$query->set('post__not_in', $post__not_in);
|
110 |
-
$query->set('post__in', $post__in);
|
111 |
-
}
|
112 |
-
return $query;
|
113 |
-
}
|
114 |
-
public static function current_selected_data($terms, $limits, $query = false) {
|
115 |
-
if( $query === false ) {
|
116 |
-
$get_queried_object = get_queried_object();
|
117 |
-
} else {
|
118 |
-
$get_queried_object = $query->get_queried_object();
|
119 |
-
}
|
120 |
-
if( is_a($get_queried_object, 'WP_Term') && strpos($get_queried_object->taxonomy, 'pa_') !== FALSE ) {
|
121 |
-
if( ! is_array($terms) ) {
|
122 |
-
$terms = array();
|
123 |
-
}
|
124 |
-
$terms[] = array(
|
125 |
-
$get_queried_object->taxonomy,
|
126 |
-
$get_queried_object->term_id,
|
127 |
-
'OR',
|
128 |
-
$get_queried_object->slug,
|
129 |
-
'attribute'
|
130 |
-
);
|
131 |
-
}
|
132 |
-
$current_terms = array();
|
133 |
-
$current_attributes = array();
|
134 |
-
if( is_array($terms) && count($terms) ) {
|
135 |
-
foreach($terms as $term) {
|
136 |
-
if( substr( $term[0], 0, 3 ) == 'pa_' ) {
|
137 |
-
$current_attributes[] = sanitize_title('attribute_' . $term[0]);
|
138 |
-
$current_terms[] = sanitize_title($term[3]);
|
139 |
-
}
|
140 |
-
}
|
141 |
-
}
|
142 |
-
if( is_array($limits) && count($limits) ) {
|
143 |
-
foreach($limits as $attr => $term_ids) {
|
144 |
-
if( substr( $attr, 0, 3 ) == 'pa_' ) {
|
145 |
-
$current_attributes[] = sanitize_title('attribute_' . $attr);
|
146 |
-
foreach($term_ids as $term_id) {
|
147 |
-
$term = get_term($term_id);
|
148 |
-
if( ! empty($term) && ! is_wp_error($term) ) {
|
149 |
-
$current_terms[] = $term->slug;
|
150 |
-
}
|
151 |
-
}
|
152 |
-
}
|
153 |
-
}
|
154 |
-
}
|
155 |
-
$current_terms = array_unique($current_terms);
|
156 |
-
$current_attributes = array_unique($current_attributes);
|
157 |
-
$current_terms = implode('","', $current_terms);
|
158 |
-
$current_attributes = implode('","', $current_attributes);
|
159 |
-
return array($terms, $current_terms, $current_attributes);
|
160 |
-
}
|
161 |
-
public static function out_of_stock_sql_array($input, $terms, $limits, $query = false, $current_attributes = false, $current_terms = false) {
|
162 |
-
if( $current_attributes === false && $current_terms === false ) {
|
163 |
-
list($terms, $current_terms, $current_attributes) = self::current_selected_data($terms, $limits, $query);
|
164 |
-
}
|
165 |
-
$outofstock = wc_get_product_visibility_term_ids();
|
166 |
-
if( empty($outofstock['outofstock']) ) {
|
167 |
-
$outofstock = get_term_by( 'slug', 'outofstock', 'product_visibility' );
|
168 |
-
$outofstock = $outofstock->term_taxonomy_id;
|
169 |
-
} else {
|
170 |
-
$outofstock = $outofstock['outofstock'];
|
171 |
-
}
|
172 |
-
$query_filtered_posts = apply_filters( 'berocket_aapf_wcvariation_filtering_main_query', array(
|
173 |
-
'select' => 'SELECT %1$s.id as var_id, %1$s.post_parent as ID, COUNT(%1$s.id) as meta_count',
|
174 |
-
'from' => 'FROM %1$s',
|
175 |
-
'join' => 'INNER JOIN %2$s AS pf1 ON (%1$s.ID = pf1.post_id)',
|
176 |
-
'where' => 'WHERE %1$s.post_type = "product_variation"',
|
177 |
-
'and1' => 'AND %1$s.post_status != "trash"',
|
178 |
-
'and2' => 'AND pf1.meta_key IN ("%4$s")',
|
179 |
-
'and3' => 'AND pf1.meta_value IN ("%5$s")',
|
180 |
-
'group' => 'GROUP BY %1$s.id'
|
181 |
-
), $input, $terms, $limits, $current_attributes, $current_terms);
|
182 |
-
$query = array(
|
183 |
-
'select' => 'SELECT filtered_post.id, filtered_post.out_of_stock, COUNT(filtered_post.ID) as post_count',
|
184 |
-
'from_open' => 'FROM (',
|
185 |
-
'subquery' => array(
|
186 |
-
'select' => 'SELECT filtered_post.*, max_filtered_post.max_meta_count, stock_table.out_of_stock_init as out_of_stock',
|
187 |
-
'from_open' => 'FROM (',
|
188 |
-
'subquery_1' => $query_filtered_posts,
|
189 |
-
'from_close' => ') as filtered_post',
|
190 |
-
'join_open_1' => 'INNER JOIN (',
|
191 |
-
'subquery_2' => array(
|
192 |
-
'select' => 'SELECT ID, MAX(meta_count) as max_meta_count',
|
193 |
-
'from_open' => 'FROM (',
|
194 |
-
'subquery' => $query_filtered_posts,
|
195 |
-
'from_close' => ') as max_filtered_post',
|
196 |
-
'group' => 'GROUP BY ID'
|
197 |
-
),
|
198 |
-
'join_close_1' => ') as max_filtered_post ON max_filtered_post.ID = filtered_post.ID AND max_filtered_post.max_meta_count = filtered_post.meta_count',
|
199 |
-
'join_open_2' => 'LEFT JOIN (',
|
200 |
-
'subquery_3' => array(
|
201 |
-
'select' => 'SELECT %1$s .id as id, IF(%1$s.post_status = "private", 1, COALESCE(stock_table_init.out_of_stock_init1, "0")) as out_of_stock_init',
|
202 |
-
'from' => 'FROM %1$s',
|
203 |
-
'join_open' => 'LEFT JOIN (',
|
204 |
-
'subquery' => array(
|
205 |
-
'select' => 'SELECT %1$s.id as id, "1" as out_of_stock_init1',
|
206 |
-
'from' => 'FROM %1$s',
|
207 |
-
'where' => apply_filters('brAAPFcompat_WCvariation_out_of_stock_where', 'WHERE %1$s.id IN
|
208 |
-
(
|
209 |
-
SELECT object_id FROM %3$s
|
210 |
-
WHERE term_taxonomy_id IN ( '.$outofstock.' )
|
211 |
-
) '
|
212 |
-
)
|
213 |
-
),
|
214 |
-
'join_close' => ') as stock_table_init on %1$s.id = stock_table_init.id',
|
215 |
-
'group' => 'GROUP BY id',
|
216 |
-
),
|
217 |
-
'join_close_2' => ') as stock_table ON filtered_post.var_id = stock_table.id',
|
218 |
-
'group' => 'GROUP BY filtered_post.ID, out_of_stock',
|
219 |
-
),
|
220 |
-
'from_close' => ') as filtered_post',
|
221 |
-
'group' => 'GROUP BY filtered_post.ID',
|
222 |
-
'having' => 'HAVING post_count = 1 AND out_of_stock = 1',
|
223 |
-
);
|
224 |
-
$query = apply_filters('berocket_aapf_wcvariation_filtering_total_query', $query, $input, $terms, $limits, $current_attributes, $current_terms);
|
225 |
-
return $query;
|
226 |
-
}
|
227 |
-
public static function out_of_stock_variable($input, $terms, $limits, $query = false) {
|
228 |
-
global $wpdb;
|
229 |
-
list($terms, $current_terms, $current_attributes) = self::current_selected_data($terms, $limits, $query);
|
230 |
-
$query = self::out_of_stock_sql_array($input, $terms, $limits, $query, $current_attributes, $current_terms);
|
231 |
-
$query = self::implode_recursive($query);
|
232 |
-
$query = str_replace(
|
233 |
-
array( '%1$s', '%2$s', '%3$s', '%4$s', '%5$s' ),
|
234 |
-
array( $wpdb->posts, $wpdb->postmeta, $wpdb->term_relationships, $current_attributes, $current_terms ),
|
235 |
-
$query
|
236 |
-
);
|
237 |
-
$out_of_stock_variable = br_get_cache(apply_filters('berocket_variation_cache_key', md5($query)), 'berocket_variation');
|
238 |
-
if( empty($out_of_stock_variable) ) {
|
239 |
-
$out_of_stock_variable = $wpdb->get_results( $query, ARRAY_N );
|
240 |
-
br_set_cache(apply_filters('berocket_variation_cache_key', md5($query)), $out_of_stock_variable, 'berocket_variation', MINUTE_IN_SECONDS);
|
241 |
-
}
|
242 |
-
if( BeRocket_AAPF::$debug_mode ) {
|
243 |
-
if( ! isset(BeRocket_AAPF::$error_log['_addons_variations_query']) || ! is_array(BeRocket_AAPF::$error_log['_addons_variations_query']) ) {
|
244 |
-
BeRocket_AAPF::$error_log['_addons_variations_query'] = array();
|
245 |
-
}
|
246 |
-
BeRocket_AAPF::$error_log['_addons_variations_query'][] = array(
|
247 |
-
'query' => $query,
|
248 |
-
'result' => $out_of_stock_variable,
|
249 |
-
'terms' => $terms
|
250 |
-
);
|
251 |
-
}
|
252 |
-
$post_not_in = array();
|
253 |
-
if( is_array($out_of_stock_variable) && count($out_of_stock_variable) ) {
|
254 |
-
foreach($out_of_stock_variable as $out_of_stock) {
|
255 |
-
$post_not_in[] = $out_of_stock[0];
|
256 |
-
}
|
257 |
-
}
|
258 |
-
return $post_not_in;
|
259 |
-
}
|
260 |
-
public static function implode_recursive($array, $glue = ' ') {
|
261 |
-
foreach($array as &$element) {
|
262 |
-
if( is_array($element) ) {
|
263 |
-
$element = self::implode_recursive($element, $glue);
|
264 |
-
}
|
265 |
-
}
|
266 |
-
return implode($glue, $array);
|
267 |
-
}
|
268 |
-
public static function out_of_stock_where($custom_where) {
|
269 |
-
if ( ! empty($_POST['price_ranges']) || ! empty($_POST['price']) ) {
|
270 |
-
global $wpdb;
|
271 |
-
$custom_where .= ' OR %1$s.id IN (
|
272 |
-
SELECT %2$s.post_id FROM %2$s
|
273 |
-
WHERE ';
|
274 |
-
if ( ! empty($_POST['price']) ) {
|
275 |
-
$min = isset( $_POST['price'][0] ) ? floatval( $_POST['price'][0] ) : 0;
|
276 |
-
$max = isset( $_POST['price'][1] ) ? floatval( $_POST['price'][1] ) : 9999999999;
|
277 |
-
$custom_where .= ' %2$s.meta_key = "_price" AND %2$s.meta_value NOT BETWEEN '.$min.' AND '.$max;
|
278 |
-
} else {
|
279 |
-
$custom_where .= ' %2$s.meta_key = "_price" AND (';
|
280 |
-
$price_ranges = array();
|
281 |
-
foreach ( $_POST['price_ranges'] as $range ) {
|
282 |
-
$range = explode( '*', $range );
|
283 |
-
$min = isset( $range[0] ) ? floatval( ($range[0] - 1) ) : 0;
|
284 |
-
$max = isset( $range[1] ) ? floatval( $range[1] ) : 0;
|
285 |
-
$price_ranges[] = '( %2$s.meta_value NOT BETWEEN '.$min.' AND '.$max.' )';
|
286 |
-
}
|
287 |
-
$custom_where .= implode(' AND ', $price_ranges);
|
288 |
-
$custom_where .= ")";
|
289 |
-
}
|
290 |
-
$custom_where .= ")";
|
291 |
-
}
|
292 |
-
return $custom_where;
|
293 |
-
}
|
294 |
-
public function faster_recount_add_data($query, $taxonomy_data, $terms) {
|
295 |
-
global $wpdb;
|
296 |
-
extract($taxonomy_data);
|
297 |
-
if( ! $use_filters ) return $query;
|
298 |
-
$br_options = BeRocket_AAPF::get_aapf_option();
|
299 |
-
if( ! empty($br_options['out_of_stock_variable_reload']) ) {
|
300 |
-
$new_post_terms = br_get_value_from_array($_POST,'terms');
|
301 |
-
$new_post_limits = br_get_value_from_array($_POST,'limits_arr');
|
302 |
-
if( ! is_array($new_post_limits) ) $new_post_limits = array();
|
303 |
-
if( ! is_array($new_post_terms) ) $new_post_terms = array();
|
304 |
-
if( is_array($new_post_terms) && count($new_post_terms) ) {
|
305 |
-
foreach($new_post_terms as $new_post_terms_i => $new_post_term) {
|
306 |
-
if( $new_post_term[0] == $taxonomy ) {
|
307 |
-
unset($new_post_terms[$new_post_terms_i]);
|
308 |
-
}
|
309 |
-
}
|
310 |
-
}
|
311 |
-
$limit_post__not_in = array();
|
312 |
-
foreach($terms as $term_data) {
|
313 |
-
$new_post_limits[$taxonomy] = array($term_data->term_id);
|
314 |
-
$limit_post__not_in[$term_data->term_taxonomy_id] = apply_filters('berocket_add_out_of_stock_variable', array(), $new_post_terms, $new_post_limits);
|
315 |
-
}
|
316 |
-
|
317 |
-
$limit_post__not_in_where_array = array();
|
318 |
-
if( is_array($limit_post__not_in) && count($limit_post__not_in) ) {
|
319 |
-
$limit_post__term_id_without_product = array();
|
320 |
-
foreach($limit_post__not_in as $wp_terms_id => $limit_post) {
|
321 |
-
if( is_array($limit_post) && count($limit_post) ) {
|
322 |
-
$limit_post__not_in_where_array[$wp_terms_id] = "({$wpdb->posts}.ID NOT IN (\"" . implode('","', $limit_post) . "\") AND term_relationships.term_taxonomy_id = {$wp_terms_id})";
|
323 |
-
} else {
|
324 |
-
$limit_post__term_id_without_product[] = $wp_terms_id;
|
325 |
-
}
|
326 |
-
}
|
327 |
-
if( count($limit_post__term_id_without_product) ) {
|
328 |
-
$limit_post__not_in_where_array[] = "(term_relationships.term_taxonomy_id IN (".implode(', ', $limit_post__term_id_without_product)."))";
|
329 |
-
}
|
330 |
-
$limit_post__not_in_where = implode(' OR ', $limit_post__not_in_where_array);
|
331 |
-
}
|
332 |
-
if( empty($br_options['out_of_stock_variable_single']) && ! empty($limit_post__not_in_where) ) {
|
333 |
-
$query['where'] = berocket_insert_to_array($query['where'], 'post__not_in', array(
|
334 |
-
'post__not_in_variation' => " AND ({$limit_post__not_in_where})"
|
335 |
-
));
|
336 |
-
}
|
337 |
-
$this->limit_post__not_in_where_array = $limit_post__not_in_where_array;
|
338 |
-
}
|
339 |
-
return $query;
|
340 |
-
}
|
341 |
-
public function faster_recount_query_result($results, $query, $terms) {
|
342 |
-
$limit_post__not_in_where_array = $this->limit_post__not_in_where_array;
|
343 |
-
$this->limit_post__not_in_where_array = array();
|
344 |
-
$br_options = BeRocket_AAPF::get_aapf_option();
|
345 |
-
if( ! empty($br_options['out_of_stock_variable_reload']) && ! empty($br_options['out_of_stock_variable_single']) ) {
|
346 |
-
if( isset($limit_post__not_in_where_array) && is_array($limit_post__not_in_where_array) && count($limit_post__not_in_where_array) ) {
|
347 |
-
global $wpdb;
|
348 |
-
foreach($limit_post__not_in_where_array as $term_id => $limit_post) {
|
349 |
-
$query_new = $query;
|
350 |
-
$query_new['where'] .= " AND ({$limit_post})";
|
351 |
-
$query_new = implode( ' ', $query_new );
|
352 |
-
$result = $wpdb->get_results( $query_new );
|
353 |
-
if( ! empty($result) && is_array($result) && count($result) ) {
|
354 |
-
foreach($result as $result_i) {
|
355 |
-
foreach($results as &$results_data) {
|
356 |
-
if( $results_data->term_count_id == $result_i->term_count_id ) {
|
357 |
-
$results_data->term_count = $result_i->term_count;
|
358 |
-
break;
|
359 |
-
}
|
360 |
-
}
|
361 |
-
}
|
362 |
-
}
|
363 |
-
}
|
364 |
-
}
|
365 |
-
}
|
366 |
-
return $results;
|
367 |
-
}
|
368 |
-
function faster_recount_cache_key($key) {
|
369 |
-
$br_options = BeRocket_AAPF::get_aapf_option();
|
370 |
-
if( ! empty($br_options['out_of_stock_variable_reload']) ) {
|
371 |
-
$key .= 'V';
|
372 |
-
}
|
373 |
-
if( ! empty($br_options['out_of_stock_variable_reload']) && ! empty($br_options['out_of_stock_variable_single']) ) {
|
374 |
-
$key .= 'V';
|
375 |
-
}
|
376 |
-
return $key;
|
377 |
-
}
|
378 |
-
}
|
379 |
-
new BeRocket_AAPF_compat_woocommerce_variation();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/admin/admin_bar.php
CHANGED
@@ -206,7 +206,7 @@ if( ! class_exists('BeRocket_aapf_admin_bar_debug') ) {
|
|
206 |
#wp-admin-bar-bapf_debug_bar .ab-submenu .ab-item .bapf_adminbar_status .dashicons-yes {color:green;}
|
207 |
#wp-admin-bar-bapf_debug_bar .ab-submenu .ab-item .bapf_adminbar_status .dashicons-no {color:red;}
|
208 |
#wp-admin-bar-bapf_debug_bar .ab-submenu .ab-item .bapf_adminbar_status_element {display:inline-block;text-align:center; padding:3px;}
|
209 |
-
#wp-admin-bar-bapf_debug_bar .ab-submenu .ab-item .bapf_adminbar_errors {text-align:center; max-height: 200px}
|
210 |
#wp-admin-bar-bapf_debug_bar .ab-submenu .ab-item .bapf_adminbar_errors > div {display: flex; border-top: 1px solid #555;text-align:left;align-items: center;}
|
211 |
#wp-admin-bar-bapf_debug_bar .ab-submenu .ab-item .bapf_adminbar_errors > div p {padding: 3px;}
|
212 |
#wp-admin-bar-bapf_debug_bar .ab-submenu .ab-item .bapf_adminbar_errors .dashicons {font-family: dashicons;font-size: 34px;line-height: 34px;display: block;cursor:pointer;}
|
206 |
#wp-admin-bar-bapf_debug_bar .ab-submenu .ab-item .bapf_adminbar_status .dashicons-yes {color:green;}
|
207 |
#wp-admin-bar-bapf_debug_bar .ab-submenu .ab-item .bapf_adminbar_status .dashicons-no {color:red;}
|
208 |
#wp-admin-bar-bapf_debug_bar .ab-submenu .ab-item .bapf_adminbar_status_element {display:inline-block;text-align:center; padding:3px;}
|
209 |
+
#wp-admin-bar-bapf_debug_bar .ab-submenu .ab-item .bapf_adminbar_errors {text-align:center; max-height: 200px; overflow: auto; margin-left: -10px; margin-right: -10px;}
|
210 |
#wp-admin-bar-bapf_debug_bar .ab-submenu .ab-item .bapf_adminbar_errors > div {display: flex; border-top: 1px solid #555;text-align:left;align-items: center;}
|
211 |
#wp-admin-bar-bapf_debug_bar .ab-submenu .ab-item .bapf_adminbar_errors > div p {padding: 3px;}
|
212 |
#wp-admin-bar-bapf_debug_bar .ab-submenu .ab-item .bapf_adminbar_errors .dashicons {font-family: dashicons;font-size: 34px;line-height: 34px;display: block;cursor:pointer;}
|
includes/compatibility/bodycommerce.php
CHANGED
@@ -2,10 +2,7 @@
|
|
2 |
if ( ! function_exists('berocket_aapf_bodycommerce_archive_module_args') ) {
|
3 |
add_filter('db_archive_module_args', 'berocket_aapf_bodycommerce_archive_module_args');
|
4 |
function berocket_aapf_bodycommerce_archive_module_args( $new_args ) {
|
5 |
-
|
6 |
-
$BeRocket_AAPF = BeRocket_AAPF::getInstance();
|
7 |
-
$new_args = $BeRocket_AAPF->woocommerce_filter_query_vars( $new_args );
|
8 |
-
}
|
9 |
|
10 |
return $new_args;
|
11 |
}
|
2 |
if ( ! function_exists('berocket_aapf_bodycommerce_archive_module_args') ) {
|
3 |
add_filter('db_archive_module_args', 'berocket_aapf_bodycommerce_archive_module_args');
|
4 |
function berocket_aapf_bodycommerce_archive_module_args( $new_args ) {
|
5 |
+
$new_args = apply_filters('bapf_uparse_apply_filters_to_query_vars_save', $new_args);
|
|
|
|
|
|
|
6 |
|
7 |
return $new_args;
|
8 |
}
|
includes/compatibility/jet_smart_filters.php
CHANGED
@@ -10,8 +10,7 @@ class BeRocket_AAPF_compat_JetSmartFilter {
|
|
10 |
}
|
11 |
}
|
12 |
function apply_filters($query) {
|
13 |
-
$
|
14 |
-
$query = $BeRocket_AAPF->woocommerce_filter_query_vars($query);
|
15 |
return $query;
|
16 |
}
|
17 |
}
|
10 |
}
|
11 |
}
|
12 |
function apply_filters($query) {
|
13 |
+
$query = apply_filters('bapf_uparse_apply_filters_to_query_vars_save', $query);
|
|
|
14 |
return $query;
|
15 |
}
|
16 |
}
|
includes/compatibility/product-table.php
CHANGED
@@ -45,8 +45,7 @@ class BeRocket_AAPF_compat_product_table {
|
|
45 |
if( empty($table_args['berocket_ajax']) ) {
|
46 |
return $query_vars;
|
47 |
}
|
48 |
-
$
|
49 |
-
$query_vars = $BeRocket_AAPF->woocommerce_filter_query_vars($query_vars);
|
50 |
return $query_vars;
|
51 |
}
|
52 |
public static function aapf_localize_widget_script($localize) {
|
45 |
if( empty($table_args['berocket_ajax']) ) {
|
46 |
return $query_vars;
|
47 |
}
|
48 |
+
$query_vars = apply_filters('bapf_uparse_apply_filters_to_query_vars_save', $query_vars);
|
|
|
49 |
return $query_vars;
|
50 |
}
|
51 |
public static function aapf_localize_widget_script($localize) {
|
includes/compatibility/relevanssi.php
CHANGED
@@ -5,6 +5,7 @@ if( ! class_exists('BeRocket_AAPF_compat_Relevanssi') ) {
|
|
5 |
if( function_exists('relevanssi_do_query') ) {
|
6 |
remove_filter('berocket_aapf_recount_terms_query', array('BeRocket_AAPF_faster_attribute_recount', 'search_query'), 50, 3);
|
7 |
add_filter('berocket_aapf_recount_terms_query', array(__CLASS__, 'search_query'), 50, 3);
|
|
|
8 |
add_filter('bapf_query_count_before_update', array(__CLASS__, 'count_before_update'));
|
9 |
add_filter('relevanssi_modify_wp_query', array(__CLASS__, 'relevanssi_query'));
|
10 |
}
|
@@ -27,24 +28,28 @@ if( ! class_exists('BeRocket_AAPF_compat_Relevanssi') ) {
|
|
27 |
static function search_query($query, $taxonomy_data, $terms) {
|
28 |
extract($taxonomy_data);
|
29 |
if( ! empty($use_filters) ) {
|
30 |
-
$
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
$
|
40 |
-
|
|
|
|
|
|
|
|
|
|
|
41 |
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
}
|
46 |
-
$query['where']['search'] = "AND {$wpdb->posts}.ID IN (" . implode(',', $posts) . ")";
|
47 |
}
|
|
|
48 |
}
|
49 |
return $query;
|
50 |
}
|
@@ -64,9 +69,19 @@ if( ! class_exists('BeRocket_AAPF_compat_Relevanssi') ) {
|
|
64 |
$BeRocket_AAPF = BeRocket_AAPF::getInstance();
|
65 |
$args = $BeRocket_AAPF->price_filter_post_clauses($args, $query);
|
66 |
if( ! empty($args['where']) || ! empty($args['join']) ) {
|
67 |
-
$
|
68 |
-
|
69 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
$ids = $wpdb->get_col($request, 0);
|
71 |
if( ! is_array($ids) || empty($ids) ) {
|
72 |
$ids = array();
|
5 |
if( function_exists('relevanssi_do_query') ) {
|
6 |
remove_filter('berocket_aapf_recount_terms_query', array('BeRocket_AAPF_faster_attribute_recount', 'search_query'), 50, 3);
|
7 |
add_filter('berocket_aapf_recount_terms_query', array(__CLASS__, 'search_query'), 50, 3);
|
8 |
+
add_filter('berocket_aapf_simple_recount_terms_query', array(__CLASS__, 'search_query_simple'), 50, 1);
|
9 |
add_filter('bapf_query_count_before_update', array(__CLASS__, 'count_before_update'));
|
10 |
add_filter('relevanssi_modify_wp_query', array(__CLASS__, 'relevanssi_query'));
|
11 |
}
|
28 |
static function search_query($query, $taxonomy_data, $terms) {
|
29 |
extract($taxonomy_data);
|
30 |
if( ! empty($use_filters) ) {
|
31 |
+
$query = self::search_query_simple($query);
|
32 |
+
}
|
33 |
+
return $query;
|
34 |
+
}
|
35 |
+
static function search_query_simple($query) {
|
36 |
+
$WC_query = WC_Query::get_main_query();
|
37 |
+
$search_ok = (! empty($WC_query) && ! empty($WC_query->query_vars['s']));
|
38 |
+
if( apply_filters('bapf_compat_relevansi_apply_search_query', $search_ok) ) {
|
39 |
+
$args = array(
|
40 |
+
's' => $WC_query->query_vars['s'],
|
41 |
+
'nopaging ' => true,
|
42 |
+
'fields' => 'ids'
|
43 |
+
);
|
44 |
+
global $wpdb;
|
45 |
+
$queryrelevanssi = new WP_Query();
|
46 |
+
$queryrelevanssi->parse_query( $args );
|
47 |
|
48 |
+
$posts = relevanssi_do_query( $queryrelevanssi );
|
49 |
+
if( empty($posts) || count($posts) == 0 ) {
|
50 |
+
$posts = array(0);
|
|
|
|
|
51 |
}
|
52 |
+
$query['where']['search'] = "AND {$wpdb->posts}.ID IN (" . implode(',', $posts) . ")";
|
53 |
}
|
54 |
return $query;
|
55 |
}
|
69 |
$BeRocket_AAPF = BeRocket_AAPF::getInstance();
|
70 |
$args = $BeRocket_AAPF->price_filter_post_clauses($args, $query);
|
71 |
if( ! empty($args['where']) || ! empty($args['join']) ) {
|
72 |
+
$args = array(
|
73 |
+
'fields' => "{$wpdb->posts}.ID",
|
74 |
+
'join' => '',
|
75 |
+
'where' => "{$wpdb->posts}.post_type = 'products'",
|
76 |
+
'groupby' => "{$wpdb->posts}.ID",
|
77 |
+
'distinct' => '',
|
78 |
+
'limits' => ''
|
79 |
+
);
|
80 |
+
$args = apply_filters('berocket_posts_clauses_recount', $args, FALSE, FALSE);
|
81 |
+
$request = 'SELECT ' . $args['fields'] . " FROM {$wpdb->posts}";
|
82 |
+
$request .= (empty($args['join']) ? '' : ' ' . $args['join']);
|
83 |
+
$request .= (empty($args['where']) ? '' : ' ' . $args['where']);
|
84 |
+
$request .= (empty($args['groupby']) ? '' : ' ' . $args['groupby']);
|
85 |
$ids = $wpdb->get_col($request, 0);
|
86 |
if( ! is_array($ids) || empty($ids) ) {
|
87 |
$ids = array();
|
includes/display_filter/reset_button.php
CHANGED
@@ -26,6 +26,13 @@ class BeRocket_AAPF_display_filters_reset_button_type extends BeRocket_AAPF_disp
|
|
26 |
$template_content['template']['content']['filter']['content']['button']['attributes']['class']['main'] = 'bapf_reset';
|
27 |
if( ! empty($berocket_query_var_title['reset_hide']) ) {
|
28 |
$template_content['template']['attributes']['class']['reset_hide'] = $berocket_query_var_title['reset_hide'];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
}
|
30 |
return $template_content;
|
31 |
}
|
26 |
$template_content['template']['content']['filter']['content']['button']['attributes']['class']['main'] = 'bapf_reset';
|
27 |
if( ! empty($berocket_query_var_title['reset_hide']) ) {
|
28 |
$template_content['template']['attributes']['class']['reset_hide'] = $berocket_query_var_title['reset_hide'];
|
29 |
+
if( ! isset($template_content['template']['attributes']['style']) ) {
|
30 |
+
$template_content['template']['attributes']['style'] = array();
|
31 |
+
}
|
32 |
+
if( ! is_array($template_content['template']['attributes']['style']) ) {
|
33 |
+
$template_content['template']['attributes']['style'] = array($template_content['template']['attributes']['style']);
|
34 |
+
}
|
35 |
+
$template_content['template']['attributes']['style']['display_none'] = 'display:none;';
|
36 |
}
|
37 |
return $template_content;
|
38 |
}
|
includes/faster_recount.php
CHANGED
@@ -3,7 +3,6 @@ class BeRocket_AAPF_faster_attribute_recount {
|
|
3 |
function __construct() {
|
4 |
add_filter('berocket_aapf_recount_terms_apply', array(__CLASS__, 'recount_terms'), 10, 2);
|
5 |
add_filter('berocket_aapf_recount_terms_query', array(__CLASS__, 'search_query'), 50, 3);
|
6 |
-
add_filter('berocket_aapf_recount_terms_query', array(__CLASS__, 'date_query'), 60, 3);
|
7 |
add_filter('berocket_aapf_recount_terms_query', array(__CLASS__, 'wpml_query'), 70, 3);
|
8 |
//Child terms include for hierarchical taxonomy
|
9 |
add_filter('berocket_aapf_recount_terms_query', array(__CLASS__, 'child_include'), 50, 3);
|
@@ -43,7 +42,7 @@ class BeRocket_AAPF_faster_attribute_recount {
|
|
43 |
}
|
44 |
}
|
45 |
extract($taxonomy_data);
|
46 |
-
global $wpdb;
|
47 |
if( $terms === FALSE ) {
|
48 |
$terms = self::get_terms($taxonomy);
|
49 |
}
|
@@ -54,71 +53,140 @@ class BeRocket_AAPF_faster_attribute_recount {
|
|
54 |
}
|
55 |
return array();
|
56 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
$wc_main_query = WC_Query::get_main_query();
|
58 |
$author = false;
|
59 |
-
|
60 |
-
|
61 |
-
|
|
|
|
|
|
|
62 |
}
|
63 |
-
|
64 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
}
|
|
|
|
|
66 |
$author = $wc_main_query->get('author');
|
67 |
if( empty($author) ) {
|
68 |
$author = false;
|
69 |
}
|
70 |
}
|
71 |
-
if(
|
72 |
-
$tax_query = apply_filters(
|
73 |
-
'berocket_aapf_recount_remove_all_berocket_tax_query',
|
74 |
-
self::remove_all_berocket_tax_query($tax_query, ($use_filters ? $taxonomy : FALSE)),
|
75 |
-
$terms,
|
76 |
-
$taxonomy_data,
|
77 |
-
$tax_query
|
78 |
-
);
|
79 |
-
$meta_query = apply_filters(
|
80 |
-
'berocket_aapf_recount_remove_all_berocket_meta_query',
|
81 |
-
$meta_query,
|
82 |
-
$terms,
|
83 |
-
$taxonomy_data,
|
84 |
-
$meta_query
|
85 |
-
);
|
86 |
-
}
|
87 |
-
if( ! empty($taxonomy_data['additional_tax_query']) ) {
|
88 |
if( empty($tax_query) ) {
|
89 |
$tax_query = array(
|
90 |
'relation' => 'AND',
|
91 |
);
|
92 |
}
|
93 |
-
$tax_query['additional_tax_query'] = $
|
94 |
}
|
95 |
-
|
96 |
$taxonomy_data['meta_query_ready'] = $meta_query = new WP_Meta_Query( $meta_query );
|
97 |
$taxonomy_data['tax_query_ready'] = $tax_query = new WP_Tax_Query( ( empty($tax_query) || ! is_array($tax_query) ? array() : $tax_query ) );
|
98 |
$taxonomy_data['meta_query_sql'] = $meta_query_sql = $meta_query->get_sql( 'post', $wpdb->posts, 'ID' );
|
99 |
$taxonomy_data['tax_query_sql'] = $tax_query_sql = $tax_query->get_sql( $wpdb->posts, 'ID' );
|
100 |
-
$taxonomy_data['term_taxonomy_ids'] = $term_taxonomy_ids = wp_list_pluck($terms, 'term_taxonomy_id', 'term_id');
|
101 |
-
if( $return_terms = apply_filters('berocket_recount_extension_enabled', false, $terms, $taxonomy_data) ) {
|
102 |
-
if( BeRocket_AAPF::$debug_mode ) {
|
103 |
-
$taxonomy_data['error'] = 'extension_enabled';
|
104 |
-
$taxonomy_data['return_terms'] = $return_terms;
|
105 |
-
BeRocket_AAPF::$error_log['faster_recount_sql'][] = $taxonomy_data;
|
106 |
-
}
|
107 |
-
return $return_terms;
|
108 |
-
}
|
109 |
|
110 |
// Generate query.
|
111 |
$query = array(
|
112 |
'select' => array(
|
113 |
'select' => "SELECT",
|
114 |
-
'elements' => array(
|
115 |
-
'term_count' => "COUNT( DISTINCT {$wpdb->posts}.ID ) as term_count",
|
116 |
-
'term_count_id' => "MAX(term_relationships.term_taxonomy_id) as term_count_id",
|
117 |
-
),
|
118 |
),
|
119 |
'from' => "FROM {$wpdb->posts}",
|
120 |
'join' => array(
|
121 |
-
'term_relationships' => "INNER JOIN {$wpdb->term_relationships} AS term_relationships ON {$wpdb->posts}.ID = term_relationships.object_id",
|
122 |
'tax_query' => $tax_query_sql['join'],
|
123 |
'meta_query' => $meta_query_sql['join'],
|
124 |
),
|
@@ -126,52 +194,27 @@ class BeRocket_AAPF_faster_attribute_recount {
|
|
126 |
'where_main' => "WHERE {$wpdb->posts}.post_type IN ( 'product' ) AND {$wpdb->posts}.post_status = 'publish'",
|
127 |
'tax_query' => $tax_query_sql['where'],
|
128 |
'meta_query' => $meta_query_sql['where'],
|
129 |
-
'term_taxonomy_id' => 'AND term_relationships.term_taxonomy_id IN (' . implode( ',', array_map( 'absint', $term_taxonomy_ids ) ) . ')',
|
130 |
-
'post__not_in' => (empty($post__not_in) ? '' : "AND {$wpdb->posts}.ID NOT IN (\"" . implode('","', $post__not_in) . "\")"),
|
131 |
-
'post__in' => (empty($post__in) ? '' : "AND {$wpdb->posts}.ID IN (\"" . implode('","', $post__in) . "\")"),
|
132 |
),
|
133 |
-
'group_by' => 'GROUP BY term_relationships.term_taxonomy_id',
|
134 |
);
|
135 |
if( $author != false ) {
|
136 |
$query['where']['author'] = "AND {$wpdb->posts}.post_author IN ({$author})";
|
137 |
}
|
138 |
-
|
139 |
-
|
140 |
-
$query['select'] = implode(' ', $query['select']);
|
141 |
-
$query['join'] = implode(' ', $query['join']);
|
142 |
-
$query['where'] = implode(' ', $query['where']);
|
143 |
-
$query = apply_filters('woocommerce_get_filtered_term_product_counts_query', $query);
|
144 |
-
if( $use_filters ) {
|
145 |
-
$query = apply_filters( 'berocket_posts_clauses_recount', $query, $taxonomy_data, $terms );
|
146 |
}
|
147 |
-
|
148 |
-
|
149 |
-
$terms_cache = br_get_cache(apply_filters('berocket_recount_cache_key', md5($query_imploded), $taxonomy_data), 'berocket_recount');
|
150 |
-
}
|
151 |
-
if( empty($terms_cache) ) {
|
152 |
-
$result = $wpdb->get_results( $query_imploded );
|
153 |
-
$result = apply_filters('berocket_query_result_recount', $result, $query, $terms);
|
154 |
-
$result = wp_list_pluck($result, 'term_count', 'term_count_id');
|
155 |
-
foreach($terms as &$term) {
|
156 |
-
$term->count = (isset($result[$term->term_taxonomy_id]) ? $result[$term->term_taxonomy_id] : 0);
|
157 |
-
}
|
158 |
-
if( isset($term) ) {
|
159 |
-
unset($term);
|
160 |
-
}
|
161 |
-
$terms = apply_filters('berocket_terms_after_recount', $terms, $query, $result);
|
162 |
-
if( apply_filters('berocket_recount_cache_use', (! $use_filters), $taxonomy_data) ) {
|
163 |
-
br_set_cache(md5(json_encode($query_imploded)), $terms, 'berocket_recount', DAY_IN_SECONDS);
|
164 |
-
}
|
165 |
-
} else {
|
166 |
-
$terms = $terms_cache;
|
167 |
}
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
|
|
|
|
|
|
175 |
}
|
176 |
static function child_include($query, $taxonomy_data, $terms) {
|
177 |
global $wpdb;
|
@@ -217,30 +260,6 @@ class BeRocket_AAPF_faster_attribute_recount {
|
|
217 |
}
|
218 |
return $query;
|
219 |
}
|
220 |
-
static function date_query($query, $taxonomy_data, $terms) {
|
221 |
-
global $wpdb;
|
222 |
-
extract($taxonomy_data);
|
223 |
-
if( ! empty($use_filters) ) {
|
224 |
-
if( ! empty($_POST['limits']) && is_array($_POST['limits']) && count($_POST['limits']) ) {
|
225 |
-
foreach($_POST['limits'] as $limit) {
|
226 |
-
if($limit[0] == '_date') {
|
227 |
-
$from = $limit[1];
|
228 |
-
$to = $limit[2];
|
229 |
-
$from = date('Y-m-d 00:00:00', strtotime($from));
|
230 |
-
$to = date('Y-m-d 23:59:59', strtotime($to));
|
231 |
-
$date_query_data = array(
|
232 |
-
'after' => $from,
|
233 |
-
'before' => $to,
|
234 |
-
);
|
235 |
-
$date_query = new WP_Date_Query( $date_query_data, 'post_date' );
|
236 |
-
$query['where']['date'] = $date_query->get_sql();
|
237 |
-
break;
|
238 |
-
}
|
239 |
-
}
|
240 |
-
}
|
241 |
-
}
|
242 |
-
return $query;
|
243 |
-
}
|
244 |
static function wpml_query($query, $taxonomy_data, $terms) {
|
245 |
global $wpdb;
|
246 |
extract($taxonomy_data);
|
@@ -250,38 +269,6 @@ class BeRocket_AAPF_faster_attribute_recount {
|
|
250 |
}
|
251 |
return $query;
|
252 |
}
|
253 |
-
static function remove_all_berocket_tax_query($tax_query, $taxonomy = FALSE, $inside = FALSE ) {
|
254 |
-
global $wpdb;
|
255 |
-
if( is_array($tax_query) ) {
|
256 |
-
$md5_exist = array();
|
257 |
-
foreach($tax_query as $key => $value) {
|
258 |
-
if( $key === 'relation' ) continue;
|
259 |
-
if( ! $inside ) {
|
260 |
-
if( in_array(md5(json_encode($value)), $md5_exist) ) {
|
261 |
-
unset($tax_query[$key]);
|
262 |
-
continue;
|
263 |
-
}
|
264 |
-
$md5_exist[] = md5(json_encode($value));
|
265 |
-
}
|
266 |
-
if( is_array($value) ) {
|
267 |
-
if( array_key_exists('relation', $value) ) {
|
268 |
-
$value = self::remove_all_berocket_tax_query($value, $taxonomy, true);
|
269 |
-
if( $value === FALSE ) {
|
270 |
-
unset($tax_query[$key]);
|
271 |
-
} else {
|
272 |
-
$tax_query[$key] = $value;
|
273 |
-
}
|
274 |
-
} elseif( ! empty($value['is_berocket']) && isset($value['taxonomy']) && ($taxonomy === FALSE || $taxonomy == $value['taxonomy']) ) {
|
275 |
-
unset($tax_query[$key]);
|
276 |
-
}
|
277 |
-
}
|
278 |
-
}
|
279 |
-
if( count($tax_query) == 1 && isset($tax_query['relation']) ) {
|
280 |
-
$tax_query = ( $inside ? FALSE : array() );
|
281 |
-
}
|
282 |
-
}
|
283 |
-
return $tax_query;
|
284 |
-
}
|
285 |
static function get_all_taxonomies($taxonomy = FALSE) {
|
286 |
if( empty($taxonomy) ) {
|
287 |
$attributes = wc_get_attribute_taxonomies();
|
3 |
function __construct() {
|
4 |
add_filter('berocket_aapf_recount_terms_apply', array(__CLASS__, 'recount_terms'), 10, 2);
|
5 |
add_filter('berocket_aapf_recount_terms_query', array(__CLASS__, 'search_query'), 50, 3);
|
|
|
6 |
add_filter('berocket_aapf_recount_terms_query', array(__CLASS__, 'wpml_query'), 70, 3);
|
7 |
//Child terms include for hierarchical taxonomy
|
8 |
add_filter('berocket_aapf_recount_terms_query', array(__CLASS__, 'child_include'), 50, 3);
|
42 |
}
|
43 |
}
|
44 |
extract($taxonomy_data);
|
45 |
+
global $wpdb, $berocket_parse_page_obj;
|
46 |
if( $terms === FALSE ) {
|
47 |
$terms = self::get_terms($taxonomy);
|
48 |
}
|
53 |
}
|
54 |
return array();
|
55 |
}
|
56 |
+
do_action('bapf_faster_recount_before_recount_terms', $terms, $taxonomy_data);
|
57 |
+
$taxonomy_data['term_taxonomy_ids'] = $term_taxonomy_ids = wp_list_pluck($terms, 'term_taxonomy_id', 'term_id');
|
58 |
+
$new_taxonomy_data = self::get_query_for_calculate(array(
|
59 |
+
'use_filters' => $use_filters,
|
60 |
+
'add_tax_query' => ( empty($taxonomy_data['additional_tax_query']) ? array() : $taxonomy_data['additional_tax_query'] ),
|
61 |
+
'taxonomy_remove' => (strtoupper($operator) == 'OR' ? $taxonomy : FALSE)
|
62 |
+
));
|
63 |
+
$query = $new_taxonomy_data['query'];
|
64 |
+
unset($new_taxonomy_data['query']);
|
65 |
+
$taxonomy_data = array_merge($taxonomy_data, $new_taxonomy_data);
|
66 |
+
$query['select']['elements'] = array(
|
67 |
+
'term_count' => "COUNT( DISTINCT {$wpdb->posts}.ID ) as term_count",
|
68 |
+
'term_count_id' => "MAX(term_relationships.term_taxonomy_id) as term_count_id",
|
69 |
+
);
|
70 |
+
$query['join']['term_relationships'] = "INNER JOIN {$wpdb->term_relationships} AS term_relationships ON {$wpdb->posts}.ID = term_relationships.object_id";
|
71 |
+
$query['where']['term_taxonomy_id'] = 'AND term_relationships.term_taxonomy_id IN (' . implode( ',', array_map( 'absint', $term_taxonomy_ids ) ) . ')';
|
72 |
+
$query['group_by'] = 'GROUP BY term_relationships.term_taxonomy_id';
|
73 |
+
$query = apply_filters('berocket_aapf_recount_terms_query', $query, $taxonomy_data, $terms);
|
74 |
+
$query['select']['elements']= implode(', ', $query['select']['elements']);
|
75 |
+
$query['select'] = implode(' ', $query['select']);
|
76 |
+
$query['join'] = implode(' ', $query['join']);
|
77 |
+
$query['where'] = implode(' ', $query['where']);
|
78 |
+
$query = apply_filters('woocommerce_get_filtered_term_product_counts_query', $query);
|
79 |
+
if( $use_filters ) {
|
80 |
+
$query = apply_filters( 'berocket_posts_clauses_recount', $query, $terms, $taxonomy_data );
|
81 |
+
}
|
82 |
+
$query_imploded = implode( ' ', $query );
|
83 |
+
$use_recount_cache = apply_filters('berocket_recount_cache_use', (! $use_filters), $taxonomy_data);
|
84 |
+
if( $use_recount_cache ) {
|
85 |
+
$terms_cache = br_get_cache(apply_filters('berocket_recount_cache_key', md5(json_encode($query_imploded)), $taxonomy_data), 'berocket_recount');
|
86 |
+
}
|
87 |
+
if( empty($terms_cache) ) {
|
88 |
+
$result = $wpdb->get_results( $query_imploded );
|
89 |
+
$result = apply_filters('berocket_query_result_recount', $result, $query, $terms);
|
90 |
+
$result = wp_list_pluck($result, 'term_count', 'term_count_id');
|
91 |
+
foreach($terms as &$term) {
|
92 |
+
$term->count = (isset($result[$term->term_taxonomy_id]) ? $result[$term->term_taxonomy_id] : 0);
|
93 |
+
}
|
94 |
+
if( isset($term) ) {
|
95 |
+
unset($term);
|
96 |
+
}
|
97 |
+
$terms = apply_filters('berocket_terms_after_recount', $terms, $query, $result);
|
98 |
+
if( $use_recount_cache ) {
|
99 |
+
br_set_cache(md5(json_encode($query_imploded)), $terms, 'berocket_recount', DAY_IN_SECONDS);
|
100 |
+
}
|
101 |
+
} else {
|
102 |
+
$terms = $terms_cache;
|
103 |
+
}
|
104 |
+
if( BeRocket_AAPF::$debug_mode ) {
|
105 |
+
$taxonomy_data['query_imploded'] = $query_imploded;
|
106 |
+
$taxonomy_data['return_terms'] = $terms;
|
107 |
+
$taxonomy_data['result'] = $result;
|
108 |
+
BeRocket_AAPF::$error_log['faster_recount_sql'][] = $taxonomy_data;
|
109 |
+
}
|
110 |
+
do_action('bapf_faster_recount_after_recount_terms', $terms, $taxonomy_data);
|
111 |
+
self::restore_url_data_after_recount();
|
112 |
+
return apply_filters('berocket_terms_recount_return', $terms, $taxonomy_data, $query_imploded);
|
113 |
+
}
|
114 |
+
static $current_url_data = FALSE;
|
115 |
+
static function restore_url_data_after_recount() {
|
116 |
+
if( self::$current_url_data !== FALSE ) {
|
117 |
+
global $berocket_parse_page_obj;
|
118 |
+
$berocket_parse_page_obj->set_default_data(self::$current_url_data);
|
119 |
+
self::$current_url_data = FALSE;
|
120 |
+
}
|
121 |
+
}
|
122 |
+
static function get_query_for_calculate($additional_data = array()) {
|
123 |
+
global $wpdb, $berocket_parse_page_obj;
|
124 |
+
$additional_data = array_merge(array(
|
125 |
+
'tax_query' => array(),
|
126 |
+
'meta_query' => array(),
|
127 |
+
'post__in' => array(),
|
128 |
+
'post__not_in' => array(),
|
129 |
+
'add_tax_query' => array(),
|
130 |
+
'taxonomy_remove' => false,
|
131 |
+
'use_filters' => false
|
132 |
+
), $additional_data);
|
133 |
+
$query_vars = $berocket_parse_page_obj->query_vars;
|
134 |
$wc_main_query = WC_Query::get_main_query();
|
135 |
$author = false;
|
136 |
+
self::$current_url_data = $berocket_parse_page_obj->get_current();
|
137 |
+
if( ! empty($additional_data['use_filters']) ) {
|
138 |
+
if( $additional_data['taxonomy_remove'] === false ) {
|
139 |
+
$filter_data = $current_filter_data;
|
140 |
+
} else {
|
141 |
+
$filter_data = $berocket_parse_page_obj->remove_taxonomy(array('taxonomy' => $additional_data['taxonomy_remove']));
|
142 |
}
|
143 |
+
$berocket_parse_page_obj->set_default_data($filter_data);
|
144 |
+
$query_vars = apply_filters('bapf_uparse_apply_filters_to_query_vars', $query_vars);
|
145 |
+
$query_vars = apply_filters('bapf_faster_recount_get_query_for_calculate', $query_vars, self::$current_url_data);
|
146 |
+
}
|
147 |
+
$tax_query = $meta_query = $post__not_in = $post__in = false;
|
148 |
+
if( ! empty($query_vars) ) {
|
149 |
+
if( ! empty($query_vars['tax_query']) ) {
|
150 |
+
$tax_query = $query_vars['tax_query'];
|
151 |
+
}
|
152 |
+
if( ! empty($query_vars['meta_query']) ) {
|
153 |
+
$meta_query = $query_vars['meta_query'];
|
154 |
+
}
|
155 |
+
if( ! empty($query_vars['post__not_in']) ) {
|
156 |
+
$post__not_in = $query_vars['post__not_in'];
|
157 |
+
}
|
158 |
+
if( ! empty($query_vars['post__in']) ) {
|
159 |
+
$post__in = $query_vars['post__in'];
|
160 |
}
|
161 |
+
}
|
162 |
+
if( ! empty($wc_main_query) ) {
|
163 |
$author = $wc_main_query->get('author');
|
164 |
if( empty($author) ) {
|
165 |
$author = false;
|
166 |
}
|
167 |
}
|
168 |
+
if( ! empty($additional_data['add_tax_query']) ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
169 |
if( empty($tax_query) ) {
|
170 |
$tax_query = array(
|
171 |
'relation' => 'AND',
|
172 |
);
|
173 |
}
|
174 |
+
$tax_query['additional_tax_query'] = $additional_data['add_tax_query'];
|
175 |
}
|
176 |
+
$taxonomy_data = array();
|
177 |
$taxonomy_data['meta_query_ready'] = $meta_query = new WP_Meta_Query( $meta_query );
|
178 |
$taxonomy_data['tax_query_ready'] = $tax_query = new WP_Tax_Query( ( empty($tax_query) || ! is_array($tax_query) ? array() : $tax_query ) );
|
179 |
$taxonomy_data['meta_query_sql'] = $meta_query_sql = $meta_query->get_sql( 'post', $wpdb->posts, 'ID' );
|
180 |
$taxonomy_data['tax_query_sql'] = $tax_query_sql = $tax_query->get_sql( $wpdb->posts, 'ID' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
181 |
|
182 |
// Generate query.
|
183 |
$query = array(
|
184 |
'select' => array(
|
185 |
'select' => "SELECT",
|
186 |
+
'elements' => array('*'),
|
|
|
|
|
|
|
187 |
),
|
188 |
'from' => "FROM {$wpdb->posts}",
|
189 |
'join' => array(
|
|
|
190 |
'tax_query' => $tax_query_sql['join'],
|
191 |
'meta_query' => $meta_query_sql['join'],
|
192 |
),
|
194 |
'where_main' => "WHERE {$wpdb->posts}.post_type IN ( 'product' ) AND {$wpdb->posts}.post_status = 'publish'",
|
195 |
'tax_query' => $tax_query_sql['where'],
|
196 |
'meta_query' => $meta_query_sql['where'],
|
|
|
|
|
|
|
197 |
),
|
|
|
198 |
);
|
199 |
if( $author != false ) {
|
200 |
$query['where']['author'] = "AND {$wpdb->posts}.post_author IN ({$author})";
|
201 |
}
|
202 |
+
if( ! empty($post__not_in) ) {
|
203 |
+
$query['where']['post__not_in'] = "AND {$wpdb->posts}.ID NOT IN (\"" . implode('","', $post__not_in) . "\")";
|
|
|
|
|
|
|
|
|
|
|
|
|
204 |
}
|
205 |
+
if( ! empty($post__in) ) {
|
206 |
+
$query['where']['post__in'] = "AND {$wpdb->posts}.ID IN (\"" . implode('","', $post__in) . "\")";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
207 |
}
|
208 |
+
if ( ! empty( $query_vars['date_query'] ) ) {
|
209 |
+
$date_query = new WP_Date_Query( $query_vars['date_query'] );
|
210 |
+
$query['where']['date'] = $date_query->get_sql();
|
211 |
+
}
|
212 |
+
$taxonomy_data['query'] = $query;
|
213 |
+
return $taxonomy_data;
|
214 |
+
}
|
215 |
+
static function implode_query_for_calculate($query, $additional_data = array()) {
|
216 |
+
|
217 |
+
return $query;
|
218 |
}
|
219 |
static function child_include($query, $taxonomy_data, $terms) {
|
220 |
global $wpdb;
|
260 |
}
|
261 |
return $query;
|
262 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
263 |
static function wpml_query($query, $taxonomy_data, $terms) {
|
264 |
global $wpdb;
|
265 |
extract($taxonomy_data);
|
269 |
}
|
270 |
return $query;
|
271 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
272 |
static function get_all_taxonomies($taxonomy = FALSE) {
|
273 |
if( empty($taxonomy) ) {
|
274 |
$attributes = wc_get_attribute_taxonomies();
|
includes/filters/display_widget.php
CHANGED
@@ -103,7 +103,6 @@ class BeRocket_AAPF_Widget {
|
|
103 |
'text_color_over' => '000000',
|
104 |
),
|
105 |
'ranges' => array( 1, 10 ),
|
106 |
-
'hide_first_last_ranges' => '',
|
107 |
'include_exclude_select' => '',
|
108 |
'include_exclude_list' => array(),
|
109 |
);
|
@@ -423,8 +422,18 @@ class BeRocket_AAPF_Widget {
|
|
423 |
} elseif( (! empty($min_price) || $min_price == '0') && ! empty($max_price) ) {
|
424 |
$price_range = array($min_price, $max_price);
|
425 |
} else {
|
426 |
-
$price_range = BeRocket_AAPF_Widget_functions::
|
427 |
-
if
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
428 |
$widget_error_log['price_range'] = $price_range;
|
429 |
$widget_error_log['return'] = 'price_range < 2';
|
430 |
$this->filter_return($br_wc_query, $wp_the_query, $wp_query, $wc_query, $old_the_query, $old_query, $widget_error_log);
|
103 |
'text_color_over' => '000000',
|
104 |
),
|
105 |
'ranges' => array( 1, 10 ),
|
|
|
106 |
'include_exclude_select' => '',
|
107 |
'include_exclude_list' => array(),
|
108 |
);
|
422 |
} elseif( (! empty($min_price) || $min_price == '0') && ! empty($max_price) ) {
|
423 |
$price_range = array($min_price, $max_price);
|
424 |
} else {
|
425 |
+
$price_range = BeRocket_AAPF_Widget_functions::get_price_ranges();
|
426 |
+
if( ! empty($price_range) && isset($price_range['min_price']) && isset($price_range['max_price']) ) {
|
427 |
+
if($price_range['min_float'] == $price_range['max_float']) {
|
428 |
+
$price_range = array($price_range['min_price'], $price_range['min_price']);
|
429 |
+
} else {
|
430 |
+
$price_range = array($price_range['min_price'], $price_range['max_price']);
|
431 |
+
}
|
432 |
+
$price_range = array(
|
433 |
+
floor(apply_filters('berocket_price_filter_widget_min_amount', apply_filters('berocket_price_slider_widget_min_amount', apply_filters( 'woocommerce_price_filter_widget_min_amount', $price_range[0] )), $price_range[0])),
|
434 |
+
ceil (apply_filters('berocket_price_filter_widget_max_amount', apply_filters('berocket_price_slider_widget_max_amount', apply_filters( 'woocommerce_price_filter_widget_max_amount', $price_range[1] )), $price_range[1]))
|
435 |
+
);
|
436 |
+
} else {
|
437 |
$widget_error_log['price_range'] = $price_range;
|
438 |
$widget_error_log['return'] = 'price_range < 2';
|
439 |
$this->filter_return($br_wc_query, $wp_the_query, $wp_query, $wc_query, $old_the_query, $old_query, $widget_error_log);
|
includes/filters/dynamic_data_template.php
CHANGED
@@ -29,7 +29,6 @@ class BeRocket_AAPF_dynamic_data_template {
|
|
29 |
add_filter('BeRocket_AAPF_template_full_content', array($this, 'select_multiple'), 10, 4);
|
30 |
//Slider data
|
31 |
add_filter('BeRocket_AAPF_template_full_content', array($this, 'new_attribute_slider'), 1, 3);
|
32 |
-
add_filter('BeRocket_AAPF_template_full_content', array($this, 'slider_selected'), 10, 4);
|
33 |
add_filter('BeRocket_AAPF_template_full_content', array($this, 'number_style'), 500, 4);
|
34 |
add_filter('BeRocket_AAPF_template_full_content', array($this, 'value_icon_slider'), 600, 4);
|
35 |
add_filter('BeRocket_AAPF_template_full_content', array($this, 'text_before_after'), 700, 4);
|
@@ -51,8 +50,6 @@ class BeRocket_AAPF_dynamic_data_template {
|
|
51 |
add_filter('BeRocket_AAPF_template_full_element_content', array($this, 'remove_empty_header'), 9900, 1);
|
52 |
//Selected Filters Area
|
53 |
add_filter('BeRocket_AAPF_template_full_element_content', array($this, 'selected_filters_hide_empty'), 1100, 2);
|
54 |
-
//Fix issues
|
55 |
-
add_filter('berocket_filter_filter_type_array', array($this, 'fix_not_correct_selected'));
|
56 |
}
|
57 |
function checkbox_checked($element, $term, $i, $berocket_query_var_title) {
|
58 |
if( $berocket_query_var_title['new_template'] == 'checkbox' ) {
|
@@ -550,46 +547,6 @@ class BeRocket_AAPF_dynamic_data_template {
|
|
550 |
}
|
551 |
return $template_content;
|
552 |
}
|
553 |
-
function slider_selected($template_content, $terms, $berocket_query_var_title) {
|
554 |
-
if( in_array($berocket_query_var_title['new_template'], array('slider', 'new_slider')) ) {
|
555 |
-
foreach($terms as $term){break;}
|
556 |
-
if( count($terms) == 1 ) {
|
557 |
-
if( isset($term->min) && isset($term->max) ) {
|
558 |
-
if( $berocket_query_var_title['slider_value1'] != $term->min ) {
|
559 |
-
$template_content['template']['content']['filter']['content']['slider_all']['content']['slider']['attributes']['data-start'] = $berocket_query_var_title['slider_value1'];
|
560 |
-
}
|
561 |
-
if( $berocket_query_var_title['slider_value2'] != $term->max ) {
|
562 |
-
$template_content['template']['content']['filter']['content']['slider_all']['content']['slider']['attributes']['data-end'] = $berocket_query_var_title['slider_value2'];
|
563 |
-
}
|
564 |
-
}
|
565 |
-
} elseif( (! empty($_POST['limits']) && is_array($_POST['limits'])) || (! empty($_POST['price']) && $term->taxonomy == 'price') ) {
|
566 |
-
if(! empty($_POST['price']) && $term->taxonomy == 'price') {
|
567 |
-
$limits = array(array(
|
568 |
-
'price',
|
569 |
-
$_POST['price'][0],
|
570 |
-
$_POST['price'][1],
|
571 |
-
));
|
572 |
-
} else {
|
573 |
-
$limits = $_POST['limits'];
|
574 |
-
}
|
575 |
-
foreach($limits as $limit) {
|
576 |
-
if( berocket_isset($limit[0]) == $term->taxonomy ) {
|
577 |
-
$terms_numeric = array_values($terms);
|
578 |
-
foreach($terms_numeric as $position => $term) {
|
579 |
-
if( berocket_isset($limit[1]) == urldecode($term->value) ) {
|
580 |
-
$template_content['template']['content']['filter']['content']['slider_all']['content']['slider']['attributes']['data-start'] = $position;
|
581 |
-
}
|
582 |
-
if( berocket_isset($limit[2]) == urldecode($term->value) ) {
|
583 |
-
$template_content['template']['content']['filter']['content']['slider_all']['content']['slider']['attributes']['data-end'] = $position;
|
584 |
-
}
|
585 |
-
}
|
586 |
-
break;
|
587 |
-
}
|
588 |
-
}
|
589 |
-
}
|
590 |
-
}
|
591 |
-
return $template_content;
|
592 |
-
}
|
593 |
function number_style($template_content, $terms, $berocket_query_var_title) {
|
594 |
if( in_array($berocket_query_var_title['new_template'], array('slider', 'new_slider')) ) {
|
595 |
foreach($terms as $term){break;}
|
@@ -987,11 +944,4 @@ class BeRocket_AAPF_dynamic_data_template {
|
|
987 |
}</style>';
|
988 |
}
|
989 |
}
|
990 |
-
function fix_not_correct_selected($options) {
|
991 |
-
global $wp_query;
|
992 |
-
if ( apply_filters( 'berocket_aapf_is_filtered_page_check', ! empty($_GET['filters']), 'get_filter_args', $wp_query ) ) {
|
993 |
-
br_aapf_args_converter($wp_query);
|
994 |
-
}
|
995 |
-
return $options;
|
996 |
-
}
|
997 |
}
|
29 |
add_filter('BeRocket_AAPF_template_full_content', array($this, 'select_multiple'), 10, 4);
|
30 |
//Slider data
|
31 |
add_filter('BeRocket_AAPF_template_full_content', array($this, 'new_attribute_slider'), 1, 3);
|
|
|
32 |
add_filter('BeRocket_AAPF_template_full_content', array($this, 'number_style'), 500, 4);
|
33 |
add_filter('BeRocket_AAPF_template_full_content', array($this, 'value_icon_slider'), 600, 4);
|
34 |
add_filter('BeRocket_AAPF_template_full_content', array($this, 'text_before_after'), 700, 4);
|
50 |
add_filter('BeRocket_AAPF_template_full_element_content', array($this, 'remove_empty_header'), 9900, 1);
|
51 |
//Selected Filters Area
|
52 |
add_filter('BeRocket_AAPF_template_full_element_content', array($this, 'selected_filters_hide_empty'), 1100, 2);
|
|
|
|
|
53 |
}
|
54 |
function checkbox_checked($element, $term, $i, $berocket_query_var_title) {
|
55 |
if( $berocket_query_var_title['new_template'] == 'checkbox' ) {
|
547 |
}
|
548 |
return $template_content;
|
549 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
550 |
function number_style($template_content, $terms, $berocket_query_var_title) {
|
551 |
if( in_array($berocket_query_var_title['new_template'], array('slider', 'new_slider')) ) {
|
552 |
foreach($terms as $term){break;}
|
944 |
}</style>';
|
945 |
}
|
946 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
947 |
}
|
includes/filters/get_terms.php
CHANGED
@@ -11,7 +11,6 @@ class BeRocket_AAPF_get_terms {
|
|
11 |
add_filter("berocket_aapf_get_terms_filter", array(__CLASS__, 'additional_sort'), 20, 3);
|
12 |
add_filter("berocket_aapf_get_terms_filter", array(__CLASS__, 'hierarchical_sort'), 30, 3);
|
13 |
add_filter("berocket_aapf_get_terms_filter", array(__CLASS__, 'depth_clear'), 40, 3);
|
14 |
-
add_action('br_aapf_args_converter_after', array($this, 'br_aapf_args_converter_after'));
|
15 |
$BeRocket_AAPF = BeRocket_AAPF::getInstance();
|
16 |
$option = $BeRocket_AAPF->get_option();
|
17 |
add_filter('berocket_aapf_get_terms_filter_after', array(__CLASS__, 'prepared_data'), 1, 3);
|
@@ -24,20 +23,17 @@ class BeRocket_AAPF_get_terms {
|
|
24 |
|| (in_array(br_get_value_from_array($option,'recount_hide'), array('removeFirst_recount')) && ( ! empty($option['out_of_stock_variable_reload']) && ! empty($option['out_of_stock_variable']) ) ) ) {
|
25 |
add_filter("berocket_aapf_get_terms_filter_after", array(__CLASS__, 'recount_products'), 30, 3);
|
26 |
}
|
|
|
|
|
|
|
27 |
}
|
28 |
}
|
29 |
}
|
30 |
-
public function
|
31 |
-
|
32 |
-
|
33 |
-
$option = $BeRocket_AAPF->get_option();
|
34 |
-
if( ! empty($option['recount_hide']) ) {
|
35 |
-
if( (apply_filters( 'berocket_aapf_is_filtered_page_check', ! empty($_GET['filters']), 'get_filter_args', $wp_query )
|
36 |
-
|| is_filtered()
|
37 |
-
) && in_array($option['recount_hide'], array('removeFirst_recount')) ) {
|
38 |
-
add_filter("berocket_aapf_get_terms_filter_after", array(__CLASS__, 'recount_products'), 30, 3);
|
39 |
-
}
|
40 |
}
|
|
|
41 |
}
|
42 |
public static function get_terms($args = array(), $additional = array()) {
|
43 |
$args = apply_filters('berocket_aapf_get_terms_class_args', $args, $additional);
|
11 |
add_filter("berocket_aapf_get_terms_filter", array(__CLASS__, 'additional_sort'), 20, 3);
|
12 |
add_filter("berocket_aapf_get_terms_filter", array(__CLASS__, 'hierarchical_sort'), 30, 3);
|
13 |
add_filter("berocket_aapf_get_terms_filter", array(__CLASS__, 'depth_clear'), 40, 3);
|
|
|
14 |
$BeRocket_AAPF = BeRocket_AAPF::getInstance();
|
15 |
$option = $BeRocket_AAPF->get_option();
|
16 |
add_filter('berocket_aapf_get_terms_filter_after', array(__CLASS__, 'prepared_data'), 1, 3);
|
23 |
|| (in_array(br_get_value_from_array($option,'recount_hide'), array('removeFirst_recount')) && ( ! empty($option['out_of_stock_variable_reload']) && ! empty($option['out_of_stock_variable']) ) ) ) {
|
24 |
add_filter("berocket_aapf_get_terms_filter_after", array(__CLASS__, 'recount_products'), 30, 3);
|
25 |
}
|
26 |
+
if( in_array($option['recount_hide'], array('removeFirst_recount')) ) {
|
27 |
+
add_filter("berocket_aapf_get_terms_filter_after", array(__CLASS__, 'recount_products_if_filtered'), 80, 3);
|
28 |
+
}
|
29 |
}
|
30 |
}
|
31 |
}
|
32 |
+
public static function recount_products_if_filtered($terms, $args = array(), $additional = array()) {
|
33 |
+
if( apply_filters( 'berocket_aapf_is_filtered_page_check', ! empty($_GET['filters']), 'get_filter_args' ) || is_filtered() ) {
|
34 |
+
$terms = self::recount_products($terms, $args, $additional);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
}
|
36 |
+
return $terms;
|
37 |
}
|
38 |
public static function get_terms($args = array(), $additional = array()) {
|
39 |
$args = apply_filters('berocket_aapf_get_terms_class_args', $args, $additional);
|
includes/functions.php
CHANGED
@@ -118,19 +118,12 @@ if( ! function_exists( 'br_is_filtered' ) ){
|
|
118 |
*
|
119 |
* @return bool
|
120 |
*/
|
121 |
-
function br_is_filtered(
|
122 |
$filtered = false;
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
$filtered = $filtered || ( isset( $_POST['limits'] ) && is_array( $_POST['limits'] ) && count( $_POST['limits'] ) > 0 );
|
128 |
-
}
|
129 |
-
if ( $price ) {
|
130 |
-
$filtered = $filtered || ( isset( $_POST['price'] ) && is_array( $_POST['price'] ) && count( $_POST['price'] ) > 0 );
|
131 |
-
}
|
132 |
-
if ( $search ) {
|
133 |
-
$filtered = $filtered || ! empty( $_GET['s'] );
|
134 |
}
|
135 |
return $filtered;
|
136 |
}
|
@@ -181,43 +174,28 @@ if ( ! function_exists( 'br_is_term_selected' ) ) {
|
|
181 |
*/
|
182 |
function br_is_term_selected( $term, $checked = FALSE, $child_parent = FALSE, $depth = 0 ) {
|
183 |
//TODO: Notice: Trying to get property 'taxonomy' of non-object
|
184 |
-
$term_taxonomy = $term->taxonomy;
|
185 |
if( $term_taxonomy == '_rating' ) {
|
186 |
$term_taxonomy = 'product_visibility';
|
187 |
}
|
188 |
$is_checked = false;
|
189 |
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
}
|
200 |
}
|
201 |
}
|
202 |
-
foreach ( $_POST['terms'] as $p_term ) {
|
203 |
-
if ( ( ! empty($p_term[0]) and ! empty($p_term[1]) and $p_term[0] == $term_taxonomy and $term->term_id == $p_term[1] ) or $is_checked ) {
|
204 |
-
if($checked) return ' checked="checked"';
|
205 |
-
else return ' selected="selected"';
|
206 |
-
}
|
207 |
-
}
|
208 |
-
}
|
209 |
-
if ( ! empty($_POST['add_terms']) and ! empty($term) and is_object( $term ) ) {
|
210 |
-
foreach ( $_POST['add_terms'] as $p_term ) {
|
211 |
-
if ( ( ! empty($p_term[0]) and ! empty($p_term[1]) and $p_term[0] == $term_taxonomy and $term->term_id == $p_term[1] ) or $is_checked ) {
|
212 |
-
if($checked) return ' checked="checked"';
|
213 |
-
else return ' selected="selected"';
|
214 |
-
}
|
215 |
-
}
|
216 |
}
|
217 |
-
if
|
218 |
-
$
|
219 |
-
|
220 |
-
if ( ( $term->term_id == $p_term ) ) {
|
221 |
if($checked) return ' checked="checked"';
|
222 |
else return ' selected="selected"';
|
223 |
}
|
@@ -236,93 +214,13 @@ if ( ! function_exists( 'br_get_selected_term' ) ) {
|
|
236 |
* @return array selected terms
|
237 |
*/
|
238 |
function br_get_selected_term( $taxonomy ) {
|
|
|
|
|
239 |
$term_ids = array();
|
240 |
-
if (
|
241 |
-
foreach
|
242 |
-
if
|
243 |
-
$term_ids
|
244 |
-
}
|
245 |
-
}
|
246 |
-
}
|
247 |
-
if ( ! empty($_POST['limits']) ) {
|
248 |
-
foreach ( $_POST['limits'] as $v ) {
|
249 |
-
if ( ! empty($v[0]) && $v[0] == $taxonomy ) {
|
250 |
-
$v[1] = urldecode( $v[1] );
|
251 |
-
$v[2] = urldecode( $v[2] );
|
252 |
-
$all_terms_name = array();
|
253 |
-
$all_terms_slug = array();
|
254 |
-
$terms = get_terms( $v[0] );
|
255 |
-
|
256 |
-
$wc_order_by = wc_attribute_orderby( $v[0] );
|
257 |
-
BeRocket_AAPF_Widget_functions::sort_terms( $terms, array(
|
258 |
-
"wc_order_by" => $wc_order_by,
|
259 |
-
"order_values_by" => '',
|
260 |
-
"filter_type" => 'attribute',
|
261 |
-
"order_values_type"=> SORT_ASC
|
262 |
-
) );
|
263 |
-
$is_numeric = true;
|
264 |
-
$is_with_string = false;
|
265 |
-
if( is_wp_error ( $all_terms_name ) ) {
|
266 |
-
BeRocket_updater::$error_log[] = $all_terms_name->errors;
|
267 |
-
}
|
268 |
-
if( ! is_numeric($v[1]) || ! is_numeric($v[2]) ) {
|
269 |
-
$is_with_string = true;
|
270 |
-
}
|
271 |
-
foreach ( $terms as $term ) {
|
272 |
-
if( ! is_numeric( substr( $term->name[0], 0, 1 ) ) ) {
|
273 |
-
$is_numeric = false;
|
274 |
-
}
|
275 |
-
if( ! is_numeric( $term->name ) ) {
|
276 |
-
$is_with_string = true;
|
277 |
-
}
|
278 |
-
array_push( $all_terms_name, $term->slug );
|
279 |
-
array_push( $all_terms_slug, $term->name );
|
280 |
-
}
|
281 |
-
if( $is_numeric ) {
|
282 |
-
array_multisort( $all_terms_slug, SORT_NUMERIC, $all_terms_name, $all_terms_slug );
|
283 |
-
} else {
|
284 |
-
//array_multisort( $all_terms_name, $all_terms_name, $all_terms_slug );
|
285 |
-
}
|
286 |
-
$taxonomy_terms = get_terms(array('fields' => 'id=>slug', 'taxonomy' => $v[0]));
|
287 |
-
if( $is_with_string ) {
|
288 |
-
$start_terms = array_search( $v[1], $all_terms_name );
|
289 |
-
$end_terms = array_search( $v[2], $all_terms_name );
|
290 |
-
$all_terms_name = array_slice( $all_terms_name, $start_terms, ( $end_terms - $start_terms + 1 ) );
|
291 |
-
$search = $all_terms_name;
|
292 |
-
} else {
|
293 |
-
$start_terms = false;
|
294 |
-
$end_terms = false;
|
295 |
-
$previous_pos = false;
|
296 |
-
$search = array();
|
297 |
-
foreach($all_terms_slug as $term_pos => $term) {
|
298 |
-
if( $term >= $v[1] && $start_terms === false ) {
|
299 |
-
$start_terms = $term_pos;
|
300 |
-
}
|
301 |
-
if( $end_terms === false ) {
|
302 |
-
if( $term > $v[2] ) {
|
303 |
-
if( $previous_pos !== false ) {
|
304 |
-
$end_terms = $previous_pos;
|
305 |
-
}
|
306 |
-
} elseif( $term == $v[2] ) {
|
307 |
-
$end_terms = $term_pos;
|
308 |
-
}
|
309 |
-
}
|
310 |
-
$previous_pos = $term_pos;
|
311 |
-
}
|
312 |
-
if( $start_terms > $end_terms ) {
|
313 |
-
$search = array();
|
314 |
-
} elseif( $v[1] > $v[2] ) {
|
315 |
-
$search = array();
|
316 |
-
} else {
|
317 |
-
$search = array_slice( $all_terms_name, $start_terms, ( $end_terms - $start_terms + 1 ) );
|
318 |
-
}
|
319 |
-
}
|
320 |
-
foreach($search as $search_el) {
|
321 |
-
$id = array_search($search_el, $taxonomy_terms);
|
322 |
-
if( $id !== FALSE ) {
|
323 |
-
$term_ids[] = $id;
|
324 |
-
}
|
325 |
-
}
|
326 |
}
|
327 |
}
|
328 |
}
|
@@ -410,349 +308,21 @@ if( ! function_exists( 'br_aapf_parse_order_by' ) ) {
|
|
410 |
}
|
411 |
}
|
412 |
|
413 |
-
if( ! function_exists( 'br_aapf_args_parser' ) ){
|
414 |
-
/**
|
415 |
-
* br_aapf_args_parser - extend $args based on passed filters
|
416 |
-
*
|
417 |
-
* @param array $args
|
418 |
-
*
|
419 |
-
* @return array
|
420 |
-
*/
|
421 |
-
function br_aapf_args_parser( $args = array() ) {
|
422 |
-
$br_options = BeRocket_AAPF::get_aapf_option();
|
423 |
-
$tax_query = array();
|
424 |
-
$tags = '';
|
425 |
-
|
426 |
-
if ( ! empty($_POST['terms']) ) {
|
427 |
-
foreach ( $_POST['terms'] as $post_key => $t ) {
|
428 |
-
if ( $t[4] == 'attribute' && $t[0] != 'product_cat' && $t[0] != 'product_tag' ) {
|
429 |
-
$taxonomies[ $t[0] ][] = br_aapf_args_parser_check_terms($t[0], $t[1]);
|
430 |
-
$taxonomies_operator[ $t[0] ] = $t[2];
|
431 |
-
} elseif ( taxonomy_exists( $t[0] ) ) {
|
432 |
-
$taxonomies[ $t[0] ][] = $t[1];
|
433 |
-
$taxonomies_operator[ $t[0] ] = $t[2];
|
434 |
-
}
|
435 |
-
}
|
436 |
-
}
|
437 |
-
|
438 |
-
$taxonomies = apply_filters( 'berocket_aapf_listener_taxonomies', ( empty($taxonomies) ? '' : $taxonomies ) );
|
439 |
-
$taxonomies_operator = apply_filters( 'berocket_aapf_listener_taxonomies_operator', ( empty($taxonomies_operator) ? '' : $taxonomies_operator ) );
|
440 |
-
|
441 |
-
if ( ! empty($taxonomies) ) {
|
442 |
-
$tax_query['relation'] = 'AND';
|
443 |
-
if ( $taxonomies ) {
|
444 |
-
foreach ( $taxonomies as $k => $v ) {
|
445 |
-
if ( $taxonomies_operator[ $k ] == 'AND' ) {
|
446 |
-
$op = 'AND';
|
447 |
-
} else {
|
448 |
-
$op = 'OR';
|
449 |
-
}
|
450 |
-
|
451 |
-
$fields = 'id';
|
452 |
-
$current_tax_query = array();
|
453 |
-
$current_tax_query['relation'] = $op;
|
454 |
-
$include_children = false;
|
455 |
-
if( in_array($k, array('product_cat', 'berocket_brand')) ) {
|
456 |
-
$include_children = true;
|
457 |
-
}
|
458 |
-
foreach($v as $v_i) {
|
459 |
-
$current_tax_query[] = apply_filters('berocket_aapf_tax_query_attribute', array(
|
460 |
-
'taxonomy' => $k,
|
461 |
-
'field' => $fields,
|
462 |
-
'terms' => $v_i,
|
463 |
-
'operator' => 'IN',
|
464 |
-
'include_children' => $include_children,
|
465 |
-
'is_berocket' => true
|
466 |
-
));
|
467 |
-
}
|
468 |
-
$tax_query[] = $current_tax_query;
|
469 |
-
}
|
470 |
-
}
|
471 |
-
}
|
472 |
-
|
473 |
-
if ( ! empty($tags) ) {
|
474 |
-
$args['product_tag'] = $tags;
|
475 |
-
}
|
476 |
-
|
477 |
-
if ( ! empty($_POST['product_cat']) and $_POST['product_cat'] != '-1' ) {
|
478 |
-
$tax_query[] = array(
|
479 |
-
'taxonomy' => 'product_cat',
|
480 |
-
'field' => 'slug',
|
481 |
-
'terms' => strip_tags( $_POST['product_cat'] ),
|
482 |
-
'operator' => 'IN',
|
483 |
-
'is_berocket'=> true
|
484 |
-
);
|
485 |
-
}
|
486 |
-
|
487 |
-
$args['tax_query'] = $tax_query;
|
488 |
-
$args['post_type'] = 'product';
|
489 |
-
|
490 |
-
if ( ! empty($_POST['orderby']) ) {
|
491 |
-
br_aapf_parse_order_by( $args );
|
492 |
-
}
|
493 |
-
|
494 |
-
return $args;
|
495 |
-
}
|
496 |
-
}
|
497 |
-
|
498 |
-
if( ! function_exists( 'br_aapf_args_parser_attributes_terms' ) ) {
|
499 |
-
function br_aapf_args_parser_attributes_terms($args) {
|
500 |
-
global $wpdb;
|
501 |
-
$args = array_merge( array(
|
502 |
-
'taxonomy' => 'product_cat',
|
503 |
-
'return' => 'terms'
|
504 |
-
), $args);
|
505 |
-
$wpdb->query("SET SESSION group_concat_max_len = 1000000");
|
506 |
-
$md5 = $wpdb->get_var(
|
507 |
-
$wpdb->prepare("SELECT MD5(GROUP_CONCAT(t.slug+t.term_id+tt.parent+tt.count))
|
508 |
-
FROM $wpdb->terms AS t
|
509 |
-
INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id
|
510 |
-
WHERE tt.taxonomy IN ('%s')",
|
511 |
-
$args['taxonomy']
|
512 |
-
)
|
513 |
-
);
|
514 |
-
$md5 = apply_filters('BRaapf_cache_check_md5', $md5, 'br_aapf_args_parser_attributes_terms', $args);
|
515 |
-
$attributes_terms = get_option( apply_filters('br_aapf_md5_cache_text', 'br_get_taxonomy_args_parser_'.$args['taxonomy']) );
|
516 |
-
if( empty($attributes_terms) || $attributes_terms['md5'] != $md5 ) {
|
517 |
-
$attributes_terms = array(
|
518 |
-
'terms' => array(),
|
519 |
-
'md5' => $md5,
|
520 |
-
'time' => time()
|
521 |
-
);
|
522 |
-
|
523 |
-
$terms = get_terms( array( $args['taxonomy'] ), array( 'orderby' => 'name', 'order' => 'ASC' ) );
|
524 |
-
if ( $terms && ! is_wp_error($terms) ) {
|
525 |
-
foreach ( $terms as $term ) {
|
526 |
-
$attributes_terms['terms'][$term->term_id] = $term->term_id;
|
527 |
-
}
|
528 |
-
}
|
529 |
-
update_option(apply_filters('br_aapf_md5_cache_text', 'br_get_taxonomy_args_parser_'.$args['taxonomy']), $attributes_terms);
|
530 |
-
}
|
531 |
-
return br_get_value_from_array($attributes_terms, $args['return']);
|
532 |
-
}
|
533 |
-
}
|
534 |
-
if( ! function_exists( 'br_aapf_args_parser_check_terms' ) ) {
|
535 |
-
function br_aapf_args_parser_check_terms($attribute, $term) {
|
536 |
-
$attributes_terms = br_aapf_args_parser_attributes_terms(array('taxonomy' => $attribute));
|
537 |
-
return ( empty($attributes_terms[ $term ]) ? '' : $attributes_terms[ $term ] );
|
538 |
-
}
|
539 |
-
}
|
540 |
-
if( ! function_exists( 'br_aapf_args_converter' ) ) {
|
541 |
-
/**
|
542 |
-
* convert args-url to normal filters
|
543 |
-
*/
|
544 |
-
function br_aapf_args_converter($query) {
|
545 |
-
$br_options = BeRocket_AAPF::get_aapf_option();
|
546 |
-
do_action('br_aapf_args_converter_before', $query);
|
547 |
-
if(! empty($_GET['filters'])) {
|
548 |
-
if( empty($br_options['seo_uri_decode']) ) {
|
549 |
-
$_GET['filters'] = urlencode($_GET['filters']);
|
550 |
-
$_GET['filters'] = str_replace('+', urlencode('+'), $_GET['filters']);
|
551 |
-
$_GET['filters'] = urldecode($_GET['filters']);
|
552 |
-
}
|
553 |
-
}
|
554 |
-
$filters_string = apply_filters('brapf_args_converter_get_string', (empty($_GET['filters']) ? '' : $_GET['filters']), $br_options, $query);
|
555 |
-
$_POST['terms'] = array();
|
556 |
-
$_POST['add_terms'] = array();
|
557 |
-
$_POST['limits'] = array();
|
558 |
-
$_POST['price'] = array();
|
559 |
-
$_POST['price_ranges'] = array();
|
560 |
-
$filters = array();
|
561 |
-
if( empty($filters_string) ) {
|
562 |
-
$filters = array();
|
563 |
-
} elseif ( preg_match( "~\|~", $filters_string ) ) {
|
564 |
-
$filters = explode( "|", $filters_string );
|
565 |
-
} elseif( $filters_string ) {
|
566 |
-
$filters[0] = $filters_string;
|
567 |
-
}
|
568 |
-
|
569 |
-
global $br_url_parser_middle_result;
|
570 |
-
foreach ( $filters as $filter ) {
|
571 |
-
if( isset($min) ) {
|
572 |
-
unset($min);
|
573 |
-
}
|
574 |
-
if( isset($min) ) {
|
575 |
-
unset($max);
|
576 |
-
}
|
577 |
-
if ( preg_match( "~\[~", $filter ) ) {
|
578 |
-
list( $attribute, $value ) = explode( "[", trim( preg_replace( "~\]~", "", $filter) ), 2 );
|
579 |
-
$attribute = berocket_wpml_attribute_untranslate($attribute);
|
580 |
-
$value = html_entity_decode($value);
|
581 |
-
|
582 |
-
$braapf_sliders = apply_filters('braapf_slider_data', array());
|
583 |
-
$parse_type = 'default';
|
584 |
-
if( (! empty($braapf_sliders['pa_'.$attribute]) || ! empty($braapf_sliders[$attribute])) && preg_match( "~\_~", $value ) ) {
|
585 |
-
$parse_type = 'slider';
|
586 |
-
} elseif( term_exists( sanitize_title($value), 'pa_'.$attribute ) ) {
|
587 |
-
$parse_type = 'or';
|
588 |
-
} elseif ( preg_match( "~\*~", $value ) ) {
|
589 |
-
$parse_type = 'price_range';
|
590 |
-
} elseif ( preg_match( "~\+~", $value ) ) {
|
591 |
-
$parse_type = 'and';
|
592 |
-
} elseif ( preg_match( "~\-~", $value ) ) {
|
593 |
-
$parse_type = 'or';
|
594 |
-
} elseif ( preg_match( "~\_~", $value ) ) {
|
595 |
-
$parse_type = 'slider';
|
596 |
-
}
|
597 |
-
switch($parse_type) {
|
598 |
-
case 'or':
|
599 |
-
$value = explode( "-", $value );
|
600 |
-
if( ! empty($br_options['slug_urls']) && $attribute != '_stock_status' && $attribute != '_sale' ) {
|
601 |
-
$values = array();
|
602 |
-
for ( $i = 0; $i < count( $value) ; $i++ ) {
|
603 |
-
$values[ $i ] = urldecode( $value[ $i ] );
|
604 |
-
}
|
605 |
-
|
606 |
-
$value = array();
|
607 |
-
$attribute_check = $attribute;
|
608 |
-
if( $attribute == '_rating' ) {
|
609 |
-
$attribute_check = 'product_visibility';
|
610 |
-
}
|
611 |
-
for ( $i = 0; $i < count( $values ); $i++ ) {
|
612 |
-
$cur_value = $values;
|
613 |
-
for ( $ii = count( $values ); $ii > 0; $ii-- ) {
|
614 |
-
if ( ! term_exists( implode( '-', $cur_value ), $attribute_check ) && ! term_exists( implode( '-', $cur_value ), 'pa_' . $attribute_check ) ) {
|
615 |
-
array_pop( $cur_value );
|
616 |
-
if ( ! $cur_value ) {
|
617 |
-
break 2;
|
618 |
-
}
|
619 |
-
} else {
|
620 |
-
$value[] = implode( '-', array_splice( $values, 0, count( $cur_value ) ) );
|
621 |
-
$i = - 1;
|
622 |
-
break;
|
623 |
-
}
|
624 |
-
}
|
625 |
-
}
|
626 |
-
}
|
627 |
-
$operator = 'OR';
|
628 |
-
break;
|
629 |
-
case 'and':
|
630 |
-
$value = explode( "+", $value );
|
631 |
-
$operator = 'AND';
|
632 |
-
break;
|
633 |
-
case 'slider':
|
634 |
-
list( $min, $max ) = explode( "_", $value );
|
635 |
-
$operator = '';
|
636 |
-
break;
|
637 |
-
case 'price_range':
|
638 |
-
$value = explode( "-", $value );
|
639 |
-
break;
|
640 |
-
default:
|
641 |
-
$value = explode( " ", $value );
|
642 |
-
$operator = 'OR';
|
643 |
-
break;
|
644 |
-
}
|
645 |
-
} else {
|
646 |
-
list( $attribute, $value ) = explode( "-", $filter, 2 );
|
647 |
-
}
|
648 |
-
|
649 |
-
$br_url_parser_middle_result[ $attribute ] = $value;
|
650 |
-
|
651 |
-
if ( $attribute == 'price' ) {
|
652 |
-
if ( isset( $min ) && isset( $max ) ) {
|
653 |
-
$_POST['price'] = apply_filters('berocket_min_max_filter', array( $min, $max ));
|
654 |
-
$BeRocket_AAPF = BeRocket_AAPF::getInstance();
|
655 |
-
$BeRocket_AAPF->wcml_currency_price_fix();
|
656 |
-
} else {
|
657 |
-
$_POST['price_ranges'] = $value;
|
658 |
-
}
|
659 |
-
} elseif ( $attribute == 'order' ) {
|
660 |
-
$_GET['orderby'] = $value;
|
661 |
-
} else {
|
662 |
-
if ( $operator ) {
|
663 |
-
foreach ( $value as $v ) {
|
664 |
-
$type = FALSE;
|
665 |
-
$operator_2 = $attribute_2 = '';
|
666 |
-
if($attribute == 'product_tag') {
|
667 |
-
$type = 'tag';
|
668 |
-
$attribute_2 = 'product_tag';
|
669 |
-
$operator_2 = $operator;
|
670 |
-
} elseif( taxonomy_exists( 'pa_'.$attribute ) ) {
|
671 |
-
$type = 'attribute';
|
672 |
-
$attribute_2 = "pa_" . $attribute;
|
673 |
-
$operator_2 = $operator;
|
674 |
-
} elseif( taxonomy_exists( $attribute ) ) {
|
675 |
-
$type = 'custom_taxonomy';
|
676 |
-
$attribute_2 = $attribute;
|
677 |
-
$operator_2 = $operator;
|
678 |
-
} elseif( $attribute == '_stock_status' || $attribute == '_sale' ) {
|
679 |
-
$type = 'attribute';
|
680 |
-
$attribute_2 = $attribute;
|
681 |
-
$operator_2 = $operator;
|
682 |
-
} elseif( $attribute == '_rating' ) {
|
683 |
-
$type = 'custom_taxonomy';
|
684 |
-
$attribute_2 = 'product_visibility';
|
685 |
-
$operator_2 = $operator;
|
686 |
-
}
|
687 |
-
if($type !== FALSE) {
|
688 |
-
if( $attribute_2 == '_stock_status' || $attribute_2 == '_sale' ) {
|
689 |
-
if( $attribute_2 == '_stock_status' ) {
|
690 |
-
$slug_name = array( '', 'instock', 'outofstock');
|
691 |
-
} else {
|
692 |
-
$slug_name = array( '', 'sale', 'notsale');
|
693 |
-
}
|
694 |
-
if( ! empty($br_options['slug_urls']) ) {
|
695 |
-
$attr_name = $v;
|
696 |
-
$v = array_search( $v, $slug_name );
|
697 |
-
} else {
|
698 |
-
$attr_name = $slug_name[$v];
|
699 |
-
}
|
700 |
-
} else {
|
701 |
-
if( ! empty($br_options['slug_urls']) ) {
|
702 |
-
$attr_name_object = get_term_by( 'slug', $v, $attribute_2, 'OBJECT' );
|
703 |
-
$attr_name = ( $attr_name_object == false ) ? '' : $attr_name_object->term_id;
|
704 |
-
$slug_name = $v;
|
705 |
-
$v = $attr_name;
|
706 |
-
$attr_name = $slug_name;
|
707 |
-
} else {
|
708 |
-
$attr_name_object = get_term_by( 'id', $v, $attribute_2, 'OBJECT' );
|
709 |
-
$attr_name = ( $attr_name_object == false ) ? '' : $attr_name_object->slug;
|
710 |
-
}
|
711 |
-
}
|
712 |
-
|
713 |
-
if( $attribute_2 == '_sale' ) {
|
714 |
-
$_POST['add_terms'][] = array( $attribute_2, $v, $operator_2, $attr_name, $type );
|
715 |
-
} else {
|
716 |
-
$_POST['terms'][] = array( $attribute_2, $v, $operator_2, $attr_name, $type );
|
717 |
-
}
|
718 |
-
}
|
719 |
-
}
|
720 |
-
} else {
|
721 |
-
if( taxonomy_exists('pa_'.$attribute) ) {
|
722 |
-
$attribute = 'pa_'.$attribute;
|
723 |
-
}
|
724 |
-
$_POST['limits'][] = array( $attribute, $min, $max );
|
725 |
-
}
|
726 |
-
}
|
727 |
-
}
|
728 |
-
do_action('br_aapf_args_converter_after', $query);
|
729 |
-
foreach(array('terms', 'add_terms', 'limits', 'price', 'price_ranges', '', '') as $post_field) {
|
730 |
-
if( isset($_POST[$post_field]) && empty($_POST[$post_field]) ) {
|
731 |
-
unset($_POST[$post_field]);
|
732 |
-
}
|
733 |
-
}
|
734 |
-
}
|
735 |
-
}
|
736 |
-
|
737 |
function br_widget_is_hide( $attribute, $widget_is_hide = false ) {
|
738 |
if ( $widget_is_hide ) {
|
739 |
-
if
|
740 |
-
|
741 |
-
if ( $term[0] == $attribute ) {
|
742 |
-
return false;
|
743 |
-
}
|
744 |
-
}
|
745 |
}
|
746 |
-
|
747 |
-
|
748 |
-
|
|
|
|
|
|
|
749 |
return false;
|
750 |
}
|
751 |
}
|
752 |
}
|
753 |
-
if ( $attribute == 'price' and ( ! empty( $_POST['price'] ) or ! empty( $_POST['price_ranges'] ) ) ) {
|
754 |
-
return false;
|
755 |
-
}
|
756 |
}
|
757 |
|
758 |
return $widget_is_hide;
|
@@ -1680,114 +1250,6 @@ if ( ! function_exists( 'g_fonts_list' ) ) {
|
|
1680 |
}
|
1681 |
}
|
1682 |
|
1683 |
-
if ( ! function_exists( 'br_get_post_meta_price' ) ) {
|
1684 |
-
/**
|
1685 |
-
* Public function to get price of product
|
1686 |
-
*
|
1687 |
-
* @param int $object_id product id
|
1688 |
-
*
|
1689 |
-
* @return float product price
|
1690 |
-
*/
|
1691 |
-
function br_get_post_meta_price( $object_id ) {
|
1692 |
-
global $wpdb;
|
1693 |
-
|
1694 |
-
$meta_list = $wpdb->get_row(
|
1695 |
-
$wpdb->prepare(
|
1696 |
-
"SELECT meta_value FROM {$wpdb->postmeta}
|
1697 |
-
WHERE post_id = %d AND meta_key = '%s'
|
1698 |
-
ORDER BY meta_id ASC LIMIT 1",
|
1699 |
-
$object_id,
|
1700 |
-
apply_filters('berocket_price_filter_meta_key', '_price', 'functions_1553')
|
1701 |
-
),
|
1702 |
-
ARRAY_A
|
1703 |
-
);
|
1704 |
-
|
1705 |
-
return maybe_unserialize( $meta_list['meta_value'] );
|
1706 |
-
}
|
1707 |
-
}
|
1708 |
-
|
1709 |
-
if ( ! function_exists( 'br_get_taxonomy_id' ) ) {
|
1710 |
-
/**
|
1711 |
-
* Public function to get category id by $value in $field
|
1712 |
-
*
|
1713 |
-
* @param string $value value for search
|
1714 |
-
* @param string $field by what field is search
|
1715 |
-
*
|
1716 |
-
* @return int category id
|
1717 |
-
*/
|
1718 |
-
function br_get_taxonomy_id( $taxonomy, $value, $field = 'slug', $return = 'term_id' ) {
|
1719 |
-
global $wpdb;
|
1720 |
-
|
1721 |
-
if ( 'id' == $field ) {
|
1722 |
-
return $value;
|
1723 |
-
} elseif ( 'slug' == $field ) {
|
1724 |
-
$field = 't.slug';
|
1725 |
-
$value = sanitize_title( $value );
|
1726 |
-
if ( empty( $value ) ) {
|
1727 |
-
return false;
|
1728 |
-
}
|
1729 |
-
} elseif ( 'name' == $field ) {
|
1730 |
-
$value = wp_unslash( $value );
|
1731 |
-
$field = 't.name';
|
1732 |
-
} else {
|
1733 |
-
return false;
|
1734 |
-
}
|
1735 |
-
|
1736 |
-
$term = $wpdb->get_row(
|
1737 |
-
$wpdb->prepare( "SELECT t.term_id, tt.term_taxonomy_id FROM {$wpdb->terms} AS t INNER JOIN {$wpdb->term_taxonomy}
|
1738 |
-
AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy = '%s' AND $field = %s LIMIT 1", $taxonomy, $value )
|
1739 |
-
);
|
1740 |
-
|
1741 |
-
if ( ! $term )
|
1742 |
-
return false;
|
1743 |
-
|
1744 |
-
$term = (array)$term;
|
1745 |
-
return $term[$return];
|
1746 |
-
}
|
1747 |
-
}
|
1748 |
-
|
1749 |
-
if ( ! function_exists( 'br_get_sub_taxonomies' ) ) {
|
1750 |
-
/**
|
1751 |
-
* Public function to get sub categories from category
|
1752 |
-
*
|
1753 |
-
* @param string $field_value value for search
|
1754 |
-
* @param string $field_name by what field is search
|
1755 |
-
* @param array $args 'return' - type of return data,
|
1756 |
-
* 'include_parent' = include parent to cate gories list, 'max_depth' - max depth of sub category
|
1757 |
-
*
|
1758 |
-
* @return string|array|o category
|
1759 |
-
*/
|
1760 |
-
function br_get_sub_taxonomies( $taxonomy, $field_value, $field_name = 'slug', $args = array(), $return = 'term_id' ) {
|
1761 |
-
$defaults = array( 'return' => 'string', 'include_parent' => false, 'max_depth' => 9 );
|
1762 |
-
$args = wp_parse_args( $args, $defaults );
|
1763 |
-
$parent_id = 0;
|
1764 |
-
|
1765 |
-
if ( $field_value ) {
|
1766 |
-
$parent_id = br_get_taxonomy_id( $taxonomy, $field_value, $field_name, $return );
|
1767 |
-
}
|
1768 |
-
|
1769 |
-
$args['taxonomy_name'] = $taxonomy;
|
1770 |
-
$categories = br_get_cat_hierarchy( $args, $parent_id );
|
1771 |
-
|
1772 |
-
if ( $args['include_parent'] ) {
|
1773 |
-
if ( $args['return'] == 'string' ) {
|
1774 |
-
if ( $parent_id ) {
|
1775 |
-
if ( $categories ) $categories .= ",";
|
1776 |
-
$categories .= $parent_id;
|
1777 |
-
}
|
1778 |
-
} elseif ( $args['return'] == 'array' ) {
|
1779 |
-
array_unshift( $cat_hierarchy, $parent_id );
|
1780 |
-
} elseif ( $args['return'] == 'hierarchy_objects' ) {
|
1781 |
-
$cat = br_get_category( $parent_id );
|
1782 |
-
$cat->depth = 0;
|
1783 |
-
$cat_hierarchy[ $parent_id ] = $cat;
|
1784 |
-
ksort( $cat_hierarchy );
|
1785 |
-
}
|
1786 |
-
}
|
1787 |
-
|
1788 |
-
return $categories;
|
1789 |
-
}
|
1790 |
-
}
|
1791 |
|
1792 |
if ( ! function_exists( 'br_get_category_id' ) ) {
|
1793 |
/**
|
@@ -1908,121 +1370,6 @@ if ( ! function_exists( 'br_get_sub_categories' ) ) {
|
|
1908 |
}
|
1909 |
}
|
1910 |
|
1911 |
-
if ( ! function_exists( 'br_wp_get_object_terms' ) ) {
|
1912 |
-
/**
|
1913 |
-
* Public function to get terms by id and taxonomy
|
1914 |
-
*
|
1915 |
-
* @param int $object_id category id
|
1916 |
-
* @param int $taxonomy category id
|
1917 |
-
*
|
1918 |
-
* @return array terms
|
1919 |
-
*/
|
1920 |
-
function br_wp_get_object_terms( $object_id, $taxonomy, $args = array() ) {
|
1921 |
-
global $wpdb;
|
1922 |
-
|
1923 |
-
if ( empty( $object_id ) || empty( $taxonomy ) )
|
1924 |
-
return array();
|
1925 |
-
|
1926 |
-
$object_id = (int) $object_id;
|
1927 |
-
|
1928 |
-
$terms = array();
|
1929 |
-
$fields = $args['fields'] ? $args['fields'] : 'all' ;
|
1930 |
-
|
1931 |
-
$select_this = '';
|
1932 |
-
if ( 'all' == $fields ) {
|
1933 |
-
$select_this = 't.*, tt.*';
|
1934 |
-
} elseif ( 'ids' == $fields ) {
|
1935 |
-
$select_this = 't.term_id';
|
1936 |
-
} elseif ( 'names' == $fields ) {
|
1937 |
-
$select_this = 't.name';
|
1938 |
-
} elseif ( 'slugs' == $fields ) {
|
1939 |
-
$select_this = 't.slug';
|
1940 |
-
} elseif ( 'all_with_object_id' == $fields ) {
|
1941 |
-
$select_this = 't.*, tt.*, tr.object_id';
|
1942 |
-
}
|
1943 |
-
|
1944 |
-
$query = $wpdb->prepare(
|
1945 |
-
"SELECT {$select_this} FROM {$wpdb->terms} AS t
|
1946 |
-
INNER JOIN {$wpdb->term_taxonomy} AS tt ON tt.term_id = t.term_id
|
1947 |
-
INNER JOIN {$wpdb->term_relationships} AS tr ON tr.term_taxonomy_id = tt.term_taxonomy_id
|
1948 |
-
WHERE tt.taxonomy = %s AND tr.object_id = %d
|
1949 |
-
ORDER BY t.term_id ASC",
|
1950 |
-
$taxonomy,
|
1951 |
-
$object_id
|
1952 |
-
);
|
1953 |
-
|
1954 |
-
if( BeRocket_AAPF::$debug_mode ) {
|
1955 |
-
$wpdb->show_errors();
|
1956 |
-
BeRocket_AAPF::$error_log['102_get_object_terms_SELECT'] = $query;
|
1957 |
-
}
|
1958 |
-
|
1959 |
-
$objects = false;
|
1960 |
-
if ( 'all' == $fields || 'all_with_object_id' == $fields ) {
|
1961 |
-
$_terms = $wpdb->get_results( $query );
|
1962 |
-
if( BeRocket_AAPF::$debug_mode ) {
|
1963 |
-
BeRocket_AAPF::$error_log['000_select_status'][] = @ $wpdb->last_error;
|
1964 |
-
}
|
1965 |
-
foreach ( $_terms as $key => $term ) {
|
1966 |
-
$_terms[$key] = sanitize_term( $term, $taxonomy, 'raw' );
|
1967 |
-
}
|
1968 |
-
$terms = array_merge( $terms, $_terms );
|
1969 |
-
$objects = true;
|
1970 |
-
} elseif ( 'ids' == $fields || 'names' == $fields || 'slugs' == $fields ) {
|
1971 |
-
$_terms = $wpdb->get_col( $query );
|
1972 |
-
if( BeRocket_AAPF::$debug_mode ) {
|
1973 |
-
ob_start();
|
1974 |
-
if ( $wpdb->last_error ) {
|
1975 |
-
$wpdb->print_error();
|
1976 |
-
}
|
1977 |
-
BeRocket_AAPF::$error_log['000_select_status'][] = ob_get_contents();
|
1978 |
-
ob_end_clean();
|
1979 |
-
}
|
1980 |
-
$_field = ( 'ids' == $fields ) ? 'term_id' : 'name';
|
1981 |
-
foreach ( $_terms as $key => $term ) {
|
1982 |
-
$_terms[$key] = sanitize_term_field( $_field, $term, $term, $taxonomy, 'raw' );
|
1983 |
-
}
|
1984 |
-
$terms = array_merge( $terms, $_terms );
|
1985 |
-
} elseif ( 'tt_ids' == $fields ) {
|
1986 |
-
$terms = $wpdb->get_col(
|
1987 |
-
"SELECT tr.term_taxonomy_id FROM {$wpdb->term_relationships} AS tr
|
1988 |
-
INNER JOIN {$wpdb->term_taxonomy} AS tt ON tr.term_taxonomy_id = tt.term_taxonomy_id
|
1989 |
-
WHERE tr.object_id IN ({$object_ids}) AND tt.taxonomy IN ({$taxonomies}) {$orderby} {$order}"
|
1990 |
-
);
|
1991 |
-
if( BeRocket_AAPF::$debug_mode ) {
|
1992 |
-
ob_start();
|
1993 |
-
if ( $wpdb->last_error ) {
|
1994 |
-
$wpdb->print_error();
|
1995 |
-
}
|
1996 |
-
BeRocket_AAPF::$error_log['000_select_status'][] = ob_get_contents();
|
1997 |
-
ob_end_clean();
|
1998 |
-
}
|
1999 |
-
foreach ( $terms as $key => $tt_id ) {
|
2000 |
-
$terms[$key] = sanitize_term_field( 'term_taxonomy_id', $tt_id, 0, $taxonomy, 'raw' ); // 0 should be the term id, however is not needed when using raw context.
|
2001 |
-
}
|
2002 |
-
}
|
2003 |
-
|
2004 |
-
if ( ! $terms ) {
|
2005 |
-
return array();
|
2006 |
-
} elseif ( $objects && 'all_with_object_id' !== $fields ) {
|
2007 |
-
$_tt_ids = array();
|
2008 |
-
$_terms = array();
|
2009 |
-
foreach ( $terms as $term ) {
|
2010 |
-
if ( in_array( $term->term_taxonomy_id, $_tt_ids ) ) {
|
2011 |
-
continue;
|
2012 |
-
}
|
2013 |
-
|
2014 |
-
$_tt_ids[] = $term->term_taxonomy_id;
|
2015 |
-
$_terms[] = $term;
|
2016 |
-
}
|
2017 |
-
$terms = $_terms;
|
2018 |
-
} elseif ( ! $objects ) {
|
2019 |
-
$terms = array_values( array_unique( $terms ) );
|
2020 |
-
}
|
2021 |
-
|
2022 |
-
return $terms;
|
2023 |
-
}
|
2024 |
-
}
|
2025 |
-
|
2026 |
if ( ! function_exists( 'br_get_cat_hierarchy' ) ) {
|
2027 |
/**
|
2028 |
* Public function to get terms by id and taxonomy
|
@@ -2045,363 +1392,9 @@ if ( ! function_exists( 'br_get_cat_hierarchy' ) ) {
|
|
2045 |
}
|
2046 |
}
|
2047 |
|
2048 |
-
if ( ! function_exists( 'br_select_post_status' ) ) {
|
2049 |
-
/**
|
2050 |
-
* Public function to get string with possible post statuses for the mysql query
|
2051 |
-
*
|
2052 |
-
* @return array string
|
2053 |
-
*/
|
2054 |
-
function br_select_post_status() {
|
2055 |
-
global $wpdb, $br_select_post_status;
|
2056 |
-
|
2057 |
-
if ( $br_select_post_status ) {
|
2058 |
-
return $br_select_post_status;
|
2059 |
-
}
|
2060 |
-
|
2061 |
-
if ( ! isset( $wpdb->posts ) ) return '1=1';
|
2062 |
-
|
2063 |
-
if ( is_user_logged_in() ) {
|
2064 |
-
$br_select_post_status = "( {$wpdb->posts}.post_status='publish' OR {$wpdb->posts}.post_status='private' )";
|
2065 |
-
} else {
|
2066 |
-
$br_select_post_status = "{$wpdb->posts}.post_status='publish'";
|
2067 |
-
}
|
2068 |
-
|
2069 |
-
return $br_select_post_status;
|
2070 |
-
}
|
2071 |
-
}
|
2072 |
-
|
2073 |
-
if ( ! function_exists( 'br_where_search' ) ) {
|
2074 |
-
/**
|
2075 |
-
* Public function to get string with possible post statuses for the mysql query
|
2076 |
-
*
|
2077 |
-
* @return array string
|
2078 |
-
*/
|
2079 |
-
function br_where_search( &$query = '' ) {
|
2080 |
-
$s = '';
|
2081 |
-
$has_new_function = class_exists('WC_Query') && method_exists('WC_Query', 'get_main_query') && method_exists('WC_Query', 'get_main_search_query_sql');
|
2082 |
-
if( $has_new_function ) {
|
2083 |
-
$WC_Query_get_main_query = WC_Query::get_main_query();
|
2084 |
-
$has_new_function = ! empty($WC_Query_get_main_query);
|
2085 |
-
}
|
2086 |
-
if( $has_new_function ) {
|
2087 |
-
$s = WC_Query::get_main_search_query_sql();
|
2088 |
-
|
2089 |
-
if ( ! empty( $s ) ) {
|
2090 |
-
$s = ' AND ' . $s;
|
2091 |
-
|
2092 |
-
if ( ! empty( $query ) ) {
|
2093 |
-
$query['where'] .= $s;
|
2094 |
-
}
|
2095 |
-
}
|
2096 |
-
}
|
2097 |
-
|
2098 |
-
return $s;
|
2099 |
-
}
|
2100 |
-
}
|
2101 |
-
|
2102 |
-
if ( ! function_exists( 'br_filters_old_wc_compatible' ) ) {
|
2103 |
-
/**
|
2104 |
-
* Public function to get string with possible post statuses for the mysql query
|
2105 |
-
*
|
2106 |
-
* @return array string
|
2107 |
-
*/
|
2108 |
-
function br_filters_old_wc_compatible( $query, $new = false ) {
|
2109 |
-
global $br_old_wp_query;
|
2110 |
-
if ( ! isset( $br_old_wp_query ) ) {
|
2111 |
-
if ( ! $new ) {
|
2112 |
-
$BeRocket_AAPF = BeRocket_AAPF::getInstance();
|
2113 |
-
$query = $BeRocket_AAPF->apply_user_price( $query, true );
|
2114 |
-
$query = $BeRocket_AAPF->apply_user_filters( $query, true );
|
2115 |
-
$query_vars = $query->query_vars;
|
2116 |
-
} else {
|
2117 |
-
$query_vars = array();
|
2118 |
-
}
|
2119 |
-
|
2120 |
-
$query_vars[ 'posts__in' ] = apply_filters( 'bapf_loop_shop_post_in', array() );
|
2121 |
-
$br_old_wp_query = $query_vars;
|
2122 |
-
}
|
2123 |
-
|
2124 |
-
return $br_old_wp_query;
|
2125 |
-
}
|
2126 |
-
}
|
2127 |
-
|
2128 |
-
if ( ! function_exists( 'br_filters_query' ) ) {
|
2129 |
-
function br_filters_query( $query, $for = 'price', $product_cat = null ) {
|
2130 |
-
global $wpdb, $wp_query;
|
2131 |
-
|
2132 |
-
$old_join_posts = $old_query_vars = $old_tax_query = $old_meta_query = '';
|
2133 |
-
$has_new_function = method_exists('WC_Query', 'get_main_query') && method_exists('WC_Query', 'get_main_meta_query') && method_exists('WC_Query', 'get_main_tax_query');
|
2134 |
-
if( $has_new_function ) {
|
2135 |
-
$WC_Query_get_main_query = WC_Query::get_main_query();
|
2136 |
-
$has_new_function = ! empty($WC_Query_get_main_query);
|
2137 |
-
}
|
2138 |
-
if ( ! $has_new_function ) {
|
2139 |
-
$old_query_vars = br_filters_old_wc_compatible( $wp_query );
|
2140 |
-
$old_meta_query = ( empty( $old_query_vars[ 'meta_query' ] ) || ! is_array($old_query_vars[ 'meta_query' ]) ? array() : $old_query_vars[ 'meta_query' ] );
|
2141 |
-
$old_tax_query = ( empty( $old_query_vars[ 'tax_query' ] ) || ! is_array($old_query_vars[ 'tax_query' ]) ? array() : $old_query_vars[ 'tax_query' ] );
|
2142 |
-
} else {
|
2143 |
-
$old_query_vars = br_filters_old_wc_compatible( $wp_query, true );
|
2144 |
-
}
|
2145 |
-
|
2146 |
-
if ( ! empty( $old_query_vars[ 'posts__in' ] ) ) {
|
2147 |
-
$old_join_posts = " AND {$wpdb->posts}.ID IN (" . implode( ',', $old_query_vars[ 'posts__in' ] ) . ") ";
|
2148 |
-
}
|
2149 |
-
|
2150 |
-
if ( $has_new_function ) {
|
2151 |
-
$tax_query = WC_Query::get_main_tax_query();
|
2152 |
-
} else {
|
2153 |
-
$tax_query = $old_tax_query;
|
2154 |
-
}
|
2155 |
-
|
2156 |
-
if ( $has_new_function ) {
|
2157 |
-
$meta_query = WC_Query::get_main_meta_query();
|
2158 |
-
} else {
|
2159 |
-
$meta_query = $old_meta_query;
|
2160 |
-
}
|
2161 |
-
if( $for == 'price' ) {
|
2162 |
-
foreach($meta_query as $meta_query_key => $meta_query_val) {
|
2163 |
-
if( is_array($meta_query_val) ) {
|
2164 |
-
if( isset($meta_query_val['key']) ) {
|
2165 |
-
if( br_get_value_from_array($meta_query_val, 'key') == apply_filters('berocket_price_filter_meta_key', '_price', 'functions_2008') ) {
|
2166 |
-
unset($meta_query[$meta_query_key]);
|
2167 |
-
}
|
2168 |
-
} else {
|
2169 |
-
foreach($meta_query_val as $meta_query2_key => $meta_query2_val) {
|
2170 |
-
if( is_array($meta_query2_val) && br_get_value_from_array($meta_query2_val, 'key') == apply_filters('berocket_price_filter_meta_key', '_price', 'functions_2013') ) {
|
2171 |
-
unset($meta_query_val[$meta_query2_key]);
|
2172 |
-
}
|
2173 |
-
}
|
2174 |
-
$meta_query[$meta_query_key] = $meta_query_val;
|
2175 |
-
}
|
2176 |
-
}
|
2177 |
-
}
|
2178 |
-
}
|
2179 |
-
|
2180 |
-
$queried_object = $wp_query->get_queried_object_id();
|
2181 |
-
if ( ! empty( $queried_object ) && $for != 'price' ) {
|
2182 |
-
$query_object = $wp_query->get_queried_object();
|
2183 |
-
if ( ! empty( $query_object->taxonomy ) && ! empty( $query_object->slug ) ) {
|
2184 |
-
$tax_query[ $query_object->taxonomy ] = array(
|
2185 |
-
'taxonomy' => $query_object->taxonomy,
|
2186 |
-
'terms' => array( $query_object->slug ),
|
2187 |
-
'field' => 'slug',
|
2188 |
-
);
|
2189 |
-
}
|
2190 |
-
}
|
2191 |
-
if( ! empty($product_cat) ) {
|
2192 |
-
$tax_query[] = array(
|
2193 |
-
'taxonomy' => 'product_cat',
|
2194 |
-
'field' => 'slug',
|
2195 |
-
'terms' => array($product_cat),
|
2196 |
-
'operator' => 'IN',
|
2197 |
-
);
|
2198 |
-
}
|
2199 |
-
$meta_query = new WP_Meta_Query( $meta_query );
|
2200 |
-
$tax_query = new WP_Tax_Query( ( empty($tax_query) || ! is_array($tax_query) ? array() : $tax_query ) );
|
2201 |
-
|
2202 |
-
if ( $for == 'price' ) {
|
2203 |
-
foreach ( $meta_query->queries as $mkey => $mquery ) {
|
2204 |
-
if ( isset( $mquery[ 'key' ] ) and $mquery[ 'key' ] == apply_filters('berocket_price_filter_meta_key', '_price', 'functions_2047') ) {
|
2205 |
-
unset( $meta_query->queries[ $mkey ] );
|
2206 |
-
}
|
2207 |
-
}
|
2208 |
-
}
|
2209 |
-
|
2210 |
-
$meta_query_sql = $meta_query->get_sql( 'post', $wpdb->posts, 'ID' );
|
2211 |
-
$tax_query_sql = $tax_query->get_sql( $wpdb->posts, 'ID' );
|
2212 |
-
|
2213 |
-
if( ! is_array($query) ) {
|
2214 |
-
$query = array('join' => '', 'where' => '');
|
2215 |
-
}
|
2216 |
-
|
2217 |
-
// Generate query
|
2218 |
-
if( ! isset($query[ 'join' ]) ) {
|
2219 |
-
$query[ 'join' ] = '';
|
2220 |
-
}
|
2221 |
-
/*$query[ 'join' ] .= "
|
2222 |
-
INNER JOIN {$wpdb->term_relationships} AS term_relationships ON {$wpdb->posts}.ID = term_relationships.object_id
|
2223 |
-
INNER JOIN {$wpdb->term_taxonomy} AS term_taxonomy USING( term_taxonomy_id )
|
2224 |
-
INNER JOIN {$wpdb->terms} AS terms USING( term_id )
|
2225 |
-
";*/
|
2226 |
-
$query[ 'join' ] .= $tax_query_sql[ 'join' ] . $meta_query_sql[ 'join' ];
|
2227 |
-
if( ! isset($query[ 'where' ]) ) {
|
2228 |
-
$query[ 'where' ] = '';
|
2229 |
-
}
|
2230 |
-
$query[ 'where' ]
|
2231 |
-
.= "
|
2232 |
-
WHERE {$wpdb->posts}.post_type IN ( 'product' )
|
2233 |
-
AND " . br_select_post_status() . "
|
2234 |
-
" . $tax_query_sql[ 'where' ] . $meta_query_sql[ 'where' ] . "
|
2235 |
-
";
|
2236 |
-
if ( defined( 'WCML_VERSION' ) && defined( 'ICL_LANGUAGE_CODE' ) ) {
|
2237 |
-
$query[ 'join' ] = $query[ 'join' ] . " INNER JOIN {$wpdb->prefix}icl_translations as wpml_lang ON ( {$wpdb->posts}.ID = wpml_lang.element_id )";
|
2238 |
-
$query[ 'where' ] = $query[ 'where' ] . " AND wpml_lang.language_code = '" . ICL_LANGUAGE_CODE . "' AND wpml_lang.element_type = 'post_product'";
|
2239 |
-
}
|
2240 |
-
br_where_search( $query );
|
2241 |
-
if ( ! empty( $post__in ) ) {
|
2242 |
-
$query[ 'where' ] .= " AND {$wpdb->posts}.ID IN (\"" . implode( '","', $post__in ) . "\")";
|
2243 |
-
}
|
2244 |
-
if( $has_new_function ) {
|
2245 |
-
$author = $WC_Query_get_main_query->get('author');
|
2246 |
-
if( empty($author) ) {
|
2247 |
-
$author = false;
|
2248 |
-
}
|
2249 |
-
if( $author != false ) {
|
2250 |
-
$query['where'] .= " AND {$wpdb->posts}.post_author IN ({$author})";
|
2251 |
-
}
|
2252 |
-
}
|
2253 |
-
|
2254 |
-
/*if( function_exists('wc_get_product_visibility_term_ids') ) {
|
2255 |
-
$product_visibility_term_ids = wc_get_product_visibility_term_ids();
|
2256 |
-
$query[ 'where' ] .= " AND ( {$wpdb->posts}.ID NOT IN (SELECT object_id FROM {$wpdb->term_relationships} WHERE term_taxonomy_id='" . $product_visibility_term_ids[ 'exclude-from-catalog' ] . "') ) ";
|
2257 |
-
}*/
|
2258 |
-
|
2259 |
-
$query[ 'where' ] .= $old_join_posts;
|
2260 |
-
//$query['group_by'] = "GROUP BY {$wpdb->posts}.ID";
|
2261 |
-
$query = apply_filters( 'woocommerce_get_filtered_term_product_counts_query', $query );
|
2262 |
-
|
2263 |
-
return $query;
|
2264 |
-
}
|
2265 |
-
}
|
2266 |
-
|
2267 |
-
if( ! function_exists('berocket_add_filter_to_link') ) {
|
2268 |
-
add_filter( 'berocket_add_filter_to_link', 'berocket_add_filter_to_link', 100, 2 );
|
2269 |
-
function berocket_add_filter_to_link( $current_url = false, $args = array() ) {
|
2270 |
-
$args = array_merge( array(
|
2271 |
-
'attribute' => '',
|
2272 |
-
'values' => array(),
|
2273 |
-
'operator' => 'OR',
|
2274 |
-
'remove_attribute' => false,
|
2275 |
-
'slider' => false
|
2276 |
-
), $args );
|
2277 |
-
|
2278 |
-
extract( $args );
|
2279 |
-
|
2280 |
-
if ( ! is_array( $values ) ) {
|
2281 |
-
$values = array( $values );
|
2282 |
-
}
|
2283 |
-
|
2284 |
-
$options = BeRocket_AAPF::get_aapf_option();
|
2285 |
-
|
2286 |
-
if ( $current_url === false ) {
|
2287 |
-
$current_url = "//" . $_SERVER[ 'HTTP_HOST' ] . $_SERVER[ 'REQUEST_URI' ];
|
2288 |
-
$filters = ( empty( $_GET[ 'filters' ] ) ? '' : $_GET[ 'filters' ] );
|
2289 |
-
} else {
|
2290 |
-
parse_str( parse_url( $current_url, PHP_URL_QUERY ), $filters );
|
2291 |
-
$filters = br_get_value_from_array( $filters, 'filters' );
|
2292 |
-
}
|
2293 |
-
|
2294 |
-
$current_url = remove_query_arg( 'filters', $current_url );
|
2295 |
-
if ( strpos( $current_url, '?' ) === false ) {
|
2296 |
-
$url_string = $current_url;
|
2297 |
-
$query_string = '';
|
2298 |
-
} else {
|
2299 |
-
list( $url_string, $query_string ) = explode( '?', $current_url );
|
2300 |
-
}
|
2301 |
-
|
2302 |
-
list( $url_string, $query_string, $filters ) = apply_filters( 'berocket_add_filter_to_link_explode', array(
|
2303 |
-
$url_string,
|
2304 |
-
$query_string,
|
2305 |
-
$filters
|
2306 |
-
), $current_url );
|
2307 |
-
|
2308 |
-
if ( empty( $options[ 'seo_uri_decode' ] ) ) {
|
2309 |
-
$filters = urlencode( $filters );
|
2310 |
-
$filters = str_replace( '+', urlencode( '+' ), $filters );
|
2311 |
-
$filters = urldecode( $filters );
|
2312 |
-
}
|
2313 |
-
|
2314 |
-
if ( substr( $attribute, 0, 3 ) == 'pa_' ) {
|
2315 |
-
$attribute = substr( $attribute, 3 );
|
2316 |
-
}
|
2317 |
-
$strip_symbols = apply_filters('brapf_TEMP_generate_url_strip_symbols', array('filters' => '|', 'before_val' => '[', 'after_val' => ']'));
|
2318 |
-
$regex = '#(([^'.preg_quote($strip_symbols['filters']).']+?)'.preg_quote($strip_symbols['before_val']).'(.+?)'.preg_quote($strip_symbols['after_val']).')'.preg_quote($strip_symbols['filters']).'#';
|
2319 |
-
|
2320 |
-
if ( strpos( $strip_symbols['filters'] . $filters, $strip_symbols['filters'] . $attribute . $strip_symbols['before_val'] ) === false ) {
|
2321 |
-
$filters = (( empty( $filters ) ? '' : $filters . $strip_symbols['filters'] ) . $attribute . $strip_symbols['before_val'] . implode( ( $slider ? '_' : ( $operator == 'OR' ? '-' : '+' ) ), $values ) . $strip_symbols['after_val']);
|
2322 |
-
preg_match_all( $regex, $filters.$strip_symbols['filters'], $matches );
|
2323 |
-
$filter_array = apply_filters('brapf_TEMP_generate_url_explode_filters', $matches[1], $filters);
|
2324 |
-
} else {
|
2325 |
-
preg_match_all( $regex, $filters.$strip_symbols['filters'], $matches );
|
2326 |
-
$filter_array = apply_filters('brapf_TEMP_generate_url_explode_filters', $matches[1], $filters);
|
2327 |
-
global $br_url_parser_middle_result;
|
2328 |
-
|
2329 |
-
foreach ( $filter_array as $filter_str_i => $filter_str ) {
|
2330 |
-
if ( strpos( $filter_str, $attribute . $strip_symbols['before_val'] ) !== false ) {
|
2331 |
-
$filter_str = str_replace(array($attribute.$strip_symbols['before_val'], $strip_symbols['after_val']), array('', ''), $filter_str);
|
2332 |
-
if ( $slider ) {
|
2333 |
-
$implode = '_';
|
2334 |
-
$filter_str = '';
|
2335 |
-
} elseif ( $attribute == 'price' ) {
|
2336 |
-
$implode = '-';
|
2337 |
-
$filter_str = '';
|
2338 |
-
} elseif ( strpos( $filter_str, '+' ) !== false ) {
|
2339 |
-
$implode = '+';
|
2340 |
-
} elseif ( strpos( $filter_str, '-' ) !== false ) {
|
2341 |
-
$implode = '-';
|
2342 |
-
} elseif ( strpos( $filter_str, '_' ) !== false ) {
|
2343 |
-
$implode = ( $operator == 'OR' ? '-' : '+' );
|
2344 |
-
$filter_str = '';
|
2345 |
-
} else {
|
2346 |
-
$implode = ( $operator == 'OR' ? '-' : '+' );
|
2347 |
-
}
|
2348 |
-
|
2349 |
-
$filter_values = $br_url_parser_middle_result[$attribute];
|
2350 |
-
if ( ! empty( $filter_str ) and ! $filter_values ) {
|
2351 |
-
$filter_values = explode( $implode, $filter_str );
|
2352 |
-
}
|
2353 |
-
|
2354 |
-
foreach ( $values as $value ) {
|
2355 |
-
if ( ( $search_i = array_search( $value, $filter_values ) ) === false ) {
|
2356 |
-
if ( $remove_attribute ) {
|
2357 |
-
$filter_values = array( $value );
|
2358 |
-
} else {
|
2359 |
-
$filter_values[] = $value;
|
2360 |
-
}
|
2361 |
-
} else {
|
2362 |
-
unset( $filter_values[ $search_i ] );
|
2363 |
-
}
|
2364 |
-
}
|
2365 |
-
|
2366 |
-
if ( count( $filter_values ) ) {
|
2367 |
-
$filter_str = $attribute . $strip_symbols['before_val'] . implode( $implode, $filter_values ) . $strip_symbols['after_val'];
|
2368 |
-
$filter_array[ $filter_str_i ] = $filter_str;
|
2369 |
-
} elseif(is_array($filter_array) && isset($filter_array[ $filter_str_i ])) {
|
2370 |
-
unset( $filter_array[ $filter_str_i ] );
|
2371 |
-
}
|
2372 |
-
|
2373 |
-
break;
|
2374 |
-
}
|
2375 |
-
}
|
2376 |
-
}
|
2377 |
-
|
2378 |
-
list( $filter_array, $strip_symbols['filters'] ) = apply_filters( 'berocket_add_filter_to_link_filters_str', array(
|
2379 |
-
$filter_array,
|
2380 |
-
$strip_symbols['filters']
|
2381 |
-
) );
|
2382 |
-
|
2383 |
-
$filters = implode( $strip_symbols['filters'], $filter_array );
|
2384 |
-
list( $url_string, $query_string, $filters ) = apply_filters( 'berocket_add_filter_to_link_implode', array(
|
2385 |
-
$url_string,
|
2386 |
-
$query_string,
|
2387 |
-
$filters
|
2388 |
-
) );
|
2389 |
-
|
2390 |
-
if ( ! empty( $query_string ) ) {
|
2391 |
-
$url_string .= '?' . $query_string;
|
2392 |
-
}
|
2393 |
-
|
2394 |
-
if ( ! empty( $filters ) ) {
|
2395 |
-
$url_string = add_query_arg( 'filters', $filters, $url_string );
|
2396 |
-
}
|
2397 |
-
return $url_string;
|
2398 |
-
}
|
2399 |
-
}
|
2400 |
-
|
2401 |
if( ! function_exists('berocket_filter_query_vars_hook') ) {
|
2402 |
function berocket_filter_query_vars_hook($query_vars) {
|
2403 |
-
$
|
2404 |
-
$query_vars = $BeRocket_AAPF->woocommerce_filter_query_vars($query_vars);
|
2405 |
return $query_vars;
|
2406 |
}
|
2407 |
}
|
118 |
*
|
119 |
* @return bool
|
120 |
*/
|
121 |
+
function br_is_filtered(){
|
122 |
$filtered = false;
|
123 |
+
global $berocket_parse_page_obj;
|
124 |
+
$data = $berocket_parse_page_obj->get_current();
|
125 |
+
if( ! empty($data) && ! empty($data['filters']) && count($data['filters']) > 0 ) {
|
126 |
+
$filtered = true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
127 |
}
|
128 |
return $filtered;
|
129 |
}
|
174 |
*/
|
175 |
function br_is_term_selected( $term, $checked = FALSE, $child_parent = FALSE, $depth = 0 ) {
|
176 |
//TODO: Notice: Trying to get property 'taxonomy' of non-object
|
177 |
+
$term_taxonomy = apply_filters('br_is_term_selected_taxonomy', $term->taxonomy, $term);
|
178 |
if( $term_taxonomy == '_rating' ) {
|
179 |
$term_taxonomy = 'product_visibility';
|
180 |
}
|
181 |
$is_checked = false;
|
182 |
|
183 |
+
global $berocket_parse_page_obj;
|
184 |
+
$filter_data = $berocket_parse_page_obj->get_current();
|
185 |
+
if ( $child_parent ) {
|
186 |
+
$selected_terms = br_get_selected_term( $term_taxonomy );
|
187 |
+
foreach( $selected_terms as $selected_term ) {
|
188 |
+
$ancestors = get_ancestors( $selected_term, $term_taxonomy );
|
189 |
+
if( count( $ancestors ) > $depth ) {
|
190 |
+
if ( $ancestors[count($ancestors) - ( $depth + 1 )] == $term->term_id ) {
|
191 |
+
$is_checked = true;
|
192 |
}
|
193 |
}
|
194 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
195 |
}
|
196 |
+
if( isset($filter_data['filters']) && is_array($filter_data['filters']) ) {
|
197 |
+
foreach($filter_data['filters'] as $filter) {
|
198 |
+
if( $is_checked || ($filter['taxonomy'] == $term_taxonomy && in_array($term->term_id, $filter['val_ids'])) ) {
|
|
|
199 |
if($checked) return ' checked="checked"';
|
200 |
else return ' selected="selected"';
|
201 |
}
|
214 |
* @return array selected terms
|
215 |
*/
|
216 |
function br_get_selected_term( $taxonomy ) {
|
217 |
+
global $berocket_parse_page_obj;
|
218 |
+
$filter_data = $berocket_parse_page_obj->get_current();
|
219 |
$term_ids = array();
|
220 |
+
if( isset($filter_data['filters']) && is_array($filter_data['filters']) ) {
|
221 |
+
foreach($filter_data['filters'] as $filter) {
|
222 |
+
if($filter['taxonomy'] == $taxonomy) {
|
223 |
+
$term_ids = array_merge($term_ids, $filter['val_ids']);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
224 |
}
|
225 |
}
|
226 |
}
|
308 |
}
|
309 |
}
|
310 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
311 |
function br_widget_is_hide( $attribute, $widget_is_hide = false ) {
|
312 |
if ( $widget_is_hide ) {
|
313 |
+
if( $attribute == '_rating' ) {
|
314 |
+
$attribute = 'product_visibility';
|
|
|
|
|
|
|
|
|
315 |
}
|
316 |
+
global $berocket_parse_page_obj;
|
317 |
+
$filter_data = $berocket_parse_page_obj->get_current();
|
318 |
+
$term_ids = array();
|
319 |
+
if( isset($filter_data['filters']) && is_array($filter_data['filters']) ) {
|
320 |
+
foreach($filter_data['filters'] as $filter) {
|
321 |
+
if($filter['taxonomy'] == $attribute || $filter['attr'] == $attribute) {
|
322 |
return false;
|
323 |
}
|
324 |
}
|
325 |
}
|
|
|
|
|
|
|
326 |
}
|
327 |
|
328 |
return $widget_is_hide;
|
1250 |
}
|
1251 |
}
|
1252 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1253 |
|
1254 |
if ( ! function_exists( 'br_get_category_id' ) ) {
|
1255 |
/**
|
1370 |
}
|
1371 |
}
|
1372 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1373 |
if ( ! function_exists( 'br_get_cat_hierarchy' ) ) {
|
1374 |
/**
|
1375 |
* Public function to get terms by id and taxonomy
|
1392 |
}
|
1393 |
}
|
1394 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1395 |
if( ! function_exists('berocket_filter_query_vars_hook') ) {
|
1396 |
function berocket_filter_query_vars_hook($query_vars) {
|
1397 |
+
$query_vars = apply_filters('bapf_uparse_apply_filters_to_query_vars_save', $query_vars);
|
|
|
1398 |
return $query_vars;
|
1399 |
}
|
1400 |
}
|
includes/shortcode_apply_filters.php
ADDED
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if( ! class_exists('BeRocket_AAPF_shortcode_apply_filters') ) {
|
3 |
+
class BeRocket_AAPF_shortcode_apply_filters {
|
4 |
+
function __construct() {
|
5 |
+
add_shortcode( 'brapf_next_shortcode_apply', array( $this, 'shortcode_apply' ) );
|
6 |
+
}
|
7 |
+
public function shortcode_apply( $atts = array() ) {
|
8 |
+
if( ! is_array($atts) ) $atts = array();
|
9 |
+
$atts = array_merge(array('apply' => true), $atts);
|
10 |
+
$this->remove_all();
|
11 |
+
if( $atts['apply'] === 'false') $atts['apply'] = false;
|
12 |
+
if($atts['apply'] !== 'default') {
|
13 |
+
$atts['apply'] = (bool) $atts['apply'];
|
14 |
+
if( $atts['apply'] ) {
|
15 |
+
$this->add_apply_filter();
|
16 |
+
} else {
|
17 |
+
$this->add_not_apply_filter();
|
18 |
+
}
|
19 |
+
}
|
20 |
+
}
|
21 |
+
public function apply_filter_to_shortcode($enable) {
|
22 |
+
$this->remove_all();
|
23 |
+
return true;
|
24 |
+
}
|
25 |
+
public function not_apply_filter_to_shortcode($enable) {
|
26 |
+
$this->remove_all();
|
27 |
+
return false;
|
28 |
+
}
|
29 |
+
public function is_query_product($post_type) {
|
30 |
+
if( is_array($post_type) && count($post_type) > 1 ) {
|
31 |
+
return false;
|
32 |
+
} elseif(is_array($post_type)) {
|
33 |
+
return array_pop($post_type) == 'product';
|
34 |
+
} else {
|
35 |
+
return $post_type == 'product';
|
36 |
+
}
|
37 |
+
}
|
38 |
+
public function apply_filter_to_query($query) {
|
39 |
+
$post_type = $query->get('post_type');
|
40 |
+
if( ! $this->is_query_product($post_type) ) return;
|
41 |
+
$this->remove_all();
|
42 |
+
$query->set('bapf_apply', true);
|
43 |
+
}
|
44 |
+
public function not_apply_filter_to_query($query) {
|
45 |
+
$post_type = $query->get('post_type');
|
46 |
+
if( ! $this->is_query_product($post_type) ) return;
|
47 |
+
$this->remove_all();
|
48 |
+
$query->set('bapf_apply', false);
|
49 |
+
}
|
50 |
+
public function add_apply_filter() {
|
51 |
+
add_filter('berocket_aapf_wcshortcode_is_filtering', array($this, 'apply_filter_to_shortcode'));
|
52 |
+
add_filter('pre_get_posts', array($this, 'apply_filter_to_query'));
|
53 |
+
}
|
54 |
+
public function add_not_apply_filter() {
|
55 |
+
add_filter('berocket_aapf_wcshortcode_is_filtering', array($this, 'not_apply_filter_to_shortcode'));
|
56 |
+
add_filter('pre_get_posts', array($this, 'not_apply_filter_to_query'));
|
57 |
+
}
|
58 |
+
public function remove_all() {
|
59 |
+
remove_filter('berocket_aapf_wcshortcode_is_filtering', array($this, 'apply_filter_to_shortcode'));
|
60 |
+
remove_filter('berocket_aapf_wcshortcode_is_filtering', array($this, 'not_apply_filter_to_shortcode'));
|
61 |
+
remove_filter('pre_get_posts', array($this, 'apply_filter_to_query'));
|
62 |
+
remove_filter('pre_get_posts', array($this, 'not_apply_filter_to_query'));
|
63 |
+
}
|
64 |
+
}
|
65 |
+
new BeRocket_AAPF_shortcode_apply_filters();
|
66 |
+
}
|
includes/url-parse.php
ADDED
@@ -0,0 +1,1267 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if( ! class_exists('BeRocket_url_parse_page') ) {
|
3 |
+
class BeRocket_url_parse_page {
|
4 |
+
public $data = false;
|
5 |
+
public $data_current = false;
|
6 |
+
public $taxonomies = false;
|
7 |
+
public $main_class = false;
|
8 |
+
public $taxonomy_md5 = false;
|
9 |
+
public $query_vars = array();
|
10 |
+
function __construct() {
|
11 |
+
global $berocket_selected_filters, $berocket_parse_page_obj;
|
12 |
+
add_action('bapf_class_ready', array($this, 'init'), 10, 1);
|
13 |
+
$berocket_parse_page_obj = $this;
|
14 |
+
foreach (glob(__DIR__ . "/url-parse/*.php") as $filename)
|
15 |
+
{
|
16 |
+
include_once($filename);
|
17 |
+
}
|
18 |
+
add_action('woocommerce_product_query', array($this, 'woocommerce_product_query'), 99999999, 1);
|
19 |
+
add_filter('woocommerce_shortcode_products_query', array( $this, 'woocommerce_shortcode_products_query' ), 10, 3);
|
20 |
+
add_filter('woocommerce_shortcode_products_query', array( $this, 'woocommerce_shortcode_products_query_save_query_late' ), 9000000, 3);
|
21 |
+
add_filter('bapf_uparse_apply_filters_to_query_vars', array( $this, 'query_vars_apply_filters' ), 10, 1);
|
22 |
+
add_filter('bapf_uparse_apply_filters_to_query_vars_save', array( $this, 'query_vars_apply_filters_save' ), 10, 1);
|
23 |
+
add_action('pre_get_posts', array($this, 'add_tax_query'), 90000000, 1);
|
24 |
+
add_action('pre_get_posts', array($this, 'add_meta_query'), 90000001, 1);
|
25 |
+
add_action('pre_get_posts', array($this, 'add_post_in'), 90000002, 1);
|
26 |
+
add_action('pre_get_posts', array($this, 'add_post_not_in'), 90000003, 1);
|
27 |
+
add_action('pre_get_posts', array($this, 'add_custom_query_line'), 90000004, 1);
|
28 |
+
add_action('pre_get_posts', array($this, 'add_custom_args'), 90000005, 1);
|
29 |
+
add_action('pre_get_posts', array($this, 'add_additional_args'), 90000010, 1);
|
30 |
+
add_action('posts_clauses', array($this, 'add_custom_query'), 90000000, 2);
|
31 |
+
add_filter('berocket_posts_clauses_recount', array($this, 'add_custom_query_without_check'), 90000000, 1);
|
32 |
+
}
|
33 |
+
public function init($BeRocket_AAPF) {
|
34 |
+
$this->main_class = $BeRocket_AAPF;
|
35 |
+
}
|
36 |
+
function get_taxonomy_md5() {
|
37 |
+
if( empty($this->taxonomy_md5) ) {
|
38 |
+
global $wpdb;
|
39 |
+
$totalmd5 = '';
|
40 |
+
$i = 0;
|
41 |
+
do {
|
42 |
+
$wpdb->query("SET SESSION group_concat_max_len = 1000000");
|
43 |
+
$md5 = $wpdb->get_var("SELECT MD5(GROUP_CONCAT(slug+term_id)) FROM $wpdb->terms LIMIT ".(20000*$i).', '.(20000*($i+1)) );
|
44 |
+
$totalmd5 .= $md5;
|
45 |
+
$i++;
|
46 |
+
} while(! empty($md5));
|
47 |
+
$this->taxonomy_md5 = $totalmd5;
|
48 |
+
}
|
49 |
+
return $this->taxonomy_md5;
|
50 |
+
}
|
51 |
+
public function woocommerce_product_query($query) {
|
52 |
+
$bapf_apply = $query->get('bapf_apply', false);
|
53 |
+
if( empty($bapf_apply) ) {
|
54 |
+
$query->set('bapf_apply', true);
|
55 |
+
$query_vars = $query->query_vars;
|
56 |
+
$tax_query_wc_main = WC_Query::get_main_tax_query();
|
57 |
+
if( ! empty($tax_query_wc_main) ) {
|
58 |
+
if( ! empty($query_vars['tax_query']) && is_array($query_vars['tax_query']) ) {
|
59 |
+
$tax_query_wc_main = array_merge($tax_query_wc_main, $query_vars['tax_query']);
|
60 |
+
}
|
61 |
+
$query_vars['tax_query'] = $tax_query_wc_main;
|
62 |
+
}
|
63 |
+
$meta_query_wc_main = WC_Query::get_main_meta_query();
|
64 |
+
if( ! empty($meta_query_wc_main) ) {
|
65 |
+
if( ! empty($query_vars['meta_query']) && is_array($query_vars['meta_query']) ) {
|
66 |
+
$meta_query_wc_main = array_merge($meta_query_wc_main, $query_vars['meta_query']);
|
67 |
+
}
|
68 |
+
$query_vars['meta_query'] = $meta_query_wc_main;
|
69 |
+
}
|
70 |
+
$this->query_vars = $query_vars;
|
71 |
+
}
|
72 |
+
}
|
73 |
+
public function woocommerce_shortcode_products_query($query_vars, $atts = array(), $name = 'products') {
|
74 |
+
if( isset($atts['berocket_aapf']) && $atts['berocket_aapf'] === false ) {
|
75 |
+
return $query_vars;
|
76 |
+
}
|
77 |
+
if( apply_filters('berocket_aapf_wcshortcode_is_filtering', ( (! is_shop() && ! is_product_taxonomy() && ! is_product_category() && ! is_product_tag()) || ! empty($atts['berocket_aapf']) ), $query_vars, $atts, $name ) ) {
|
78 |
+
$query_vars['bapf_apply'] = true;
|
79 |
+
$this->query_vars = $query_vars;
|
80 |
+
$query_vars = $this->query_vars_apply_filters($query_vars);
|
81 |
+
}
|
82 |
+
return $query_vars;
|
83 |
+
}
|
84 |
+
public function woocommerce_shortcode_products_query_save_query_late( $query_vars, $atts = array(), $name = 'products' ) {
|
85 |
+
if( ! empty($query_vars['bapf_apply']) ) {
|
86 |
+
$this->save_shortcode_query_vars($query_vars);
|
87 |
+
}
|
88 |
+
return $query_vars;
|
89 |
+
}
|
90 |
+
public function save_shortcode_query_vars($query_vars) {
|
91 |
+
$br_query_vars = $query_vars;
|
92 |
+
if( ! empty($br_query_vars['tax_query']) && is_array($br_query_vars['tax_query']) ) {
|
93 |
+
foreach($br_query_vars['tax_query'] as $i => $tax_query_val) {
|
94 |
+
if( ! empty($tax_query_val['taxonomy']) ) {
|
95 |
+
$br_query_vars['tax_query'][$i] = array(
|
96 |
+
$tax_query_val,
|
97 |
+
);
|
98 |
+
}
|
99 |
+
}
|
100 |
+
}
|
101 |
+
global $br_wc_query, $br_aapf_wc_footer_widget;
|
102 |
+
$br_query_vars['fields'] = 'ids';
|
103 |
+
$br_wc_query = $br_query_vars;
|
104 |
+
$br_aapf_wc_footer_widget = true;
|
105 |
+
add_action( 'wp_footer', array( $this, 'wp_footer_widget'), 99999 );
|
106 |
+
}
|
107 |
+
public function wp_footer_widget() {
|
108 |
+
global $br_widget_ids;
|
109 |
+
if( isset( $br_widget_ids ) && is_array( $br_widget_ids ) && count( $br_widget_ids ) > 0 ) {
|
110 |
+
echo '<div class="berocket_wc_shortcode_fix" style="display: none;">';
|
111 |
+
foreach ( $br_widget_ids as $widget ) {
|
112 |
+
$widget['instance']['br_wp_footer'] = true;
|
113 |
+
the_widget( 'BeRocket_new_AAPF_Widget_single', $widget['instance'], $widget['args']);
|
114 |
+
}
|
115 |
+
echo '</div>';
|
116 |
+
}
|
117 |
+
}
|
118 |
+
public function query_vars_apply_filters($query_vars) {
|
119 |
+
$args = $this->query_vars_tax_query($query_vars);
|
120 |
+
$this->args_apply_to_query_vars($query_vars, $args);
|
121 |
+
$args = $this->query_vars_meta_query($query_vars);
|
122 |
+
$this->args_apply_to_query_vars($query_vars, $args);
|
123 |
+
$args = $this->query_vars_post_in($query_vars);
|
124 |
+
$this->args_apply_to_query_vars($query_vars, $args);
|
125 |
+
$args = $this->query_vars_post_not_in($query_vars);
|
126 |
+
$this->args_apply_to_query_vars($query_vars, $args);
|
127 |
+
$args = $this->query_custom_query_line($query_vars);
|
128 |
+
$this->args_apply_to_query_vars($query_vars, $args);
|
129 |
+
$args_list = $this->query_custom_args($query_vars);
|
130 |
+
foreach($args_list as $args) {
|
131 |
+
$this->args_apply_to_query_vars($query_vars, $args);
|
132 |
+
}
|
133 |
+
$args = apply_filters( 'bapf_uparse_query_vars_apply_filters', array(), $query_vars, $this->get_current() );
|
134 |
+
$this->args_apply_to_query_vars($query_vars, $args);
|
135 |
+
do_action('bapf_uparse_query_vars_ready', $query_vars);
|
136 |
+
return $query_vars;
|
137 |
+
}
|
138 |
+
public function query_vars_apply_filters_save($query_vars) {
|
139 |
+
$query_vars = $this->query_vars_apply_filters($query_vars);
|
140 |
+
return $query_vars;
|
141 |
+
}
|
142 |
+
private function query_vars_tax_query($query_vars) {
|
143 |
+
if( ! empty($query_vars['bapf_tax_applied']) ) return array();
|
144 |
+
$data = $this->get_current();
|
145 |
+
$args = array();
|
146 |
+
if( ! empty($data['tax_query']) ) {
|
147 |
+
if( ! empty($query_vars['tax_query']) && is_array($query_vars['tax_query']) ) {
|
148 |
+
$tax_query = array_merge($query_vars['tax_query'], $data['tax_query']);
|
149 |
+
} else {
|
150 |
+
$tax_query = $data['tax_query'];
|
151 |
+
}
|
152 |
+
$args['tax_query'] = $tax_query;
|
153 |
+
}
|
154 |
+
$args['bapf_tax_applied'] = true;
|
155 |
+
return $args;
|
156 |
+
}
|
157 |
+
private function query_vars_meta_query($query_vars) {
|
158 |
+
if( ! empty($query_vars['bapf_meta_applied']) ) return array();
|
159 |
+
$data = $this->get_current();
|
160 |
+
$args = array();
|
161 |
+
if( ! empty($data['meta_query']) ) {
|
162 |
+
if( ! empty($query_vars['meta_query']) && is_array($query_vars['meta_query']) ) {
|
163 |
+
$meta_query = array_merge($query_vars['meta_query'], $data['meta_query']);
|
164 |
+
} else {
|
165 |
+
$meta_query = $data['meta_query'];
|
166 |
+
}
|
167 |
+
$args['meta_query'] = $meta_query;
|
168 |
+
}
|
169 |
+
$args['bapf_meta_applied'] = true;
|
170 |
+
return $args;
|
171 |
+
}
|
172 |
+
private function query_vars_post_in($query_vars) {
|
173 |
+
if( ! empty($query_vars['bapf_postin_applied']) ) return array();
|
174 |
+
$data = $this->get_current();
|
175 |
+
$args = array();
|
176 |
+
if( ! empty($data['posts_in']) && is_array($data['posts_in']) && count($data['posts_in']) > 0 ) {
|
177 |
+
$args[ 'post__in' ] = $data['posts_in'];
|
178 |
+
if( ! empty($query_vars[ 'post__in' ]) ) {
|
179 |
+
$args[ 'post__in' ] = array_merge($query_vars[ 'post__in' ], $args[ 'post__in' ]);
|
180 |
+
}
|
181 |
+
}
|
182 |
+
$args['bapf_postin_applied'] = true;
|
183 |
+
return $args;
|
184 |
+
}
|
185 |
+
private function query_vars_post_not_in($query_vars) {
|
186 |
+
if( ! empty($query_vars['bapf_postnotin_applied']) ) return array();
|
187 |
+
$data = $this->get_current();
|
188 |
+
$args = array();
|
189 |
+
if( ! empty($data['posts_not_in']) && is_array($data['posts_not_in']) && count($data['posts_not_in']) > 0 ) {
|
190 |
+
$args[ 'post__not_in' ] = $data['posts_not_in'];
|
191 |
+
if( ! empty($query_vars['post__in']) && is_array($query_vars['post__in']) ) {
|
192 |
+
$args[ 'post__in' ] = array_diff($query_vars['post__in'], $args['post__not_in']);
|
193 |
+
}
|
194 |
+
if( ! empty($query_vars[ 'post__not_in' ]) ) {
|
195 |
+
$args[ 'post__not_in' ] = array_merge($query_vars[ 'post__not_in' ], $args[ 'post__not_in' ]);
|
196 |
+
}
|
197 |
+
}
|
198 |
+
$args['bapf_postnotin_applied'] = true;
|
199 |
+
return $args;
|
200 |
+
}
|
201 |
+
private function query_custom_query_line($query_vars) {
|
202 |
+
if( ! empty($query_vars['custom_query_line']) ) return array();
|
203 |
+
$data = $this->get_current();
|
204 |
+
$args = array();
|
205 |
+
$custom_query_lines = array();
|
206 |
+
foreach($data['filters'] as $filter) {
|
207 |
+
if( ! empty($filter['custom_query_line']) ) {
|
208 |
+
$custom_query_lines[] = $filter['custom_query_line'];
|
209 |
+
}
|
210 |
+
}
|
211 |
+
if( count($custom_query_lines) > 0 ) {
|
212 |
+
$args['custom_query_line'] = implode(';', $custom_query_lines);
|
213 |
+
}
|
214 |
+
return $args;
|
215 |
+
}
|
216 |
+
private function query_custom_args($query_vars) {
|
217 |
+
if( ! empty($query_vars['bapf_customargs_applied']) ) return array();
|
218 |
+
$data = $this->get_current();
|
219 |
+
$args_list = array();
|
220 |
+
$custom_query_lines = array();
|
221 |
+
foreach($data['filters'] as $filter) {
|
222 |
+
$result = apply_filters('bapf_uparse_query_custom_args_each', null, $this, $filter, $query_vars);
|
223 |
+
if( $result !== null ) {
|
224 |
+
$args_list[] = $result;
|
225 |
+
}
|
226 |
+
}
|
227 |
+
$args['bapf_customargs_applied'] = true;
|
228 |
+
return $args_list;
|
229 |
+
}
|
230 |
+
private function args_apply_to_query(&$query, $args) {
|
231 |
+
if( is_array($args) ) {
|
232 |
+
foreach($args as $name => $value) {
|
233 |
+
$query->set($name, $value);
|
234 |
+
}
|
235 |
+
}
|
236 |
+
}
|
237 |
+
private function args_apply_to_query_vars(&$query_vars, $args) {
|
238 |
+
if( is_array($args) ) {
|
239 |
+
foreach($args as $name => $value) {
|
240 |
+
$query_vars[$name] = $value;
|
241 |
+
}
|
242 |
+
}
|
243 |
+
}
|
244 |
+
public function add_tax_query($query) {
|
245 |
+
if( empty($query->query_vars['bapf_apply']) ) return;
|
246 |
+
$args = $this->query_vars_tax_query($query->query_vars);
|
247 |
+
$this->args_apply_to_query($query, $args);
|
248 |
+
}
|
249 |
+
public function add_meta_query($query) {
|
250 |
+
if( empty($query->query_vars['bapf_apply']) ) return;
|
251 |
+
$args = $this->query_vars_meta_query($query->query_vars);
|
252 |
+
$this->args_apply_to_query($query, $args);
|
253 |
+
}
|
254 |
+
public function add_post_in($query) {
|
255 |
+
if( empty($query->query_vars['bapf_apply']) ) return;
|
256 |
+
$args = $this->query_vars_post_in($query->query_vars);
|
257 |
+
$this->args_apply_to_query($query, $args);
|
258 |
+
}
|
259 |
+
public function add_post_not_in($query) {
|
260 |
+
if( empty($query->query_vars['bapf_apply']) ) return;
|
261 |
+
$args = $this->query_vars_post_not_in($query->query_vars);
|
262 |
+
$this->args_apply_to_query($query, $args);
|
263 |
+
}
|
264 |
+
public function add_custom_query_line($query) {
|
265 |
+
if( empty($query->query_vars['bapf_apply']) ) return;
|
266 |
+
$args = $this->query_custom_query_line($query->query_vars);
|
267 |
+
$this->args_apply_to_query($query, $args);
|
268 |
+
}
|
269 |
+
public function add_custom_args($query) {
|
270 |
+
if( empty($query->query_vars['bapf_apply']) ) return;
|
271 |
+
$args_list = $this->query_custom_args($query->query_vars);
|
272 |
+
foreach($args_list as $args) {
|
273 |
+
$this->args_apply_to_query($query, $args);
|
274 |
+
}
|
275 |
+
}
|
276 |
+
public function add_custom_query($args, $query) {
|
277 |
+
if( empty($query->query_vars['bapf_apply']) ) return $args;
|
278 |
+
return $this->add_custom_query_without_check($args);
|
279 |
+
}
|
280 |
+
public function add_additional_args($query) {
|
281 |
+
if( empty($query->query_vars['bapf_apply']) ) return;
|
282 |
+
$args = apply_filters( 'bapf_uparse_query_vars_apply_filters', array(), $query->query_vars, $this->get_current() );
|
283 |
+
$this->args_apply_to_query($query, $args);
|
284 |
+
do_action('bapf_uparse_query_vars_ready', $query->query_vars);
|
285 |
+
}
|
286 |
+
public function add_custom_query_without_check($args) {
|
287 |
+
$data = $this->get_current();
|
288 |
+
if( ! empty($data['filters']) && is_array($data['filters']) ) {
|
289 |
+
foreach($data['filters'] as $filter) {
|
290 |
+
if( ! empty($filter['custom_query']) ) {
|
291 |
+
$args = call_user_func($filter['custom_query'], $args, $filter);
|
292 |
+
}
|
293 |
+
}
|
294 |
+
}
|
295 |
+
return $args;
|
296 |
+
}
|
297 |
+
public function get_current() {
|
298 |
+
$data = apply_filters('bapf_uparse_get_current', null, $this);
|
299 |
+
if( $data !== null ) {
|
300 |
+
return $data;
|
301 |
+
}
|
302 |
+
if( $this->data_current === false ) {
|
303 |
+
$this->data_current = $this->parse_line(false);
|
304 |
+
}
|
305 |
+
if( $this->data === false ) {
|
306 |
+
$this->data = $this->data_current;
|
307 |
+
}
|
308 |
+
return apply_filters('bapf_uparse_get_current_modify', $this->data, $this);
|
309 |
+
}
|
310 |
+
public function data_check($data = false) {
|
311 |
+
if( $data === false ) {
|
312 |
+
return $this->get_current();
|
313 |
+
}
|
314 |
+
foreach($data['filters'] as &$filter) {
|
315 |
+
$datafix = 5;
|
316 |
+
if( ! isset($filter['val_arr']) ) {
|
317 |
+
$datafix = 1;
|
318 |
+
} elseif( ! isset($filter['terms']) ) {
|
319 |
+
$datafix = 2;
|
320 |
+
} elseif( ! isset($filter['used']) ) {
|
321 |
+
$datafix = 3;
|
322 |
+
}
|
323 |
+
switch($datafix) {
|
324 |
+
case 1:
|
325 |
+
$filter = $this->parse_filter_values_each($filter, $data);
|
326 |
+
case 2:
|
327 |
+
$filter = $this->add_terms_to_data_each($filter, $data);
|
328 |
+
case 3:
|
329 |
+
$filter = $this->data_set_filter_used($filter, $data);
|
330 |
+
}
|
331 |
+
}
|
332 |
+
$data = $this->data_generate_global_filtering($data);
|
333 |
+
return $data;
|
334 |
+
}
|
335 |
+
private function data_set_filter_used($filter, $data) {
|
336 |
+
$filter = $this->generate_tax_query_each($filter, $data);
|
337 |
+
if( ! empty($filter['tax_query']) ) {
|
338 |
+
$filter['used'] = 'tax_query';
|
339 |
+
} else {
|
340 |
+
$filter = $this->generate_meta_query_each($filter, $data);
|
341 |
+
if( ! empty($filter['meta_query']) ) {
|
342 |
+
$filter['used'] = 'meta_query';
|
343 |
+
} else {
|
344 |
+
$filter = $this->generate_posts_in_each($filter, $data);
|
345 |
+
if( ! empty($filter['posts_in']) && is_array($filter['posts_in']) ) {
|
346 |
+
$filter['used'] = 'posts_in';
|
347 |
+
} else {
|
348 |
+
$filter = $this->generate_posts_not_in_each($filter, $data);
|
349 |
+
if( ! empty($filter['posts_not_in']) && is_array($filter['posts_not_in']) ) {
|
350 |
+
$filter['used'] = 'posts_not_in';
|
351 |
+
} else {
|
352 |
+
$filter = $this->generate_custom_query_each($filter, $data);
|
353 |
+
if( ! empty($filter['custom_query']) && is_array($filter['custom_query']) ) {
|
354 |
+
$filter['used'] = 'custom_query';
|
355 |
+
}
|
356 |
+
}
|
357 |
+
}
|
358 |
+
}
|
359 |
+
}
|
360 |
+
return $filter;
|
361 |
+
}
|
362 |
+
private function data_generate_global_filtering($data) {
|
363 |
+
$data = $this->sort_filters($data);
|
364 |
+
$tax_query_global = array();
|
365 |
+
$meta_query_global = array();
|
366 |
+
$posts_not_in_global = array();
|
367 |
+
$posts_in_global = array();
|
368 |
+
if( ! empty($data['filters']) && is_array($data['filters']) ) {
|
369 |
+
foreach($data['filters'] as &$filter) {
|
370 |
+
if( isset($filter['used']) ) {
|
371 |
+
switch($filter['used']) {
|
372 |
+
case 'tax_query':
|
373 |
+
$tax_query_global[] = $filter['tax_query'];
|
374 |
+
break;
|
375 |
+
case 'meta_query':
|
376 |
+
$meta_query_global[] = $filter['meta_query'];
|
377 |
+
break;
|
378 |
+
case 'posts_in':
|
379 |
+
$posts_in_global = $posts_in_global + $filter['posts_in'];
|
380 |
+
break;
|
381 |
+
case 'posts_not_in':
|
382 |
+
$posts_not_in_global = $posts_not_in_global + $filter['posts_not_in'];
|
383 |
+
break;
|
384 |
+
case 'custom_query':
|
385 |
+
$custom_query_global[] = $filter['custom_query'];
|
386 |
+
break;
|
387 |
+
}
|
388 |
+
}
|
389 |
+
}
|
390 |
+
}
|
391 |
+
if( ! empty($tax_query_global) ) {
|
392 |
+
$tax_query_global['relation'] = 'AND';
|
393 |
+
}
|
394 |
+
$data['tax_query'] = $tax_query_global;
|
395 |
+
if( ! empty($meta_query_global) ) {
|
396 |
+
$meta_query_global['relation'] = 'AND';
|
397 |
+
}
|
398 |
+
$data['meta_query'] = $meta_query_global;
|
399 |
+
$data['posts_in'] = array_unique($posts_in_global);
|
400 |
+
$data['posts_not_in'] = array_unique($posts_not_in_global);
|
401 |
+
return apply_filters('bapf_uparse_data_generate_global_filtering_modify', $data, $this);
|
402 |
+
}
|
403 |
+
private function sort_filters($data) {
|
404 |
+
$sort_array = array();
|
405 |
+
foreach($data['filters'] as &$filter) {
|
406 |
+
$sort_array[] = ( empty($filter['taxonomy']) ? $filter['attr'] : $filter['taxonomy'] );
|
407 |
+
if( in_array($filter['type'], array('attribute', 'taxonomy')) ) {
|
408 |
+
if( ! empty($filter['val_arr']) ) {
|
409 |
+
if( isset($filter['val_arr']['op']) ) {
|
410 |
+
$operator = $filter['val_arr']['op'];
|
411 |
+
unset($filter['val_arr']['op']);
|
412 |
+
}
|
413 |
+
if( isset($operator) && $operator == 'SLIDER' ) {
|
414 |
+
$filter['val_arr'] = array(
|
415 |
+
'from' => $filter['val_arr']['from'],
|
416 |
+
'to' => $filter['val_arr']['to']
|
417 |
+
);
|
418 |
+
} else {
|
419 |
+
sort($filter['val_arr']);
|
420 |
+
}
|
421 |
+
if( isset($operator) ) {
|
422 |
+
$filter['val_arr']['op'] = $operator;
|
423 |
+
unset($operator);
|
424 |
+
}
|
425 |
+
}
|
426 |
+
}
|
427 |
+
$filter = apply_filters('', $filter, $data);
|
428 |
+
}
|
429 |
+
array_multisort($sort_array, $data['filters']);
|
430 |
+
return $data;
|
431 |
+
}
|
432 |
+
public function parse_line($link = false) {
|
433 |
+
$data = apply_filters('bapf_uparse_parse_line', null, $this, $link);
|
434 |
+
if( $data !== null ) {
|
435 |
+
return $data;
|
436 |
+
}
|
437 |
+
$filter_line = $this->parse_get_filter_line($link);
|
438 |
+
$data = $this->parse_filter_line_to_array($filter_line);
|
439 |
+
$data = $this->parse_filter_values($data);
|
440 |
+
$data = $this->add_terms_to_data($data);
|
441 |
+
$data = $this->generate_tax_query($data);
|
442 |
+
$data = $this->generate_meta_query($data);
|
443 |
+
$data = $this->generate_posts_in($data);
|
444 |
+
$data = $this->generate_posts_not_in($data);
|
445 |
+
$data = $this->generate_custom_query($data);
|
446 |
+
$data = $this->data_generate_global_filtering($data);
|
447 |
+
|
448 |
+
$data = apply_filters('bapf_uparse_parse_line_modify', $data, $link);
|
449 |
+
return $data;
|
450 |
+
}
|
451 |
+
public function get_link_from_data($data = false, $link = false, $args = false) {
|
452 |
+
if( $data === false ) {
|
453 |
+
$data = $this->get_current();
|
454 |
+
}
|
455 |
+
if( $link === false ) {
|
456 |
+
$link = "//".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
|
457 |
+
}
|
458 |
+
$result = apply_filters('bapf_uparse_get_link_from_data', null, $this, $data);
|
459 |
+
if( $result !== null ) {
|
460 |
+
return $result;
|
461 |
+
}
|
462 |
+
$link = $this->remove_filters_from_link($link);
|
463 |
+
$filters_line = $this->generate_filter_link($data, $args);
|
464 |
+
$link = $this->add_filters_to_link($link, $filters_line);
|
465 |
+
return $link;
|
466 |
+
}
|
467 |
+
public function remove_filters_from_link($link) {
|
468 |
+
$link = remove_query_arg( apply_filters('bapf_uparse_remove_filters_from_link_arg', 'filters', $this), $link );
|
469 |
+
$result = apply_filters('bapf_uparse_remove_filters_from_link', null, $this, $link);
|
470 |
+
if( $result !== null ) {
|
471 |
+
return $result;
|
472 |
+
}
|
473 |
+
return $link;
|
474 |
+
}
|
475 |
+
public function generate_filter_link($data, $args = array()) {
|
476 |
+
$result = apply_filters('bapf_uparse_generate_filter_link', null, $this, $data, $args);
|
477 |
+
if( $result !== null ) {
|
478 |
+
return $result;
|
479 |
+
}
|
480 |
+
$filters_lines = array();
|
481 |
+
foreach($data['filters'] as $filter) {
|
482 |
+
$filters_line = $this->generate_filter_link_each($filter, $data, $args);
|
483 |
+
$filters_lines = array_merge($filters_lines, $filters_line);
|
484 |
+
}
|
485 |
+
$result = apply_filters('bapf_uparse_generate_filter_link_lines', null, $this, $filters_lines, $data, $args);
|
486 |
+
if( $result !== null ) {
|
487 |
+
return $result;
|
488 |
+
}
|
489 |
+
$delimiter = apply_filters('bapf_uparse_generate_filter_link_delimiter', '&', $this, $filters_lines, $data, $args);
|
490 |
+
$filter_line = implode($delimiter, $filters_lines);
|
491 |
+
return $filter_line;
|
492 |
+
}
|
493 |
+
public function generate_filter_link_each($filter, $data, $args = array()) {
|
494 |
+
$result = apply_filters('bapf_uparse_generate_filter_link_each', null, $this, $filter, $data, $args);
|
495 |
+
if( $result !== null ) {
|
496 |
+
return $result;
|
497 |
+
}
|
498 |
+
$values_lines = array();
|
499 |
+
if(in_array($filter['type'], array('attribute', 'taxonomy'))) {
|
500 |
+
$values_lines = $this->generate_filter_link_each_without_check($filter, $data, $args);
|
501 |
+
}
|
502 |
+
return $values_lines;
|
503 |
+
}
|
504 |
+
public function generate_filter_link_each_without_check($filter, $data, $args = array()) {
|
505 |
+
$values_lines = array();
|
506 |
+
$taxonomy_name = $filter['taxonomy'];
|
507 |
+
if($filter['type'] == 'attribute') {
|
508 |
+
$taxonomy_name = substr($taxonomy_name, 3);
|
509 |
+
}
|
510 |
+
$link_elements = apply_filters('bapf_uparse_generate_filter_link_each_taxval_delimiters', array(
|
511 |
+
'before_values' => '[',
|
512 |
+
'after_values' => ']',
|
513 |
+
), $this, $filter, $data);
|
514 |
+
$taxonomy_name = apply_filters('bapf_uparse_generate_filter_link_each_taxonomy_name', $taxonomy_name, $this, $filter, $data);
|
515 |
+
if( ! empty($filter['val_arr']) ) {
|
516 |
+
$filter_lines = $this->generate_filter_val_arr($filter['val_arr'], $filter);
|
517 |
+
foreach($filter_lines as $filter_line) {
|
518 |
+
$values_line = $taxonomy_name . $link_elements['before_values'] . $filter_line . $link_elements['after_values'];
|
519 |
+
$values_lines[] = apply_filters('bapf_uparse_generate_filter_link_each_values_line', $values_line, $this, $filter, $data, $link_elements, array(
|
520 |
+
'taxonomy_name' => $taxonomy_name,
|
521 |
+
'filter_line' => $filter_line
|
522 |
+
));
|
523 |
+
}
|
524 |
+
}
|
525 |
+
return $values_lines;
|
526 |
+
}
|
527 |
+
public function generate_filter_val_arr($val_arr, $filter) {
|
528 |
+
$result = apply_filters('bapf_uparse_generate_filter_val_arr', null, $this, $val_arr, $filter);
|
529 |
+
if( $result !== null ) {
|
530 |
+
return $result;
|
531 |
+
}
|
532 |
+
$delimiter = '-';
|
533 |
+
if( isset($val_arr['op']) ) {
|
534 |
+
$delimiter = $this->func_operator_to_delimiter($val_arr['op']);
|
535 |
+
unset($val_arr['op']);
|
536 |
+
}
|
537 |
+
$values_lines = array();
|
538 |
+
$values = array();
|
539 |
+
foreach($val_arr as $value) {
|
540 |
+
if( is_array($value) ) {
|
541 |
+
$values_lines_add = $this->generate_filter_val_arr($value, $filter);
|
542 |
+
$values_lines = array_merge($values_lines, $values_lines_add);
|
543 |
+
} else {
|
544 |
+
$values[] = $value;
|
545 |
+
}
|
546 |
+
}
|
547 |
+
$values_lines[] = implode($delimiter, $values);
|
548 |
+
return $values_lines;
|
549 |
+
}
|
550 |
+
public function add_filters_to_link($link, $filters_line) {
|
551 |
+
$result = apply_filters('bapf_uparse_add_filters_to_link', null, $this, $link, $filters_line);
|
552 |
+
if( $result !== null ) {
|
553 |
+
return $result;
|
554 |
+
}
|
555 |
+
if ( ! empty( $filters_line ) ) {
|
556 |
+
$link = add_query_arg( apply_filters('bapf_uparse_remove_filters_from_link_arg', 'filters', $this), $filters_line, $link );
|
557 |
+
}
|
558 |
+
return $link;
|
559 |
+
}
|
560 |
+
public function modify_data($args, $data = false) {
|
561 |
+
$args = array_merge(array('values' => array(), 'type' => 'revert', 'op' => 'AND', 'calculate' => TRUE), $args);
|
562 |
+
$data = $this->data_check($data);
|
563 |
+
$result = apply_filters('bapf_uparse_modify_data', null, $this, $args, $data);
|
564 |
+
if( $result !== null ) {
|
565 |
+
return $result;
|
566 |
+
}
|
567 |
+
$values = (is_array($args['values']) ? $args['values']: array());
|
568 |
+
foreach($values as $value_i => $value) {
|
569 |
+
$result = apply_filters('bapf_uparse_modify_data_each_precheck', null, $this, $value, $args, $data);
|
570 |
+
if( $result !== null ) {
|
571 |
+
$data = $result;
|
572 |
+
unset($values[$value_i]);
|
573 |
+
}
|
574 |
+
}
|
575 |
+
$type = $args['type'];
|
576 |
+
$operator = $args['op'];
|
577 |
+
$add_not_exist = array();
|
578 |
+
$options = $this->main_class->get_option();
|
579 |
+
foreach($values as $value_i => &$value) {
|
580 |
+
$result = apply_filters('bapf_uparse_modify_data_value_each', null, $this, $value, $args, $data);
|
581 |
+
if( $result !== null ) {
|
582 |
+
$value = $result;
|
583 |
+
continue;
|
584 |
+
}
|
585 |
+
if( is_numeric($value['value']) ) {
|
586 |
+
$term_add = $this->get_term_by('id', $value['value'], $value['taxonomy']);
|
587 |
+
} else {
|
588 |
+
$term_add = $this->get_term_by('slug', $value['value'], $value['taxonomy']);
|
589 |
+
}
|
590 |
+
if( ! empty($term_add) && ! is_a($term_add, 'WP_Error') ) {
|
591 |
+
$value['term'] = (empty($options['slug_urls']) ? $term_add->term_id : $term_add->slug);
|
592 |
+
$value['id'] = $term_add->term_id;
|
593 |
+
} else {
|
594 |
+
unset($values[$value_i]);
|
595 |
+
}
|
596 |
+
}
|
597 |
+
if( isset($value) ) {
|
598 |
+
unset($value);
|
599 |
+
}
|
600 |
+
if( ! empty($data['filters']) && is_array($data['filters']) && count($data['filters']) > 0 ) {
|
601 |
+
foreach($data['filters'] as $filter_i => &$filter) {
|
602 |
+
$result = apply_filters('bapf_uparse_modify_data_each', null, $this, $filter, $args, $data);
|
603 |
+
if( $result !== null ) {
|
604 |
+
unset($values[$value_i]);
|
605 |
+
$filter = $this->back_generate($result, $data, $args);
|
606 |
+
}
|
607 |
+
foreach($values as $value_i => $value) {
|
608 |
+
if($filter['taxonomy'] == $value['taxonomy'] && in_array($filter['type'], array('attribute', 'taxonomy')) ) {
|
609 |
+
$position = false;
|
610 |
+
if( isset($filter['val_arr']) && is_array($filter['val_arr']) ) {
|
611 |
+
$position = array_search($value['term'], $filter['val_arr']);
|
612 |
+
}
|
613 |
+
if(($type == 'add' || $type == 'revert') && $position === false) {
|
614 |
+
if( ! isset($filter['val_arr']) || ! is_array($filter['val_arr']) ) {
|
615 |
+
$filter['val_arr'] = array();
|
616 |
+
}
|
617 |
+
if( ! isset($filter['val_ids']) || ! is_array($filter['val_ids']) ) {
|
618 |
+
$filter['val_ids'] = array();
|
619 |
+
}
|
620 |
+
$filter['val_arr'][] = $value['term'];
|
621 |
+
$filter['val_ids'][$value['term']] = $value['id'];
|
622 |
+
} elseif(($type == 'remove' || $type == 'revert') && $position !== false) {
|
623 |
+
unset($filter['val_arr'][$position]);
|
624 |
+
if( isset($filter['val_ids']) && is_array($filter['val_ids']) ) {
|
625 |
+
$position2 = array_search($value['id'], $filter['val_ids']);
|
626 |
+
if( $position2 !== false ) {
|
627 |
+
unset($filter['val_ids'][$position2]);
|
628 |
+
}
|
629 |
+
}
|
630 |
+
if(count($filter['val_arr']) == 0 || (count($filter['val_arr']) == 1 && ! empty($filter['val_arr']['op'])) ) {
|
631 |
+
unset($data['filters'][$filter_i]);
|
632 |
+
}
|
633 |
+
}
|
634 |
+
unset($values[$value_i]);
|
635 |
+
$filter = $this->back_generate($filter, $data, $args);
|
636 |
+
}
|
637 |
+
}
|
638 |
+
}
|
639 |
+
}
|
640 |
+
if(($type == 'revert' || $type == 'add') && ! empty($values)) {
|
641 |
+
$add_values = array();
|
642 |
+
foreach($values as $value) {
|
643 |
+
if( empty($add_values[$value['taxonomy']]) ) {
|
644 |
+
$add_values[$value['taxonomy']] = array('values' => array(), 'ids' => array());
|
645 |
+
}
|
646 |
+
$add_values[$value['taxonomy']]['values'][] = $value['term'];
|
647 |
+
$add_values[$value['taxonomy']]['ids'][$value['term']] = $value['id'];
|
648 |
+
}
|
649 |
+
foreach($add_values as $taxonomy => $add_value) {
|
650 |
+
$values = $add_value['values'];
|
651 |
+
$values['op'] = $operator;
|
652 |
+
$filter_arr = array(
|
653 |
+
'val_arr' => $values,
|
654 |
+
'val_ids' => $add_value['ids'],
|
655 |
+
'taxonomy' => $taxonomy
|
656 |
+
);
|
657 |
+
$filter_arr = $this->back_generate($filter_arr, $data, $args);
|
658 |
+
$data['filters'][] = $filter_arr;
|
659 |
+
}
|
660 |
+
}
|
661 |
+
$data = $this->data_generate_global_filtering($data);
|
662 |
+
return $data;
|
663 |
+
}
|
664 |
+
public function remove_taxonomy($args, $data = false) {
|
665 |
+
$args = array_merge(array('taxonomy' => ''), $args);
|
666 |
+
$data = $this->data_check($data);
|
667 |
+
if( ! empty($args['taxonomy']) && ! empty($data['filters']) && is_array($data['filters']) && count($data['filters']) > 0 ) {
|
668 |
+
foreach($data['filters'] as $filter_i => &$filter) {
|
669 |
+
if($filter['taxonomy'] == $args['taxonomy'] || $args['taxonomy'] === FALSE ) {
|
670 |
+
unset($data['filters'][$filter_i]);
|
671 |
+
}
|
672 |
+
}
|
673 |
+
}
|
674 |
+
$data = $this->data_generate_global_filtering($data);
|
675 |
+
return $data;
|
676 |
+
}
|
677 |
+
public function back_generate($filter, $data, $args = array()) {
|
678 |
+
$args = array_merge(array('calculate' => TRUE), $args);
|
679 |
+
if(empty($filter['attr']) || empty($filter['type'])) {
|
680 |
+
if( substr($filter['taxonomy'], 0, 3) == 'pa_' ) {
|
681 |
+
$filter['attr'] = substr($filter['taxonomy'], 3);
|
682 |
+
$filter['type'] = 'attribute';
|
683 |
+
} else {
|
684 |
+
$filter['attr'] = $filter['taxonomy'];
|
685 |
+
$filter['type'] = 'taxonomy';
|
686 |
+
}
|
687 |
+
}
|
688 |
+
if(! empty($args['calculate']) ) {
|
689 |
+
$filter = $this->add_terms_to_data_each($filter, $data);
|
690 |
+
$filter = $this->data_set_filter_used($filter, $data);
|
691 |
+
}
|
692 |
+
return $filter;
|
693 |
+
}
|
694 |
+
public function query_vars($query_vars = array(), $data = false) {
|
695 |
+
$data = $this->data_check($data);
|
696 |
+
$data = apply_filters('bapf_uparse_query_vars', null, $this, $args, $data);
|
697 |
+
if( $data !== null ) {
|
698 |
+
return $data;
|
699 |
+
}
|
700 |
+
return $query_vars;
|
701 |
+
}
|
702 |
+
public function set_default_data($data = false) {
|
703 |
+
$data = $this->data_check($data);
|
704 |
+
$this->data = apply_filters('bapf_uparse_set_default_data', $data, $this, $data);
|
705 |
+
return $data;
|
706 |
+
}
|
707 |
+
public function reset_data() {
|
708 |
+
$this->get_current();
|
709 |
+
$this->data = apply_filters('bapf_uparse_reset_data', $this->get_main_data(), $this, $this->data);
|
710 |
+
return $this->data;
|
711 |
+
}
|
712 |
+
public function get_main_data() {
|
713 |
+
$this->get_current();
|
714 |
+
return $this->data_current;
|
715 |
+
}
|
716 |
+
public function get_data_errors($data = false) {
|
717 |
+
$data = $this->data_check($data);
|
718 |
+
$error = apply_filters('bapf_uparse_get_data_errors', null, $this, $data);
|
719 |
+
if( $error !== null ) {
|
720 |
+
return $error;
|
721 |
+
}
|
722 |
+
$error = array();
|
723 |
+
}
|
724 |
+
public function parse_get_filter_line($link = false) {
|
725 |
+
$result = apply_filters('bapf_uparse_parse_get_filter_line', null, $this, $link);
|
726 |
+
if( $result !== null ) {
|
727 |
+
return $result;
|
728 |
+
}
|
729 |
+
$filter_line = '';
|
730 |
+
$filter_var = apply_filters('bapf_uparse_parse1_filter_var', 'filters', $this, $link);
|
731 |
+
if( $link !== false ) {
|
732 |
+
$parsed_link = wp_parse_url($link);
|
733 |
+
if( ! empty($parsed_link['query']) ) {
|
734 |
+
$query_line = explode('&', $parsed_link['query']);
|
735 |
+
foreach($query_line as $query_arg) {
|
736 |
+
$query_arg = explode('=', $query_arg, 2);
|
737 |
+
if( $query_arg[0] == $filter_var ) {
|
738 |
+
$filter_line = $query_arg[1];
|
739 |
+
break;
|
740 |
+
}
|
741 |
+
}
|
742 |
+
}
|
743 |
+
} elseif( ! empty($_GET[$filter_var]) ) {
|
744 |
+
$filter_line = $_GET[$filter_var];
|
745 |
+
}
|
746 |
+
$filter_line = berocket_sanitize_array($filter_line);
|
747 |
+
$filter_line = urlencode($filter_line);
|
748 |
+
$filter_line = str_replace('+', urlencode('+'), $filter_line);
|
749 |
+
$filter_line = urldecode($filter_line);
|
750 |
+
return apply_filters('bapf_uparse_parse_get_filter_line_modify', $filter_line, $this, $link);
|
751 |
+
}
|
752 |
+
public function parse_filter_line_to_array($filter_line = false) {
|
753 |
+
if( $filter_line === false ) {
|
754 |
+
$filter_line = $this->parse_get_filter_line();
|
755 |
+
}
|
756 |
+
$result = apply_filters('bapf_uparse_parse_filter_line_to_array', null, $this, $filter_line);
|
757 |
+
if( $result !== null ) {
|
758 |
+
return $result;
|
759 |
+
}
|
760 |
+
$data = array(
|
761 |
+
'fullline' => $filter_line,
|
762 |
+
'filters' => array()
|
763 |
+
);
|
764 |
+
$filter_regex = $this->get_regex('filter');
|
765 |
+
preg_match_all($filter_regex, $filter_line, $search);
|
766 |
+
if( is_array($search) && count($search) > 0 && count($search[0]) > 0 ) {
|
767 |
+
for($i = 0; $i < count($search[0]); $i++) {
|
768 |
+
$single_filter = apply_filters('bapf_uparse_parse2_single_filter', null, $this, $search, $i, $filter_line);
|
769 |
+
if( $single_filter !== null ) {
|
770 |
+
$data['filters'][] = $single_filter;
|
771 |
+
continue;
|
772 |
+
}
|
773 |
+
$data['filters'][] = array(
|
774 |
+
'line' => $search[1][$i],
|
775 |
+
'attr' => $search[2][$i],
|
776 |
+
'val' => $search[3][$i]
|
777 |
+
);
|
778 |
+
}
|
779 |
+
}
|
780 |
+
return apply_filters('bapf_uparse_parse_filter_line_to_array_modify', $data, $this, $filter_line);;
|
781 |
+
}
|
782 |
+
public function parse_filter_values($data) {
|
783 |
+
$result = apply_filters('bapf_uparse_parse_filter_values', null, $this, $data);
|
784 |
+
if( $result !== null ) {
|
785 |
+
return $result;
|
786 |
+
}
|
787 |
+
foreach($data['filters'] as &$filter) {
|
788 |
+
$filter = $this->parse_filter_values_each($filter, $data);
|
789 |
+
}
|
790 |
+
return apply_filters('bapf_uparse_parse_filter_values_modify', $data, $this);
|
791 |
+
}
|
792 |
+
public function parse_filter_values_each($filter, $data) {
|
793 |
+
$result = apply_filters('bapf_uparse_parse_filter_values_each', null, $this, $filter, $data);
|
794 |
+
if( $result !== null ) {
|
795 |
+
$filter = $result;
|
796 |
+
}
|
797 |
+
$taxonomy = $this->func_check_attribute_name($filter['attr']);
|
798 |
+
if( is_array($taxonomy) ) {
|
799 |
+
$filter['taxonomy'] = $taxonomy['taxonomy'];
|
800 |
+
$filter['type'] = $taxonomy['type'];
|
801 |
+
$values = $this->func_check_attribute_values($filter['val'], $taxonomy['taxonomy'], $filter);
|
802 |
+
if( isset($values['values']) ) {
|
803 |
+
$filter['val_arr'] = $values['values'];
|
804 |
+
$filter['val_arr']['op'] = $values['operator'];
|
805 |
+
$filter['val_ids'] = ( empty($values['value_ids']) ? array() : $values['value_ids'] );
|
806 |
+
}
|
807 |
+
if( isset($values['error']) ) {
|
808 |
+
if( empty($filter['errors']) || ! is_array($filter['errors']) ) {
|
809 |
+
$filter['errors'] = array();
|
810 |
+
}
|
811 |
+
$filter['errors'][] = $values['error'];
|
812 |
+
}
|
813 |
+
} elseif(is_a($taxonomy, 'WP_Error') ) {
|
814 |
+
if( empty($filter['errors']) || ! is_array($filter['errors']) ) {
|
815 |
+
$filter['errors'] = array();
|
816 |
+
}
|
817 |
+
$filter['errors'][] = $taxonomy;
|
818 |
+
}
|
819 |
+
return $filter;
|
820 |
+
}
|
821 |
+
public function add_terms_to_data($data) {
|
822 |
+
$result = apply_filters('bapf_uparse_add_terms_to_data', null, $this, $data);
|
823 |
+
if( $result !== null ) {
|
824 |
+
return $result;
|
825 |
+
}
|
826 |
+
foreach($data['filters'] as &$filter) {
|
827 |
+
$filter = $this->add_terms_to_data_each($filter, $data);
|
828 |
+
}
|
829 |
+
return apply_filters('bapf_uparse_add_terms_to_data_modify', $data, $this);
|
830 |
+
}
|
831 |
+
private function add_terms_to_data_each($filter, $data) {
|
832 |
+
$result = apply_filters('bapf_uparse_add_terms_to_data_each', null, $this, $filter, $data);
|
833 |
+
if( $result !== null ) {
|
834 |
+
return $result;
|
835 |
+
}
|
836 |
+
if( ! empty($filter['val_ids']) ) {
|
837 |
+
$custom_terms = apply_filters('bapf_uparse_add_terms_to_data_each_terms', null, $this, $filter, $data);
|
838 |
+
if( $custom_terms === null ) {
|
839 |
+
$terms = get_terms(array('include' => $filter['val_ids']));
|
840 |
+
} else {
|
841 |
+
$terms = $custom_terms;
|
842 |
+
}
|
843 |
+
$filter['terms'] = array();
|
844 |
+
if( is_array($terms) ) {
|
845 |
+
foreach($terms as $term) {
|
846 |
+
$filter['terms'][$term->term_id] = $term;
|
847 |
+
}
|
848 |
+
}
|
849 |
+
}
|
850 |
+
return $filter;
|
851 |
+
}
|
852 |
+
public function generate_tax_query($data) {
|
853 |
+
$result = apply_filters('bapf_uparse_generate_tax_query', null, $this, $data);
|
854 |
+
if( $result !== null ) {
|
855 |
+
return $result;
|
856 |
+
}
|
857 |
+
$tax_query_global = array();
|
858 |
+
foreach($data['filters'] as &$filter) {
|
859 |
+
$filter = $this->generate_tax_query_each($filter, $data);
|
860 |
+
if( ! empty($filter['tax_query']) ) {
|
861 |
+
$tax_query_global[] = $filter['tax_query'];
|
862 |
+
$filter['used'] = 'tax_query';
|
863 |
+
}
|
864 |
+
}
|
865 |
+
if( ! empty($tax_query_global) ) {
|
866 |
+
$tax_query_global['relation'] = 'AND';
|
867 |
+
}
|
868 |
+
$data['tax_query'] = $tax_query_global;
|
869 |
+
return apply_filters('bapf_uparse_generate_tax_query_modify', $data, $this);
|
870 |
+
}
|
871 |
+
private function generate_tax_query_each($filter, $data) {
|
872 |
+
$result = apply_filters('bapf_uparse_generate_tax_query_each', null, $this, $filter, $data);
|
873 |
+
if( $result !== null ) {
|
874 |
+
return $result;
|
875 |
+
}
|
876 |
+
$tax_query = array();
|
877 |
+
if( ! empty($filter['type']) && ( $filter['type'] == 'attribute' || $filter['type'] == 'taxonomy' ) ) {
|
878 |
+
if( count($filter['val_arr']) > 0 ) {
|
879 |
+
$tax_query = $this->func_generate_tq_single($filter['val_arr'], $filter);
|
880 |
+
}
|
881 |
+
$filter['tax_query'] = $tax_query;
|
882 |
+
}
|
883 |
+
return $filter;
|
884 |
+
}
|
885 |
+
public function generate_meta_query($data) {
|
886 |
+
$result = apply_filters('bapf_uparse_generate_meta_query', null, $this, $data);
|
887 |
+
if( $result !== null ) {
|
888 |
+
return $result;
|
889 |
+
}
|
890 |
+
$meta_query_global = array();
|
891 |
+
foreach($data['filters'] as &$filter) {
|
892 |
+
$filter = $this->generate_meta_query_each($filter, $data);
|
893 |
+
if( ! empty($filter['meta_query']) ) {
|
894 |
+
$meta_query_global[] = $filter['meta_query'];
|
895 |
+
$filter['used'] = 'meta_query';
|
896 |
+
}
|
897 |
+
}
|
898 |
+
if( ! empty($meta_query_global) ) {
|
899 |
+
$meta_query_global['relation'] = 'AND';
|
900 |
+
}
|
901 |
+
$data['meta_query'] = $meta_query_global;
|
902 |
+
return apply_filters('bapf_uparse_generate_meta_query_modify', $data, $this);
|
903 |
+
}
|
904 |
+
private function generate_meta_query_each($filter, $data) {
|
905 |
+
$result = apply_filters('bapf_uparse_generate_meta_query_each', null, $this, $filter, $data);
|
906 |
+
if( $result !== null ) {
|
907 |
+
return $result;
|
908 |
+
}
|
909 |
+
return $filter;
|
910 |
+
}
|
911 |
+
public function generate_posts_in($data) {
|
912 |
+
$result = apply_filters('bapf_uparse_generate_posts_in', null, $this, $data);
|
913 |
+
if( $result !== null ) {
|
914 |
+
return $result;
|
915 |
+
}
|
916 |
+
$posts_in_global = array();
|
917 |
+
foreach($data['filters'] as &$filter) {
|
918 |
+
$filter = $this->generate_posts_in_each($filter, $data);
|
919 |
+
if( ! empty($filter['posts_in']) && is_array($filter['posts_in']) ) {
|
920 |
+
$posts_in_global = $posts_in_global + $filter['posts_in'];
|
921 |
+
$filter['used'] = 'posts_in';
|
922 |
+
}
|
923 |
+
}
|
924 |
+
$data['posts_in'] = array_unique($posts_in_global);
|
925 |
+
return $data;
|
926 |
+
}
|
927 |
+
public function generate_posts_in_each($filter, $data) {
|
928 |
+
$result = apply_filters('bapf_uparse_generate_posts_in_each', null, $this, $filter, $data);
|
929 |
+
if( $result !== null ) {
|
930 |
+
return $result;
|
931 |
+
}
|
932 |
+
return $filter;
|
933 |
+
}
|
934 |
+
public function generate_posts_not_in($data) {
|
935 |
+
$result = apply_filters('bapf_uparse_generate_posts_not_in', null, $this, $data);
|
936 |
+
if( $result !== null ) {
|
937 |
+
return $result;
|
938 |
+
}
|
939 |
+
$posts_not_in_global = array();
|
940 |
+
foreach($data['filters'] as &$filter) {
|
941 |
+
$filter = $this->generate_posts_not_in_each($filter, $data);
|
942 |
+
if( ! empty($filter['posts_not_in']) && is_array($filter['posts_not_in']) ) {
|
943 |
+
$posts_not_in_global = $posts_not_in_global + $filter['posts_not_in'];
|
944 |
+
$filter['used'] = 'posts_not_in';
|
945 |
+
}
|
946 |
+
}
|
947 |
+
$data['posts_not_in'] = array_unique($posts_not_in_global);
|
948 |
+
return $data;
|
949 |
+
}
|
950 |
+
public function generate_posts_not_in_each($filter, $data) {
|
951 |
+
$result = apply_filters('bapf_uparse_generate_posts_not_in_each', null, $this, $filter, $data);
|
952 |
+
if( $result !== null ) {
|
953 |
+
return $result;
|
954 |
+
}
|
955 |
+
return $filter;
|
956 |
+
}
|
957 |
+
public function generate_custom_query($data) {
|
958 |
+
$result = apply_filters('bapf_uparse_generate_custom_query', null, $this, $data);
|
959 |
+
if( $result !== null ) {
|
960 |
+
return $result;
|
961 |
+
}
|
962 |
+
foreach($data['filters'] as &$filter) {
|
963 |
+
$filter = $this->generate_custom_query_each($filter, $data);
|
964 |
+
if( ! empty($filter['custom_query']) && is_array($filter['custom_query']) ) {
|
965 |
+
$filter['used'] = 'custom_query';
|
966 |
+
}
|
967 |
+
}
|
968 |
+
return $data;
|
969 |
+
}
|
970 |
+
public function generate_custom_query_each($filter, $data) {
|
971 |
+
$result = apply_filters('bapf_uparse_generate_custom_query_each', null, $this, $filter, $data);
|
972 |
+
if( $result !== null ) {
|
973 |
+
return $result;
|
974 |
+
}
|
975 |
+
return $filter;
|
976 |
+
}
|
977 |
+
|
978 |
+
public function func_generate_tq_single($val_arr, $filter) {
|
979 |
+
$result = apply_filters('bapf_uparse_func_generate_tq_single', null, $this, $val_arr, $filter);
|
980 |
+
if( $result !== null ) {
|
981 |
+
return $result;
|
982 |
+
}
|
983 |
+
$operator = 'OR';
|
984 |
+
if( isset($val_arr['op']) ) {
|
985 |
+
$operator = $val_arr['op'];
|
986 |
+
unset($val_arr['op']);
|
987 |
+
}
|
988 |
+
$tax_query = array();
|
989 |
+
if( count($val_arr) > 0 ) {
|
990 |
+
$term_ids = array();
|
991 |
+
$additional = array();
|
992 |
+
foreach($val_arr as $value) {
|
993 |
+
if( is_array($value) ) {
|
994 |
+
$element = $this->func_generate_tq_single($value, $filter);
|
995 |
+
if( ! empty($element) ) {
|
996 |
+
$additional[] = $element;
|
997 |
+
}
|
998 |
+
} elseif( isset($filter['val_ids'][$value]) ) {
|
999 |
+
$term_ids[] = $filter['val_ids'][$value];
|
1000 |
+
}
|
1001 |
+
}
|
1002 |
+
if( count($additional) > 0 ) {
|
1003 |
+
$tax_query = $additional;
|
1004 |
+
$tax_query['relation'] = $operator;
|
1005 |
+
}
|
1006 |
+
if( count($term_ids) > 0 ) {
|
1007 |
+
$ids_tax_query = array(
|
1008 |
+
'taxonomy' => $filter['taxonomy'],
|
1009 |
+
'field' => 'id',
|
1010 |
+
'terms' => $term_ids,
|
1011 |
+
'operator' => ($operator == 'AND' ? 'AND' : 'IN')
|
1012 |
+
);
|
1013 |
+
if(empty($tax_query) ) {
|
1014 |
+
$tax_query = $ids_tax_query;
|
1015 |
+
} else {
|
1016 |
+
$tax_query[] = $ids_tax_query;
|
1017 |
+
}
|
1018 |
+
}
|
1019 |
+
}
|
1020 |
+
return $tax_query;
|
1021 |
+
}
|
1022 |
+
public function func_get_taxonomies() {
|
1023 |
+
if( $this->taxonomies === false ) {
|
1024 |
+
$taxonomies = get_object_taxonomies('product');
|
1025 |
+
$this->taxonomies = array();
|
1026 |
+
foreach($taxonomies as $taxonomy) {
|
1027 |
+
$this->taxonomies[$taxonomy] = $taxonomy;
|
1028 |
+
}
|
1029 |
+
}
|
1030 |
+
return apply_filters('bapf_uparse_func_get_taxonomies_modify', $this->taxonomies, $this);
|
1031 |
+
}
|
1032 |
+
public function func_check_attribute_name($attribute_name) {
|
1033 |
+
$result = apply_filters('bapf_uparse_func_check_attribute_name', null, $this, $attribute_name);
|
1034 |
+
if( $result !== null ) {
|
1035 |
+
return $result;
|
1036 |
+
}
|
1037 |
+
$result = false;
|
1038 |
+
$taxonomies = $this->func_get_taxonomies();
|
1039 |
+
$taxonomy = false;
|
1040 |
+
$type = false;
|
1041 |
+
if( isset($taxonomies['pa_'.$attribute_name]) ) {
|
1042 |
+
$taxonomy = 'pa_'.$attribute_name;
|
1043 |
+
$type = 'attribute';
|
1044 |
+
} elseif( isset($taxonomies[$attribute_name]) ) {
|
1045 |
+
$taxonomy = $attribute_name;
|
1046 |
+
$type = 'taxonomy';
|
1047 |
+
} else {
|
1048 |
+
return new WP_Error( 'bapf_uparse', __('Taxonomy do not exist: ', 'BeRocket_AJAX_domain').$attribute_name );
|
1049 |
+
}
|
1050 |
+
if($taxonomy !== false) {
|
1051 |
+
$result = array(
|
1052 |
+
'taxonomy' => $taxonomy,
|
1053 |
+
'type' => $type
|
1054 |
+
);
|
1055 |
+
}
|
1056 |
+
return $result;
|
1057 |
+
}
|
1058 |
+
public function func_check_attribute_values($values_line, $taxonomy, $filter, $args = array()) {
|
1059 |
+
if( ! is_array($args) ) $args = array();
|
1060 |
+
$options = $this->main_class->get_option();
|
1061 |
+
$args = array_merge(array(
|
1062 |
+
'field' => (empty($options['slug_urls']) ? 'ids' : 'slug'),
|
1063 |
+
), $args);
|
1064 |
+
$result = apply_filters('bapf_uparse_func_check_attribute_values', null, $this, $values_line, $taxonomy, $filter, $args);
|
1065 |
+
if( $result !== null ) {
|
1066 |
+
return $result;
|
1067 |
+
}
|
1068 |
+
$custom_terms = apply_filters('bapf_uparse_func_check_attribute_values_terms', null, $this, $values_line, $taxonomy, $filter, $args);
|
1069 |
+
if($custom_terms === null) {
|
1070 |
+
$terms = $this->func_get_terms_slug_id($taxonomy);
|
1071 |
+
} else {
|
1072 |
+
$terms = $custom_terms;
|
1073 |
+
}
|
1074 |
+
$data = false;
|
1075 |
+
if( is_array($terms) && count($terms) > 0 ) {
|
1076 |
+
if( $args['field'] == 'slug' ) {
|
1077 |
+
$terms = array_flip($terms);
|
1078 |
+
}
|
1079 |
+
$values_regex = $this->get_regex('values');
|
1080 |
+
preg_match_all($values_regex, $values_line, $values);
|
1081 |
+
if( count($values) > 0 && count($values[0]) > 0 ) {
|
1082 |
+
$value_ids = array();
|
1083 |
+
$new_values = $values[0];
|
1084 |
+
$terms_correct = array();
|
1085 |
+
$values_not_exist = array();
|
1086 |
+
$delimiter = '-';
|
1087 |
+
do {
|
1088 |
+
$values = $new_values;
|
1089 |
+
$new_values = array();
|
1090 |
+
$count_terms_correct = count($terms_correct);
|
1091 |
+
do {
|
1092 |
+
$check_term = implode($values);
|
1093 |
+
if( isset($terms[$check_term]) ) {
|
1094 |
+
$terms_correct[] = $check_term;
|
1095 |
+
if( $args['field'] == 'slug' ) {
|
1096 |
+
$value_ids[$check_term] = $terms[$check_term];
|
1097 |
+
} else {
|
1098 |
+
$value_ids[$check_term] = $check_term;
|
1099 |
+
}
|
1100 |
+
if(count($new_values) > 0) {
|
1101 |
+
$delimiter = array_shift($new_values);
|
1102 |
+
}
|
1103 |
+
break;
|
1104 |
+
} else {
|
1105 |
+
array_unshift($new_values, array_pop($values));
|
1106 |
+
}
|
1107 |
+
} while(count($values) > 0);
|
1108 |
+
if( count($terms_correct) == $count_terms_correct && count($new_values) > 0 ) {
|
1109 |
+
$values_not_exist[] = array_shift($new_values);
|
1110 |
+
}
|
1111 |
+
} while(count($new_values) > 0);
|
1112 |
+
$data = array(
|
1113 |
+
'values' => $terms_correct,
|
1114 |
+
'value_ids' => $value_ids,
|
1115 |
+
'operator' => $this->func_delimiter_to_operator($delimiter)
|
1116 |
+
);
|
1117 |
+
if( count($values_not_exist) > 0 ) {
|
1118 |
+
$data['error'] = new WP_Error( 'bapf_uparse', __('Values not exist: ', 'BeRocket_AJAX_domain').implode($values_not_exist) );
|
1119 |
+
}
|
1120 |
+
}
|
1121 |
+
}
|
1122 |
+
return apply_filters('bapf_uparse_func_check_attribute_values_modify', $data, $this, $values_line, $taxonomy, $filter, $args);
|
1123 |
+
}
|
1124 |
+
public function func_get_delimiter_operator_array() {
|
1125 |
+
return apply_filters('bapf_uparse_func_delimiter_to_operator', array(
|
1126 |
+
'+' => 'AND',
|
1127 |
+
'-' => 'OR',
|
1128 |
+
'_' => 'SLIDER'
|
1129 |
+
));
|
1130 |
+
}
|
1131 |
+
public function func_delimiter_to_operator($delimiter = '-') {
|
1132 |
+
$convert = $this->func_get_delimiter_operator_array();
|
1133 |
+
if( isset($convert[$delimiter]) ) {
|
1134 |
+
return $convert[$delimiter];
|
1135 |
+
} else {
|
1136 |
+
return false;
|
1137 |
+
}
|
1138 |
+
}
|
1139 |
+
public function func_operator_to_delimiter($operator) {
|
1140 |
+
$convert = $this->func_get_delimiter_operator_array();
|
1141 |
+
$convert = array_flip($convert);
|
1142 |
+
if( isset($convert[$operator]) ) {
|
1143 |
+
return $convert[$operator];
|
1144 |
+
} else {
|
1145 |
+
return false;
|
1146 |
+
}
|
1147 |
+
}
|
1148 |
+
public function get_term_by($field, $value, $taxonomy) {
|
1149 |
+
$result = apply_filters('bapf_uparse_get_terms', null, $this, array('taxonomy' => $taxonomy));
|
1150 |
+
if( $result !== null ) {
|
1151 |
+
if( is_array($result) && count($result) > 0 ) {
|
1152 |
+
foreach($result as $term) {
|
1153 |
+
if(
|
1154 |
+
($field == 'id' && $term->term_id == $value ) ||
|
1155 |
+
($field == 'slug' && $term->slug == $value )
|
1156 |
+
) {
|
1157 |
+
return $term;
|
1158 |
+
}
|
1159 |
+
}
|
1160 |
+
}
|
1161 |
+
return false;
|
1162 |
+
}
|
1163 |
+
return get_term_by($field, $value, $taxonomy);
|
1164 |
+
}
|
1165 |
+
public function get_terms($args, $custom = true) {
|
1166 |
+
if( $custom ) {
|
1167 |
+
$result = apply_filters('bapf_uparse_get_terms', null, $this, $args);
|
1168 |
+
if( $result !== null ) {
|
1169 |
+
if(! empty($args['include'])) {
|
1170 |
+
if( ! is_array($args['include']) ) {
|
1171 |
+
$args['include'] = array($args['include']);
|
1172 |
+
}
|
1173 |
+
$terms = array();
|
1174 |
+
foreach($result as $term) {
|
1175 |
+
if(array_search($term->term_id, $args['include']) !== FALSE) {
|
1176 |
+
$terms[] = $term;
|
1177 |
+
}
|
1178 |
+
}
|
1179 |
+
$result = $terms;
|
1180 |
+
}
|
1181 |
+
if(! empty($args['exclude'])) {
|
1182 |
+
if( ! is_array($args['exclude']) ) {
|
1183 |
+
$args['exclude'] = array($args['exclude']);
|
1184 |
+
}
|
1185 |
+
$terms = array();
|
1186 |
+
foreach($result as $term) {
|
1187 |
+
if(array_search($term->term_id, $args['exclude']) === FALSE) {
|
1188 |
+
$terms[] = $term;
|
1189 |
+
}
|
1190 |
+
}
|
1191 |
+
$result = $terms;
|
1192 |
+
}
|
1193 |
+
if(! empty($args['fields'])) {
|
1194 |
+
$terms = array();
|
1195 |
+
foreach($result as $term) {
|
1196 |
+
switch($args['fields']) {
|
1197 |
+
case 'ids':
|
1198 |
+
$terms[] = $term->term_id;
|
1199 |
+
break;
|
1200 |
+
case 'names':
|
1201 |
+
$terms[] = $term->name;
|
1202 |
+
break;
|
1203 |
+
case 'count':
|
1204 |
+
$terms[] = $term->count;
|
1205 |
+
break;
|
1206 |
+
case 'id=>parent':
|
1207 |
+
$terms[$term->term_id] = $term->parent;
|
1208 |
+
break;
|
1209 |
+
case 'id=>slug':
|
1210 |
+
$terms[$term->term_id] = $term->slug;
|
1211 |
+
break;
|
1212 |
+
case 'id=>name':
|
1213 |
+
$terms[$term->term_id] = $term->name;
|
1214 |
+
break;
|
1215 |
+
default:
|
1216 |
+
$terms[] = $term;
|
1217 |
+
}
|
1218 |
+
}
|
1219 |
+
$result = $terms;
|
1220 |
+
}
|
1221 |
+
return $result;
|
1222 |
+
}
|
1223 |
+
}
|
1224 |
+
$terms = get_terms($args);
|
1225 |
+
return $terms;
|
1226 |
+
}
|
1227 |
+
public function func_get_terms_slug_id($taxonomy) {
|
1228 |
+
$terms_data = br_get_cache($taxonomy, 'bapf_uparse_get_terms');
|
1229 |
+
$md5 = $this->get_taxonomy_md5();
|
1230 |
+
if( ! empty($terms_data) ) {
|
1231 |
+
if( is_array($terms_data) && isset($terms_data['md5']) && $terms_data['md5'] == $md5 && ! empty($terms_data['data']) ) {
|
1232 |
+
$terms = $terms_data['data'];
|
1233 |
+
}
|
1234 |
+
}
|
1235 |
+
if( empty($terms) ) {
|
1236 |
+
$terms = $this->get_terms(array(
|
1237 |
+
'fields' => 'id=>slug',
|
1238 |
+
'hide_empty' => false,
|
1239 |
+
'taxonomy' => $taxonomy
|
1240 |
+
));
|
1241 |
+
br_set_cache($taxonomy, array('md5' => $md5, 'data' => $terms), 'bapf_uparse_get_terms', 43200);
|
1242 |
+
}
|
1243 |
+
return $terms;
|
1244 |
+
}
|
1245 |
+
public function get_regex($return = false) {
|
1246 |
+
$regex = apply_filters('bapf_uparse_regex', array(
|
1247 |
+
'filter' => '/((%val_sym%)\[(%val_sym%)\])(?:$|\|)/',
|
1248 |
+
'values' => '/[^%delimiters%]+|[%delimiters%]/',
|
1249 |
+
'replacements' => array(
|
1250 |
+
'%val_sym%' => '[\w+_*-]+',
|
1251 |
+
'%delimiters%' => '\+_-'
|
1252 |
+
)
|
1253 |
+
), $this);
|
1254 |
+
foreach($regex as $type => &$regex_single) {
|
1255 |
+
if($type != 'replacements') {
|
1256 |
+
$regex_single = str_replace(array_keys($regex['replacements']), array_values($regex['replacements']), $regex_single);
|
1257 |
+
}
|
1258 |
+
}
|
1259 |
+
if($return === false) {
|
1260 |
+
return $regex;
|
1261 |
+
} else {
|
1262 |
+
return ( empty($regex[$return]) ? '' : $regex[$return]);
|
1263 |
+
}
|
1264 |
+
}
|
1265 |
+
}
|
1266 |
+
new BeRocket_url_parse_page();
|
1267 |
+
}
|
includes/url-parse/price.php
ADDED
@@ -0,0 +1,145 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if( ! class_exists('BeRocket_url_parse_page_price') ) {
|
3 |
+
class BeRocket_url_parse_page_price {
|
4 |
+
public $main_class;
|
5 |
+
function __construct() {
|
6 |
+
add_action('bapf_class_ready', array($this, 'init'), 10, 1);
|
7 |
+
add_filter('bapf_uparse_func_check_attribute_name', array($this, 'name_price'), 100, 3);
|
8 |
+
add_filter('bapf_uparse_func_check_attribute_values', array($this, 'values_price'), 100, 6);
|
9 |
+
add_filter('bapf_uparse_generate_custom_query_each', array($this, 'custom_query'), 100, 6);
|
10 |
+
add_filter('bapf_uparse_generate_filter_link_each', array($this, 'generate_filter_link'), 100, 4);
|
11 |
+
add_filter('BeRocket_AAPF_template_full_content', array($this, 'slider_selected'), 10, 4);
|
12 |
+
}
|
13 |
+
public function init($BeRocket_AAPF) {
|
14 |
+
$this->main_class = $BeRocket_AAPF;
|
15 |
+
}
|
16 |
+
public function name_price($result, $instance, $attribute_name) {
|
17 |
+
$price_taxonomy = apply_filters('bapf_uparse_price_taxonomy', 'price');
|
18 |
+
if( $result === null && $attribute_name == $price_taxonomy ) {
|
19 |
+
$result = array(
|
20 |
+
'taxonomy' => 'bapf_price',
|
21 |
+
'type' => 'price'
|
22 |
+
);
|
23 |
+
}
|
24 |
+
return $result;
|
25 |
+
}
|
26 |
+
public function values_price($result, $instance, $values_line, $taxonomy, $filter, $args) {
|
27 |
+
if( $result === null && isset($filter['type']) && $filter['type'] == 'price' ) {
|
28 |
+
$error = array(
|
29 |
+
'error' => new WP_Error( 'bapf_uparse', __('Incorrect data for price: ', 'BeRocket_AJAX_domain').$values_line )
|
30 |
+
);
|
31 |
+
$values = explode('_', $values_line);
|
32 |
+
if( count($values) == 2 ) {
|
33 |
+
$values[0] = floatval($values[0]);
|
34 |
+
$values[1] = floatval($values[1]);
|
35 |
+
if( $values[0] >= 0 && $values[1] >= 0 && $values[0] <= $values[1] ) {
|
36 |
+
$result = array(
|
37 |
+
'values' => array('from' => $values[0], 'to' => $values[1]),
|
38 |
+
'operator' => $instance->func_delimiter_to_operator('_')
|
39 |
+
);
|
40 |
+
} else { return $error; }
|
41 |
+
} else { return $error; }
|
42 |
+
}
|
43 |
+
return $result;
|
44 |
+
}
|
45 |
+
public function custom_query($result, $instance, $filter, $data) {
|
46 |
+
if( $result === null && isset($filter['type']) && $filter['type'] == 'price' && isset($filter['val_arr']['from']) && isset($filter['val_arr']['to']) ) {
|
47 |
+
$result = $filter;
|
48 |
+
$result['custom_query'] = array($this, 'post_clauses');
|
49 |
+
$result['custom_query_line'] = 'priceslider:'.$filter['val_arr']['from'].'-'.$filter['val_arr']['to'];
|
50 |
+
}
|
51 |
+
return $result;
|
52 |
+
}
|
53 |
+
public function generate_filter_link($result, $instance, $filter, $data) {
|
54 |
+
if( $filter['type'] == 'price' && isset($filter['val_arr']['from']) && isset($filter['val_arr']['to']) ) {
|
55 |
+
|
56 |
+
}
|
57 |
+
return $result;
|
58 |
+
}
|
59 |
+
public function generate_filter_link_val_arr($val_arr, $filter, $instance) {
|
60 |
+
if( isset($val_arr['from']) && isset($val_arr['to']) ) {
|
61 |
+
$delimiter = '_';
|
62 |
+
if( isset($val_arr['op']) ) {
|
63 |
+
$delimiter = $instance->func_operator_to_delimiter($val_arr['op']);
|
64 |
+
unset($val_arr['op']);
|
65 |
+
}
|
66 |
+
}
|
67 |
+
}
|
68 |
+
public function post_clauses($args, $filter) {
|
69 |
+
return $this->add_price_to_post_clauses($args, $filter);
|
70 |
+
}
|
71 |
+
public function add_price_to_post_clauses($args, $filter = false) {
|
72 |
+
global $berocket_parse_page_obj;
|
73 |
+
if( ! empty($filter['val_arr']) && isset($filter['val_arr']['from']) && isset($filter['val_arr']['to']) ) {
|
74 |
+
$options = $this->main_class->get_option();
|
75 |
+
if( empty($options['filter_price_variation']) ) {
|
76 |
+
$args = $this->wc_price_to_post_clauses($args, $filter);
|
77 |
+
} else {
|
78 |
+
$args = $this->advanced_price_to_post_clauses($args, $filter);
|
79 |
+
}
|
80 |
+
}
|
81 |
+
return $args;
|
82 |
+
}
|
83 |
+
public function wc_price_to_post_clauses($args, $filter) {
|
84 |
+
global $wpdb;
|
85 |
+
if ( ! strstr( $args['join'], 'wc_product_meta_lookup' ) ) {
|
86 |
+
$args['join'] .= " LEFT JOIN {$wpdb->wc_product_meta_lookup} as wc_product_meta_lookup ON {$wpdb->posts}.ID = wc_product_meta_lookup.product_id ";
|
87 |
+
}
|
88 |
+
$min = apply_filters('bapf_uparse_price_for_filtering_convert', (isset( $filter['val_arr']['from'] ) ? floatval( $filter['val_arr']['from'] ) : 0));
|
89 |
+
$max = apply_filters('bapf_uparse_price_for_filtering_convert', (isset( $filter['val_arr']['to'] ) ? floatval( $filter['val_arr']['to'] ) : 9999999999));
|
90 |
+
list($min, $max) = apply_filters('berocket_min_max_filter', array($min, $max));
|
91 |
+
$args['where'] .= $wpdb->prepare(
|
92 |
+
' AND wc_product_meta_lookup.min_price >= %f AND wc_product_meta_lookup.max_price <= %f ',
|
93 |
+
$min,
|
94 |
+
$max
|
95 |
+
);
|
96 |
+
return $args;
|
97 |
+
}
|
98 |
+
public function advanced_price_to_post_clauses($args, $filter) {
|
99 |
+
global $wpdb;
|
100 |
+
$min = apply_filters('bapf_uparse_price_for_filtering_convert', (isset( $filter['val_arr']['from'] ) ? floatval( $filter['val_arr']['from'] ) : 0));
|
101 |
+
$max = apply_filters('bapf_uparse_price_for_filtering_convert', (isset( $filter['val_arr']['to'] ) ? floatval( $filter['val_arr']['to'] ) : 9999999999));
|
102 |
+
list($min, $max) = apply_filters('berocket_min_max_filter', array($min, $max));
|
103 |
+
$where = $wpdb->prepare(
|
104 |
+
'bapf_price_lookup.min_price >= %f AND bapf_price_lookup.max_price <= %f ',
|
105 |
+
$min,
|
106 |
+
$max
|
107 |
+
);
|
108 |
+
$args['join'] .= $this->get_advanced_price_temp_table($where);
|
109 |
+
return $args;
|
110 |
+
}
|
111 |
+
public function get_advanced_price_temp_table ($where) {
|
112 |
+
global $wpdb;
|
113 |
+
$query_price = array(
|
114 |
+
'select' => "SELECT IF(bapf_price_post.post_parent = 0, bapf_price_post.ID, bapf_price_post.post_parent) as product_id from {$wpdb->posts} as bapf_price_post",
|
115 |
+
'join' => "JOIN {$wpdb->wc_product_meta_lookup} as bapf_price_lookup ON bapf_price_post.ID = bapf_price_lookup.product_id",
|
116 |
+
'where' => "WHERE (" . $where . ")"
|
117 |
+
);
|
118 |
+
$query_price = apply_filters('berocket_aapf_get_advanced_price_temp_table', $query_price, $where);
|
119 |
+
$query_price = implode(' ', $query_price);
|
120 |
+
$table = " JOIN ({$query_price}) as bapf_custom_price ON {$wpdb->posts}.ID = bapf_custom_price.product_id";
|
121 |
+
|
122 |
+
return $table;
|
123 |
+
}
|
124 |
+
function slider_selected($template_content, $terms, $berocket_query_var_title) {
|
125 |
+
if( in_array($berocket_query_var_title['new_template'], array('slider', 'new_slider')) ) {
|
126 |
+
foreach($terms as $term){break;}
|
127 |
+
if( count($terms) == 1 ) {
|
128 |
+
global $berocket_parse_page_obj;
|
129 |
+
$filter_data = $berocket_parse_page_obj->get_current();
|
130 |
+
foreach($filter_data['filters'] as $filter) {
|
131 |
+
if( (($term->taxonomy == 'price' && $filter['type'] == 'price')
|
132 |
+
|| ( in_array($filter['type'], array('attribute', 'taxonomy')) && $filter['taxonomy'] == $term->taxonomy ) )
|
133 |
+
&& ! empty($filter['val_arr']['op']) && $filter['val_arr']['op'] == 'SLIDER') {
|
134 |
+
$template_content['template']['content']['filter']['content']['slider_all']['content']['slider']['attributes']['data-start'] = floatval($filter['val_arr']['from']);
|
135 |
+
$template_content['template']['content']['filter']['content']['slider_all']['content']['slider']['attributes']['data-end'] = floatval($filter['val_arr']['to']);
|
136 |
+
break;
|
137 |
+
}
|
138 |
+
}
|
139 |
+
}
|
140 |
+
}
|
141 |
+
return $template_content;
|
142 |
+
}
|
143 |
+
}
|
144 |
+
new BeRocket_url_parse_page_price();
|
145 |
+
}
|
includes/visual-composer.php
CHANGED
@@ -3,58 +3,60 @@ function berocket_filter_vc_before_init() {
|
|
3 |
if( class_exists('WPBakeryShortCode') && function_exists('vc_map') ) {
|
4 |
global $post;
|
5 |
$old_post = $post;
|
6 |
-
|
7 |
-
|
8 |
-
$query = new WP_Query(array('post_type' => 'br_product_filter', 'nopaging' => true, 'fields' => 'ids'));
|
9 |
-
$posts = $query->get_posts();
|
10 |
-
$filter_list = array(__('--Please select filter--', 'BeRocket_AJAX_domain') => '');
|
11 |
-
if ( is_array($posts) && count($posts) ) {
|
12 |
-
foreach($posts as $post_id) {
|
13 |
-
$filter_list[get_the_title($post_id) . ' (ID:' . $post_id . ')'] = $post_id;
|
14 |
}
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
),
|
30 |
-
)
|
31 |
-
|
32 |
-
class WPBakeryShortCode_br_filters_group extends WPBakeryShortCode {
|
33 |
-
}
|
34 |
-
$query = new WP_Query(array('post_type' => 'br_filters_group', 'nopaging' => true, 'fields' => 'ids'));
|
35 |
-
$posts = $query->get_posts();
|
36 |
-
$filter_list = array(__('--Please select filter--', 'BeRocket_AJAX_domain') => '');
|
37 |
-
if ( is_array($posts) && count($posts) ) {
|
38 |
-
foreach($posts as $post_id) {
|
39 |
-
$filter_list[get_the_title($post_id) . ' (ID:' . $post_id . ')'] = $post_id;
|
40 |
}
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
),
|
56 |
-
)
|
57 |
-
|
58 |
}
|
59 |
}
|
60 |
|
3 |
if( class_exists('WPBakeryShortCode') && function_exists('vc_map') ) {
|
4 |
global $post;
|
5 |
$old_post = $post;
|
6 |
+
if( is_admin() ) {
|
7 |
+
class WPBakeryShortCode_br_filter_single extends WPBakeryShortCode {
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
}
|
9 |
+
$query = new WP_Query(array('post_type' => 'br_product_filter', 'nopaging' => true, 'fields' => 'ids'));
|
10 |
+
$posts = $query->get_posts();
|
11 |
+
$filter_list = array(__('--Please select filter--', 'BeRocket_AJAX_domain') => '');
|
12 |
+
if ( is_array($posts) && count($posts) ) {
|
13 |
+
foreach($posts as $post_id) {
|
14 |
+
$filter_list[get_the_title($post_id) . ' (ID:' . $post_id . ')'] = $post_id;
|
15 |
+
}
|
16 |
+
}
|
17 |
+
wp_reset_query();
|
18 |
+
vc_map( array(
|
19 |
+
'base' => 'br_filter_single',
|
20 |
+
'name' => __( 'Single Filter', 'BeRocket_AJAX_domain' ),
|
21 |
+
'class' => '',
|
22 |
+
'category' => __( 'BeRocket', 'BeRocket_AJAX_domain' ),
|
23 |
+
'icon' => 'icon-heart',
|
24 |
+
'params' => array(
|
25 |
+
array(
|
26 |
+
'type' => 'dropdown',
|
27 |
+
'heading' => __( 'Filter', 'BeRocket_AJAX_domain' ),
|
28 |
+
'param_name' => 'filter_id',
|
29 |
+
'value' => $filter_list,
|
30 |
+
),
|
31 |
),
|
32 |
+
) );
|
33 |
+
class WPBakeryShortCode_br_filters_group extends WPBakeryShortCode {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
}
|
35 |
+
$query = new WP_Query(array('post_type' => 'br_filters_group', 'nopaging' => true, 'fields' => 'ids'));
|
36 |
+
$posts = $query->get_posts();
|
37 |
+
$filter_list = array(__('--Please select filter--', 'BeRocket_AJAX_domain') => '');
|
38 |
+
if ( is_array($posts) && count($posts) ) {
|
39 |
+
foreach($posts as $post_id) {
|
40 |
+
$filter_list[get_the_title($post_id) . ' (ID:' . $post_id . ')'] = $post_id;
|
41 |
+
}
|
42 |
+
}
|
43 |
+
wp_reset_query();
|
44 |
+
vc_map( array(
|
45 |
+
'base' => 'br_filters_group',
|
46 |
+
'name' => __( 'Group Filter', 'BeRocket_AJAX_domain' ),
|
47 |
+
'class' => '',
|
48 |
+
'category' => __( 'BeRocket', 'BeRocket_AJAX_domain' ),
|
49 |
+
'icon' => 'icon-heart',
|
50 |
+
'params' => array(
|
51 |
+
array(
|
52 |
+
'type' => 'dropdown',
|
53 |
+
'heading' => __( 'Filter', 'BeRocket_product_brand_domain' ),
|
54 |
+
'param_name' => 'group_id',
|
55 |
+
'value' => $filter_list,
|
56 |
+
),
|
57 |
),
|
58 |
+
) );
|
59 |
+
}
|
60 |
}
|
61 |
}
|
62 |
|
includes/widget_functions.php
CHANGED
@@ -54,7 +54,10 @@ class BeRocket_AAPF_Widget_functions {
|
|
54 |
} elseif( (! empty($min_price) || $min_price == '0') && ! empty($max_price) ) {
|
55 |
$price_range = array($min_price, $max_price);
|
56 |
} else {
|
57 |
-
$
|
|
|
|
|
|
|
58 |
}
|
59 |
if ( ! empty($price_values) ) {
|
60 |
$all_terms_name = $price_range;
|
@@ -97,18 +100,8 @@ class BeRocket_AAPF_Widget_functions {
|
|
97 |
$max = $max_price;
|
98 |
}
|
99 |
}
|
100 |
-
|
101 |
-
|
102 |
-
$slider_value1 = array_search( $_POST['price'][0], $all_terms_name );
|
103 |
-
$slider_value2 = array_search( $_POST['price'][1], $all_terms_name );
|
104 |
-
} else {
|
105 |
-
$slider_value1 = apply_filters('berocket_price_filter_widget_min_amount', apply_filters('berocket_price_slider_widget_min_amount', apply_filters('woocommerce_price_filter_widget_min_amount', $_POST['price'][0])), $_POST['price'][0]);
|
106 |
-
$slider_value2 = apply_filters('berocket_price_filter_widget_max_amount', apply_filters('berocket_price_slider_widget_max_amount', apply_filters('woocommerce_price_filter_widget_max_amount', $_POST['price'][1])), $_POST['price'][1]);
|
107 |
-
}
|
108 |
-
} else {
|
109 |
-
$slider_value1 = $min;
|
110 |
-
$slider_value2 = $max;
|
111 |
-
}
|
112 |
$id = 'br_price';
|
113 |
$slider_class .= ' berocket_filter_price_slider';
|
114 |
$main_class .= ' price';
|
@@ -145,333 +138,6 @@ class BeRocket_AAPF_Widget_functions {
|
|
145 |
return $set_query_var_title;
|
146 |
}
|
147 |
|
148 |
-
public static function remove_pid( $terms ) {
|
149 |
-
|
150 |
-
foreach ( $terms as &$term ) {
|
151 |
-
if ( isset( $term ) ) {
|
152 |
-
if ( isset( $term->PID ) ) {
|
153 |
-
$term->PID = '';
|
154 |
-
}
|
155 |
-
|
156 |
-
if ( is_array( $term ) ) {
|
157 |
-
foreach ( $term as &$subterm ) {
|
158 |
-
if ( isset( $subterm ) and isset( $subterm->PID ) ) {
|
159 |
-
$subterm->PID = '';
|
160 |
-
}
|
161 |
-
}
|
162 |
-
if( isset($subterm) ) {
|
163 |
-
unset($subterm);
|
164 |
-
}
|
165 |
-
}
|
166 |
-
|
167 |
-
}
|
168 |
-
}
|
169 |
-
if( isset($term) ) {
|
170 |
-
unset($term);
|
171 |
-
}
|
172 |
-
return $terms;
|
173 |
-
}
|
174 |
-
|
175 |
-
public static function listener_wp_query() {
|
176 |
-
global $wp_query, $wp_rewrite;
|
177 |
-
$br_options = apply_filters( 'berocket_aapf_listener_br_options', BeRocket_AAPF::get_aapf_option() );
|
178 |
-
|
179 |
-
$add_to_args = array();
|
180 |
-
if ( ! empty($_POST['limits']) && is_array($_POST['limits']) ) {
|
181 |
-
foreach ( $_POST['limits'] as $post_key => $t ) {
|
182 |
-
if( $t[0] == '_date' ) {
|
183 |
-
$from = $t[1];
|
184 |
-
$to = $t[2];
|
185 |
-
$from = substr($from, 0, 2).'/'.substr($from, 2, 2).'/'.substr($from, 4, 4);
|
186 |
-
$to = substr($to, 0, 2).'/'.substr($to, 2, 2).'/'.substr($to, 4, 4);
|
187 |
-
$from = date('Y-m-d 00:00:00', strtotime($from));
|
188 |
-
$to = date('Y-m-d 23:59:59', strtotime($to));
|
189 |
-
$add_to_args['date_query'] = array(
|
190 |
-
'after' => $from,
|
191 |
-
'before' => $to,
|
192 |
-
);
|
193 |
-
unset($_POST['limits'][$post_key]);
|
194 |
-
}
|
195 |
-
}
|
196 |
-
}
|
197 |
-
$BeRocket_AAPF = BeRocket_AAPF::getInstance();
|
198 |
-
if ( ! empty($_POST['terms']) && is_array($_POST['terms']) ) {
|
199 |
-
$stop_sale = false;
|
200 |
-
$check_sale = $check_notsale = 0;
|
201 |
-
foreach ( $_POST['terms'] as $post_key => $t ) {
|
202 |
-
if( $t[0] == 'price' ) {
|
203 |
-
if( preg_match( "~\*~", $t[1] ) ) {
|
204 |
-
if( ! isset( $_POST['price_ranges'] ) ) {
|
205 |
-
$_POST['price_ranges'] = array();
|
206 |
-
}
|
207 |
-
$_POST['price_ranges'][] = $t[1];
|
208 |
-
unset( $_POST['terms'][$post_key] );
|
209 |
-
}
|
210 |
-
} elseif( $t[0] == '_sale' ) {
|
211 |
-
// if both used do nothing
|
212 |
-
if ( $t[0] == '_sale' and $t[3] == 'sale' ) {
|
213 |
-
$check_sale++;
|
214 |
-
}
|
215 |
-
if ( $t[0] == '_sale' and $t[3] == 'notsale' ) {
|
216 |
-
$check_notsale++;
|
217 |
-
}
|
218 |
-
unset($_POST['terms'][$post_key]);
|
219 |
-
} elseif( $t[0] == '_rating' ) {
|
220 |
-
$_POST['terms'][$post_key][0] = 'product_visibility';
|
221 |
-
}
|
222 |
-
}
|
223 |
-
if ( ! empty($br_options['slug_urls']) ) {
|
224 |
-
foreach ( $_POST['terms'] as $post_key => $t ) {
|
225 |
-
if( $t[0] == '_stock_status' ) {
|
226 |
-
$_stock_status = array( 'instock' => 1, 'outofstock' => 2);
|
227 |
-
$_POST['terms'][$post_key][1] = (isset($_stock_status[$t[1]]) ? $_stock_status[$t[1]] : $_stock_status['instock']);
|
228 |
-
} else {
|
229 |
-
$t[1] = get_term_by( 'slug', $t[3], $t[0] );
|
230 |
-
$t[1] = $t[1]->term_id;
|
231 |
-
$_POST['terms'][$post_key] = $t;
|
232 |
-
}
|
233 |
-
}
|
234 |
-
}
|
235 |
-
|
236 |
-
if ( ! ($check_sale and $check_notsale) ) {
|
237 |
-
if ( $check_sale ) {
|
238 |
-
$add_to_args['post__in'] = array_merge( array( 0 ), wc_get_product_ids_on_sale() );
|
239 |
-
} elseif( $check_notsale ) {
|
240 |
-
$add_to_args['post__in'] = array_merge( array( 0 ), $BeRocket_AAPF->wc_get_product_ids_not_on_sale() );
|
241 |
-
}
|
242 |
-
}
|
243 |
-
}
|
244 |
-
|
245 |
-
add_filter( 'post_class', array( __CLASS__, 'add_product_class' ) );
|
246 |
-
add_filter( 'woocommerce_pagination_args', array( __CLASS__, 'pagination_args' ) );
|
247 |
-
|
248 |
-
$woocommerce_hide_out_of_stock_items = self::woocommerce_hide_out_of_stock_items();
|
249 |
-
|
250 |
-
$meta_query = $BeRocket_AAPF->remove_out_of_stock( array() , true, $woocommerce_hide_out_of_stock_items != 'yes' );
|
251 |
-
|
252 |
-
$args = apply_filters( 'berocket_aapf_listener_wp_query_args', array() );
|
253 |
-
foreach($add_to_args as $arg_name => $add_arg) {
|
254 |
-
$args[$arg_name] = $add_arg;
|
255 |
-
}
|
256 |
-
if( ! empty($_POST['limits']) ) {
|
257 |
-
$args = apply_filters('berocket_aapf_convert_limits_to_tax_query', $args, $_POST['limits']);
|
258 |
-
}
|
259 |
-
if( ! isset($args['post__in']) ) {
|
260 |
-
$args['post__in'] = array();
|
261 |
-
}
|
262 |
-
if( $woocommerce_hide_out_of_stock_items == 'yes' ) {
|
263 |
-
$args['post__in'] = $BeRocket_AAPF->remove_out_of_stock( $args['post__in'] );
|
264 |
-
}
|
265 |
-
if( ! br_woocommerce_version_check() ) {
|
266 |
-
$args['post__in'] = $BeRocket_AAPF->remove_hidden( $args['post__in'] );
|
267 |
-
}
|
268 |
-
$args['meta_query'] = $meta_query;
|
269 |
-
|
270 |
-
if( ! empty($_POST['limits']) ) {
|
271 |
-
$args = apply_filters('berocket_aapf_convert_limits_to_tax_query', $args, $_POST['limits']);
|
272 |
-
}
|
273 |
-
if( isset($_POST['price']) && is_array($_POST['price']) ) {
|
274 |
-
$_POST['price'] = apply_filters('berocket_min_max_filter', $_POST['price']);
|
275 |
-
}
|
276 |
-
$min = isset( $_POST['price'][0] ) ? floatval( $_POST['price'][0] ) : 0;
|
277 |
-
$max = isset( $_POST['price'][1] ) ? floatval( $_POST['price'][1] ) : 9999999999;
|
278 |
-
|
279 |
-
$args['meta_query'][] = array(
|
280 |
-
'key' => apply_filters('berocket_price_filter_meta_key', '_price', 'widget_2847'),
|
281 |
-
'value' => array( $min, $max ),
|
282 |
-
'compare' => 'BETWEEN',
|
283 |
-
'type' => 'DECIMAL',
|
284 |
-
'price_filter' => true,
|
285 |
-
);
|
286 |
-
$args['post_status'] = 'publish';
|
287 |
-
if ( is_user_logged_in() ) {
|
288 |
-
$args['post_status'] .= '|private';
|
289 |
-
}
|
290 |
-
$args['post_type'] = 'product';
|
291 |
-
$default_posts_per_page = get_option( 'posts_per_page' );
|
292 |
-
$args['posts_per_page'] = apply_filters( 'loop_shop_per_page', $default_posts_per_page );
|
293 |
-
if ( ! empty($_POST['price_ranges']) && is_array($_POST['price_ranges']) ) {
|
294 |
-
$price_range_query = array( 'relation' => 'OR' );
|
295 |
-
foreach ( $_POST['price_ranges'] as $range ) {
|
296 |
-
$range = explode( '*', $range );
|
297 |
-
$price_range_query[] = array( 'key' => apply_filters('berocket_price_filter_meta_key', '_price', 'widget_2867'), 'compare' => 'BETWEEN', 'type' => 'NUMERIC', 'value' => array( ($range[0] - 1), $range[1] ) );
|
298 |
-
}
|
299 |
-
$args['meta_query'][] = $price_range_query;
|
300 |
-
}
|
301 |
-
if ( ! empty($_POST['price']) && is_array($_POST['price']) ) {
|
302 |
-
$args['meta_query'][] = array( 'key' => apply_filters('berocket_price_filter_meta_key', '_price', 'widget_2872'), 'compare' => 'BETWEEN', 'type' => 'NUMERIC', 'value' => array( ($_POST['price'][0]), $_POST['price'][1] ) );
|
303 |
-
}
|
304 |
-
|
305 |
-
if( isset($_POST['product_taxonomy']) && $_POST['product_taxonomy'] != '-1' && strpos( $_POST['product_taxonomy'], '|' ) !== FALSE ) {
|
306 |
-
$product_taxonomy = explode( '|', $_POST['product_taxonomy'] );
|
307 |
-
$args['taxonomy'] = $product_taxonomy[0];
|
308 |
-
$args['term'] = $product_taxonomy[1];
|
309 |
-
}
|
310 |
-
if( isset($_POST['s']) && strlen($_POST['s']) > 0 ) {
|
311 |
-
$args['s'] = $_POST['s'];
|
312 |
-
}
|
313 |
-
|
314 |
-
if( function_exists('wc_get_product_visibility_term_ids') ) {
|
315 |
-
$product_visibility_term_ids = wc_get_product_visibility_term_ids();
|
316 |
-
|
317 |
-
$args['tax_query'][] = array(
|
318 |
-
'taxonomy' => 'product_visibility',
|
319 |
-
'field' => 'term_taxonomy_id',
|
320 |
-
'terms' => array($product_visibility_term_ids['exclude-from-catalog']),
|
321 |
-
'operator' => 'NOT IN'
|
322 |
-
);
|
323 |
-
}
|
324 |
-
$args = array_merge($args, WC()->query->get_catalog_ordering_args());
|
325 |
-
$wp_query = new WP_Query( $args );
|
326 |
-
|
327 |
-
// here we get max products to know if current page is not too big
|
328 |
-
$is_using_permalinks = $wp_rewrite->using_permalinks();
|
329 |
-
$_POST['location'] = (empty($_POST['location']) ? $_GET['location'] : $_POST['location']);
|
330 |
-
if ( $is_using_permalinks and preg_match( "~/page/([0-9]+)~", $_POST['location'], $mathces ) or preg_match( "~paged?=([0-9]+)~", $_POST['location'], $mathces ) ) {
|
331 |
-
$args['paged'] = min( $mathces[1], $wp_query->max_num_pages );
|
332 |
-
|
333 |
-
$wp_query = new WP_Query( $args );
|
334 |
-
}
|
335 |
-
return apply_filters('berocket_listener_wp_query_return', $wp_query, $args);
|
336 |
-
}
|
337 |
-
|
338 |
-
public static function rebuild() {
|
339 |
-
add_action('woocommerce_before_shop_loop', array( __CLASS__, 'tags_restore' ), 999999);
|
340 |
-
}
|
341 |
-
|
342 |
-
public static function tags_restore() {
|
343 |
-
global $wp_query;
|
344 |
-
$args = apply_filters( 'berocket_aapf_listener_wp_query_args', array() );
|
345 |
-
$tags = ( empty($args['product_tag']) ? '' : $args['product_tag'] );
|
346 |
-
if( ! empty($tags) ) {
|
347 |
-
$q_vars = $wp_query->query_vars;
|
348 |
-
$q_vars['product_tag'] = $tags;
|
349 |
-
$q_vars['taxonomy'] = '';
|
350 |
-
$q_vars['term'] = '';
|
351 |
-
unset( $q_vars['s'] );
|
352 |
-
if( isset($q_vars['tax_query']) ) {
|
353 |
-
$tax_query_reset = $q_vars['tax_query'];
|
354 |
-
unset($q_vars['tax_query']);
|
355 |
-
}
|
356 |
-
$wp_query = new WP_Query( $q_vars );
|
357 |
-
if( isset($tax_query_reset) ) {
|
358 |
-
$wp_query->set('tax_query', $tax_query_reset);
|
359 |
-
$q_vars['tax_query'] = $tax_query_reset;
|
360 |
-
unset($tax_query_reset);
|
361 |
-
}
|
362 |
-
}
|
363 |
-
}
|
364 |
-
|
365 |
-
public static function woocommerce_before_main_content() {
|
366 |
-
?>||EXPLODE||<?php
|
367 |
-
self::tags_restore();
|
368 |
-
}
|
369 |
-
|
370 |
-
public static function woocommerce_after_main_content() {
|
371 |
-
?>||EXPLODE||<?php
|
372 |
-
}
|
373 |
-
|
374 |
-
public static function pre_get_posts() {
|
375 |
-
add_action( 'woocommerce_before_shop_loop', array( __CLASS__, 'woocommerce_before_main_content' ), 999999 );
|
376 |
-
add_action( 'woocommerce_after_shop_loop', array( __CLASS__, 'woocommerce_after_main_content' ), 1 );
|
377 |
-
}
|
378 |
-
|
379 |
-
public static function end_clean() {
|
380 |
-
global $wp_query, $wp_rewrite;
|
381 |
-
$br_options = apply_filters( 'berocket_aapf_listener_br_options', BeRocket_AAPF::get_aapf_option() );
|
382 |
-
if ( $br_options['alternative_load_type'] != 'js' ) {
|
383 |
-
$_RESPONSE['products'] = explode('||EXPLODE||', ob_get_contents());
|
384 |
-
$_RESPONSE['products'] = $_RESPONSE['products'][1];
|
385 |
-
ob_end_clean();
|
386 |
-
|
387 |
-
if ( $_RESPONSE['products'] == null ) {
|
388 |
-
unset( $_RESPONSE['products'] );
|
389 |
-
ob_start();
|
390 |
-
wc_no_products_found();
|
391 |
-
$_RESPONSE['no_products'] = ob_get_contents();
|
392 |
-
ob_end_clean();
|
393 |
-
} else {
|
394 |
-
$_RESPONSE['products'] = str_replace( 'explode=explode#038;', '', $_RESPONSE['products'] );
|
395 |
-
$_RESPONSE['products'] = str_replace( '&explode=explode', '', $_RESPONSE['products'] );
|
396 |
-
$_RESPONSE['products'] = str_replace( '?explode=explode', '', $_RESPONSE['products'] );
|
397 |
-
}
|
398 |
-
}
|
399 |
-
|
400 |
-
if ( braapf_filters_must_be_recounted() ) {
|
401 |
-
$_RESPONSE['attributesname'] = array();
|
402 |
-
$_RESPONSE['attributes'] = array();
|
403 |
-
|
404 |
-
if ( isset($_POST['attributes']) && is_array( $_POST['attributes'] ) ) {
|
405 |
-
$attributes = array_combine ( $_POST['attributes'], $_POST['cat_limit'] );
|
406 |
-
foreach ( $attributes as $attribute => $cat_limit ) {
|
407 |
-
if ( $attribute != 'price' ) {
|
408 |
-
$terms = FALSE;
|
409 |
-
if( $attribute == '_stock_status' ) {
|
410 |
-
$terms = array();
|
411 |
-
array_push($terms, (object)array('term_id' => '1', 'term_taxonomy_id' => '1','name' => __('In stock', 'BeRocket_AJAX_domain'), 'slug' => 'instock', 'taxonomy' => '_stock_status', 'count' => 1));
|
412 |
-
array_push($terms, (object)array('term_id' => '2', 'term_taxonomy_id' => '2', 'name' => __('Out of stock', 'BeRocket_AJAX_domain'), 'slug' => 'outofstock', 'taxonomy' => '_stock_status', 'count' => 1));
|
413 |
-
}
|
414 |
-
$_RESPONSE['attributesname'][] = $attribute;
|
415 |
-
$terms = BeRocket_AAPF_Widget::get_attribute_values( $attribute, 'id', braapf_filters_must_be_recounted('first'), TRUE, $terms, $cat_limit );
|
416 |
-
$_RESPONSE['attributes'][] = self::remove_pid( array_values($terms));
|
417 |
-
}
|
418 |
-
}
|
419 |
-
}
|
420 |
-
}
|
421 |
-
if( empty($br_options['woocommerce_removes']['ordering']) ) {
|
422 |
-
ob_start();
|
423 |
-
woocommerce_catalog_ordering();
|
424 |
-
$_RESPONSE['catalog_ordering'] = ob_get_contents();
|
425 |
-
ob_end_clean();
|
426 |
-
}
|
427 |
-
if( empty($br_options['woocommerce_removes']['result_count']) ) {
|
428 |
-
ob_start();
|
429 |
-
woocommerce_result_count();
|
430 |
-
$_RESPONSE['result_count'] = ob_get_contents();
|
431 |
-
ob_end_clean();
|
432 |
-
}
|
433 |
-
if( empty($br_options['woocommerce_removes']['pagination']) ) {
|
434 |
-
ob_start();
|
435 |
-
woocommerce_pagination();
|
436 |
-
$_RESPONSE['pagination'] = ob_get_contents();
|
437 |
-
$_RESPONSE['pagination'] = str_replace( 'explode=explode#038;', '', $_RESPONSE['pagination'] );
|
438 |
-
$_RESPONSE['pagination'] = str_replace( '&explode=explode', '', $_RESPONSE['pagination'] );
|
439 |
-
$_RESPONSE['pagination'] = str_replace( '?explode=explode', '', $_RESPONSE['pagination'] );
|
440 |
-
ob_end_clean();
|
441 |
-
}
|
442 |
-
if ( $br_options['alternative_load_type'] == 'js' ) echo '||JSON||';
|
443 |
-
$_RESPONSE = apply_filters('berocket_ajax_response_with_fix', $_RESPONSE);
|
444 |
-
$_RESPONSE['attributesname'] = array_values($_RESPONSE['attributesname']);
|
445 |
-
$_RESPONSE['attributes'] = array_values($_RESPONSE['attributes']);
|
446 |
-
foreach($_RESPONSE['attributesname'] as &$attributesname) {
|
447 |
-
if( ! is_array($attributesname) ) {
|
448 |
-
$attributesname = array();
|
449 |
-
}
|
450 |
-
}
|
451 |
-
if( isset($attributesname) ) {
|
452 |
-
unset($attributesname);
|
453 |
-
}
|
454 |
-
foreach($_RESPONSE['attributes'] as &$attributes) {
|
455 |
-
if( ! is_array($attributes) ) {
|
456 |
-
$attributes = array();
|
457 |
-
}
|
458 |
-
}
|
459 |
-
if( isset($attributes) ) {
|
460 |
-
unset($attributes);
|
461 |
-
}
|
462 |
-
echo json_encode( $_RESPONSE );
|
463 |
-
if ( $br_options['alternative_load_type'] == 'js' ) echo '||JSON||';
|
464 |
-
|
465 |
-
die();
|
466 |
-
}
|
467 |
-
|
468 |
-
public static function start_clean() {
|
469 |
-
$br_options = apply_filters( 'berocket_aapf_listener_br_options', BeRocket_AAPF::get_aapf_option() );
|
470 |
-
if ( $br_options['alternative_load_type'] != 'js' ) {
|
471 |
-
ob_start();
|
472 |
-
}
|
473 |
-
}
|
474 |
-
|
475 |
public static function color_listener() {
|
476 |
if ( defined('DOING_AJAX') && DOING_AJAX && !isset( $_POST ['tax_color_set'] ) && isset( $_POST ['br_widget_color'] ) ) {
|
477 |
$_POST ['tax_color_set'] = $_POST ['br_widget_color'];
|
@@ -532,248 +198,69 @@ class BeRocket_AAPF_Widget_functions {
|
|
532 |
return br_get_sub_categories( $parent, 'id', array( 'return' => 'hierarchy_objects', 'max_depth' => $max_count ) );
|
533 |
}
|
534 |
|
535 |
-
public static function
|
536 |
-
$
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
$home_root = parse_url( home_url() );
|
554 |
-
$home_root = ( isset( $home_root['path'] ) ) ? $home_root['path'] : '';
|
555 |
-
$home_root = preg_quote( $home_root, '|' );
|
556 |
-
|
557 |
-
$request = preg_replace( '|^' . $home_root . '|i', '', $request );
|
558 |
-
$request = preg_replace( '|^/+|', '', $request );
|
559 |
-
|
560 |
-
$is_using_permalinks = $wp_rewrite->using_permalinks();
|
561 |
-
if ( ! $is_using_permalinks ) {
|
562 |
-
$base = trailingslashit( get_bloginfo( 'url' ) );
|
563 |
-
|
564 |
-
if ( $pagenum > 1 ) {
|
565 |
-
$result = add_query_arg( 'paged', $pagenum, $base . $request );
|
566 |
-
} else {
|
567 |
-
$result = $base . $request;
|
568 |
-
}
|
569 |
-
} else {
|
570 |
-
$qs_regex = '|\?.*?$|';
|
571 |
-
preg_match( $qs_regex, $request, $qs_match );
|
572 |
-
|
573 |
-
if ( ! empty( $qs_match[0] ) ) {
|
574 |
-
$query_string = $qs_match[0];
|
575 |
-
$request = preg_replace( $qs_regex, '', $request );
|
576 |
-
} else {
|
577 |
-
$query_string = '';
|
578 |
-
}
|
579 |
-
|
580 |
-
$request = preg_replace( "|$wp_rewrite->pagination_base/\d+/?$|", '', $request );
|
581 |
-
$request = preg_replace( '|^' . preg_quote( $wp_rewrite->index, '|' ) . '|i', '', $request );
|
582 |
-
$request = ltrim( $request, '/' );
|
583 |
-
|
584 |
-
$base = trailingslashit( get_bloginfo( 'url' ) );
|
585 |
-
|
586 |
-
$is_using_index_permalinks = $wp_rewrite->using_index_permalinks();
|
587 |
-
if ( $is_using_index_permalinks && ( $pagenum > 1 || '' != $request ) )
|
588 |
-
$base .= $wp_rewrite->index . '/';
|
589 |
-
|
590 |
-
if ( $pagenum > 1 ) {
|
591 |
-
$request = ( ( !empty( $request ) ) ? trailingslashit( $request ) : $request ) . user_trailingslashit( $wp_rewrite->pagination_base . "/" . $pagenum, 'paged' );
|
592 |
-
}
|
593 |
-
|
594 |
-
$result = $base . $request . $query_string;
|
595 |
-
}
|
596 |
-
|
597 |
-
/**
|
598 |
-
* Filter the page number link for the current request.
|
599 |
-
*
|
600 |
-
* @since 2.5.0
|
601 |
-
*
|
602 |
-
* @param string $result The page number link.
|
603 |
-
*/
|
604 |
-
$result = apply_filters( 'get_pagenum_link', $result );
|
605 |
-
|
606 |
-
if ( $escape )
|
607 |
-
return esc_url( $result );
|
608 |
-
else
|
609 |
-
return esc_url_raw( $result );
|
610 |
-
}
|
611 |
-
|
612 |
-
public static function get_terms_child_parent ( $child_parent, $attribute, $current_terms = FALSE, $child_parent_depth = 1 ) {
|
613 |
-
if ( isset($child_parent) && $child_parent == 'parent' ) {
|
614 |
-
$args_terms = array(
|
615 |
-
'orderby' => 'id',
|
616 |
-
'order' => 'ASC',
|
617 |
-
'hide_empty' => false,
|
618 |
-
'parent' => 0,
|
619 |
-
);
|
620 |
-
if( $attribute == 'product_cat' ) {
|
621 |
-
$current_terms = br_get_taxonomy_hierarchy(array(), 0, 1);
|
622 |
-
} else {
|
623 |
-
$current_terms = get_terms( $attribute, $args_terms );
|
624 |
-
}
|
625 |
-
}
|
626 |
-
if ( isset($child_parent) && $child_parent == 'child' ) {
|
627 |
-
$current_terms = array( (object) array( 'depth' => 0, 'child' => 0, 'term_id' => 'R__term_id__R', 'count' => 'R__count__R', 'slug' => 'R__slug__R', 'name' => 'R__name__R', 'taxonomy' => 'R__taxonomy__R' ) );
|
628 |
-
$selected_terms = br_get_selected_term( $attribute );
|
629 |
-
$selected_terms_id = array();
|
630 |
-
if( empty($child_parent_depth) ) {
|
631 |
-
$child_parent_depth = 0;
|
632 |
-
}
|
633 |
-
foreach( $selected_terms as $selected_term ) {
|
634 |
-
$ancestors = get_ancestors( $selected_term, $attribute );
|
635 |
-
if( count( $ancestors ) >= ( $child_parent_depth - 1 ) ) {
|
636 |
-
if( count( $ancestors ) > ( $child_parent_depth - 1 ) ) {
|
637 |
-
$selected_term = $ancestors[count( $ancestors ) - ( $child_parent_depth )];
|
638 |
-
}
|
639 |
-
if ( ! in_array( $selected_term, $selected_terms_id ) ) {
|
640 |
-
$args_terms = array(
|
641 |
-
'orderby' => 'id',
|
642 |
-
'order' => 'ASC',
|
643 |
-
'hide_empty' => false,
|
644 |
-
'parent' => $selected_term,
|
645 |
-
);
|
646 |
-
$selected_terms_id[] = $selected_term;
|
647 |
-
$additional_terms = get_terms( $attribute, $args_terms );
|
648 |
-
$current_terms = array_merge( $current_terms, $additional_terms );
|
649 |
-
}
|
650 |
-
}
|
651 |
-
}
|
652 |
-
}
|
653 |
-
return $current_terms;
|
654 |
-
}
|
655 |
-
|
656 |
-
public static function is_parent_selected($attribute, $child_parent_depth = 1) {
|
657 |
-
$selected_terms = br_get_selected_term( $attribute );
|
658 |
-
$selected_terms_id = array();
|
659 |
-
foreach( $selected_terms as $selected_term ) {
|
660 |
-
if( empty($child_parent_depth) ) {
|
661 |
-
$child_parent_depth = 0;
|
662 |
-
}
|
663 |
-
$ancestors = get_ancestors( $selected_term, $attribute );
|
664 |
-
if( count( $ancestors ) > ( $child_parent_depth - 1 ) ) {
|
665 |
-
return true;
|
666 |
-
}
|
667 |
-
}
|
668 |
-
return false;
|
669 |
-
}
|
670 |
-
|
671 |
-
public static function old_wc_compatible( $query, $new = false ) {
|
672 |
-
return br_filters_old_wc_compatible( $query, $new );
|
673 |
-
}
|
674 |
-
|
675 |
-
public static function get_price_range( $product_cat = null ) {
|
676 |
-
global $wpdb, $br_wc_query, $wp_query;
|
677 |
-
|
678 |
-
$BeRocket_AAPF = BeRocket_AAPF::getInstance();
|
679 |
-
$br_options = $BeRocket_AAPF->get_option();
|
680 |
-
|
681 |
-
if( br_woocommerce_version_check('3.6') ) {
|
682 |
-
$query[ 'select' ] = "SELECT MIN(cast(FLOOR(wc_product_meta_lookup.min_price) as decimal)) as min_price,
|
683 |
-
MIN(wc_product_meta_lookup.min_price) as min_float,
|
684 |
-
MAX(wc_product_meta_lookup.max_price) as max_float,
|
685 |
-
MAX(cast(CEIL(wc_product_meta_lookup.max_price) as decimal)) as max_price ";
|
686 |
-
$query[ 'from' ] = "FROM {$wpdb->posts}";
|
687 |
-
$query[ 'join' ] = " INNER JOIN {$wpdb->wc_product_meta_lookup} as wc_product_meta_lookup ON $wpdb->posts.ID = wc_product_meta_lookup.product_id ";
|
688 |
} else {
|
689 |
-
$query[
|
690 |
-
|
691 |
-
|
692 |
-
|
693 |
-
$
|
694 |
-
|
695 |
-
|
696 |
-
|
697 |
-
|
698 |
-
$query =
|
699 |
-
|
700 |
-
$query[
|
701 |
-
|
702 |
-
|
703 |
-
|
704 |
-
|
705 |
-
|
706 |
-
|
707 |
-
|
708 |
-
|
709 |
-
|
710 |
-
|
711 |
-
|
712 |
-
|
713 |
-
|
714 |
-
|
715 |
-
|
716 |
-
|
717 |
-
|
718 |
-
|
719 |
-
|
|
|
|
|
|
|
|
|
|
|
720 |
} else {
|
721 |
-
$
|
722 |
-
|
723 |
-
|
724 |
-
if( !br_woocommerce_version_check('3.6') ) {
|
725 |
-
if ( $query[ 'where' ] ) {
|
726 |
-
$query[ 'where' ] .= " AND ";
|
727 |
-
} else {
|
728 |
-
$query[ 'where' ] = " WHERE ";
|
729 |
-
}
|
730 |
-
$query[ 'where' ] .= "wp_price_check.meta_key = '".apply_filters('berocket_price_filter_meta_key', '_price', 'widget_1243')."' AND wp_price_check.meta_value > ''";
|
731 |
-
}
|
732 |
-
|
733 |
-
if ( $post__not_in = apply_filters('berocket_aapf_get_attribute_values_post__not_in_outside', false) ) {
|
734 |
-
if ( $query[ 'where' ] ) {
|
735 |
-
$query[ 'where' ] .= " AND ";
|
736 |
-
} else {
|
737 |
-
$query[ 'where' ] = " WHERE ";
|
738 |
-
}
|
739 |
-
|
740 |
-
$query[ 'where' ] .= "$wpdb->posts.ID NOT IN(" . implode( ',', $post__not_in ) . ")";
|
741 |
-
}
|
742 |
-
if ( $post__in = apply_filters('berocket_aapf_get_attribute_values_post__in_outside', false) ) {
|
743 |
-
if ( $query[ 'where' ] ) {
|
744 |
-
$query[ 'where' ] .= " AND ";
|
745 |
} else {
|
746 |
-
$
|
747 |
}
|
748 |
-
|
749 |
-
$query[ 'where' ] .= "$wpdb->posts.ID IN(" . implode( ',', $post__in ) . ")";
|
750 |
}
|
751 |
-
|
752 |
-
$query_string = implode( ' ', $query );
|
753 |
-
|
754 |
-
$query_string = $wpdb->get_row( $query_string );
|
755 |
-
|
756 |
-
$price_range = false;
|
757 |
-
if ( isset( $query_string->min_price ) && isset( $query_string->max_price ) && $query_string->min_price != $query_string->max_price
|
758 |
-
&& (
|
759 |
-
( $query_string->min_price < ($query_string->max_price - 1) )
|
760 |
-
|| ( $query_string->min_price == $query_string->min_float && $query_string->max_price == $query_string->max_float )
|
761 |
-
)
|
762 |
-
) {
|
763 |
-
$price_range = array(
|
764 |
-
floor(apply_filters('berocket_price_filter_widget_min_amount', apply_filters('berocket_price_slider_widget_min_amount', apply_filters( 'woocommerce_price_filter_widget_min_amount', $query_string->min_price )), $query_string->min_price)),
|
765 |
-
ceil(apply_filters('berocket_price_filter_widget_max_amount', apply_filters('berocket_price_slider_widget_max_amount', apply_filters( 'woocommerce_price_filter_widget_max_amount', $query_string->max_price )), $query_string->max_price))
|
766 |
-
);
|
767 |
-
}
|
768 |
-
if( BeRocket_AAPF::$debug_mode ) {
|
769 |
-
BeRocket_AAPF::$error_log['7_price_range'] = array(
|
770 |
-
'price_range' => $price_range,
|
771 |
-
'sql' => $query_string,
|
772 |
-
);
|
773 |
-
}
|
774 |
-
return apply_filters( 'berocket_aapf_get_price_range', $price_range );
|
775 |
}
|
776 |
-
|
777 |
public static function get_attribute_values( $taxonomy = '', $order_by = 'id', $hide_empty = false, $count_filtering = true, $input_terms = FALSE, $product_cat = FALSE, $operator = 'OR' ) {
|
778 |
$br_options = apply_filters( 'berocket_aapf_listener_br_options', BeRocket_AAPF::get_aapf_option() );
|
779 |
if ( ! $taxonomy || $taxonomy == 'price' ) return array();
|
@@ -984,123 +471,6 @@ class BeRocket_AAPF_Widget_functions {
|
|
984 |
return $return_array;
|
985 |
}
|
986 |
|
987 |
-
public static function get_filter_products( $wp_query_product_cat, $woocommerce_hide_out_of_stock_items, $use_filters = true ) {
|
988 |
-
$BeRocket_AAPF = BeRocket_AAPF::getInstance();
|
989 |
-
global $wp_query, $wp_rewrite;
|
990 |
-
$_POST['product_cat'] = $wp_query_product_cat;
|
991 |
-
|
992 |
-
$old_post_terms = (isset($_POST['terms']) ? $_POST['terms'] : null);
|
993 |
-
|
994 |
-
add_filter( 'woocommerce_pagination_args', array( __CLASS__, 'pagination_args' ) );
|
995 |
-
|
996 |
-
$args = apply_filters( 'berocket_aapf_listener_wp_query_args', array() );
|
997 |
-
$tags = (isset($args['product_tag']) ? $args['product_tag'] : null);
|
998 |
-
$meta_query = $BeRocket_AAPF->remove_out_of_stock( array() , true, $woocommerce_hide_out_of_stock_items != 'yes' );
|
999 |
-
$args['post__in'] = array();
|
1000 |
-
|
1001 |
-
if( $woocommerce_hide_out_of_stock_items == 'yes' ) {
|
1002 |
-
$args['post__in'] = $BeRocket_AAPF->remove_out_of_stock( $args['post__in'] );
|
1003 |
-
}
|
1004 |
-
if ( $use_filters ) {
|
1005 |
-
$args['post__in'] = $BeRocket_AAPF->limits_filter( $args['post__in'] );
|
1006 |
-
$args['post__in'] = $BeRocket_AAPF->price_filter( $args['post__in'] );
|
1007 |
-
$args['post__in'] = $BeRocket_AAPF->add_terms( $args['post__in'] );
|
1008 |
-
} else {
|
1009 |
-
$args = array( 'posts_per_page' => -1 );
|
1010 |
-
if ( ! empty($_POST['product_cat']) and $_POST['product_cat'] != '-1' ) {
|
1011 |
-
$args['tax_query'][] = array(
|
1012 |
-
'taxonomy' => 'product_cat',
|
1013 |
-
'field' => 'slug',
|
1014 |
-
'terms' => strip_tags( $_POST['product_cat'] ),
|
1015 |
-
'operator' => 'IN'
|
1016 |
-
);
|
1017 |
-
}
|
1018 |
-
}
|
1019 |
-
|
1020 |
-
$args['post_status'] = 'publish';
|
1021 |
-
$args['post_type'] = 'product';
|
1022 |
-
|
1023 |
-
if( isset($args['tax_query']) ) {
|
1024 |
-
$tax_query_reset = $args['tax_query'];
|
1025 |
-
unset($args['tax_query']);
|
1026 |
-
}
|
1027 |
-
$wp_query = new WP_Query( $args );
|
1028 |
-
if( isset($tax_query_reset) ) {
|
1029 |
-
$wp_query->set('tax_query', $tax_query_reset);
|
1030 |
-
$args['tax_query'] = $tax_query_reset;
|
1031 |
-
unset($tax_query_reset);
|
1032 |
-
}
|
1033 |
-
|
1034 |
-
// here we get max products to know if current page is not too big
|
1035 |
-
if( ! isset($_POST['location']) ) {
|
1036 |
-
$_POST['location'] = '';
|
1037 |
-
}
|
1038 |
-
if ( $wp_rewrite->using_permalinks() and preg_match( "~/page/([0-9]+)~", $_POST['location'], $mathces ) or preg_match( "~paged?=([0-9]+)~", $_POST['location'], $mathces ) ) {
|
1039 |
-
$args['paged'] = min( $mathces[1], $wp_query->max_num_pages );
|
1040 |
-
if( isset($args['tax_query']) ) {
|
1041 |
-
$tax_query_reset = $args['tax_query'];
|
1042 |
-
unset($args['tax_query']);
|
1043 |
-
}
|
1044 |
-
$wp_query = new WP_Query( $args );
|
1045 |
-
if( isset($tax_query_reset) ) {
|
1046 |
-
$wp_query->set('tax_query', $tax_query_reset);
|
1047 |
-
$args['tax_query'] = $tax_query_reset;
|
1048 |
-
unset($tax_query_reset);
|
1049 |
-
}
|
1050 |
-
}
|
1051 |
-
if ( $wp_query->found_posts <= 1 ) {
|
1052 |
-
$args['paged'] = 0;
|
1053 |
-
if( isset($args['tax_query']) ) {
|
1054 |
-
$tax_query_reset = $args['tax_query'];
|
1055 |
-
unset($args['tax_query']);
|
1056 |
-
}
|
1057 |
-
$wp_query = new WP_Query( $args );
|
1058 |
-
if( isset($tax_query_reset) ) {
|
1059 |
-
$wp_query->set('tax_query', $tax_query_reset);
|
1060 |
-
$args['tax_query'] = $tax_query_reset;
|
1061 |
-
unset($tax_query_reset);
|
1062 |
-
}
|
1063 |
-
}
|
1064 |
-
|
1065 |
-
$products = array();
|
1066 |
-
if ( $wp_query->have_posts() ) {
|
1067 |
-
while ( have_posts() ) {
|
1068 |
-
the_post();
|
1069 |
-
$products[] = get_the_ID();
|
1070 |
-
}
|
1071 |
-
}
|
1072 |
-
|
1073 |
-
wp_reset_query();
|
1074 |
-
if( isset($meta_query) && is_array( $meta_query ) && count( $meta_query ) > 0 ) {
|
1075 |
-
$q_vars = $wp_query->query_vars;
|
1076 |
-
foreach( $q_vars['meta_query'] as $key_meta => $val_meta ) {
|
1077 |
-
if( $key_meta != 'relation' && $val_meta['key'] == '_stock_status') {
|
1078 |
-
unset( $q_vars['meta_query'][$key_meta] );
|
1079 |
-
}
|
1080 |
-
}
|
1081 |
-
$q_vars['meta_query'] = array_merge( $q_vars['meta_query'], $meta_query );
|
1082 |
-
$wp_query->set('meta_query', $q_vars['meta_query']);
|
1083 |
-
}
|
1084 |
-
if( ! empty($tags) ) {
|
1085 |
-
$q_vars = $wp_query->query_vars;
|
1086 |
-
$q_vars['product_tag'] = $tags;
|
1087 |
-
unset($q_vars['s']);
|
1088 |
-
if( isset($q_vars['tax_query']) ) {
|
1089 |
-
$tax_query_reset = $q_vars['tax_query'];
|
1090 |
-
unset($q_vars['tax_query']);
|
1091 |
-
}
|
1092 |
-
$wp_query = new WP_Query( $q_vars );
|
1093 |
-
if( isset($tax_query_reset) ) {
|
1094 |
-
$wp_query->set('tax_query', $tax_query_reset);
|
1095 |
-
$q_vars['tax_query'] = $tax_query_reset;
|
1096 |
-
unset($tax_query_reset);
|
1097 |
-
}
|
1098 |
-
}
|
1099 |
-
|
1100 |
-
$_POST['terms'] = $old_post_terms;
|
1101 |
-
return $products;
|
1102 |
-
}
|
1103 |
-
|
1104 |
public static function woocommerce_hide_out_of_stock_items(){
|
1105 |
$hide = get_option( 'woocommerce_hide_out_of_stock_items', null );
|
1106 |
|
@@ -1112,103 +482,5 @@ class BeRocket_AAPF_Widget_functions {
|
|
1112 |
|
1113 |
return apply_filters( 'berocket_aapf_hide_out_of_stock_items', $hide );
|
1114 |
}
|
1115 |
-
|
1116 |
-
public static function price_range_count($term, $from, $to) {
|
1117 |
-
if( class_exists('WP_Meta_Query') && class_exists('WP_Tax_Query') ) {
|
1118 |
-
global $wpdb, $wp_query;
|
1119 |
-
$old_join_posts = '';
|
1120 |
-
$has_new_function = method_exists('WC_Query', 'get_main_query') && method_exists('WC_Query', 'get_main_meta_query') && method_exists('WC_Query', 'get_main_tax_query');
|
1121 |
-
if( $has_new_function ) {
|
1122 |
-
$WC_Query_get_main_query = WC_Query::get_main_query();
|
1123 |
-
$has_new_function = ! empty($WC_Query_get_main_query);
|
1124 |
-
}
|
1125 |
-
if( ! $has_new_function ) {
|
1126 |
-
$old_query_vars = self::old_wc_compatible($wp_query);
|
1127 |
-
$old_meta_query = (empty( $old_query_vars[ 'meta_query' ] ) || ! is_array($old_query_vars[ 'meta_query' ]) ? array() : $old_query_vars['meta_query']);
|
1128 |
-
$old_tax_query = (empty($old_query_vars['tax_query']) || ! is_array($old_query_vars[ 'tax_query' ]) ? array() : $old_query_vars['tax_query']);
|
1129 |
-
} else {
|
1130 |
-
$old_query_vars = self::old_wc_compatible($wp_query, true);
|
1131 |
-
}
|
1132 |
-
if( ! empty( $old_query_vars['posts__in'] ) ) {
|
1133 |
-
$old_join_posts = " AND {$wpdb->posts}.ID IN (".implode(',', $old_query_vars['posts__in']).") ";
|
1134 |
-
}
|
1135 |
-
if( $has_new_function ) {
|
1136 |
-
$tax_query = WC_Query::get_main_tax_query();
|
1137 |
-
} else {
|
1138 |
-
$tax_query = $old_tax_query;
|
1139 |
-
}
|
1140 |
-
if( $has_new_function ) {
|
1141 |
-
$meta_query = WC_Query::get_main_meta_query();
|
1142 |
-
} else {
|
1143 |
-
$meta_query = $old_meta_query;
|
1144 |
-
}
|
1145 |
-
foreach( $meta_query as $key => $val ) {
|
1146 |
-
if( is_array($val) ) {
|
1147 |
-
if ( ! empty( $val['price_filter'] ) || ! empty( $val['rating_filter'] ) ) {
|
1148 |
-
unset( $meta_query[ $key ] );
|
1149 |
-
}
|
1150 |
-
if( isset( $val['relation']) ) {
|
1151 |
-
unset($val['relation']);
|
1152 |
-
foreach( $val as $key2 => $val2 ) {
|
1153 |
-
if ( isset( $val2['key'] ) && $val2['key'] == apply_filters('berocket_price_filter_meta_key', '_price', 'widget_1162') ) {
|
1154 |
-
if ( isset( $meta_query[ $key ][ $key2 ] ) ) unset( $meta_query[ $key ][ $key2 ] );
|
1155 |
-
}
|
1156 |
-
}
|
1157 |
-
if( count($meta_query[ $key ]) <= 1 ) {
|
1158 |
-
unset( $meta_query[ $key ] );
|
1159 |
-
}
|
1160 |
-
} else {
|
1161 |
-
if ( isset( $val['key'] ) && $val['key'] == apply_filters('berocket_price_filter_meta_key', '_price', 'widget_1170') ) {
|
1162 |
-
if ( isset( $meta_query[ $key ] ) ) unset( $meta_query[ $key ] );
|
1163 |
-
}
|
1164 |
-
}
|
1165 |
-
}
|
1166 |
-
}
|
1167 |
-
$queried_object = $wp_query->get_queried_object_id();
|
1168 |
-
if( ! empty($queried_object) ) {
|
1169 |
-
$query_object = $wp_query->get_queried_object();
|
1170 |
-
if( ! empty($query_object->taxonomy) && ! empty($query_object->slug) ) {
|
1171 |
-
$tax_query[ $query_object->taxonomy ] = array(
|
1172 |
-
'taxonomy' => $query_object->taxonomy,
|
1173 |
-
'terms' => array( $query_object->slug ),
|
1174 |
-
'field' => 'slug',
|
1175 |
-
);
|
1176 |
-
}
|
1177 |
-
}
|
1178 |
-
$meta_query = new WP_Meta_Query( $meta_query );
|
1179 |
-
$tax_query = new WP_Tax_Query( ( empty($tax_query) || ! is_array($tax_query) ? array() : $tax_query ) );
|
1180 |
-
$meta_query_sql = $meta_query->get_sql( 'post', $wpdb->posts, 'ID' );
|
1181 |
-
$tax_query_sql = $tax_query->get_sql( $wpdb->posts, 'ID' );
|
1182 |
-
|
1183 |
-
// Generate query
|
1184 |
-
$query = array();
|
1185 |
-
$query['select'] = "SELECT COUNT( DISTINCT {$wpdb->posts}.ID ) as range_count";
|
1186 |
-
$query['from'] = "FROM {$wpdb->posts}";
|
1187 |
-
$query['join'] = "
|
1188 |
-
INNER JOIN {$wpdb->postmeta} AS price_term ON {$wpdb->posts}.ID = price_term.post_id
|
1189 |
-
" . $tax_query_sql['join'] . $meta_query_sql['join'];
|
1190 |
-
$query['where'] = "
|
1191 |
-
WHERE {$wpdb->posts}.post_type IN ( 'product' )
|
1192 |
-
AND " . br_select_post_status() . "
|
1193 |
-
" . $tax_query_sql['where'] . $meta_query_sql['where'] . "
|
1194 |
-
AND price_term.meta_key = '".apply_filters('berocket_price_filter_meta_key', '_price', 'widget_1203')."'
|
1195 |
-
AND price_term.meta_value >= {$from} AND price_term.meta_value <= {$to}
|
1196 |
-
";
|
1197 |
-
if( defined( 'WCML_VERSION' ) && defined('ICL_LANGUAGE_CODE') ) {
|
1198 |
-
$query['join'] = $query['join']." INNER JOIN {$wpdb->prefix}icl_translations as wpml_lang ON ( {$wpdb->posts}.ID = wpml_lang.element_id )";
|
1199 |
-
$query['where'] = $query['where']." AND wpml_lang.language_code = '".ICL_LANGUAGE_CODE."' AND wpml_lang.element_type = 'post_product'";
|
1200 |
-
}
|
1201 |
-
br_where_search( $query );
|
1202 |
-
$query['where'] .= $old_join_posts;
|
1203 |
-
$query = apply_filters( 'woocommerce_get_filtered_ranges_product_counts_query', $query );
|
1204 |
-
$query = implode( ' ', $query );
|
1205 |
-
|
1206 |
-
$results = $wpdb->get_results( $query );
|
1207 |
-
if( isset( $results[0]->range_count ) ) {
|
1208 |
-
$term->count = $results[0]->range_count;
|
1209 |
-
}
|
1210 |
-
}
|
1211 |
-
return $term;
|
1212 |
-
}
|
1213 |
}
|
1214 |
new BeRocket_AAPF_Widget_functions();
|
54 |
} elseif( (! empty($min_price) || $min_price == '0') && ! empty($max_price) ) {
|
55 |
$price_range = array($min_price, $max_price);
|
56 |
} else {
|
57 |
+
$price_range_data = BeRocket_AAPF_Widget_functions::get_price_ranges();
|
58 |
+
if( ! empty($price_range_data) && isset($price_range_data['min_price']) && isset($price_range_data['max_price']) ) {
|
59 |
+
$price_range = array($price_range_data['min_price'], $price_range_data['max_price']);
|
60 |
+
}
|
61 |
}
|
62 |
if ( ! empty($price_values) ) {
|
63 |
$all_terms_name = $price_range;
|
100 |
$max = $max_price;
|
101 |
}
|
102 |
}
|
103 |
+
$slider_value1 = $min;
|
104 |
+
$slider_value2 = $max;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
105 |
$id = 'br_price';
|
106 |
$slider_class .= ' berocket_filter_price_slider';
|
107 |
$main_class .= ' price';
|
138 |
return $set_query_var_title;
|
139 |
}
|
140 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
141 |
public static function color_listener() {
|
142 |
if ( defined('DOING_AJAX') && DOING_AJAX && !isset( $_POST ['tax_color_set'] ) && isset( $_POST ['br_widget_color'] ) ) {
|
143 |
$_POST ['tax_color_set'] = $_POST ['br_widget_color'];
|
198 |
return br_get_sub_categories( $parent, 'id', array( 'return' => 'hierarchy_objects', 'max_depth' => $max_count ) );
|
199 |
}
|
200 |
|
201 |
+
public static function get_price_ranges($price_ranges = FALSE) {
|
202 |
+
global $wpdb;
|
203 |
+
$options = BeRocket_AAPF::get_aapf_option();
|
204 |
+
$use_filters = braapf_filters_must_be_recounted();
|
205 |
+
$taxonomy_data = BeRocket_AAPF_faster_attribute_recount::get_query_for_calculate(array(
|
206 |
+
'use_filters' => $use_filters,
|
207 |
+
'taxonomy_remove' => 'bapf_price'
|
208 |
+
));
|
209 |
+
$query = $taxonomy_data['query'];
|
210 |
+
$query['select']['elements'] = array(
|
211 |
+
'min_price' => "MIN(cast(FLOOR(bapf_custom_price.min_price) as decimal)) as min_price",
|
212 |
+
'min_float' => "MIN(bapf_custom_price.min_price) as min_float",
|
213 |
+
'max_price' => "MAX(cast(CEIL(bapf_custom_price.max_price) as decimal)) as max_price",
|
214 |
+
'max_float' => "MAX(bapf_custom_price.max_price) as max_float"
|
215 |
+
);
|
216 |
+
if( ! empty($options['filter_price_variation']) && $price_ranges !== false && is_array($price_ranges) ) {
|
217 |
+
$query['join']['product_variation'] = "INNER JOIN {$wpdb->posts} as bapf_variation_posts ON {$wpdb->posts}.ID = bapf_variation_posts.post_parent OR {$wpdb->posts}.ID = bapf_variation_posts.ID";
|
218 |
+
$query['join']['product_meta_lookup'] = " INNER JOIN {$wpdb->wc_product_meta_lookup} as bapf_custom_price ON bapf_variation_posts.ID = bapf_custom_price.product_id ";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
219 |
} else {
|
220 |
+
$query['join']['product_meta_lookup'] = " INNER JOIN {$wpdb->wc_product_meta_lookup} as bapf_custom_price ON $wpdb->posts.ID = bapf_custom_price.product_id";
|
221 |
+
}
|
222 |
+
if( $price_ranges !== false && is_array($price_ranges) ) {
|
223 |
+
$case_values = array();
|
224 |
+
foreach($price_ranges as $price_range) {
|
225 |
+
$from = isset($price_range['real_from']) ? $price_range['real_from'] : $price_range['from'];
|
226 |
+
$to = isset($price_range['real_to']) ? $price_range['real_to'] : $price_range['to'];
|
227 |
+
$case_values[] = "WHEN bapf_custom_price.min_price >= {$from} and bapf_custom_price.max_price <= {$to} THEN '{$price_range['from']}-{$price_range['to']}'";
|
228 |
+
}
|
229 |
+
$query['select']['elements']['price_range'] = "CASE ". implode(" ", $case_values). " END price_range";
|
230 |
+
$query['select']['elements']['price_range_count'] = "count(distinct($wpdb->posts.ID)) as product_count";
|
231 |
+
$query['group'] = 'GROUP BY price_range';
|
232 |
+
}
|
233 |
+
$query['select']['elements']= implode(', ', $query['select']['elements']);
|
234 |
+
$query['select'] = implode(' ', $query['select']);
|
235 |
+
$query['join'] = implode(' ', $query['join']);
|
236 |
+
$query['where'] = implode(' ', $query['where']);
|
237 |
+
$query['join'] .= " LEFT JOIN {$wpdb->wc_product_meta_lookup} as wc_product_meta_lookup ON {$wpdb->posts}.ID = wc_product_meta_lookup.product_id ";
|
238 |
+
$query = apply_filters('woocommerce_get_filtered_term_product_counts_query', $query);
|
239 |
+
if( $use_filters ) {
|
240 |
+
$query = apply_filters( 'berocket_posts_clauses_recount', $query );
|
241 |
+
}
|
242 |
+
$query_imploded = implode( ' ', $query );
|
243 |
+
$use_price_cache = apply_filters('berocket_recount_price_cache_use', false);
|
244 |
+
if($use_price_cache) {
|
245 |
+
$result = br_get_cache(apply_filters('berocket_recount_cache_key', md5(json_encode($query_imploded)), $taxonomy_data), 'berocket_recount');
|
246 |
+
}
|
247 |
+
if( empty($result) ) {
|
248 |
+
$result = $wpdb->get_results( $query_imploded );
|
249 |
+
if($use_price_cache) {
|
250 |
+
br_set_cache(md5(json_encode($query_imploded)), $result, 'berocket_recount', DAY_IN_SECONDS);
|
251 |
+
}
|
252 |
+
}
|
253 |
+
BeRocket_AAPF_faster_attribute_recount::restore_url_data_after_recount();
|
254 |
+
if( empty($result) || count($result) == 0 ) {
|
255 |
+
return FALSE;
|
256 |
} else {
|
257 |
+
if( $price_ranges === false ) {
|
258 |
+
return (array)$result[0];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
259 |
} else {
|
260 |
+
return (array)$result;
|
261 |
}
|
|
|
|
|
262 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
263 |
}
|
|
|
264 |
public static function get_attribute_values( $taxonomy = '', $order_by = 'id', $hide_empty = false, $count_filtering = true, $input_terms = FALSE, $product_cat = FALSE, $operator = 'OR' ) {
|
265 |
$br_options = apply_filters( 'berocket_aapf_listener_br_options', BeRocket_AAPF::get_aapf_option() );
|
266 |
if ( ! $taxonomy || $taxonomy == 'price' ) return array();
|
471 |
return $return_array;
|
472 |
}
|
473 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
474 |
public static function woocommerce_hide_out_of_stock_items(){
|
475 |
$hide = get_option( 'woocommerce_hide_out_of_stock_items', null );
|
476 |
|
482 |
|
483 |
return apply_filters( 'berocket_aapf_hide_out_of_stock_items', $hide );
|
484 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
485 |
}
|
486 |
new BeRocket_AAPF_Widget_functions();
|
libraries/link_parser.php
CHANGED
@@ -1,16 +1,7 @@
|
|
1 |
<?php
|
2 |
class BeRocket_AAPF_link_parser {
|
3 |
-
public $js_parse_result = false;
|
4 |
-
public $js_generate_result = false;
|
5 |
-
public $php_parse_result = false;
|
6 |
-
public $php_generate_result = false;
|
7 |
-
public $php_remove_result = false;
|
8 |
-
public $using_slug = false;
|
9 |
public $taxonomy_changer = array();
|
10 |
function __construct() {
|
11 |
-
$BeRocket_AAPF = BeRocket_AAPF::getInstance();
|
12 |
-
$option = $BeRocket_AAPF->get_option();
|
13 |
-
$this->using_slug = ! empty($option['slug_urls']);
|
14 |
$this->taxonomy_changer = apply_filters('BR_AAPF_link_parser_taxonomy_changer', array(
|
15 |
'_stock_status' => array(
|
16 |
'taxonomy' => '_stock_status',
|
@@ -35,83 +26,23 @@ class BeRocket_AAPF_link_parser {
|
|
35 |
'taxonomy' => 'price'
|
36 |
)
|
37 |
), $this);
|
38 |
-
|
39 |
-
|
40 |
-
add_filter('BR_AAPF_link_parser_jsr', array($this, 'js_generate'), 10, 2);
|
41 |
-
add_filter('BR_AAPF_link_parser_phpp', array($this, 'php_parse'), 10, 2);
|
42 |
-
add_filter('BR_AAPF_link_parser_phpg', array($this, 'php_generate'), 10, 2);
|
43 |
-
add_filter('BR_AAPF_link_parser_phpr', array($this, 'php_remove'), 10, 2);
|
44 |
-
remove_all_filters('berocket_add_filter_to_link', 100);
|
45 |
-
add_filter('berocket_add_filter_to_link', array($this, 'add_filter_to_link'), 10, 2);
|
46 |
-
}
|
47 |
-
function js_parse($data, $args = array()) {
|
48 |
-
if( $this->js_parse_result === false || ! empty($args['force']) ) {
|
49 |
-
if( ! is_array($data) ) {
|
50 |
-
$data = array();
|
51 |
-
}
|
52 |
-
$this->js_parse_result = $this->js_parse_inside($data, $args);
|
53 |
-
}
|
54 |
-
return $this->js_parse_result;
|
55 |
-
}
|
56 |
-
function js_generate($data, $args = array()) {
|
57 |
-
if( $this->js_generate_result === false || ! empty($args['force']) ) {
|
58 |
-
if( ! is_array($data) ) {
|
59 |
-
$data = array();
|
60 |
-
}
|
61 |
-
$this->js_generate_result = $this->js_generate_inside($data, $args);
|
62 |
-
}
|
63 |
-
return $this->js_generate_result;
|
64 |
-
}
|
65 |
-
function php_parse($data, $args = array()) {
|
66 |
-
if( $this->php_parse_result === false || ! empty($args['force']) ) {
|
67 |
-
if( ! is_array($data) ) {
|
68 |
-
$data = array();
|
69 |
-
}
|
70 |
-
$this->php_parse_result = $this->php_parse_inside($data, $args);
|
71 |
-
}
|
72 |
-
return $this->php_parse_result;
|
73 |
-
}
|
74 |
-
function php_generate($data, $args = array()) {
|
75 |
-
if( ! is_array($data) ) {
|
76 |
-
$data = array();
|
77 |
}
|
78 |
-
$this
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
$
|
|
|
|
|
|
|
84 |
}
|
85 |
-
$this->php_remove_result = $this->php_remove_inside($data, $args);
|
86 |
-
return $this->php_remove_result;
|
87 |
-
}
|
88 |
-
function js_parse_inside($data, $args = array()) {
|
89 |
-
return $data;
|
90 |
-
}
|
91 |
-
function js_generate_inside($data, $args = array()) {
|
92 |
-
return $data;
|
93 |
-
}
|
94 |
-
function js_remove_filters($data, $args = array()) {
|
95 |
-
return $data;
|
96 |
-
}
|
97 |
-
function php_parse_inside($data, $args = array()) {
|
98 |
-
return $data;
|
99 |
}
|
100 |
-
function
|
101 |
-
|
102 |
-
|
103 |
-
function php_remove_inside($data, $args = array()) {
|
104 |
-
$link_data = $this->get_query_vars_name();
|
105 |
-
return remove_query_arg($link_data['var_names'], $this->get_query_vars_name_link(br_get_value_from_array($args, array('link'), false)));
|
106 |
-
}
|
107 |
-
function get_query_vars_name_link($link = false) {
|
108 |
-
if( $link === false ) {
|
109 |
-
$link = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
|
110 |
-
}
|
111 |
-
return $link;
|
112 |
-
}
|
113 |
-
function get_query_vars_name($link = false) {
|
114 |
-
return array();
|
115 |
}
|
116 |
function check_taxonomy($taxonomy) {
|
117 |
if( taxonomy_exists( 'pa_'.$taxonomy ) ) {
|
@@ -123,33 +54,4 @@ class BeRocket_AAPF_link_parser {
|
|
123 |
}
|
124 |
return false;
|
125 |
}
|
126 |
-
function get_term_taxonomy($taxonomy, $term) {
|
127 |
-
if ( array_key_exists($taxonomy, $this->taxonomy_changer) ) {
|
128 |
-
$term_data = array(
|
129 |
-
'term_group' => 0,
|
130 |
-
'taxonomy' => $taxonomy,
|
131 |
-
'description' => '',
|
132 |
-
'parent' => 0,
|
133 |
-
'count' => 1
|
134 |
-
);
|
135 |
-
$terms = $this->taxonomy_changer[$taxonomy]['terms'];
|
136 |
-
if( $this->using_slug ) {
|
137 |
-
$term_data['slug'] = $term_data['name'] = $term;
|
138 |
-
$term_data['term_id'] = $term_data['term_taxonomy_id'] = array_search( $term, $terms );
|
139 |
-
} else {
|
140 |
-
$term_data['term_id'] = $term_data['term_taxonomy_id'] = $term;
|
141 |
-
$term_data['slug'] = $term_data['name'] = $terms[$term];
|
142 |
-
}
|
143 |
-
$term_data = (object)$term_data;
|
144 |
-
} else {
|
145 |
-
$term_data = get_term_by( ($this->using_slug ? 'slug' : 'term_id'), $term, $taxonomy, 'OBJECT' );
|
146 |
-
}
|
147 |
-
return $term_data;
|
148 |
-
}
|
149 |
-
function add_filter_to_link($current_url = FALSE, $args = array()) {
|
150 |
-
if( $current_url === FALSE ) {
|
151 |
-
$current_url = $this->get_query_vars_name_link();
|
152 |
-
}
|
153 |
-
return $current_url;
|
154 |
-
}
|
155 |
}
|
1 |
<?php
|
2 |
class BeRocket_AAPF_link_parser {
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
public $taxonomy_changer = array();
|
4 |
function __construct() {
|
|
|
|
|
|
|
5 |
$this->taxonomy_changer = apply_filters('BR_AAPF_link_parser_taxonomy_changer', array(
|
6 |
'_stock_status' => array(
|
7 |
'taxonomy' => '_stock_status',
|
26 |
'taxonomy' => 'price'
|
27 |
)
|
28 |
), $this);
|
29 |
+
if( ! is_admin() ) {
|
30 |
+
add_action( 'braapf_wp_enqueue_script_after', array($this, 'js_generate'), 10, 1 );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
}
|
32 |
+
add_filter('bapf_uparse_parse_get_filter_line', array($this, 'get_filter_line'), 100, 3);
|
33 |
+
}
|
34 |
+
function js_generate($handle) {
|
35 |
+
if( $handle == 'berocket_aapf_widget-script' ) {
|
36 |
+
ob_start();
|
37 |
+
$this->js_generate_inside();
|
38 |
+
$script = ob_get_clean();
|
39 |
+
wp_add_inline_script('berocket_aapf_widget-script', $script);
|
40 |
+
remove_action( 'braapf_wp_enqueue_script_after', array($this, 'js_generate'), 10, 1 );
|
41 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
}
|
43 |
+
function js_generate_inside() {}
|
44 |
+
function get_filter_line($result, $instance, $link = false) {
|
45 |
+
return $result;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
}
|
47 |
function check_taxonomy($taxonomy) {
|
48 |
if( taxonomy_exists( 'pa_'.$taxonomy ) ) {
|
54 |
}
|
55 |
return false;
|
56 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
}
|
main.php
CHANGED
@@ -122,7 +122,6 @@ class BeRocket_AAPF extends BeRocket_Framework {
|
|
122 |
'products_only' => '1',
|
123 |
'out_of_stock_variable' => '',
|
124 |
'out_of_stock_variable_reload' => '',
|
125 |
-
'out_of_stock_variable_single' => '',
|
126 |
'page_same_as_filter' => '',
|
127 |
'styles_in_footer' => '',
|
128 |
|
@@ -236,8 +235,6 @@ class BeRocket_AAPF extends BeRocket_Framework {
|
|
236 |
add_action( 'divi_extensions_init', array($this, 'divi_extensions_init') );
|
237 |
add_action( 'admin_init', array( $this, 'admin_init' ) );
|
238 |
add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
|
239 |
-
add_shortcode( 'br_filters', array( $this, 'shortcode' ) );
|
240 |
-
add_shortcode( 'brapf_next_shortcode_apply', array( $this, 'shortcode_apply' ) );
|
241 |
add_action( 'init', array( $this, 'create_metadata_table' ), 999999999 );
|
242 |
add_action( 'br_footer_script', array( $this, 'include_all_scripts' ) );
|
243 |
add_action( 'delete_transient_wc_products_onsale', array( $this, 'delete_products_not_on_sale' ) );
|
@@ -252,14 +249,6 @@ class BeRocket_AAPF extends BeRocket_Framework {
|
|
252 |
if ( ! defined('DOING_AJAX') || ! DOING_AJAX ) {
|
253 |
$this->not_ajax_functions();
|
254 |
}
|
255 |
-
|
256 |
-
if ( isset($_GET['explode']) && $_GET['explode'] == 'explode') {
|
257 |
-
add_action( 'woocommerce_before_template_part', array( 'BeRocket_AAPF_Widget_functions', 'pre_get_posts'), 999999 );
|
258 |
-
add_action( 'wp_footer', array( 'BeRocket_AAPF_Widget_functions', 'end_clean'), 999999 );
|
259 |
-
add_action( 'init', array( 'BeRocket_AAPF_Widget_functions', 'start_clean'), 1 );
|
260 |
-
} else {
|
261 |
-
add_action( 'woocommerce_before_template_part', array( 'BeRocket_AAPF_Widget_functions', 'rebuild'), 999999 );
|
262 |
-
}
|
263 |
if ( ! empty($option['selected_area_show']) ) {
|
264 |
add_action ( br_get_value_from_array($option, 'elements_position_hook', 'woocommerce_archive_description'), array($this, 'selected_area'), 1 );
|
265 |
}
|
@@ -267,9 +256,6 @@ class BeRocket_AAPF extends BeRocket_Framework {
|
|
267 |
add_action( 'wp_enqueue_scripts', array( $this, 'include_all_styles' ) );
|
268 |
}
|
269 |
add_filter( 'is_active_sidebar', array($this, 'is_active_sidebar'), 10, 2);
|
270 |
-
if( ! empty($option['child_pre_indent']) ) {
|
271 |
-
add_filter('berocket_aapf_select_term_child_prefix', array($this, 'select_term_child_prefix'));
|
272 |
-
}
|
273 |
if( ! empty($option['page_same_as_filter']) ) {
|
274 |
include_once( dirname( __FILE__ ) . '/includes/addons/page-same-as-filter.php' );
|
275 |
new BeRocket_AAPF_addon_page_same_as_filter($option['page_same_as_filter']);
|
@@ -283,7 +269,7 @@ class BeRocket_AAPF extends BeRocket_Framework {
|
|
283 |
add_filter( 'woocommerce_redirect_single_search_result', '__return_false' );
|
284 |
}
|
285 |
if( ! empty($option['out_of_stock_variable']) ) {
|
286 |
-
include_once( dirname( __FILE__ ) . '/includes/addons/woocommerce-variation.php' );
|
287 |
}
|
288 |
if( ! empty($option['seo_meta_title']) ) {
|
289 |
include_once( dirname( __FILE__ ) . '/includes/addons/seo_meta_title.php' );
|
@@ -293,11 +279,6 @@ class BeRocket_AAPF extends BeRocket_Framework {
|
|
293 |
add_filter( 'plugin_action_links_' . $plugin_base_slug, array( $this, 'plugin_action_links' ) );
|
294 |
add_filter( 'berocket_aapf_widget_terms', array($this, 'wpml_attribute_slug_translate'));
|
295 |
add_filter ( 'BeRocket_updater_menu_order_custom_post', array($this, 'menu_order_custom_post') );
|
296 |
-
if( br_woocommerce_version_check('3.6') ) {
|
297 |
-
//TEST FUNCTIONS
|
298 |
-
add_filter( 'posts_clauses', array( $this, 'price_filter_post_clauses' ), 99999999999, 2 );
|
299 |
-
add_filter( 'berocket_posts_clauses_recount', array( $this, 'add_price_to_post_clauses' ), 10, 3 );
|
300 |
-
}
|
301 |
add_action('woocommerce_before_template_part', array($this, 'no_products_block_before'), 1, 1);
|
302 |
add_action('woocommerce_after_template_part', array($this, 'no_products_block_after'), 999999, 1);
|
303 |
add_action('braapf_wp_enqueue_style_after', array($this, 'custom_user_css'), 10, 1);
|
@@ -309,6 +290,7 @@ class BeRocket_AAPF extends BeRocket_Framework {
|
|
309 |
add_action( 'admin_notices', array( $this, 'no_woocommerce' ) );
|
310 |
}
|
311 |
}
|
|
|
312 |
} else {
|
313 |
add_filter( 'berocket_display_additional_notices', array(
|
314 |
$this,
|
@@ -1055,14 +1037,6 @@ class BeRocket_AAPF extends BeRocket_Framework {
|
|
1055 |
"value" => '1',
|
1056 |
'label_for' => __("Fixed CSS styles for Select2 (do not enable if Select2 work correct. Option can break Select2 in other plugins or themes)", 'BeRocket_AJAX_domain'),
|
1057 |
),
|
1058 |
-
'out_of_stock_variable_single' => array(
|
1059 |
-
"label" => __( 'Fix WPEngine query issue', "BeRocket_AJAX_domain" ),
|
1060 |
-
"tr_class" => "out_of_stock_variable_single bapf_incompatibility_fixes bapf_incompatibility_fixes_hide",
|
1061 |
-
"type" => "checkbox",
|
1062 |
-
"name" => "out_of_stock_variable_single",
|
1063 |
-
"value" => '1',
|
1064 |
-
'label_for' => __('Can also work with other hostings if they limit query size.', 'BeRocket_AJAX_domain') . '<br>',
|
1065 |
-
),
|
1066 |
),
|
1067 |
'Design' => array(
|
1068 |
'ajax_load_icon' => array(
|
@@ -1486,15 +1460,6 @@ function out_of_stock_variable_reload_hide() {
|
|
1486 |
}
|
1487 |
out_of_stock_variable_reload_hide();
|
1488 |
jQuery('.berocket_aapf_recount_hide, .out_of_stock_variable').on('change', out_of_stock_variable_reload_hide);
|
1489 |
-
function out_of_stock_variable_single_hide() {
|
1490 |
-
if( (jQuery('.berocket_aapf_recount_hide').val() == 'recount' || jQuery('.berocket_aapf_recount_hide').val() == 'removeFirst_recount' || jQuery('.berocket_aapf_recount_hide').val() == 'removeRecount') && parseInt(jQuery('.out_of_stock_variable').val()) && jQuery('.out_of_stock_variable_reload').prop('checked') ) {
|
1491 |
-
jQuery('.out_of_stock_variable_single').show();
|
1492 |
-
} else {
|
1493 |
-
jQuery('.out_of_stock_variable_single').hide();
|
1494 |
-
}
|
1495 |
-
}
|
1496 |
-
out_of_stock_variable_single_hide();
|
1497 |
-
jQuery('.berocket_aapf_recount_hide, .out_of_stock_variable, .out_of_stock_variable_reload').on('change', out_of_stock_variable_single_hide);
|
1498 |
function load_fix_ajax_request_load() {
|
1499 |
if( jQuery('.load_fix_ajax_request_load').prop('checked') ) {
|
1500 |
jQuery('.load_fix_use_get_query').parent().show();
|
@@ -1641,12 +1606,6 @@ jQuery(document).on('change', '.berocket_disable_ajax_loading', berocket_disable
|
|
1641 |
add_action( "wp_ajax_berocket_aapf_save_simple_filter_creation", array ( $this, 'save_simple_filter_creation' ) );
|
1642 |
}
|
1643 |
function not_ajax_functions() {
|
1644 |
-
add_filter( 'pre_get_posts', array( $this, 'apply_user_price' ) );
|
1645 |
-
add_filter( 'pre_get_posts', array( $this, 'apply_user_filters' ), 900000 );
|
1646 |
-
add_filter( 'woocommerce_shortcode_products_query', array( $this, 'woocommerce_shortcode_products_query' ), 10, 3 );
|
1647 |
-
add_filter( 'woocommerce_shortcode_products_query', array( $this, 'woocommerce_shortcode_products_query_save_query_late' ), 9000000, 3 );
|
1648 |
-
add_filter( 'berocket_shortcode_products_query', array( $this, 'woocommerce_shortcode_products_query' ), 10, 3 );
|
1649 |
-
add_filter( 'berocket_shortcode_products_query', array( $this, 'woocommerce_shortcode_products_query_save_query_late' ), 9000000, 3 );
|
1650 |
$shortcode_types = array(
|
1651 |
'products',
|
1652 |
'product',
|
@@ -1726,11 +1685,6 @@ jQuery(document).on('change', '.berocket_disable_ajax_loading', berocket_disable
|
|
1726 |
$wp_check_product_cat = $wp_query_product_cat;
|
1727 |
}
|
1728 |
|
1729 |
-
$post_temrs = "[]";
|
1730 |
-
if ( ! empty($_POST['terms']) ) {
|
1731 |
-
$post_temrs = json_encode( $_POST['terms'] );
|
1732 |
-
}
|
1733 |
-
|
1734 |
if ( ! empty($sitepress) && method_exists($sitepress, 'get_current_language') ) {
|
1735 |
$current_language = $sitepress->get_current_language();
|
1736 |
} else {
|
@@ -1796,7 +1750,6 @@ jQuery(document).on('change', '.berocket_disable_ajax_loading', berocket_disable
|
|
1796 |
'ub_product_count' => '',
|
1797 |
'ub_product_text' => '',
|
1798 |
'ub_product_button_text' => '',
|
1799 |
-
'berocket_aapf_widget_product_filters' => $post_temrs,
|
1800 |
'default_sorting' => $default_sorting,
|
1801 |
'first_page' => '1',
|
1802 |
'scroll_shop_top' => ( empty($br_options['scroll_shop_top']) ? '' : $br_options['scroll_shop_top'] ),
|
@@ -1934,21 +1887,6 @@ jQuery(document).on('change', '.berocket_disable_ajax_loading', berocket_disable
|
|
1934 |
<p>' . __( 'Update WooCommerce plugin', 'BeRocket_AJAX_domain' ) . '</p>
|
1935 |
</div>';
|
1936 |
}
|
1937 |
-
public function shortcode_apply( $atts = array() ) {
|
1938 |
-
if( ! is_array($atts) ) $atts = array();
|
1939 |
-
$atts = array_merge(array('apply' => true), $atts);
|
1940 |
-
remove_filter('berocket_aapf_wcshortcode_is_filtering', array($this, 'apply_filter_to_shortcode'));
|
1941 |
-
remove_filter('berocket_aapf_wcshortcode_is_filtering', array($this, 'not_apply_filter_to_shortcode'));
|
1942 |
-
if( $atts['apply'] === 'false') $atts['apply'] = false;
|
1943 |
-
if($atts['apply'] !== 'default') {
|
1944 |
-
$atts['apply'] = (bool) $atts['apply'];
|
1945 |
-
if( $atts['apply'] ) {
|
1946 |
-
add_filter('berocket_aapf_wcshortcode_is_filtering', array($this, 'apply_filter_to_shortcode'));
|
1947 |
-
} else {
|
1948 |
-
add_filter('berocket_aapf_wcshortcode_is_filtering', array($this, 'not_apply_filter_to_shortcode'));
|
1949 |
-
}
|
1950 |
-
}
|
1951 |
-
}
|
1952 |
public function apply_filter_to_shortcode($enable) {
|
1953 |
remove_filter('berocket_aapf_wcshortcode_is_filtering', array($this, 'apply_filter_to_shortcode'));
|
1954 |
return true;
|
@@ -1957,597 +1895,17 @@ jQuery(document).on('change', '.berocket_disable_ajax_loading', berocket_disable
|
|
1957 |
remove_filter('berocket_aapf_wcshortcode_is_filtering', array($this, 'not_apply_filter_to_shortcode'));
|
1958 |
return false;
|
1959 |
}
|
1960 |
-
public function shortcode( $atts = array() ) {
|
1961 |
-
if( self::$debug_mode ) {
|
1962 |
-
if( ! isset( self::$error_log['2_shortcodes'] ) )
|
1963 |
-
{
|
1964 |
-
self::$error_log['2_shortcodes'] = array();
|
1965 |
-
}
|
1966 |
-
self::$error_log['2_shortcodes'][] = $atts;
|
1967 |
-
}
|
1968 |
-
$default = BeRocket_AAPF_Widget::$defaults;
|
1969 |
-
$a = shortcode_atts( $default, $atts );
|
1970 |
-
if ( ! empty($atts['style']) ) {
|
1971 |
-
$a['style'] = $atts['style'];
|
1972 |
-
}
|
1973 |
-
if ( ! empty($atts['product_cat']) ) {
|
1974 |
-
$a['product_cat'] = json_encode( explode( "|", $a['product_cat'] ) );
|
1975 |
-
}
|
1976 |
-
if ( ! empty($atts['show_page']) ) {
|
1977 |
-
$a['show_page'] = explode( "|", $a['show_page'] );
|
1978 |
-
}
|
1979 |
-
if ( ! empty($atts['include_exclude_list']) ) {
|
1980 |
-
$a['include_exclude_list'] = explode( "|", $a['include_exclude_list'] );
|
1981 |
-
}
|
1982 |
-
if ( ! empty($atts['ranges']) ) {
|
1983 |
-
$a['ranges'] = explode( "|", $a['ranges'] );
|
1984 |
-
}
|
1985 |
-
if( ! empty($atts['search_box_style']) ) {
|
1986 |
-
$a['search_box_style'] = array_merge($default['search_box_style'], (array)json_decode($atts['search_box_style']));
|
1987 |
-
}
|
1988 |
-
$a['search_box_attributes'] = $default['search_box_attributes'];
|
1989 |
-
if( ! empty($atts['search_box_attributes']) ) {
|
1990 |
-
$atts['search_box_attributes'] = (array)json_decode( $atts['search_box_attributes'] );
|
1991 |
-
if( is_array( $atts['search_box_attributes'] ) ) {
|
1992 |
-
foreach($atts['search_box_attributes'] as $attr_num => $attr_data) {
|
1993 |
-
$a['search_box_attributes'][$attr_num] = array_merge($default['search_box_attributes'][$attr_num], (array)$attr_data);
|
1994 |
-
}
|
1995 |
-
}
|
1996 |
-
}
|
1997 |
-
$a['child_onew_childs'] = $default['child_onew_childs'];
|
1998 |
-
if( ! empty($atts['child_onew_childs']) ) {
|
1999 |
-
$atts['child_onew_childs'] = (array)json_decode( $atts['child_onew_childs'] );
|
2000 |
-
if( is_array( $atts['child_onew_childs'] ) ) {
|
2001 |
-
foreach($atts['child_onew_childs'] as $child_num => $child_data) {
|
2002 |
-
$a['child_onew_childs'][$child_num] = array_merge($default['child_onew_childs'][$child_num], (array)$child_data);
|
2003 |
-
}
|
2004 |
-
}
|
2005 |
-
}
|
2006 |
-
|
2007 |
-
$a = apply_filters( 'berocket_aapf_shortcode_options', $a );
|
2008 |
-
ob_start();
|
2009 |
-
new BeRocket_AAPF_Widget($a, array());
|
2010 |
-
return ob_get_clean();
|
2011 |
-
}
|
2012 |
-
public function woocommerce_shortcode_products_query( $query_vars, $atts = array(), $name = 'products' ) {
|
2013 |
-
global $bapf_save_shortcode_query_late;
|
2014 |
-
$bapf_save_shortcode_query_late = false;
|
2015 |
-
if( isset($atts['berocket_aapf']) && $atts['berocket_aapf'] === false ) {
|
2016 |
-
return $query_vars;
|
2017 |
-
}
|
2018 |
-
if( apply_filters('berocket_aapf_wcshortcode_is_filtering', ( (! is_shop() && ! is_product_taxonomy() && ! is_product_category() && ! is_product_tag()) || ! empty($atts['berocket_aapf']) ), $query_vars, $atts, $name ) ) {
|
2019 |
-
$bapf_save_shortcode_query_late = true;
|
2020 |
-
$query_vars = $this->woocommerce_filter_query_vars($query_vars, $atts, $name);
|
2021 |
-
}
|
2022 |
-
return $query_vars;
|
2023 |
-
}
|
2024 |
-
public function woocommerce_shortcode_products_query_save_query_late( $query_vars, $atts = array(), $name = 'products' ) {
|
2025 |
-
global $bapf_save_shortcode_query_late;
|
2026 |
-
if( $bapf_save_shortcode_query_late ) {
|
2027 |
-
$bapf_save_shortcode_query_late = false;
|
2028 |
-
$this->save_shortcode_query_vars($query_vars);
|
2029 |
-
}
|
2030 |
-
return $query_vars;
|
2031 |
-
}
|
2032 |
public function woocommerce_shortcode_no_result($atts) {
|
2033 |
if( ! empty($atts['berocket_aapf']) ) {
|
2034 |
wc_no_products_found();
|
2035 |
}
|
2036 |
}
|
2037 |
-
public function price_filter_post_clauses( $args, $wp_query ) {
|
2038 |
-
if( empty($wp_query->query_vars['berocket_filtered']) ) {
|
2039 |
-
return $args;
|
2040 |
-
}
|
2041 |
-
return $this->add_price_to_post_clauses($args);
|
2042 |
-
}
|
2043 |
-
public function add_price_to_post_clauses($args, $taxonomy_data = false, $terms = false) {
|
2044 |
-
if( ! empty($_POST['price']) ) {
|
2045 |
-
$options = $this->get_option();
|
2046 |
-
if( empty($options['filter_price_variation']) ) {
|
2047 |
-
$args = $this->wc_price_to_post_clauses($args);
|
2048 |
-
} else {
|
2049 |
-
$args = $this->advanced_price_to_post_clauses($args, $taxonomy_data, $terms);
|
2050 |
-
}
|
2051 |
-
}
|
2052 |
-
return $args;
|
2053 |
-
}
|
2054 |
-
public function wc_price_to_post_clauses($args) {
|
2055 |
-
global $wpdb;
|
2056 |
-
|
2057 |
-
if ( ! strstr( $args['join'], 'wc_product_meta_lookup' ) ) {
|
2058 |
-
$args['join'] .= " LEFT JOIN {$wpdb->wc_product_meta_lookup} as wc_product_meta_lookup ON {$wpdb->posts}.ID = wc_product_meta_lookup.product_id ";
|
2059 |
-
}
|
2060 |
-
$min = isset( $_POST['price'][0] ) ? floatval( $_POST['price'][0] ) : 0;
|
2061 |
-
$max = isset( $_POST['price'][1] ) ? floatval( $_POST['price'][1] ) : 9999999999;
|
2062 |
-
$args['where'] .= $wpdb->prepare(
|
2063 |
-
' AND wc_product_meta_lookup.min_price >= %f AND wc_product_meta_lookup.max_price <= %f ',
|
2064 |
-
$min,
|
2065 |
-
$max
|
2066 |
-
);
|
2067 |
-
return $args;
|
2068 |
-
}
|
2069 |
-
public static function get_advanced_price_temp_table ($where, $taxonomy_data, $terms) {
|
2070 |
-
global $wpdb;
|
2071 |
-
$obj = self::getInstance();
|
2072 |
-
$option = $obj->get_option();
|
2073 |
-
$query_price = array(
|
2074 |
-
'select' => "SELECT IF(bapf_price_post.post_parent = 0, bapf_price_post.ID, bapf_price_post.post_parent) as product_id from {$wpdb->posts} as bapf_price_post",
|
2075 |
-
'join' => "JOIN {$wpdb->wc_product_meta_lookup} as bapf_price_lookup ON bapf_price_post.ID = bapf_price_lookup.product_id",
|
2076 |
-
'where' => "WHERE (" . $where . ")"
|
2077 |
-
);
|
2078 |
-
$query_price = apply_filters('berocket_aapf_get_advanced_price_temp_table', $query_price, $where, $taxonomy_data, $terms);
|
2079 |
-
$query_price = implode(' ', $query_price);
|
2080 |
-
$table = "JOIN ({$query_price}) as bapf_custom_price ON {$wpdb->posts}.ID = bapf_custom_price.product_id";
|
2081 |
-
|
2082 |
-
return $table;
|
2083 |
-
}
|
2084 |
-
public function advanced_price_to_post_clauses($args, $taxonomy_data = false, $terms = false) {
|
2085 |
-
global $wpdb;
|
2086 |
-
$min = isset( $_POST['price'][0] ) ? floatval( $_POST['price'][0] ) : 0;
|
2087 |
-
$max = isset( $_POST['price'][1] ) ? floatval( $_POST['price'][1] ) : 9999999999;
|
2088 |
-
$where = $wpdb->prepare(
|
2089 |
-
'bapf_price_lookup.min_price >= %f AND bapf_price_lookup.max_price <= %f ',
|
2090 |
-
$min,
|
2091 |
-
$max
|
2092 |
-
);
|
2093 |
-
$args['join'] .= self::get_advanced_price_temp_table($where, $taxonomy_data, $terms);
|
2094 |
-
return $args;
|
2095 |
-
}
|
2096 |
-
public function woocommerce_filter_query_vars( $query_vars, $atts = array(), $name = 'products' ) {
|
2097 |
-
$new_query_vars = $query_vars;
|
2098 |
-
$new_query_vars['nopaging'] = true;
|
2099 |
-
$new_query_vars['fields'] = 'ids';
|
2100 |
-
$query = new WP_Query( $new_query_vars );
|
2101 |
-
global $braapf_not_filtered_data;
|
2102 |
-
$braapf_not_filtered_data = array(
|
2103 |
-
'post__not_in' => $query->get( 'post__not_in' ),
|
2104 |
-
'post__in' => $query->get( 'post__in' ),
|
2105 |
-
);
|
2106 |
-
global $br_shortcode_query;
|
2107 |
-
$br_shortcode_query = $query;
|
2108 |
-
global $wp_query;
|
2109 |
-
$args = $this->get_filter_args($wp_query, true);
|
2110 |
-
$args_fields = array( 'meta_key', 'tax_query', 'fields', 'where', 'join', 'meta_query', 'date_query', 's' );
|
2111 |
-
foreach ( $args_fields as $args_field ) {
|
2112 |
-
if ( ! empty($args[ $args_field ]) ) {
|
2113 |
-
if( ! empty($query_vars[ $args_field ]) && is_array($query_vars[ $args_field ]) ) {
|
2114 |
-
$query_vars[ $args_field ] = array_merge($query_vars[ $args_field ], $args[ $args_field ]);
|
2115 |
-
} else {
|
2116 |
-
$query_vars[ $args_field ] = $args[ $args_field ];
|
2117 |
-
}
|
2118 |
-
}
|
2119 |
-
}
|
2120 |
-
if( empty($query_vars['post__in']) ) {
|
2121 |
-
if ( $name == 'sale_products' ) {
|
2122 |
-
$query_vars['post__in'] = array_merge( array( 0 ), wc_get_product_ids_on_sale() );
|
2123 |
-
} else {
|
2124 |
-
$query_vars['post__in'] = array();
|
2125 |
-
}
|
2126 |
-
} else {
|
2127 |
-
if ( $name == 'sale_products' ) {
|
2128 |
-
$query_vars[ 'post__in' ] = array_merge( $query_vars[ 'post__in' ], wc_get_product_ids_on_sale() );
|
2129 |
-
}
|
2130 |
-
}
|
2131 |
-
$custom_terms = br_get_value_from_array($_POST,'terms');
|
2132 |
-
if( ! empty($atts['attribute']) ) {
|
2133 |
-
if( ! empty($atts['terms']) ) {
|
2134 |
-
$terms = explode(',',$atts['terms']);
|
2135 |
-
foreach($terms as &$term) {
|
2136 |
-
$term = get_term_by( 'slug', $term, 'pa_'.$atts['attribute']);
|
2137 |
-
}
|
2138 |
-
if( isset($term) ) {
|
2139 |
-
unset($term);
|
2140 |
-
}
|
2141 |
-
} else {
|
2142 |
-
$terms = get_terms( array(
|
2143 |
-
'taxonomy' => 'pa_'.$atts['attribute'],
|
2144 |
-
'hide_empty' => true,
|
2145 |
-
) );
|
2146 |
-
}
|
2147 |
-
if( ! is_array($custom_terms) ) {
|
2148 |
-
$custom_terms = array();
|
2149 |
-
}
|
2150 |
-
foreach($terms as $term) {
|
2151 |
-
$custom_terms[] = array(
|
2152 |
-
$term->taxonomy,
|
2153 |
-
$term->term_id,
|
2154 |
-
'OR',
|
2155 |
-
$term->slug,
|
2156 |
-
'attribute'
|
2157 |
-
);
|
2158 |
-
}
|
2159 |
-
}
|
2160 |
-
if( empty($query_vars['post__not_in']) ) {
|
2161 |
-
$query_vars['post__not_in'] = array();
|
2162 |
-
}
|
2163 |
-
$query_vars['post__not_in'] = array_merge($query_vars['post__not_in'], apply_filters('berocket_add_out_of_stock_variable', array(), $custom_terms, berocket_isset($_POST['limits_arr'])));
|
2164 |
-
$query_vars['post__in'] = apply_filters( 'bapf_loop_shop_post_in', $query_vars['post__in']);
|
2165 |
-
if( is_array($query_vars['post__in']) ) {
|
2166 |
-
$query_vars['post__in'] = array_diff($query_vars['post__in'], $query_vars['post__not_in']);
|
2167 |
-
}
|
2168 |
-
if ( br_woocommerce_version_check('3.6') && ! empty($_POST['price']) ) {
|
2169 |
-
$query_vars['berocket_price'] = $_POST['price'];
|
2170 |
-
}
|
2171 |
-
$query_vars['berocket_filtered'] = true;
|
2172 |
-
$this->save_shortcode_query_vars($query_vars);
|
2173 |
-
$query_vars = apply_filters('berocket_filters_query_vars_already_filtered', $query_vars, br_get_value_from_array($_POST,'terms'), br_get_value_from_array($_POST,'limits_arr'));
|
2174 |
-
return $query_vars;
|
2175 |
-
}
|
2176 |
-
public function save_shortcode_query_vars($query_vars) {
|
2177 |
-
$br_query_vars = $query_vars;
|
2178 |
-
if( ! empty($br_query_vars['tax_query']) && is_array($br_query_vars['tax_query']) ) {
|
2179 |
-
foreach($br_query_vars['tax_query'] as $i => $tax_query_val) {
|
2180 |
-
if( ! empty($tax_query_val['taxonomy']) ) {
|
2181 |
-
$br_query_vars['tax_query'][$i] = array(
|
2182 |
-
$tax_query_val,
|
2183 |
-
);
|
2184 |
-
}
|
2185 |
-
}
|
2186 |
-
}
|
2187 |
-
global $br_wc_query, $br_aapf_wc_footer_widget;
|
2188 |
-
$br_query_vars['fields'] = 'ids';
|
2189 |
-
$br_wc_query = $br_query_vars;
|
2190 |
-
$br_aapf_wc_footer_widget = true;
|
2191 |
-
add_action( 'wp_footer', array( $this, 'wp_footer_widget'), 99999 );
|
2192 |
-
}
|
2193 |
public function display_products() {
|
2194 |
return '';
|
2195 |
}
|
2196 |
-
public function apply_user_price( $query, $is_shortcode = FALSE ) {
|
2197 |
-
$options = $this->get_option();
|
2198 |
-
if( class_exists('WC_Query') && method_exists('WC_Query', 'get_main_query') ) {
|
2199 |
-
$wc_query = WC_Query::get_main_query();
|
2200 |
-
$is_wc_main_query = $wc_query === $query;
|
2201 |
-
} else {
|
2202 |
-
$is_wc_main_query = $query->is_main_query();
|
2203 |
-
}
|
2204 |
-
$is_wc_main_query = apply_filters('berocket_aapf_check_is_wc_main_query', $is_wc_main_query, $query, $is_shortcode);
|
2205 |
-
if ( ( ( ! is_admin() && $is_wc_main_query ) || $is_shortcode ) && ( apply_filters( 'berocket_aapf_is_filtered_page_check', ! empty($_GET['filters']), 'apply_user_price', $query ) ) ) {
|
2206 |
-
br_aapf_args_converter( $query );
|
2207 |
-
if( ! empty($options['products_only']) ) {
|
2208 |
-
add_filter('pre_option_woocommerce_shop_page_display', array( $this, 'display_products' ), 99999);
|
2209 |
-
add_filter('pre_option_woocommerce_category_archive_display', array( $this, 'display_products' ), 99999);
|
2210 |
-
}
|
2211 |
-
}
|
2212 |
-
return $query;
|
2213 |
-
}
|
2214 |
-
public function apply_user_filters( $query, $is_shortcode = FALSE ) {
|
2215 |
-
$options = $this->get_option();
|
2216 |
-
if( self::$debug_mode ) {
|
2217 |
-
if ( empty( self::$error_log['8_1_query_in'] ) || ! is_array( self::$error_log['8_1_query_in'] ) ) {
|
2218 |
-
self::$error_log['8_1_query_in'] = array();
|
2219 |
-
}
|
2220 |
-
self::$error_log['8_1_query_in'][] = $query;
|
2221 |
-
self::$error_log['PERMALINK'] = get_option('permalink_structure');
|
2222 |
-
}
|
2223 |
-
if( class_exists('WC_Query') && method_exists('WC_Query', 'get_main_query') ) {
|
2224 |
-
$wc_query = WC_Query::get_main_query();
|
2225 |
-
$is_wc_main_query = $wc_query === $query || $query->is_main_query();
|
2226 |
-
if( $is_wc_main_query && ! $query->is_main_query() ) {
|
2227 |
-
$is_shortcode = true;
|
2228 |
-
}
|
2229 |
-
} else {
|
2230 |
-
$is_wc_main_query = $query->is_main_query();
|
2231 |
-
}
|
2232 |
-
|
2233 |
-
$is_wc_main_query = apply_filters('berocket_aapf_check_is_wc_main_query', $is_wc_main_query, $query, $is_shortcode);
|
2234 |
-
if( apply_filters( 'berocket_aapf_is_filtered_page_check', ! empty($_GET['filters']), 'apply_user_filters', $query ) ) {
|
2235 |
-
br_aapf_args_converter( $query );
|
2236 |
-
}
|
2237 |
-
if ( ( ( ! is_admin() && $is_wc_main_query ) || $is_shortcode ) ) {
|
2238 |
-
if( ( apply_filters( 'berocket_aapf_is_filtered_page_check', ! empty($_GET['filters']), 'apply_user_filters', $query ) )
|
2239 |
-
&& ( ( isset($query->query_vars['wc_query']) && $query->query_vars['wc_query'] == 'product_query' ) || ( isset($query->query_vars['post_type']) && $query->query_vars['post_type'] == 'product' ) ) ) {
|
2240 |
-
$args = $this->get_filter_args($query);
|
2241 |
-
global $braapf_not_filtered_data;
|
2242 |
-
$braapf_not_filtered_data = array(
|
2243 |
-
'post__not_in' => $query->get( 'post__not_in' ),
|
2244 |
-
'post__in' => $query->get( 'post__in' ),
|
2245 |
-
);
|
2246 |
-
$query_vars_post__in = $query->get( 'post__in' );
|
2247 |
-
$query_vars_post__in = apply_filters( 'bapf_loop_shop_post_in', $query_vars_post__in);
|
2248 |
-
$query->set( 'post__in', $query_vars_post__in );
|
2249 |
-
$args_fields = array( 'meta_key', 'tax_query', 'fields', 'where', 'join', 'meta_query', 'date_query', 's' );
|
2250 |
-
foreach ( $args_fields as $args_field ) {
|
2251 |
-
if ( ! empty($args[ $args_field ]) ) {
|
2252 |
-
$variable = $query->get( $args_field );
|
2253 |
-
if( is_array($variable) ) {
|
2254 |
-
$variable = array_merge($variable, $args[ $args_field ]);
|
2255 |
-
} else {
|
2256 |
-
$variable = $args[ $args_field ];
|
2257 |
-
}
|
2258 |
-
$query->set( $args_field, $variable );
|
2259 |
-
}
|
2260 |
-
}
|
2261 |
-
$query->set('berocket_filtered', true);
|
2262 |
-
|
2263 |
-
//THIS CAN BE NEW FIX FOR SORTING, BUT NOT SURE
|
2264 |
-
if( class_exists('WC_Query') && method_exists('WC_Query', 'product_query') ) {
|
2265 |
-
|
2266 |
-
if( empty($_GET['orderby']) && wc_clean( get_query_var( 'orderby' ) ) && strtolower(wc_clean( get_query_var( 'order' ) )) == 'desc' ) {
|
2267 |
-
$orderby = wc_clean( get_query_var( 'orderby' ) );
|
2268 |
-
$orderby = is_array( $orderby ) ? $orderby : explode(' ', $orderby);
|
2269 |
-
$orderby = $orderby[0];
|
2270 |
-
if( in_array($orderby, array('date')) ) {
|
2271 |
-
$_GET['orderby'] = strtolower($orderby);
|
2272 |
-
} else {
|
2273 |
-
$_GET['orderby'] = strtolower($orderby.'-'.wc_clean( get_query_var( 'order' ) ));
|
2274 |
-
}
|
2275 |
-
}
|
2276 |
-
$post__in = $query->get('post__in');
|
2277 |
-
wc()->query->product_query($query);
|
2278 |
-
$query->set('post__in', $post__in);
|
2279 |
-
}
|
2280 |
-
if( self::$debug_mode ) {
|
2281 |
-
self::$error_log['8_query_out'] = $query;
|
2282 |
-
}
|
2283 |
-
}
|
2284 |
-
$query = apply_filters('berocket_filters_query_already_filtered', $query, br_get_value_from_array($_POST, 'terms'), br_get_value_from_array($_POST, 'limits_arr'));
|
2285 |
-
}
|
2286 |
-
|
2287 |
-
if ( (( ! is_admin() && $query->is_main_query() ) || $is_shortcode) && isset($query->query_vars['post_type']) && $query->query_vars['post_type'] == 'product' ) {
|
2288 |
-
global $br_wc_query;
|
2289 |
-
$br_wc_query = $query;
|
2290 |
-
}
|
2291 |
-
if ( $is_shortcode ) {
|
2292 |
-
global $br_aapf_wc_footer_widget;
|
2293 |
-
$br_aapf_wc_footer_widget = true;
|
2294 |
-
add_action( 'wp_footer', array( $this, 'wp_footer_widget'), 99999 );
|
2295 |
-
}
|
2296 |
-
|
2297 |
-
if( self::$debug_mode ) {
|
2298 |
-
self::$error_log['8_2_query_out'] = $query;
|
2299 |
-
}
|
2300 |
-
|
2301 |
-
return apply_filters('berocket_aapf_return_query_filtered', $query, $is_shortcode);
|
2302 |
-
}
|
2303 |
-
public function get_filter_args($query, $is_shortcode = false) {
|
2304 |
-
$options = $this->get_option();
|
2305 |
-
$args = array();
|
2306 |
-
if ( apply_filters( 'berocket_aapf_is_filtered_page_check', ! empty($_GET['filters']), 'get_filter_args', $query ) ) {
|
2307 |
-
if( $is_shortcode ) {
|
2308 |
-
$query->set('brapf_is_shortcode', true);
|
2309 |
-
}
|
2310 |
-
br_aapf_args_converter( $query );
|
2311 |
-
|
2312 |
-
if( self::$debug_mode ) {
|
2313 |
-
self::$error_log['8_query_in'] = $query;
|
2314 |
-
}
|
2315 |
-
if( ! empty($options['products_only']) ) {
|
2316 |
-
add_filter('pre_option_woocommerce_shop_page_display', array( $this, 'display_products' ), 99999);
|
2317 |
-
add_filter('pre_option_woocommerce_category_archive_display', array( $this, 'display_products' ), 99999);
|
2318 |
-
}
|
2319 |
-
|
2320 |
-
$old_post_terms = ( empty($_POST['terms']) ? '' : $_POST['terms'] );
|
2321 |
-
$woocommerce_hide_out_of_stock_items = BeRocket_AAPF_Widget_functions::woocommerce_hide_out_of_stock_items();
|
2322 |
-
$meta_query = $this->remove_out_of_stock( array(), true, $woocommerce_hide_out_of_stock_items != 'yes' );
|
2323 |
-
|
2324 |
-
$args = br_aapf_args_parser();
|
2325 |
-
if ( isset( $args['meta_query'] ) ) {
|
2326 |
-
$args['meta_query'] += $meta_query;
|
2327 |
-
} else {
|
2328 |
-
$args['meta_query'] = $meta_query;
|
2329 |
-
}
|
2330 |
-
$_POST['terms'] = $old_post_terms;
|
2331 |
-
|
2332 |
-
if ( ! br_woocommerce_version_check('3.6') && ! empty($_POST['price']) ) {
|
2333 |
-
$min = isset( $_POST['price'][0] ) ? floatval( $_POST['price'][0] ) : 0;
|
2334 |
-
$max = isset( $_POST['price'][1] ) ? floatval( $_POST['price'][1] ) : 9999999999;
|
2335 |
-
if ( wc_tax_enabled() && 'incl' === get_option( 'woocommerce_tax_display_shop' ) && ! wc_prices_include_tax() ) {
|
2336 |
-
$tax_classes = array_merge( array( '' ), WC_Tax::get_tax_classes() );
|
2337 |
-
$class_min = $min;
|
2338 |
-
|
2339 |
-
foreach ( $tax_classes as $tax_class ) {
|
2340 |
-
if ( $tax_rates = WC_Tax::get_rates( $tax_class ) ) {
|
2341 |
-
$class_min = $min - WC_Tax::get_tax_total( WC_Tax::calc_exclusive_tax( $min, $tax_rates ) );
|
2342 |
-
}
|
2343 |
-
}
|
2344 |
-
$min = $class_min;
|
2345 |
-
}
|
2346 |
-
|
2347 |
-
$args['meta_query'][] = array(
|
2348 |
-
'key' => apply_filters('berocket_price_filter_meta_key', '_price', 'main_1543'),
|
2349 |
-
'value' => array( $min, $max ),
|
2350 |
-
'compare' => 'BETWEEN',
|
2351 |
-
'type' => 'DECIMAL',
|
2352 |
-
'price_filter' => true,
|
2353 |
-
);
|
2354 |
-
}
|
2355 |
-
|
2356 |
-
$args = apply_filters( 'berocket_aapf_filters_on_page_load', $args );
|
2357 |
-
if( self::$debug_mode ) {
|
2358 |
-
self::$error_log['3_user_filters'] = $args;
|
2359 |
-
}
|
2360 |
-
|
2361 |
-
global $berocket_filters_session;
|
2362 |
-
if( ! empty($args['tax_query']) ) {
|
2363 |
-
$_SESSION['BeRocket_filters'] = array('terms' => $_POST['terms']);
|
2364 |
-
$berocket_filters_session = $_SESSION['BeRocket_filters'];
|
2365 |
-
} else {
|
2366 |
-
if( isset($_SESSION['BeRocket_filters']) ) {
|
2367 |
-
unset($_SESSION['BeRocket_filters']);
|
2368 |
-
}
|
2369 |
-
if( isset($berocket_filters_session) ) {
|
2370 |
-
unset($berocket_filters_session);
|
2371 |
-
}
|
2372 |
-
}
|
2373 |
-
}
|
2374 |
-
return $args;
|
2375 |
-
}
|
2376 |
-
public function remove_out_of_stock( $filtered_posts, $use_post_terms = false, $show_out_of_stock = false ) {
|
2377 |
-
global $wpdb;
|
2378 |
-
if ( $use_post_terms ) {
|
2379 |
-
$meta_query = array();
|
2380 |
-
if( ! empty($_POST['terms']) ) {
|
2381 |
-
$stock_status = array();
|
2382 |
-
foreach($_POST['terms'] as $term) {
|
2383 |
-
if( $term[0] == '_stock_status' ) {
|
2384 |
-
$stock_status[] = $term[3];
|
2385 |
-
if( $term[3] == 'outofstock' ) {
|
2386 |
-
$stock_status[] = 'onbackorder';
|
2387 |
-
}
|
2388 |
-
}
|
2389 |
-
}
|
2390 |
-
if( count($stock_status) ) {
|
2391 |
-
array_push($meta_query , array( 'key' => '_stock_status', 'value' => $stock_status, 'compare' => 'IN' ) );
|
2392 |
-
}
|
2393 |
-
for ( $i = count( $_POST['terms'] ) - 1; $i >= 0; $i-- ) {
|
2394 |
-
if ( $_POST['terms'][$i][0] == '_stock_status' ) {
|
2395 |
-
unset( $_POST['terms'][$i] );
|
2396 |
-
}
|
2397 |
-
}
|
2398 |
-
}
|
2399 |
-
|
2400 |
-
if ( $show_out_of_stock ) {
|
2401 |
-
return $meta_query;
|
2402 |
-
} else {
|
2403 |
-
return array();
|
2404 |
-
}
|
2405 |
-
}
|
2406 |
-
|
2407 |
-
$query_string = "
|
2408 |
-
SELECT DISTINCT ID, post_parent, post_type FROM $wpdb->posts
|
2409 |
-
INNER JOIN $wpdb->postmeta as meta ON ID = meta.post_id
|
2410 |
-
WHERE post_type IN ( 'product', 'product_variation' ) AND post_status = 'publish'
|
2411 |
-
AND meta_key = '_stock_status' AND meta_value != 'outofstock'";
|
2412 |
-
|
2413 |
-
if( self::$debug_mode ) {
|
2414 |
-
self::$error_log['104_remove_out_of_stock_SELECT'] = $query_string;
|
2415 |
-
$wpdb->show_errors();
|
2416 |
-
}
|
2417 |
-
|
2418 |
-
// TODO: split this into 2 queries(product and product_variation) this way we will not be using all data at the same time
|
2419 |
-
$matched_products_query = $wpdb->get_results( $query_string, OBJECT_K );
|
2420 |
-
unset( $query_string );
|
2421 |
-
$matched_products = array( 0 );
|
2422 |
-
|
2423 |
-
if( self::$debug_mode ) {
|
2424 |
-
self::$error_log['000_select_status'][] = @ $wpdb->last_error;
|
2425 |
-
}
|
2426 |
-
|
2427 |
-
foreach ( $matched_products_query as $product ) {
|
2428 |
-
if ( $product->post_type == 'product' )
|
2429 |
-
$matched_products[] = $product->ID;
|
2430 |
-
// TODO: check if we really need this in_array. We have array_unique after foreach. Only one should be left
|
2431 |
-
if ( $product->post_parent > 0 && ! in_array( $product->post_parent, $matched_products ) )
|
2432 |
-
$matched_products[] = $product->post_parent;
|
2433 |
-
}
|
2434 |
-
if( ! empty($matched_products) && is_array($matched_products) ) {
|
2435 |
-
$matched_products = array_unique( $matched_products );
|
2436 |
-
}
|
2437 |
-
|
2438 |
-
if ( sizeof( $filtered_posts ) == 0) {
|
2439 |
-
$filtered_posts = $matched_products;
|
2440 |
-
} else {
|
2441 |
-
// TODO: array_intersect will create count($filtered_posts) * count($matched_products) loops.
|
2442 |
-
// TODO: this should be handled above, in foreach
|
2443 |
-
$filtered_posts = array_intersect( $filtered_posts, $matched_products );
|
2444 |
-
}
|
2445 |
-
|
2446 |
-
return (array) $filtered_posts;
|
2447 |
-
}
|
2448 |
-
public function remove_hidden( $filtered_posts ){
|
2449 |
-
global $wpdb;
|
2450 |
-
|
2451 |
-
$query_string = "
|
2452 |
-
SELECT DISTINCT ID, post_parent, post_type FROM $wpdb->posts
|
2453 |
-
INNER JOIN $wpdb->postmeta as meta ON ID = meta.post_id
|
2454 |
-
WHERE post_type IN ( 'product', 'product_variation' ) AND post_status = 'publish'
|
2455 |
-
AND meta_key = '_visibility' AND meta_value NOT IN ('hidden', 'search')";
|
2456 |
-
|
2457 |
-
if( self::$debug_mode ) {
|
2458 |
-
self::$error_log['105_remove_hidden_SELECT'] = $query_string;
|
2459 |
-
$wpdb->show_errors();
|
2460 |
-
}
|
2461 |
-
|
2462 |
-
$matched_products_query = $wpdb->get_results( $query_string, OBJECT_K );
|
2463 |
-
unset( $query_string );
|
2464 |
-
$matched_products = array( 0 );
|
2465 |
-
|
2466 |
-
if( self::$debug_mode ) {
|
2467 |
-
self::$error_log['000_select_status'][] = @ $wpdb->last_error;
|
2468 |
-
}
|
2469 |
-
|
2470 |
-
foreach ( $matched_products_query as $product ) {
|
2471 |
-
if ( $product->post_type == 'product' )
|
2472 |
-
$matched_products[] = $product->ID;
|
2473 |
-
if ( $product->post_parent > 0 && ! in_array( $product->post_parent, $matched_products ) )
|
2474 |
-
$matched_products[] = $product->post_parent;
|
2475 |
-
}
|
2476 |
-
if( ! empty($matched_products) && is_array($matched_products) ) {
|
2477 |
-
$matched_products = array_unique( $matched_products );
|
2478 |
-
}
|
2479 |
-
|
2480 |
-
if ( sizeof( $filtered_posts ) == 0) {
|
2481 |
-
$filtered_posts = $matched_products;
|
2482 |
-
} else {
|
2483 |
-
$filtered_posts = array_intersect( $filtered_posts, $matched_products );
|
2484 |
-
}
|
2485 |
-
return (array) $filtered_posts;
|
2486 |
-
}
|
2487 |
public function delete_products_not_on_sale($transient) {
|
2488 |
delete_transient( 'wc_products_notonsale' );
|
2489 |
}
|
2490 |
-
public function new_blog( $blog_id, $user_id, $domain, $path, $site_id, $meta ) {
|
2491 |
-
global $wpdb;
|
2492 |
-
if ( is_plugin_active_for_network( plugin_basename( __FILE__ ) ) ) {
|
2493 |
-
$old_blog = $wpdb->blogid;
|
2494 |
-
switch_to_blog($blog_id);
|
2495 |
-
$this->_br_add_defaults();
|
2496 |
-
switch_to_blog($old_blog);
|
2497 |
-
}
|
2498 |
-
}
|
2499 |
-
public function br_add_defaults( $networkwide ) {
|
2500 |
-
global $wpdb;
|
2501 |
-
if ( function_exists('is_multisite') && is_multisite() ) {
|
2502 |
-
if ( $networkwide) {
|
2503 |
-
$old_blog = $wpdb->blogid;
|
2504 |
-
$blogids = $wpdb->get_col("SELECT blog_id FROM $wpdb->blogs");
|
2505 |
-
|
2506 |
-
foreach ( $blogids as $blog_id ) {
|
2507 |
-
switch_to_blog( $blog_id );
|
2508 |
-
$this->_br_add_defaults();
|
2509 |
-
}
|
2510 |
-
|
2511 |
-
switch_to_blog( $old_blog );
|
2512 |
-
return;
|
2513 |
-
}
|
2514 |
-
}
|
2515 |
-
$this->_br_add_defaults();
|
2516 |
-
}
|
2517 |
-
public function _br_add_defaults() {
|
2518 |
-
$tmp = $this->get_option();
|
2519 |
-
$tmp2 = get_option( 'berocket_permalink_option' );
|
2520 |
-
$version = get_option( 'br_filters_version' );
|
2521 |
-
if ( isset($tmp['chk_default_options_db']) and ($tmp['chk_default_options_db'] == '1' or ! is_array( $tmp )) ) {
|
2522 |
-
delete_option( 'br_filters_options' );
|
2523 |
-
update_option( 'br_filters_options', self::$defaults );
|
2524 |
-
}
|
2525 |
-
if ( ( isset($tmp['chk_default_options_db']) and $tmp['chk_default_options_db'] == '1' ) or !is_array( $tmp2 ) ) {
|
2526 |
-
delete_option( 'berocket_permalink_option' );
|
2527 |
-
update_option( 'berocket_permalink_option', $this->default_permalink );
|
2528 |
-
update_option( 'berocket_nn_permalink_option', $this->default_nn_permalink );
|
2529 |
-
}
|
2530 |
-
}
|
2531 |
-
public function br_delete_plugin_options($networkwide) {
|
2532 |
-
global $wpdb;
|
2533 |
-
if (function_exists('is_multisite') && is_multisite()) {
|
2534 |
-
if ($networkwide) {
|
2535 |
-
$old_blog = $wpdb->blogid;
|
2536 |
-
$blogids = $wpdb->get_col("SELECT blog_id FROM {$wpdb->blogs}");
|
2537 |
-
foreach ($blogids as $blog_id) {
|
2538 |
-
switch_to_blog($blog_id);
|
2539 |
-
$this->_br_delete_plugin_options();
|
2540 |
-
}
|
2541 |
-
switch_to_blog($old_blog);
|
2542 |
-
return;
|
2543 |
-
}
|
2544 |
-
}
|
2545 |
-
$this->_br_delete_plugin_options();
|
2546 |
-
}
|
2547 |
-
public function _br_delete_plugin_options() {
|
2548 |
-
delete_option( 'br_filters_options' );
|
2549 |
-
delete_option( 'berocket_permalink_option' );
|
2550 |
-
}
|
2551 |
public function convert_styles_to_string(&$style) {
|
2552 |
if( empty($style) || ! is_array($style) ) {
|
2553 |
return '';
|
@@ -2902,30 +2260,6 @@ jQuery(document).on('change', '.berocket_disable_ajax_loading', berocket_disable
|
|
2902 |
$args['groupby'] = "$wpdb->posts.ID";
|
2903 |
return $args;
|
2904 |
}
|
2905 |
-
public function wp_footer_widget() {
|
2906 |
-
global $br_widget_ids;
|
2907 |
-
if( isset( $br_widget_ids ) && is_array( $br_widget_ids ) && count( $br_widget_ids ) > 0 ) {
|
2908 |
-
echo '<div class="berocket_wc_shortcode_fix" style="display: none;">';
|
2909 |
-
foreach ( $br_widget_ids as $widget ) {
|
2910 |
-
$widget['instance']['br_wp_footer'] = true;
|
2911 |
-
the_widget( 'BeRocket_new_AAPF_Widget_single', $widget['instance'], $widget['args']);
|
2912 |
-
}
|
2913 |
-
echo '</div>';
|
2914 |
-
}
|
2915 |
-
}
|
2916 |
-
public function get_attribute_for_variation_link($product, $filters) {
|
2917 |
-
$attributes = $product->get_variation_attributes();
|
2918 |
-
$filter_attribute = array();
|
2919 |
-
if( ! empty($filters) && is_array($filters) ) {
|
2920 |
-
foreach($filters as $term) {
|
2921 |
-
if( empty($attributes[$term[0]]) || ! empty($filter_attribute[$term[0]]) ) continue;
|
2922 |
-
if( in_array(strtolower(urlencode(urldecode($term[3]))), $attributes[$term[0]]) ) {
|
2923 |
-
$filter_attribute[$term[0]] = urldecode($term[3]);
|
2924 |
-
}
|
2925 |
-
}
|
2926 |
-
}
|
2927 |
-
return $filter_attribute;
|
2928 |
-
}
|
2929 |
public function wcml_currency_price_fix() {
|
2930 |
if ( ! empty($_POST['price']) ) {
|
2931 |
global $woocommerce_wpml;
|
@@ -2959,22 +2293,6 @@ jQuery(document).on('change', '.berocket_disable_ajax_loading', berocket_disable
|
|
2959 |
$compatibility['br_filters_group'] = 'br-product-filters';
|
2960 |
return $compatibility;
|
2961 |
}
|
2962 |
-
public function limits_filter($post_in) {
|
2963 |
-
$post_in = apply_filters('berocket_aapf_limits_filter_function', $post_in);
|
2964 |
-
return $post_in;
|
2965 |
-
}
|
2966 |
-
public function select_term_child_prefix($prefix) {
|
2967 |
-
$styles = array(
|
2968 |
-
's' => ' ',
|
2969 |
-
'2s' => ' ',
|
2970 |
-
'4s' => ' '
|
2971 |
-
);
|
2972 |
-
$option = $this->get_option();
|
2973 |
-
if( array_key_exists($option['child_pre_indent'], $styles) ) {
|
2974 |
-
$prefix = $styles[$option['child_pre_indent']];
|
2975 |
-
}
|
2976 |
-
return $prefix;
|
2977 |
-
}
|
2978 |
public function BRaapf_cache_check_md5($md5) {
|
2979 |
$options = $this->get_option();
|
2980 |
$md5 = $md5 . br_get_value_from_array($options, 'purge_cache_time');
|
@@ -3119,8 +2437,9 @@ jQuery(document).on('change', '.berocket_disable_ajax_loading', berocket_disable
|
|
3119 |
if( $previous !== '0' && ( version_compare($previous, '1.5.6', '<') || (version_compare($previous, '2.0', '>') && version_compare($previous, '3.0.5', '<') ) ) ) {
|
3120 |
$deprecated_filters = false;
|
3121 |
if( ! empty($options['addons']) && is_array($options['addons']) ) {
|
3122 |
-
foreach($options['addons'] as $addon) {
|
3123 |
if( strpos($addon, 'deprecated_filters.php') !== FALSE ) {
|
|
|
3124 |
$deprecated_filters = true;
|
3125 |
break;
|
3126 |
}
|
@@ -3147,6 +2466,20 @@ jQuery(document).on('change', '.berocket_disable_ajax_loading', berocket_disable
|
|
3147 |
));
|
3148 |
}
|
3149 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3150 |
}
|
3151 |
public function save_settings_callback( $settings ) {
|
3152 |
$options = $this->get_option();
|
122 |
'products_only' => '1',
|
123 |
'out_of_stock_variable' => '',
|
124 |
'out_of_stock_variable_reload' => '',
|
|
|
125 |
'page_same_as_filter' => '',
|
126 |
'styles_in_footer' => '',
|
127 |
|
235 |
add_action( 'divi_extensions_init', array($this, 'divi_extensions_init') );
|
236 |
add_action( 'admin_init', array( $this, 'admin_init' ) );
|
237 |
add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
|
|
|
|
|
238 |
add_action( 'init', array( $this, 'create_metadata_table' ), 999999999 );
|
239 |
add_action( 'br_footer_script', array( $this, 'include_all_scripts' ) );
|
240 |
add_action( 'delete_transient_wc_products_onsale', array( $this, 'delete_products_not_on_sale' ) );
|
249 |
if ( ! defined('DOING_AJAX') || ! DOING_AJAX ) {
|
250 |
$this->not_ajax_functions();
|
251 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
252 |
if ( ! empty($option['selected_area_show']) ) {
|
253 |
add_action ( br_get_value_from_array($option, 'elements_position_hook', 'woocommerce_archive_description'), array($this, 'selected_area'), 1 );
|
254 |
}
|
256 |
add_action( 'wp_enqueue_scripts', array( $this, 'include_all_styles' ) );
|
257 |
}
|
258 |
add_filter( 'is_active_sidebar', array($this, 'is_active_sidebar'), 10, 2);
|
|
|
|
|
|
|
259 |
if( ! empty($option['page_same_as_filter']) ) {
|
260 |
include_once( dirname( __FILE__ ) . '/includes/addons/page-same-as-filter.php' );
|
261 |
new BeRocket_AAPF_addon_page_same_as_filter($option['page_same_as_filter']);
|
269 |
add_filter( 'woocommerce_redirect_single_search_result', '__return_false' );
|
270 |
}
|
271 |
if( ! empty($option['out_of_stock_variable']) ) {
|
272 |
+
include_once( dirname( __FILE__ ) . '/includes/addons/new-woocommerce-variation.php' );
|
273 |
}
|
274 |
if( ! empty($option['seo_meta_title']) ) {
|
275 |
include_once( dirname( __FILE__ ) . '/includes/addons/seo_meta_title.php' );
|
279 |
add_filter( 'plugin_action_links_' . $plugin_base_slug, array( $this, 'plugin_action_links' ) );
|
280 |
add_filter( 'berocket_aapf_widget_terms', array($this, 'wpml_attribute_slug_translate'));
|
281 |
add_filter ( 'BeRocket_updater_menu_order_custom_post', array($this, 'menu_order_custom_post') );
|
|
|
|
|
|
|
|
|
|
|
282 |
add_action('woocommerce_before_template_part', array($this, 'no_products_block_before'), 1, 1);
|
283 |
add_action('woocommerce_after_template_part', array($this, 'no_products_block_after'), 999999, 1);
|
284 |
add_action('braapf_wp_enqueue_style_after', array($this, 'custom_user_css'), 10, 1);
|
290 |
add_action( 'admin_notices', array( $this, 'no_woocommerce' ) );
|
291 |
}
|
292 |
}
|
293 |
+
do_action('bapf_class_ready', $this);
|
294 |
} else {
|
295 |
add_filter( 'berocket_display_additional_notices', array(
|
296 |
$this,
|
1037 |
"value" => '1',
|
1038 |
'label_for' => __("Fixed CSS styles for Select2 (do not enable if Select2 work correct. Option can break Select2 in other plugins or themes)", 'BeRocket_AJAX_domain'),
|
1039 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1040 |
),
|
1041 |
'Design' => array(
|
1042 |
'ajax_load_icon' => array(
|
1460 |
}
|
1461 |
out_of_stock_variable_reload_hide();
|
1462 |
jQuery('.berocket_aapf_recount_hide, .out_of_stock_variable').on('change', out_of_stock_variable_reload_hide);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1463 |
function load_fix_ajax_request_load() {
|
1464 |
if( jQuery('.load_fix_ajax_request_load').prop('checked') ) {
|
1465 |
jQuery('.load_fix_use_get_query').parent().show();
|
1606 |
add_action( "wp_ajax_berocket_aapf_save_simple_filter_creation", array ( $this, 'save_simple_filter_creation' ) );
|
1607 |
}
|
1608 |
function not_ajax_functions() {
|
|
|
|
|
|
|
|
|
|
|
|
|
1609 |
$shortcode_types = array(
|
1610 |
'products',
|
1611 |
'product',
|
1685 |
$wp_check_product_cat = $wp_query_product_cat;
|
1686 |
}
|
1687 |
|
|
|
|
|
|
|
|
|
|
|
1688 |
if ( ! empty($sitepress) && method_exists($sitepress, 'get_current_language') ) {
|
1689 |
$current_language = $sitepress->get_current_language();
|
1690 |
} else {
|
1750 |
'ub_product_count' => '',
|
1751 |
'ub_product_text' => '',
|
1752 |
'ub_product_button_text' => '',
|
|
|
1753 |
'default_sorting' => $default_sorting,
|
1754 |
'first_page' => '1',
|
1755 |
'scroll_shop_top' => ( empty($br_options['scroll_shop_top']) ? '' : $br_options['scroll_shop_top'] ),
|
1887 |
<p>' . __( 'Update WooCommerce plugin', 'BeRocket_AJAX_domain' ) . '</p>
|
1888 |
</div>';
|
1889 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1890 |
public function apply_filter_to_shortcode($enable) {
|
1891 |
remove_filter('berocket_aapf_wcshortcode_is_filtering', array($this, 'apply_filter_to_shortcode'));
|
1892 |
return true;
|
1895 |
remove_filter('berocket_aapf_wcshortcode_is_filtering', array($this, 'not_apply_filter_to_shortcode'));
|
1896 |
return false;
|
1897 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1898 |
public function woocommerce_shortcode_no_result($atts) {
|
1899 |
if( ! empty($atts['berocket_aapf']) ) {
|
1900 |
wc_no_products_found();
|
1901 |
}
|
1902 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1903 |
public function display_products() {
|
1904 |
return '';
|
1905 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1906 |
public function delete_products_not_on_sale($transient) {
|
1907 |
delete_transient( 'wc_products_notonsale' );
|
1908 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1909 |
public function convert_styles_to_string(&$style) {
|
1910 |
if( empty($style) || ! is_array($style) ) {
|
1911 |
return '';
|
2260 |
$args['groupby'] = "$wpdb->posts.ID";
|
2261 |
return $args;
|
2262 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2263 |
public function wcml_currency_price_fix() {
|
2264 |
if ( ! empty($_POST['price']) ) {
|
2265 |
global $woocommerce_wpml;
|
2293 |
$compatibility['br_filters_group'] = 'br-product-filters';
|
2294 |
return $compatibility;
|
2295 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2296 |
public function BRaapf_cache_check_md5($md5) {
|
2297 |
$options = $this->get_option();
|
2298 |
$md5 = $md5 . br_get_value_from_array($options, 'purge_cache_time');
|
2437 |
if( $previous !== '0' && ( version_compare($previous, '1.5.6', '<') || (version_compare($previous, '2.0', '>') && version_compare($previous, '3.0.5', '<') ) ) ) {
|
2438 |
$deprecated_filters = false;
|
2439 |
if( ! empty($options['addons']) && is_array($options['addons']) ) {
|
2440 |
+
foreach($options['addons'] as $i => $addon) {
|
2441 |
if( strpos($addon, 'deprecated_filters.php') !== FALSE ) {
|
2442 |
+
unset($options['addons'][$i]);
|
2443 |
$deprecated_filters = true;
|
2444 |
break;
|
2445 |
}
|
2466 |
));
|
2467 |
}
|
2468 |
}
|
2469 |
+
if( $previous !== '0' && ( version_compare($previous, '1.6', '<') || (version_compare($previous, '2.0', '>') && version_compare($previous, '3.1', '<') ) ) ) {
|
2470 |
+
$options = $this->get_option();
|
2471 |
+
if( ! empty($options['addons']) && is_array($options['addons']) ) {
|
2472 |
+
foreach($options['addons'] as $i => $addon) {
|
2473 |
+
if( strpos($addon, 'deprecated_filters.php') !== FALSE ) {
|
2474 |
+
unset($options['addons'][$i]);
|
2475 |
+
break;
|
2476 |
+
}
|
2477 |
+
}
|
2478 |
+
}
|
2479 |
+
$options['purge_cache_time'] = time();
|
2480 |
+
update_option( 'br_filters_options', $options );
|
2481 |
+
delete_option('BeRocket_aapf_additional_tables_addon_position');
|
2482 |
+
}
|
2483 |
}
|
2484 |
public function save_settings_callback( $settings ) {
|
2485 |
$options = $this->get_option();
|
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: 5.0
|
7 |
Tested up to: 5.8
|
8 |
-
Stable tag: 1.
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
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: 5.0
|
7 |
Tested up to: 5.8
|
8 |
+
Stable tag: 1.6beta
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
templates/disabled/checkbox.php
DELETED
@@ -1,131 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* The template for displaying checkbox filters
|
4 |
-
*
|
5 |
-
* Override this template by copying it to yourtheme/woocommerce-filters/checkbox.php
|
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++;
|
16 |
-
$random_name = strval($berocket_unique_value);
|
17 |
-
$hiden_value = false;
|
18 |
-
$child_parent = berocket_isset($child_parent);
|
19 |
-
$is_child_parent = $child_parent == 'child';
|
20 |
-
$is_child_parent_or = ( $child_parent == 'child' || $child_parent == 'parent' );
|
21 |
-
$child_parent_depth = berocket_isset($child_parent_depth, false, 0);
|
22 |
-
if ( $child_parent == 'parent' ) {
|
23 |
-
$child_parent_depth = 0;
|
24 |
-
}
|
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');
|
31 |
-
if( empty($term_taxonomy_echo) ) {
|
32 |
-
$term_taxonomy_echo = berocket_isset($term, 'taxonomy');
|
33 |
-
}
|
34 |
-
$parent_count = 0;
|
35 |
-
$item_i++;
|
36 |
-
if ( $is_child_parent && $is_first ) {
|
37 |
-
?><li class="berocket_child_parent_sample"><ul><?php
|
38 |
-
} elseif(isset($term->parent) && $term->parent != 0) {
|
39 |
-
$parent_count = get_ancestors( $term->term_id, $term->taxonomy );
|
40 |
-
$parent_count = count($parent_count);
|
41 |
-
} elseif( isset($term->depth) ) {
|
42 |
-
$parent_count = $term->depth;
|
43 |
-
}
|
44 |
-
$added_categories[] = berocket_isset($term, 'term_id');
|
45 |
-
|
46 |
-
?>
|
47 |
-
<li class="berocket_disabled_filter_element berocket_term_parent_<?php echo ( property_exists($term, 'parent') ? $term->parent : '' ); ?> berocket_term_depth_<?php echo $parent_count; ?> <?php if ( $is_child_parent ) echo 'R__class__R '; ?>
|
48 |
-
<?php if( ! empty($hide_o_value) && isset($term->count) && $term->count == 0 && ( !$is_child_parent || !$is_first ) ) {
|
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 ) != '' ) {
|
52 |
-
echo ' berocket_hide_sel_value'; $hiden_value = true;
|
53 |
-
}
|
54 |
-
if( ! empty($attribute_count) ) {
|
55 |
-
if( $item_i > $attribute_count ) {
|
56 |
-
echo ' berocket_hide_attribute_count_value';
|
57 |
-
$hiden_value = true;
|
58 |
-
} elseif( ! empty($hide_o_value) && berocket_isset($term, 'count') == 0 && ( !$is_child_parent || !$is_first ) ) {
|
59 |
-
echo ' berocket_hide_attribute_count_value';
|
60 |
-
$item_i--;
|
61 |
-
$hiden_value = true;
|
62 |
-
}
|
63 |
-
}
|
64 |
-
if( ! empty($hide_child_attributes) && in_array(berocket_isset($term, 'parent'), $added_categories) ) {
|
65 |
-
echo ' berocket_hide_child_attributes';
|
66 |
-
} ?>">
|
67 |
-
<span>
|
68 |
-
<input id='checkbox_<?php echo str_replace ( '*' , '-' , berocket_isset($term, 'term_id')), str_replace ( '*' , '-' , $term_taxonomy_echo) ?>_<?php echo berocket_isset($random_name) ?>'
|
69 |
-
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) ?>"
|
70 |
-
type='checkbox'
|
71 |
-
autocomplete="off"
|
72 |
-
disabled
|
73 |
-
checked
|
74 |
-
style="<?php echo ( empty($uo['style']['checkbox_radio']) ? '' : $uo['style']['checkbox_radio'] )?>"/>
|
75 |
-
<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'] )?>"
|
76 |
-
class="berocket_label_widgets<?php if( br_is_term_selected( $term, true, $is_child_parent_or, $child_parent_depth ) != '') echo ' berocket_checked'; ?>">
|
77 |
-
<?php
|
78 |
-
echo apply_filters( 'berocket_check_radio_color_filter_term_text_disabled', ( ( ! 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>' ) : '' ) .
|
79 |
-
apply_filters('berocket_radio_filter_term_name', htmlentities(berocket_isset($term, 'name'), ENT_QUOTES), $term) .
|
80 |
-
( ! 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, FALSE );
|
81 |
-
?>
|
82 |
-
</label>
|
83 |
-
<?php if( ! empty($hide_child_attributes) ) { ?>
|
84 |
-
<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>
|
85 |
-
<?php } ?>
|
86 |
-
</span>
|
87 |
-
</li>
|
88 |
-
<?php
|
89 |
-
if( ! empty($hide_child_attributes) && in_array(berocket_isset($term, 'parent'), $added_categories) ) {
|
90 |
-
?>
|
91 |
-
<style>
|
92 |
-
.br_child_toggle.br_child_toggle_<?php echo str_replace ( '*' , '-' , berocket_isset($term, 'parent')); ?> {
|
93 |
-
display: inline-block;
|
94 |
-
}
|
95 |
-
</style>
|
96 |
-
<?php
|
97 |
-
}
|
98 |
-
if ( $is_child_parent && $is_first ) {
|
99 |
-
?></ul></li><?php
|
100 |
-
}
|
101 |
-
endforeach;?>
|
102 |
-
<?php if( $is_child_parent && is_array(berocket_isset($terms)) && count($terms) == 1 ) {
|
103 |
-
if( BeRocket_AAPF_Widget_functions::is_parent_selected($attribute, $child_parent_depth - 1) ) {
|
104 |
-
echo '<li>'.$child_parent_no_values.'</li>';
|
105 |
-
} else {
|
106 |
-
echo '<li>'.$child_parent_previous.'</li>';
|
107 |
-
}
|
108 |
-
} else {
|
109 |
-
if( $child_parent_no_values ) {?>
|
110 |
-
<script>
|
111 |
-
if ( typeof(child_parent_depth) == 'undefined' || child_parent_depth < <?php echo $child_parent_depth; ?> ) {
|
112 |
-
child_parent_depth = <?php echo $child_parent_depth; ?>;
|
113 |
-
}
|
114 |
-
jQuery(document).ready(function() {
|
115 |
-
if( child_parent_depth == <?php echo $child_parent_depth; ?> ) {
|
116 |
-
jQuery('.woocommerce-info').text('<?php echo $child_parent_no_values; ?>');
|
117 |
-
}
|
118 |
-
});
|
119 |
-
</script>
|
120 |
-
<?php }
|
121 |
-
}
|
122 |
-
if( ! empty($attribute_count_show_hide) ) {
|
123 |
-
if( $attribute_count_show_hide == 'hidden' ) {
|
124 |
-
$hide_button_value = true;
|
125 |
-
} elseif( $attribute_count_show_hide == 'visible' ) {
|
126 |
-
$hide_button_value = false;
|
127 |
-
}
|
128 |
-
}
|
129 |
-
if( empty($hide_button_value) ) { ?>
|
130 |
-
<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 fa"></span></li>
|
131 |
-
<?php } endif; ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
templates/disabled/color.php
DELETED
@@ -1,199 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
extract($berocket_query_var_title);
|
3 |
-
global $berocket_unique_value;
|
4 |
-
$berocket_unique_value++;
|
5 |
-
$random_name = strval($berocket_unique_value);
|
6 |
-
$hiden_value = false;
|
7 |
-
$child_parent = berocket_isset($child_parent);
|
8 |
-
$is_child_parent = $child_parent == 'child';
|
9 |
-
$is_child_parent_or = ( $child_parent == 'child' || $child_parent == 'parent' );
|
10 |
-
$child_parent_depth = berocket_isset($child_parent_depth, false, 0);
|
11 |
-
if ( $child_parent == 'parent' ) {
|
12 |
-
$child_parent_depth = 0;
|
13 |
-
}
|
14 |
-
$item_i = 0;
|
15 |
-
if ( is_array(berocket_isset($terms)) ) {
|
16 |
-
if( berocket_isset($color_image_checked) == 'brchecked_custom' ) {
|
17 |
-
echo '<style>
|
18 |
-
.berocket_aapf_widget .berocket_checkbox_color.brchecked_custom_'.$random_name.' input[type="checkbox"]:checked + label .berocket_color_span_block,
|
19 |
-
.berocket_aapf_widget .berocket_checkbox_color.brchecked_custom_'.$random_name.' .berocket_checked .berocket_color_span_block{
|
20 |
-
'.$color_image_checked_custom_css.'
|
21 |
-
}
|
22 |
-
</style>';
|
23 |
-
}
|
24 |
-
if( $color_image_block_size == 'hxpx_wxpx' ) {
|
25 |
-
if( empty($color_image_block_size_height) ) {
|
26 |
-
$color_image_block_size_height = 50;
|
27 |
-
}
|
28 |
-
if( empty($color_image_block_size_width) ) {
|
29 |
-
$color_image_block_size_width = 50;
|
30 |
-
}
|
31 |
-
echo '<style>
|
32 |
-
.berocket_aapf_widget .berocket_checkbox_color.berocket_color_with_value.hxpx_wxpx_'.$random_name.'.brchecked_default input[type="checkbox"]:checked + label .berocket_color_span_block,
|
33 |
-
.berocket_aapf_widget .berocket_checkbox_color.berocket_color_with_value.hxpx_wxpx_'.$random_name.'.brchecked_default .berocket_checked .berocket_color_span_block{
|
34 |
-
width: '.($color_image_block_size_width + 10).'px;
|
35 |
-
}
|
36 |
-
.berocket_aapf_widget .berocket_checkbox_color.hxpx_wxpx_'.$random_name.' label span.berocket_color_span_block, span.berocket_color_span_block{
|
37 |
-
width: '.$color_image_block_size_width.'px;
|
38 |
-
}
|
39 |
-
.berocket_aapf_widget .berocket_checkbox_color.hxpx_wxpx_'.$random_name.' label span.berocket_color_span_block, span.berocket_color_span_block{
|
40 |
-
height: '.$color_image_block_size_height.'px;
|
41 |
-
line-height: '.$color_image_block_size_height.'px;
|
42 |
-
}
|
43 |
-
.berocket_aapf_widget .berocket_checkbox_color.hxpx_wxpx_'.$random_name.'{
|
44 |
-
height: '.($color_image_block_size_height + 10).'px;
|
45 |
-
}';
|
46 |
-
if( ($color_image_block_size_ratio = $color_image_block_size_width / $color_image_block_size_height) < 1.3 ) {
|
47 |
-
|
48 |
-
$color_image_block_size_margin = (15 / $color_image_block_size_ratio) + (1 - $color_image_block_size_ratio) * (30 + 5 / $color_image_block_size_ratio / $color_image_block_size_ratio);
|
49 |
-
echo '.berocket_checkbox_color.hxpx_wxpx_'.$random_name.' .berocket_color_span_block .berocket_color_multiple {
|
50 |
-
margin-left: -'.$color_image_block_size_margin.'%;
|
51 |
-
margin-right: -'.$color_image_block_size_margin.'%;
|
52 |
-
}';
|
53 |
-
}
|
54 |
-
echo '</style>';
|
55 |
-
}
|
56 |
-
foreach ( $terms as $term ) {
|
57 |
-
$is_first = ($term->term_id == 'R__term_id__R');
|
58 |
-
$term_taxonomy_echo = berocket_isset($term, 'wpml_taxonomy');
|
59 |
-
if( empty($term_taxonomy_echo) ) {
|
60 |
-
$term_taxonomy_echo = berocket_isset($term, 'taxonomy');
|
61 |
-
}
|
62 |
-
$item_i++;
|
63 |
-
$variables_for_hooks = array(
|
64 |
-
'type' => $type,
|
65 |
-
'item_i' => $item_i,
|
66 |
-
'is_child_parent' => $is_child_parent,
|
67 |
-
'is_first' => $is_first,
|
68 |
-
);
|
69 |
-
$meta_class = apply_filters('berocket_widget_color_image_temp_meta_class_init', ' ', $term);
|
70 |
-
$meta_after = '';
|
71 |
-
if ( !$is_child_parent || !$is_first ) {
|
72 |
-
if( $type == 'color' ) {
|
73 |
-
$berocket_term = get_metadata( 'berocket_term', $term->term_id, 'color' );
|
74 |
-
$berocket_term = br_get_value_from_array($berocket_term, 0, '');
|
75 |
-
$meta_color = array($berocket_term);
|
76 |
-
} else {
|
77 |
-
$meta_color = get_metadata( 'berocket_term', $term->term_id, $type );
|
78 |
-
}
|
79 |
-
} else {
|
80 |
-
$meta_color = 'R';
|
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;
|
90 |
-
if( $type == 'color' ) {
|
91 |
-
$meta_color = $meta_color[0];
|
92 |
-
$meta_color = str_replace('#', '', $meta_color);
|
93 |
-
$meta_color = 'background-color: #'.$meta_color.';';
|
94 |
-
$meta_class = '<span class="berocket_color_span_absolute"><span>'.$meta_class.'</span></span>';
|
95 |
-
} elseif( $type == 'image' ) {
|
96 |
-
if ( ! empty($meta_color[0]) ) {
|
97 |
-
if ( substr( $meta_color[0], 0, 3) == 'fa-' ) {
|
98 |
-
$meta_class = '<i class="fa '.$meta_color[0].'"></i> ';
|
99 |
-
$meta_color = '';
|
100 |
-
} else {
|
101 |
-
$meta_color = 'background: url('.$meta_color[0].') no-repeat scroll 50% 50% rgba(0, 0, 0, 0);';
|
102 |
-
$meta_class = ' ';
|
103 |
-
}
|
104 |
-
$meta_after = '';
|
105 |
-
} else {
|
106 |
-
$meta_color = '';
|
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 |
-
<li class="berocket_disabled_filter_element berocket_term_parent_<?php echo berocket_isset($term, 'parent');
|
113 |
-
if ( $is_child_parent ) echo ' R__class__R';
|
114 |
-
if( ! empty($hide_o_value) && berocket_isset($term, 'count') == 0 && ( !$is_child_parent || !$is_first ) ) {
|
115 |
-
echo ' berocket_hide_o_value';
|
116 |
-
$hiden_value = true;
|
117 |
-
}
|
118 |
-
if( ! empty($hide_sel_value) && br_is_term_selected( $term, true, $is_child_parent_or, $child_parent_depth ) != '' ) {
|
119 |
-
echo ' berocket_hide_sel_value';
|
120 |
-
$hiden_value = true;
|
121 |
-
}
|
122 |
-
if( ! empty($attribute_count) ) {
|
123 |
-
if( $item_i > $attribute_count ) {
|
124 |
-
echo ' berocket_hide_attribute_count_value';
|
125 |
-
$hiden_value = true;
|
126 |
-
} elseif( ! empty($hide_o_value) && berocket_isset($term, 'count') == 0 && ( !$is_child_parent || !$is_first ) ) {
|
127 |
-
echo ' berocket_hide_attribute_count_value';
|
128 |
-
$item_i--;
|
129 |
-
$hiden_value = true;
|
130 |
-
}
|
131 |
-
}
|
132 |
-
if( $color_image_block_size == 'hxpx_wxpx' ) {
|
133 |
-
echo ' hxpx_wxpx_'.$random_name;
|
134 |
-
} else {
|
135 |
-
echo ' '.$color_image_block_size;
|
136 |
-
}
|
137 |
-
if( berocket_isset($color_image_checked) == 'brchecked_custom' ) {
|
138 |
-
echo ' brchecked_custom_'.$random_name;
|
139 |
-
} else {
|
140 |
-
echo ' '.(empty($color_image_checked) ? 'brchecked_default' : $color_image_checked);
|
141 |
-
}
|
142 |
-
?> berocket_checkbox_color<?php echo ( ! empty($use_value_with_color) ? ' berocket_color_with_value' : ' berocket_color_without_value' ) ?>">
|
143 |
-
<span>
|
144 |
-
<input id='checkbox_<?php echo str_replace ( '*' , '-' , berocket_isset($term, 'term_id')), str_replace ( '*' , '-' , $term_taxonomy_echo) ?>_<?php echo berocket_isset($random_name) ?>'
|
145 |
-
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) ?>"
|
146 |
-
type='checkbox'
|
147 |
-
autocomplete="off"
|
148 |
-
checked
|
149 |
-
disabled
|
150 |
-
style="<?php echo ( empty($uo['style']['checkbox_radio']) ? '' : $uo['style']['checkbox_radio'] ) ?>" />
|
151 |
-
<label data-for='checkbox_<?php echo str_replace ( '*' , '-' , berocket_isset($term, 'term_id')), str_replace ( '*' , '-' , $term_taxonomy_echo) ?>'
|
152 |
-
class="berocket_label_widgets<?php if( br_is_term_selected( $term, true, $is_child_parent_or, $child_parent_depth ) != '') echo ' berocket_checked'; ?>">
|
153 |
-
<?php
|
154 |
-
echo apply_filters( 'berocket_check_radio_color_filter_term_text_disabled', ( '<span class="'. apply_filters('berocket_widget_color_image_temp_span_class', 'berocket_color_span_block', array($meta_class, $meta_after, $meta_color), $term) . '"
|
155 |
-
style="' . $meta_color . '">' . $meta_class . '</span>' .
|
156 |
-
( ! 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>' : '' ) .
|
157 |
-
berocket_isset($meta_after) ), $term, $operator, FALSE );
|
158 |
-
?>
|
159 |
-
</label>
|
160 |
-
</span>
|
161 |
-
</li>
|
162 |
-
<?php
|
163 |
-
if ( $is_child_parent && $is_first ) {
|
164 |
-
?>
|
165 |
-
</ul></li>
|
166 |
-
<?php
|
167 |
-
}
|
168 |
-
} ?>
|
169 |
-
<?php if( $is_child_parent && is_array(berocket_isset($terms)) && count($terms) == 1 ) {
|
170 |
-
if( BeRocket_AAPF_Widget_functions::is_parent_selected($attribute, $child_parent_depth - 1) ) {
|
171 |
-
echo '<li>'.$child_parent_no_values.'</li>';
|
172 |
-
} else {
|
173 |
-
echo '<li>'.$child_parent_previous.'</li>';
|
174 |
-
}
|
175 |
-
} else {
|
176 |
-
if( $child_parent_no_values ) {?>
|
177 |
-
<script>
|
178 |
-
if ( typeof(child_parent_depth) == 'undefined' || child_parent_depth < <?php echo $child_parent_depth; ?> ) {
|
179 |
-
child_parent_depth = <?php echo $child_parent_depth; ?>;
|
180 |
-
}
|
181 |
-
jQuery(document).ready(function() {
|
182 |
-
if( child_parent_depth == <?php echo $child_parent_depth; ?> ) {
|
183 |
-
jQuery('.woocommerce-info').text('<?php echo $child_parent_no_values; ?>');
|
184 |
-
}
|
185 |
-
});
|
186 |
-
</script>
|
187 |
-
<?php }
|
188 |
-
}
|
189 |
-
if( ! empty($attribute_count_show_hide) ) {
|
190 |
-
if( $attribute_count_show_hide == 'hidden' ) {
|
191 |
-
$hide_button_value = true;
|
192 |
-
} elseif( $attribute_count_show_hide == 'visible' ) {
|
193 |
-
$hide_button_value = false;
|
194 |
-
}
|
195 |
-
}
|
196 |
-
if( empty($hide_button_value) ) { ?>
|
197 |
-
<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 fa"></span></li>
|
198 |
-
<div style="clear: both;"></div>
|
199 |
-
<?php } }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
templates/disabled/image.php
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
<?php include 'color.php'; ?>
|
|
templates/disabled/radio.php
DELETED
@@ -1,116 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
extract($berocket_query_var_title);
|
3 |
-
global $berocket_unique_value;
|
4 |
-
$berocket_unique_value++;
|
5 |
-
$random_name = strval($berocket_unique_value);
|
6 |
-
$hiden_value = false;
|
7 |
-
$is_child_parent = $child_parent == 'child';
|
8 |
-
$is_child_parent_or = ( $child_parent == 'child' || $child_parent == 'parent' );
|
9 |
-
if ( ! $child_parent_depth || $child_parent == 'parent' ) {
|
10 |
-
$child_parent_depth = 0;
|
11 |
-
}
|
12 |
-
$added_categories = array();
|
13 |
-
$item_i = 0;
|
14 |
-
if ( is_array(berocket_isset($terms)) ) {
|
15 |
-
foreach ( $terms as $term ) {
|
16 |
-
$is_first = ($term->term_id == 'R__term_id__R');
|
17 |
-
$term_taxonomy_echo = berocket_isset($term, 'wpml_taxonomy');
|
18 |
-
if( empty($term_taxonomy_echo) ) {
|
19 |
-
$term_taxonomy_echo = berocket_isset($term, 'taxonomy');
|
20 |
-
}
|
21 |
-
$item_i++;
|
22 |
-
$parent_count = 0;
|
23 |
-
if ( $is_child_parent && $is_first ) {
|
24 |
-
?><li class="berocket_child_parent_sample"><ul><?php
|
25 |
-
} elseif( isset($term->parent) && $term->parent != 0) {
|
26 |
-
$parent_count = get_ancestors( $term->term_id, $term->taxonomy );
|
27 |
-
$parent_count = count($parent_count);
|
28 |
-
}
|
29 |
-
$added_categories[] = $term->term_id;
|
30 |
-
?>
|
31 |
-
<li class="berocket_disabled_filter_element berocket_term_parent_<?php echo berocket_isset($term, 'parent'); ?> berocket_term_depth_<?php echo $parent_count; ?>
|
32 |
-
<?php if( ! empty($hide_o_value) && berocket_isset($term, 'count') == 0 && ( !$is_child_parent || !$is_first ) ) {
|
33 |
-
echo 'berocket_hide_o_value ';
|
34 |
-
$hiden_value = true;
|
35 |
-
}
|
36 |
-
if( $hide_sel_value && br_is_term_selected( $term, true, $is_child_parent_or, $child_parent_depth ) != '' ) {
|
37 |
-
echo 'berocket_hide_sel_value';
|
38 |
-
$hiden_value = true;
|
39 |
-
}
|
40 |
-
if( ! empty($attribute_count) ) {
|
41 |
-
if( $item_i > $attribute_count ) {
|
42 |
-
echo ' berocket_hide_attribute_count_value';
|
43 |
-
$hiden_value = true;
|
44 |
-
} elseif( ! empty($hide_o_value) && berocket_isset($term, 'count') == 0 && ( !$is_child_parent || !$is_first ) ) {
|
45 |
-
echo ' berocket_hide_attribute_count_value';
|
46 |
-
$item_i--;
|
47 |
-
$hiden_value = true;
|
48 |
-
}
|
49 |
-
}
|
50 |
-
if( $hide_child_attributes && berocket_isset($term, 'parent') && in_array(berocket_isset($term, 'parent'), $added_categories) ) {
|
51 |
-
echo ' berocket_hide_child_attributes ';
|
52 |
-
} ?>">
|
53 |
-
<span>
|
54 |
-
<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; ?>"
|
55 |
-
type='radio' id='radio_<?php echo berocket_isset($term, 'term_id') ?>_<?php echo $random_name ?>'
|
56 |
-
checked
|
57 |
-
disabled
|
58 |
-
style="<?php echo br_get_value_from_array($uo, array('style', 'checkbox_radio')) ?>"/>
|
59 |
-
<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')) ?>"
|
60 |
-
class="berocket_label_widgets<?php
|
61 |
-
if( br_is_term_selected( $term, true, $is_child_parent_or, $child_parent_depth ) != '') echo ' berocket_checked';
|
62 |
-
?>">
|
63 |
-
<?php
|
64 |
-
echo apply_filters( 'berocket_check_radio_color_filter_term_text_disabled', ( ( ! 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>' ) : '' ) .
|
65 |
-
apply_filters('berocket_radio_filter_term_name', htmlentities(berocket_isset($term, 'name'), ENT_QUOTES), $term) .
|
66 |
-
( ! 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 );
|
67 |
-
?></label>
|
68 |
-
<?php if( ! empty($hide_child_attributes) ) { ?>
|
69 |
-
<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>
|
70 |
-
<?php } ?>
|
71 |
-
</span>
|
72 |
-
</li>
|
73 |
-
<?php
|
74 |
-
if( ! empty($hide_child_attributes) && ! empty($term->parent) && in_array($term->parent, $added_categories) ) {
|
75 |
-
?>
|
76 |
-
<style>
|
77 |
-
.br_child_toggle.br_child_toggle_<?php echo str_replace ( '*' , '-' , $term->parent); ?> {
|
78 |
-
display: inline-block;
|
79 |
-
}
|
80 |
-
</style>
|
81 |
-
<?php
|
82 |
-
}
|
83 |
-
if ( $is_child_parent && $is_first ) {
|
84 |
-
?></ul></li><?php
|
85 |
-
}
|
86 |
-
} ?>
|
87 |
-
<?php if( $is_child_parent && isset($terms) && is_array($terms) && count($terms) == 1 ) {
|
88 |
-
if( BeRocket_AAPF_Widget_functions::is_parent_selected($attribute, $child_parent_depth - 1) ) {
|
89 |
-
echo '<li>'.$child_parent_no_values.'</li>';
|
90 |
-
} else {
|
91 |
-
echo '<li>'.$child_parent_previous.'</li>';
|
92 |
-
}
|
93 |
-
} else {
|
94 |
-
if( $child_parent_no_values ) {?>
|
95 |
-
<script>
|
96 |
-
if ( typeof(child_parent_depth) == 'undefined' || child_parent_depth < <?php echo $child_parent_depth; ?> ) {
|
97 |
-
child_parent_depth = <?php echo $child_parent_depth; ?>;
|
98 |
-
}
|
99 |
-
jQuery(document).ready(function() {
|
100 |
-
if( child_parent_depth == <?php echo $child_parent_depth; ?> ) {
|
101 |
-
jQuery('.woocommerce-info').text('<?php echo $child_parent_no_values; ?>');
|
102 |
-
}
|
103 |
-
});
|
104 |
-
</script>
|
105 |
-
<?php }
|
106 |
-
}
|
107 |
-
if( ! empty($attribute_count_show_hide) ) {
|
108 |
-
if( $attribute_count_show_hide == 'hidden' ) {
|
109 |
-
$hide_button_value = true;
|
110 |
-
} elseif( $attribute_count_show_hide == 'visible' ) {
|
111 |
-
$hide_button_value = false;
|
112 |
-
}
|
113 |
-
}
|
114 |
-
if( empty($hide_button_value) ) { ?>
|
115 |
-
<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 fa"></span></li>
|
116 |
-
<?php } } ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
templates/disabled/select.php
DELETED
@@ -1,99 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* The template for displaying checkbox filters
|
4 |
-
*
|
5 |
-
* Override this template by copying it to yourtheme/woocommerce-filters/checkbox.php
|
6 |
-
*
|
7 |
-
* @author BeRocket
|
8 |
-
* @package WooCommerce-Filters/Templates
|
9 |
-
* @version 1.0.1
|
10 |
-
*/
|
11 |
-
extract($berocket_query_var_title);
|
12 |
-
global $berocket_unique_value;
|
13 |
-
$berocket_unique_value++;
|
14 |
-
$random_name = strval($berocket_unique_value);
|
15 |
-
$child_parent = berocket_isset($child_parent);
|
16 |
-
$is_child_parent = $child_parent == 'child';
|
17 |
-
$is_child_parent_or = ( $child_parent == 'child' || $child_parent == 'parent' );
|
18 |
-
$child_parent_depth = berocket_isset($child_parent_depth, false, 0);
|
19 |
-
if ( $child_parent == 'parent' ) {
|
20 |
-
$child_parent_depth = 0;
|
21 |
-
}
|
22 |
-
if ( $is_child_parent ) {
|
23 |
-
?>
|
24 |
-
<li class="berocket_child_parent_sample select<?php if( ! empty($select_multiple) ) echo ' multiple'; ?>"><ul>
|
25 |
-
<span>
|
26 |
-
<?php $term = br_get_value_from_array($terms, 0);
|
27 |
-
$term_taxonomy_echo = berocket_isset($term, 'wpml_taxonomy');
|
28 |
-
if( empty($term_taxonomy_echo) ) {
|
29 |
-
$term_taxonomy_echo = berocket_isset($term, 'taxonomy');
|
30 |
-
} ?>
|
31 |
-
<ul<?php if( ! empty($select_multiple) ) echo ' multiple="multiple" data-placeholder="'.$select_first_element_text.'"'?> id='checkbox_<?php echo berocket_isset($term, 'term_id') ?>_<?php echo berocket_isset($random_name) ?>'
|
32 |
-
class="<?php echo br_get_value_from_array($uo, array('class', 'selectbox')) ?> <?php echo $term_taxonomy_echo; ?>"
|
33 |
-
data-taxonomy='<?php echo $term_taxonomy_echo ?>'>
|
34 |
-
<?php if( empty($select_multiple) ) { ?>
|
35 |
-
<li data-taxonomy='<?php echo $term_taxonomy_echo ?>' value=''><?php echo $select_first_element_text ?></li>
|
36 |
-
<?php } ?>
|
37 |
-
<li value='<?php echo berocket_isset($term, 'term_id') ?>' data-term_id='<?php echo berocket_isset($term, 'term_id') ?>' autocomplete="off"
|
38 |
-
<?php echo br_is_term_selected( $term, false, $is_child_parent_or, $child_parent_depth ); ?>
|
39 |
-
><?php echo apply_filters('berocket_radio_filter_term_name', berocket_isset($term, 'name'), $term) ?></li>
|
40 |
-
</ul>
|
41 |
-
</span>
|
42 |
-
</ul></li>
|
43 |
-
<?php
|
44 |
-
unset($terms[0]);
|
45 |
-
}
|
46 |
-
$terms = array_values($terms);
|
47 |
-
if( $is_child_parent && is_array(berocket_isset($terms)) && count($terms) == 0 ) {
|
48 |
-
if( BeRocket_AAPF_Widget_functions::is_parent_selected($attribute, $child_parent_depth - 1) ) {
|
49 |
-
echo '<li>'.$child_parent_no_values.'</li>';
|
50 |
-
} else {
|
51 |
-
echo '<li>'.$child_parent_previous.'</li>';
|
52 |
-
}
|
53 |
-
} else {
|
54 |
-
if( $child_parent_no_values ) {?>
|
55 |
-
<script>
|
56 |
-
if ( typeof(child_parent_depth) == 'undefined' || child_parent_depth < <?php echo $child_parent_depth; ?> ) {
|
57 |
-
child_parent_depth = <?php echo $child_parent_depth; ?>;
|
58 |
-
}
|
59 |
-
jQuery(document).ready(function() {
|
60 |
-
if( child_parent_depth == <?php echo $child_parent_depth; ?> ) {
|
61 |
-
jQuery('.woocommerce-info').text('<?php echo $child_parent_no_values; ?>');
|
62 |
-
}
|
63 |
-
});
|
64 |
-
</script>
|
65 |
-
<?php }
|
66 |
-
}
|
67 |
-
if ( is_array(berocket_isset($terms)) && count( $terms ) > 0 ) {
|
68 |
-
$term_taxonomy_echo = berocket_isset($terms[0], 'wpml_taxonomy');
|
69 |
-
if( empty($term_taxonomy_echo) ) {
|
70 |
-
$term_taxonomy_echo = berocket_isset($terms[0], 'taxonomy');
|
71 |
-
}
|
72 |
-
?>
|
73 |
-
<li class="berocket_disabled_filter_element">
|
74 |
-
<span>
|
75 |
-
<select disabled<?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) ?>' autocomplete="off"
|
76 |
-
class="<?php echo br_get_value_from_array($uo, array('class', 'selectbox')) ?> <?php echo $term_taxonomy_echo ?>"
|
77 |
-
data-taxonomy='<?php echo $term_taxonomy_echo ?>'>
|
78 |
-
<?php foreach ( $terms as $term ):
|
79 |
-
$term_taxonomy_echo = berocket_isset($term, 'wpml_taxonomy');
|
80 |
-
if( empty($term_taxonomy_echo) ) {
|
81 |
-
$term_taxonomy_echo = berocket_isset($term, 'taxonomy');
|
82 |
-
}
|
83 |
-
$parent_count = 0;
|
84 |
-
if(isset($term->parent) && $term->parent != 0) {
|
85 |
-
$parent_count = get_ancestors( $term->term_id, $term->taxonomy );
|
86 |
-
$parent_count = count($parent_count);
|
87 |
-
} elseif( isset($term->depth) ) {
|
88 |
-
$parent_count = $term->depth;
|
89 |
-
}
|
90 |
-
?>
|
91 |
-
<option value=''
|
92 |
-
selected
|
93 |
-
<?php if( ! $is_child_parent_or && ! empty($hide_o_value) && berocket_isset($term, 'count') == 0 ) { echo ' hidden disabled'; $hiden_value = true; } ?>
|
94 |
-
><?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>
|
95 |
-
<?php endforeach; ?>
|
96 |
-
</select>
|
97 |
-
</span>
|
98 |
-
</li>
|
99 |
-
<?php } ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
templates/disabled/slider.php
DELETED
@@ -1,92 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
extract($berocket_query_var_title);
|
3 |
-
global $berocket_unique_value;
|
4 |
-
$berocket_unique_value++;
|
5 |
-
$unique = strval($berocket_unique_value);
|
6 |
-
$is_child_parent = ( isset($child_parent) && $child_parent == 'child' );
|
7 |
-
$is_child_parent_or = ( isset($child_parent) && ( $child_parent == 'child' || $child_parent == 'parent' ) );
|
8 |
-
if ( $is_child_parent ) {
|
9 |
-
?>
|
10 |
-
<li class="berocket_child_parent_sample"><ul>
|
11 |
-
<li class='<?php echo berocket_isset($main_class) ?>'>
|
12 |
-
<span class='left'>
|
13 |
-
<?php echo ( ! 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>' ) : '' ) . $text_before_price ?>
|
14 |
-
<input disabled class="berocket_slider_start_val" type='text' id='R__slug__R_<?php echo $unique; ?>_1'
|
15 |
-
value='<?php echo berocket_isset($slider_value1) ?>'
|
16 |
-
style="<?php echo br_get_value_from_array($uo, array('style', 'slider_input'))?>"
|
17 |
-
/><?php echo berocket_isset($text_after_price) . ( ! 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>' ) : '' ) ?>
|
18 |
-
</span>
|
19 |
-
<span class='right'>
|
20 |
-
<?php echo ( ! 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>' ) : '' ) . berocket_isset($text_before_price) ?>
|
21 |
-
<input disabled class="berocket_slider_end_val" type='text' id='R__slug__R_<?php echo $unique; ?>_2'
|
22 |
-
value='<?php echo $slider_value2 ?>'
|
23 |
-
style="<?php echo br_get_value_from_array($uo, array('style', 'slider_input'))?>"
|
24 |
-
/><?php echo berocket_isset($text_after_price) . ( ! 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>' ) : '' ) ?>
|
25 |
-
</span>
|
26 |
-
<div class='slide <?php echo br_get_value_from_array($uo, array('class', 'slider')) ?>'>
|
27 |
-
<div class='<?php echo berocket_isset($slider_class) ?>' data-taxonomy='<?php echo berocket_isset($filter_slider_id) ?>'
|
28 |
-
data-min='R__min__R' data-max='R__max__R'
|
29 |
-
data-value1='R__value1__R' data-value2='R__value2__R'
|
30 |
-
data-value_1='R__value1__R' data-value_2='R__value2__R'
|
31 |
-
data-term_slug='<?php echo urldecode($term->slug) ?>' data-filter_type='<?php echo berocket_isset($filter_type) ?>'
|
32 |
-
disabled="disabled"
|
33 |
-
data-step='<?php echo berocket_isset($step) ?>' data-all_terms_name='R__allterm__R'
|
34 |
-
data-all_terms_slug='R__sallterm__R'
|
35 |
-
data-child_parent="<?php if ( $is_child_parent_or ) echo $child_parent ;?>"
|
36 |
-
data-child_parent_depth="<?php echo berocket_isset($child_parent_depth) ;?>"
|
37 |
-
data-fields_1='R__slug__R_<?php echo $unique; ?>_1'
|
38 |
-
data-fields_2='R__slug__R_<?php echo $unique; ?>_2'
|
39 |
-
data-number_style="<?php if( ! empty($number_style) ) echo json_encode($number_style); ?>"></div>
|
40 |
-
</div>
|
41 |
-
</li>
|
42 |
-
</ul></li>
|
43 |
-
<?php
|
44 |
-
while ( isset( $all_terms_name[0] ) && $all_terms_name[0] == 'R__name__R' ) {
|
45 |
-
array_splice( $all_terms_name, 0, 1 );
|
46 |
-
$max--;
|
47 |
-
$slider_value1--;
|
48 |
-
$slider_value2--;
|
49 |
-
}
|
50 |
-
}
|
51 |
-
if( !$is_child_parent || count( $all_terms_name ) > 0 ) {
|
52 |
-
if( is_array($all_terms_slug) ) {
|
53 |
-
foreach($all_terms_slug as &$all_term_slug) {
|
54 |
-
$all_term_slug = str_replace("'", ''', $all_term_slug);
|
55 |
-
}
|
56 |
-
if( isset($all_term_slug) ) {
|
57 |
-
unset($all_term_slug);
|
58 |
-
}
|
59 |
-
}
|
60 |
-
?>
|
61 |
-
<li class='<?php echo berocket_isset($main_class) ?>'>
|
62 |
-
<span class='left'>
|
63 |
-
<?php echo ( ! 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>' ) : '' ) . berocket_isset($text_before_price) ?>
|
64 |
-
<input <?php if( empty($enable_slider_inputs) ) echo 'disabled '; ?>class="berocket_slider_start_val" type='text' id='text_<?php echo berocket_isset($filter_slider_id) . $unique ?>_1'
|
65 |
-
value='<?php echo berocket_isset($slider_value1) ?>'
|
66 |
-
style="<?php echo br_get_value_from_array($uo, array('style', 'slider_input'))?>"
|
67 |
-
/><?php echo berocket_isset($text_after_price) . ( ! 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>' ) : '' ) ?>
|
68 |
-
</span>
|
69 |
-
<span class='right'>
|
70 |
-
<?php echo ( ! 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>' ) : '' ) . berocket_isset($text_before_price) ?>
|
71 |
-
<input <?php if( empty($enable_slider_inputs) ) echo 'disabled '; ?>class="berocket_slider_end_val" type='text' id='text_<?php echo berocket_isset($filter_slider_id) . $unique ?>_2'
|
72 |
-
value='<?php echo berocket_isset($slider_value2) ?>'
|
73 |
-
style="<?php echo br_get_value_from_array($uo, array('style', 'slider_input'));?>"
|
74 |
-
/><?php echo berocket_isset($text_after_price) . ( ! 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>' ) : '' ) ?>
|
75 |
-
</span>
|
76 |
-
<div disabled class='slide <?php echo br_get_value_from_array($uo, array('class', 'slider'))?>'>
|
77 |
-
<div class='<?php echo berocket_isset($slider_class) ?>' data-taxonomy='<?php echo berocket_isset($filter_slider_id) ?>'
|
78 |
-
data-min='<?php echo berocket_isset($min) ?>' data-max='<?php echo berocket_isset($max) ?>'
|
79 |
-
data-value1='<?php echo berocket_isset($slider_value1) ?>' data-value2='<?php echo berocket_isset($slider_value2) ?>'
|
80 |
-
data-value_1='<?php echo berocket_isset($slider_value1) ?>' data-value_2='<?php echo berocket_isset($slider_value2) ?>'
|
81 |
-
data-term_slug='' data-filter_type='<?php echo berocket_isset($filter_type) ?>'
|
82 |
-
data-step='<?php echo berocket_isset($step) ?>' data-all_terms_name='<?php echo json_encode(berocket_isset($all_terms_name)); ?>'
|
83 |
-
data-all_terms_slug='<?php echo json_encode(berocket_isset($all_terms_slug)); ?>'
|
84 |
-
data-child_parent="<?php if ( $is_child_parent_or ) echo $child_parent ;?>"
|
85 |
-
data-disabled=true
|
86 |
-
data-child_parent_depth="<?php echo berocket_isset($child_parent_depth) ;?>"
|
87 |
-
data-fields_1='text_<?php echo berocket_isset($filter_slider_id) . $unique ?>_1'
|
88 |
-
data-fields_2='text_<?php echo berocket_isset($filter_slider_id) . $unique ?>_2'
|
89 |
-
data-number_style='<?php if( ! empty($number_style) ) echo json_encode($number_style); ?>'></div>
|
90 |
-
</div>
|
91 |
-
</li>
|
92 |
-
<?php } ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
templates/disabled/tag_cloud.php
DELETED
@@ -1,65 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* The template for displaying Tag cloud filters
|
4 |
-
*
|
5 |
-
* Override this template by copying it to yourtheme/woocommerce-filters/tag_cloud.php
|
6 |
-
*
|
7 |
-
* @author BeRocket
|
8 |
-
* @package WooCommerce-Filters/Templates
|
9 |
-
* @version 1.0.1
|
10 |
-
*/
|
11 |
-
extract($berocket_query_var_title);
|
12 |
-
$term_i = 0;
|
13 |
-
foreach ( $terms as $term ) { ?>
|
14 |
-
<li title="<?php echo $term->count; ?>" class="berocket_tag_cloud_element berocket_disabled_filter_element">
|
15 |
-
<span>
|
16 |
-
<input class="checkbox_<?php echo berocket_isset($term, 'term_id') ?>" autocomplete="off"
|
17 |
-
checked
|
18 |
-
disabled
|
19 |
-
type='checkbox' id='checkbox_<?php echo berocket_isset($term, 'term_id') ?>'/>
|
20 |
-
<label data-for='checkbox_<?php echo berocket_isset($term, 'term_id') ?>' for='checkbox_<?php echo berocket_isset($term, 'term_id') ?>'<?php if( br_is_term_selected( $term, true ) != '') echo ' class="berocket_checked"'; ?>><?php echo ( ! 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>' ) : '' ) . berocket_isset($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>' ) : '' ) ?></label>
|
21 |
-
</span>
|
22 |
-
</li>
|
23 |
-
<?php
|
24 |
-
$term_i++;
|
25 |
-
}
|
26 |
-
|
27 |
-
if( br_get_value_from_array($tag_script_var, 'tags_type') != 'doe' ) {
|
28 |
-
wp_enqueue_script( 'berocket_aapf_widget-tag_cloud2'); ?>
|
29 |
-
<script>
|
30 |
-
jQuery(document).ready(function () {
|
31 |
-
var settings = {
|
32 |
-
'weightMode': 'size',
|
33 |
-
'weightFrom': 'title',
|
34 |
-
'weightSizeMin': <?php echo br_get_value_from_array($tag_script_var, 'min_font_size'); ?>,
|
35 |
-
'weightSizeMax': <?php echo br_get_value_from_array($tag_script_var, 'max_font_size'); ?>,
|
36 |
-
};
|
37 |
-
jQuery('.berocket_aapf_widget-tag_cloud').wrap(function() {
|
38 |
-
return '<canvas height="<?php echo br_get_value_from_array($tag_script_var, 'height'); ?>" id="myCanvas">' + jQuery( this ).text() + "</canvas>";
|
39 |
-
});
|
40 |
-
jQuery('.berocket_aapf_widget-tag_cloud').parents('canvas').tagcanvas(settings);
|
41 |
-
});
|
42 |
-
</script>
|
43 |
-
<?php } else {
|
44 |
-
wp_enqueue_script( 'berocket_aapf_widget-tag_cloud'); ?>
|
45 |
-
|
46 |
-
<script>
|
47 |
-
jQuery(document).ready(function () {
|
48 |
-
var settings = {
|
49 |
-
'height' : <?php echo br_get_value_from_array($tag_script_var, 'height'); ?>,
|
50 |
-
'minFontSize' : <?php echo br_get_value_from_array($tag_script_var, 'min_font_size'); ?>,
|
51 |
-
'maxFontSize' : <?php echo br_get_value_from_array($tag_script_var, 'max_font_size'); ?>,
|
52 |
-
'spacing' : 4,
|
53 |
-
'maxCount' : <?php echo br_get_value_from_array($tag_script_var, 'tags_count'); ?>
|
54 |
-
};
|
55 |
-
jQuery('.berocket_aapf_widget-tag_cloud').doecloud(settings);
|
56 |
-
});
|
57 |
-
</script>
|
58 |
-
<?php } ?>
|
59 |
-
<style>
|
60 |
-
.berocket_aapf_widget.berocket_aapf_widget-tag_cloud{
|
61 |
-
<?php if( ! empty($tag_script_var['height']) ) { ?>
|
62 |
-
height: <?php echo $tag_script_var['height']; ?>px!important;
|
63 |
-
<?php } ?>
|
64 |
-
}
|
65 |
-
</style>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
templates/old_templates/checkbox.php
DELETED
@@ -1,142 +0,0 @@
|
|
1 |
-
<?php
|
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++;
|
15 |
-
$random_name = strval($berocket_unique_value);
|
16 |
-
$hiden_value = false;
|
17 |
-
$child_parent = berocket_isset($child_parent);
|
18 |
-
$is_child_parent = $child_parent == 'child';
|
19 |
-
$is_child_parent_or = ( $child_parent == 'child' || $child_parent == 'parent' );
|
20 |
-
$child_parent_depth = berocket_isset($child_parent_depth, false, 0);
|
21 |
-
if ( $child_parent == 'parent' ) {
|
22 |
-
$child_parent_depth = 0;
|
23 |
-
}
|
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');
|
31 |
-
if( empty($term_taxonomy_echo) ) {
|
32 |
-
$term_taxonomy_echo = berocket_isset($term, 'taxonomy');
|
33 |
-
}
|
34 |
-
$parent_count = 0;
|
35 |
-
$item_i++;
|
36 |
-
if ( $is_child_parent && $is_first ) {
|
37 |
-
?><li class="berocket_child_parent_sample"><ul><?php
|
38 |
-
} elseif(isset($term->parent) && $term->parent != 0) {
|
39 |
-
$parent_count = get_ancestors( $term->term_id, $term->taxonomy );
|
40 |
-
$parent_count = count($parent_count);
|
41 |
-
} elseif( isset($term->depth) ) {
|
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 ) != '' ) {
|
67 |
-
echo ' berocket_hide_sel_value'; $hiden_value = true;
|
68 |
-
}
|
69 |
-
if( ! empty($attribute_count) ) {
|
70 |
-
if( $item_i > $attribute_count ) {
|
71 |
-
echo ' berocket_hide_attribute_count_value';
|
72 |
-
$hiden_value = true;
|
73 |
-
} elseif( ! empty($hide_o_value) && berocket_isset($term, 'count') == 0 && ( !$is_child_parent || !$is_first ) ) {
|
74 |
-
echo ' berocket_hide_attribute_count_value';
|
75 |
-
$item_i--;
|
76 |
-
$hiden_value = true;
|
77 |
-
}
|
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_functions::is_parent_selected( $attribute, $child_parent_depth - 1 ) ) {
|
112 |
-
echo '<li>' . $child_parent_no_values . '</li>';
|
113 |
-
} else {
|
114 |
-
echo '<li>' . $child_parent_previous . '</li>';
|
115 |
-
}
|
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; ?>;
|
123 |
-
}
|
124 |
-
jQuery(document).ready(function() {
|
125 |
-
if( 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) ) {
|
133 |
-
if( $attribute_count_show_hide == 'hidden' ) {
|
134 |
-
$hide_button_value = true;
|
135 |
-
} elseif( $attribute_count_show_hide == 'visible' ) {
|
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 fa"></span></li><?php
|
141 |
-
}
|
142 |
-
endif;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
templates/old_templates/color.php
DELETED
@@ -1,208 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
extract($berocket_query_var_title);
|
3 |
-
global $berocket_unique_value;
|
4 |
-
$berocket_unique_value++;
|
5 |
-
$random_name = strval($berocket_unique_value);
|
6 |
-
$hiden_value = false;
|
7 |
-
$child_parent = berocket_isset($child_parent);
|
8 |
-
$is_child_parent = $child_parent == 'child';
|
9 |
-
$is_child_parent_or = ( $child_parent == 'child' || $child_parent == 'parent' );
|
10 |
-
$child_parent_depth = berocket_isset($child_parent_depth, false, 0);
|
11 |
-
if ( $child_parent == 'parent' ) {
|
12 |
-
$child_parent_depth = 0;
|
13 |
-
}
|
14 |
-
$item_i = 0;
|
15 |
-
if ( is_array(berocket_isset($terms)) ) {
|
16 |
-
if( berocket_isset($color_image_checked) == 'brchecked_custom' ) {
|
17 |
-
echo '<style>
|
18 |
-
.berocket_aapf_widget .berocket_checkbox_color.brchecked_custom_'.$random_name.' input[type="checkbox"]:checked + label .berocket_color_span_block,
|
19 |
-
.berocket_aapf_widget .berocket_checkbox_color.brchecked_custom_'.$random_name.' .berocket_checked .berocket_color_span_block{
|
20 |
-
'.$color_image_checked_custom_css.'
|
21 |
-
}
|
22 |
-
</style>';
|
23 |
-
}
|
24 |
-
if( $color_image_block_size == 'hxpx_wxpx' ) {
|
25 |
-
if( empty($color_image_block_size_height) ) {
|
26 |
-
$color_image_block_size_height = 50;
|
27 |
-
}
|
28 |
-
if( empty($color_image_block_size_width) ) {
|
29 |
-
$color_image_block_size_width = 50;
|
30 |
-
}
|
31 |
-
echo '<style>
|
32 |
-
.berocket_aapf_widget .berocket_checkbox_color.berocket_color_with_value.hxpx_wxpx_'.$random_name.'.brchecked_default input[type="checkbox"]:checked + label .berocket_color_span_block,
|
33 |
-
.berocket_aapf_widget .berocket_checkbox_color.berocket_color_with_value.hxpx_wxpx_'.$random_name.'.brchecked_default .berocket_checked .berocket_color_span_block{
|
34 |
-
width: '.($color_image_block_size_width + 10).'px;
|
35 |
-
}
|
36 |
-
.berocket_aapf_widget .berocket_checkbox_color.hxpx_wxpx_'.$random_name.' label span.berocket_color_span_block, span.berocket_color_span_block{
|
37 |
-
width: '.$color_image_block_size_width.'px;
|
38 |
-
}
|
39 |
-
.berocket_aapf_widget .berocket_checkbox_color.hxpx_wxpx_'.$random_name.' label span.berocket_color_span_block, span.berocket_color_span_block{
|
40 |
-
height: '.$color_image_block_size_height.'px;
|
41 |
-
line-height: '.$color_image_block_size_height.'px;
|
42 |
-
}
|
43 |
-
.berocket_aapf_widget .berocket_checkbox_color.hxpx_wxpx_'.$random_name.'{
|
44 |
-
height: '.($color_image_block_size_height + 10).'px;
|
45 |
-
}';
|
46 |
-
if( ($color_image_block_size_ratio = $color_image_block_size_width / $color_image_block_size_height) < 1.3 ) {
|
47 |
-
|
48 |
-
$color_image_block_size_margin = (15 / $color_image_block_size_ratio) + (1 - $color_image_block_size_ratio) * (30 + 5 / $color_image_block_size_ratio / $color_image_block_size_ratio);
|
49 |
-
echo '.berocket_checkbox_color.hxpx_wxpx_'.$random_name.' .berocket_color_span_block .berocket_color_multiple {
|
50 |
-
margin-left: -'.$color_image_block_size_margin.'%;
|
51 |
-
margin-right: -'.$color_image_block_size_margin.'%;
|
52 |
-
}';
|
53 |
-
}
|
54 |
-
echo '</style>';
|
55 |
-
}
|
56 |
-
foreach ( $terms as $term ) {
|
57 |
-
$is_first = ($term->term_id == 'R__term_id__R');
|
58 |
-
$term_taxonomy_echo = berocket_isset($term, 'wpml_taxonomy');
|
59 |
-
if( empty($term_taxonomy_echo) ) {
|
60 |
-
$term_taxonomy_echo = berocket_isset($term, 'taxonomy');
|
61 |
-
}
|
62 |
-
$item_i++;
|
63 |
-
$variables_for_hooks = array(
|
64 |
-
'type' => $type,
|
65 |
-
'item_i' => $item_i,
|
66 |
-
'is_child_parent' => $is_child_parent,
|
67 |
-
'is_first' => $is_first,
|
68 |
-
);
|
69 |
-
$meta_class = apply_filters('berocket_widget_color_image_temp_meta_class_init', ' ', $term, $variables_for_hooks);
|
70 |
-
$meta_after = '';
|
71 |
-
if ( !$is_child_parent || !$is_first ) {
|
72 |
-
if( $type == 'color' ) {
|
73 |
-
$berocket_term = get_metadata( 'berocket_term', $term->term_id, 'color' );
|
74 |
-
$berocket_term = br_get_value_from_array($berocket_term, 0, '');
|
75 |
-
$meta_color = array($berocket_term);
|
76 |
-
} else {
|
77 |
-
$meta_color = get_metadata( 'berocket_term', $term->term_id, $type );
|
78 |
-
}
|
79 |
-
} else {
|
80 |
-
$meta_color = 'R';
|
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;
|
88 |
-
if( $type == 'color' ) {
|
89 |
-
$meta_color = $meta_color[0];
|
90 |
-
$meta_color = str_replace('#', '', $meta_color);
|
91 |
-
$meta_color = 'background-color: #'.$meta_color.';';
|
92 |
-
$meta_class = '<span class="berocket_color_span_absolute"><span>'.$meta_class.'</span></span>';
|
93 |
-
} elseif( $type == 'image' ) {
|
94 |
-
if ( ! empty($meta_color[0]) ) {
|
95 |
-
if ( substr( $meta_color[0], 0, 3) == 'fa-' ) {
|
96 |
-
$meta_class = '<i class="fa '.$meta_color[0].'"></i> ';
|
97 |
-
$meta_color = '';
|
98 |
-
} else {
|
99 |
-
$meta_color = 'background: url('.$meta_color[0].') no-repeat scroll 50% 50% rgba(0, 0, 0, 0);background-size: cover;';
|
100 |
-
$meta_class = ' ';
|
101 |
-
}
|
102 |
-
$meta_after = '';
|
103 |
-
} else {
|
104 |
-
$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 ) ) {
|
130 |
-
echo ' berocket_hide_o_value';
|
131 |
-
$hiden_value = true;
|
132 |
-
}
|
133 |
-
if( ! empty($hide_sel_value) && br_is_term_selected( $term, true, $is_child_parent_or, $child_parent_depth ) != '' ) {
|
134 |
-
echo ' berocket_hide_sel_value';
|
135 |
-
$hiden_value = true;
|
136 |
-
}
|
137 |
-
if( ! empty($attribute_count) ) {
|
138 |
-
if( $item_i > $attribute_count ) {
|
139 |
-
echo ' berocket_hide_attribute_count_value';
|
140 |
-
$hiden_value = true;
|
141 |
-
} elseif( ! empty($hide_o_value) && berocket_isset($term, 'count') == 0 && ( !$is_child_parent || !$is_first ) ) {
|
142 |
-
echo ' berocket_hide_attribute_count_value';
|
143 |
-
$item_i--;
|
144 |
-
$hiden_value = true;
|
145 |
-
}
|
146 |
-
}
|
147 |
-
if( $color_image_block_size == 'hxpx_wxpx' ) {
|
148 |
-
echo ' hxpx_wxpx_'.$random_name;
|
149 |
-
} else {
|
150 |
-
echo ' '.$color_image_block_size;
|
151 |
-
}
|
152 |
-
if( berocket_isset($color_image_checked) == 'brchecked_custom' ) {
|
153 |
-
echo ' brchecked_custom_'.$random_name;
|
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_functions::is_parent_selected($attribute, $child_parent_depth - 1) ) {
|
179 |
-
echo '<li>'.$child_parent_no_values.'</li>';
|
180 |
-
} else {
|
181 |
-
echo '<li>'.$child_parent_previous.'</li>';
|
182 |
-
}
|
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 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|