Advanced AJAX Product Filters - Version 1.1.8.1

Version Description

  • Fix - WooCommerce 3.0.1 issues
  • Fix - Premium plugin link on settings page.
Download this release

Release Info

Developer dholovnia
Plugin Icon wp plugin Advanced AJAX Product Filters
Version 1.1.8.1
Comparing to
See all releases

Code changes from version 1.1.6 to 1.1.8.1

README.md CHANGED
@@ -4,8 +4,8 @@ Contributors: dholovnia, berocket
4
  Donate link: http://berocket.com
5
  Tags: filters, product filters, ajax product filters, advanced product filters, woocommerce filters, woocommerce product filters, woocommerce ajax product filters, widget, plugin
6
  Requires at least: 4.0
7
- Tested up to: 4.6.1
8
- Stable tag: 1.1.6
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -139,6 +139,15 @@ http://woocommerce-product-filter.berocket.com
139
 
140
  == Changelog ==
141
 
 
 
 
 
 
 
 
 
 
142
  = 1.1.6 =
143
  * Fix - Price for currency exchange
144
  * Fix - Optimization for price widget
@@ -289,4 +298,4 @@ you set to order `by custom` you can drag&drop values up and down and set yo
289
  * Fix - better support for older PHP versions
290
 
291
  = 1.0.1 =
292
- * First public version
4
  Donate link: http://berocket.com
5
  Tags: filters, product filters, ajax product filters, advanced product filters, woocommerce filters, woocommerce product filters, woocommerce ajax product filters, widget, plugin
6
  Requires at least: 4.0
7
+ Tested up to: 4.7.2
8
+ Stable tag: 1.1.8
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
139
 
140
  == Changelog ==
141
 
142
+ = 1.1.8 =
143
+ * Fix - Better compatibility with WPML
144
+
145
+ = 1.1.7 =
146
+ * Fix - Remove notices on PHP 7 and newer
147
+ * Fix - Fix fo Currency Exchange plugin
148
+ * Fix - Styles for admin panel
149
+ * Fix - Remove sliders from all filters
150
+
151
  = 1.1.6 =
152
  * Fix - Price for currency exchange
153
  * Fix - Optimization for price widget
298
  * Fix - better support for older PHP versions
299
 
300
  = 1.0.1 =
301
+ * First public version
assets/screenshot-1.png ADDED
Binary file
assets/screenshot-2.png ADDED
Binary file
assets/screenshot-3.png ADDED
Binary file
images/70p_sale.jpg ADDED
Binary file
includes/functions.php CHANGED
@@ -20,6 +20,17 @@ if( ! function_exists( 'br_get_woocommerce_version' ) ){
20
  }
21
  }
22
  }
 
 
 
 
 
 
 
 
 
 
 
23
 
24
  if( ! function_exists( 'br_get_template_part' ) ){
25
  /**
@@ -220,7 +231,7 @@ if( ! function_exists( 'br_aapf_args_converter' ) ) {
220
  }
221
 
222
  if ( $attribute == 'price' ) {
223
- $_POST['price'] = array( $min, $max );
224
  } elseif ( $attribute == 'order' ) {
225
  $_GET['orderby'] = $value;
226
  } else {
@@ -234,4 +245,4 @@ if( ! function_exists( 'br_aapf_args_converter' ) ) {
234
  }
235
  }
236
  }
237
- }
20
  }
21
  }
22
  }
23
+ if( ! function_exists( 'br_woocommerce_version_check' ) ){
24
+ function br_woocommerce_version_check( $version = '2.7' ) {
25
+ $wc_version = br_get_woocommerce_version();
26
+ if( $wc_version !== NULL ) {
27
+ if( version_compare( $wc_version, $version, ">=" ) ) {
28
+ return true;
29
+ }
30
+ }
31
+ return false;
32
+ }
33
+ }
34
 
35
  if( ! function_exists( 'br_get_template_part' ) ){
36
  /**
231
  }
232
 
233
  if ( $attribute == 'price' ) {
234
+ $_POST['price'] = apply_filters('berocket_min_max_filter', array( $min, $max ));
235
  } elseif ( $attribute == 'order' ) {
236
  $_GET['orderby'] = $value;
237
  } else {
245
  }
246
  }
247
  }
248
+ }
includes/widget.php CHANGED
@@ -22,7 +22,7 @@ class BeRocket_AAPF_Widget extends WP_Widget {
22
  /**
23
  * Constructor
24
  */
25
- function BeRocket_AAPF_Widget() {
26
  global $wp_version;
27
  /* Widget settings. */
28
  $widget_ops = array( 'classname' => 'widget_berocket_aapf', 'description' => __('Add Filters to Products page', 'BeRocket_AJAX_domain') );
@@ -31,11 +31,7 @@ class BeRocket_AAPF_Widget extends WP_Widget {
31
  $control_ops = array( 'id_base' => 'berocket_aapf_widget' );
32
 
33
  /* Create the widget. */
34
- if( strcmp( $wp_version, '4.3') < 0 ) {
35
- $this->WP_Widget( 'berocket_aapf_widget', __('AJAX Product Filters', 'BeRocket_AJAX_domain'), $widget_ops, $control_ops );
36
- } else {
37
- $this->__construct( 'berocket_aapf_widget', __('AJAX Product Filters', 'BeRocket_AJAX_domain'), $widget_ops, $control_ops );
38
- }
39
 
40
  add_filter( 'berocket_aapf_listener_wp_query_args', 'br_aapf_args_parser' );
41
  }
@@ -266,8 +262,8 @@ class BeRocket_AAPF_Widget extends WP_Widget {
266
  $slider_value2 = $max;
267
 
268
  if( $attribute == 'price' and @ $_POST['price'] ){
269
- $slider_value1 = $_POST['price'][0];
270
- $slider_value2 = $_POST['price'][1];
271
  }
272
  if( $attribute != 'price' and @ $_POST['limits'] ){
273
  foreach( $_POST['limits'] as $p_limit ){
@@ -670,13 +666,17 @@ class BeRocket_AAPF_Widget extends WP_Widget {
670
  if( $woocommerce_hide_out_of_stock_items == 'yes' ) {
671
  $args['post__in'] = BeRocket_AAPF::remove_out_of_stock( $args['post__in'] );
672
  }
673
- $args['post__in'] = BeRocket_AAPF::remove_hidden( $args['post__in'] );
 
 
674
 
675
  $args['post__in'] = BeRocket_AAPF::limits_filter( $args['post__in'] );
 
 
 
676
  $args['post__in'] = BeRocket_AAPF::price_filter( $args['post__in'] );
677
  $args['post_status'] = 'publish';
678
  $args['post_type'] = 'product';
679
- $args['post__in'] = BeRocket_AAPF::price_filter( $args['post__in'] );
680
  $default_posts_per_page = get_option( 'posts_per_page' );
681
  $args['posts_per_page'] = apply_filters( 'loop_shop_per_page', $default_posts_per_page );
682
  unset( $default_posts_per_page );
@@ -689,7 +689,6 @@ class BeRocket_AAPF_Widget extends WP_Widget {
689
  if( isset($_POST['s']) && strlen($_POST['s']) > 0 ) {
690
  $args['s'] = $_POST['s'];
691
  }
692
-
693
  $wp_query = new WP_Query( $args );
694
 
695
  // here we get max products to know if current page is not too big
@@ -697,6 +696,7 @@ class BeRocket_AAPF_Widget extends WP_Widget {
697
  $args['paged'] = min( $mathces[1], $wp_query->max_num_pages );
698
  $wp_query = new WP_Query( $args );
699
  }
 
700
  unset( $args );
701
 
702
  if( @ ! $br_options['ajax_request_load'] ) {
@@ -872,4 +872,4 @@ class BeRocket_AAPF_Widget extends WP_Widget {
872
  else
873
  return esc_url_raw( $result );
874
  }
875
- }
22
  /**
23
  * Constructor
24
  */
25
+ function __construct() {
26
  global $wp_version;
27
  /* Widget settings. */
28
  $widget_ops = array( 'classname' => 'widget_berocket_aapf', 'description' => __('Add Filters to Products page', 'BeRocket_AJAX_domain') );
31
  $control_ops = array( 'id_base' => 'berocket_aapf_widget' );
32
 
33
  /* Create the widget. */
34
+ parent::__construct( 'berocket_aapf_widget', __('AJAX Product Filters', 'BeRocket_AJAX_domain'), $widget_ops, $control_ops );
 
 
 
 
35
 
36
  add_filter( 'berocket_aapf_listener_wp_query_args', 'br_aapf_args_parser' );
37
  }
262
  $slider_value2 = $max;
263
 
264
  if( $attribute == 'price' and @ $_POST['price'] ){
265
+ $slider_value1 = apply_filters('woocommerce_price_filter_widget_min_amount', $_POST['price'][0]);
266
+ $slider_value2 = apply_filters('woocommerce_price_filter_widget_max_amount', $_POST['price'][1]);
267
  }
268
  if( $attribute != 'price' and @ $_POST['limits'] ){
269
  foreach( $_POST['limits'] as $p_limit ){
666
  if( $woocommerce_hide_out_of_stock_items == 'yes' ) {
667
  $args['post__in'] = BeRocket_AAPF::remove_out_of_stock( $args['post__in'] );
668
  }
669
+ if( ! br_woocommerce_version_check() ) {
670
+ $args['post__in'] = BeRocket_AAPF::remove_hidden( $args['post__in'] );
671
+ }
672
 
673
  $args['post__in'] = BeRocket_AAPF::limits_filter( $args['post__in'] );
674
+ if( isset($_POST['price']) && is_array($_POST['price']) ) {
675
+ $_POST['price'] = apply_filters('berocket_min_max_filter', $_POST['price']);
676
+ }
677
  $args['post__in'] = BeRocket_AAPF::price_filter( $args['post__in'] );
678
  $args['post_status'] = 'publish';
679
  $args['post_type'] = 'product';
 
680
  $default_posts_per_page = get_option( 'posts_per_page' );
681
  $args['posts_per_page'] = apply_filters( 'loop_shop_per_page', $default_posts_per_page );
682
  unset( $default_posts_per_page );
689
  if( isset($_POST['s']) && strlen($_POST['s']) > 0 ) {
690
  $args['s'] = $_POST['s'];
691
  }
 
692
  $wp_query = new WP_Query( $args );
693
 
694
  // here we get max products to know if current page is not too big
696
  $args['paged'] = min( $mathces[1], $wp_query->max_num_pages );
697
  $wp_query = new WP_Query( $args );
698
  }
699
+ //echo '<pre>', print_r($wp_query, true), '</pre>';
700
  unset( $args );
701
 
702
  if( @ ! $br_options['ajax_request_load'] ) {
872
  else
873
  return esc_url_raw( $result );
874
  }
875
+ }
js/widget.min.js CHANGED
@@ -485,6 +485,9 @@
485
  $(o2).prop('checked', false);
486
  $(o2).parents('li').first().removeClass('berocket_hide_sel_value');
487
  });
 
 
 
488
  } else {
489
  $('.'+$label.attr('for')).prop('checked', true);
490
  if( $label.parents('li').first().find('input').attr('type') == 'radio' ) {
@@ -495,7 +498,10 @@
495
  $(o2).parents('li').first().addClass('berocket_hide_sel_value');
496
  });
497
  }
498
- $label.addClass('berocket_checked');
 
 
 
499
  }
500
  $('.'+$label.attr('for')).parents('ul').find('input').trigger('refresh');
501
  if( the_ajax_script.hide_sel_value ) {
485
  $(o2).prop('checked', false);
486
  $(o2).parents('li').first().removeClass('berocket_hide_sel_value');
487
  });
488
+ $('.'+$label.attr('for')).each(function( i2, o2 ) {
489
+ $(o2).parents('li').first().find('label').removeClass('berocket_checked');
490
+ });
491
  } else {
492
  $('.'+$label.attr('for')).prop('checked', true);
493
  if( $label.parents('li').first().find('input').attr('type') == 'radio' ) {
498
  $(o2).parents('li').first().addClass('berocket_hide_sel_value');
499
  });
500
  }
501
+ $('.'+$label.attr('for')).each(function( i2, o2 ) {
502
+ $(o2).parents('li').first().find('label').addClass('berocket_checked');
503
+ });
504
+ //$label.addClass('berocket_checked');
505
  }
506
  $('.'+$label.attr('for')).parents('ul').find('input').trigger('refresh');
507
  if( the_ajax_script.hide_sel_value ) {
readme.txt CHANGED
@@ -4,8 +4,8 @@ Contributors: dholovnia, berocket
4
  Donate link: http://berocket.com
5
  Tags: filters, product filters, ajax product filters, advanced product filters, woocommerce filters, woocommerce product filters, woocommerce ajax product filters, widget, plugin
6
  Requires at least: 4.0
7
- Tested up to: 4.6.1
8
- Stable tag: 1.1.6
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -30,7 +30,8 @@ WooCommerce AJAX Product Filters - advanced AJAX product filters plugin for WooC
30
 
31
  = Additional Features in Paid Plugin: =
32
 
33
- * Filter by Attribute, Tag, Custom Taxonomy, Color, Sub-categories and Availability( in stock | out of stock | any )
 
34
  * Customize filters look through admin
35
  * Option to re-count products amount in values when some value selected
36
  * Tag Cloud for Tag filter
@@ -38,14 +39,23 @@ WooCommerce AJAX Product Filters - advanced AJAX product filters plugin for WooC
38
  * Slider can use strings as a value
39
  * Filters can be collapsed by clicking on title, option to collapse filter on start
40
  * Price Filter Custom Min and Max values
 
41
  * Add custom CSS on admin settings page
42
  * Show icons before/after widget title and/or before/after values
43
  * Option to upload "Loading..." gif image and set label after/before/above/under it
44
- * Show icons before/after widget title and/or before/after values
45
  * Scroll top position can be controlled by the admin
46
  * Option to hide on mobile devices
47
  * Much better support for custom theme
48
  * Enhancements of the free features
 
 
 
 
 
 
 
 
 
49
 
50
  = Paid Plugin Link =
51
  http://berocket.com/product/woocommerce-ajax-products-filter
@@ -137,11 +147,33 @@ http://woocommerce-products-filter.berocket.com/
137
  ---
138
 
139
  == Screenshots ==
 
 
 
140
 
141
  ---
142
 
143
  == Changelog ==
144
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
145
  = 1.1.6 =
146
  * Fix - Price for currency exchange
147
  * Fix - Optimization for price widget
@@ -291,4 +323,4 @@ you set to order `by custom` you can drag&amp;drop values up and down and set yo
291
  * Fix - better support for older PHP versions
292
 
293
  = 1.0.1 =
294
- * First public version
4
  Donate link: http://berocket.com
5
  Tags: filters, product filters, ajax product filters, advanced product filters, woocommerce filters, woocommerce product filters, woocommerce ajax product filters, widget, plugin
6
  Requires at least: 4.0
7
+ Tested up to: 4.7.4
8
+ Stable tag: 1.1.8.1
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
30
 
31
  = Additional Features in Paid Plugin: =
32
 
33
+ * Filter by Attribute, Tag, Custom Taxonomy, Color, Image, Sale status, Sub-categories and Availability( in stock | out of stock | any )
34
+ * Nice URLs for SEO Friendly URLs
35
  * Customize filters look through admin
36
  * Option to re-count products amount in values when some value selected
37
  * Tag Cloud for Tag filter
39
  * Slider can use strings as a value
40
  * Filters can be collapsed by clicking on title, option to collapse filter on start
41
  * Price Filter Custom Min and Max values
42
+ * Price as checkbox with min and max values
43
  * Add custom CSS on admin settings page
44
  * Show icons before/after widget title and/or before/after values
45
  * Option to upload "Loading..." gif image and set label after/before/above/under it
 
46
  * Scroll top position can be controlled by the admin
47
  * Option to hide on mobile devices
48
  * Much better support for custom theme
49
  * Enhancements of the free features
50
+ * Shortcode Builder for Easy Shortcode Creation
51
+ * Show amount of products before update with "Update button" widget
52
+ * Optimization to Handle up to 5 000 Products Total
53
+ * Option to Set Values for the Price Slider Manually
54
+ * Selected Filters Area
55
+ * Reset button and Search box widget
56
+ * Cache for Widgets
57
+ * Filters Visibility by Pages
58
+ * Display only selected attribute values or hide selected attribute values
59
 
60
  = Paid Plugin Link =
61
  http://berocket.com/product/woocommerce-ajax-products-filter
147
  ---
148
 
149
  == Screenshots ==
150
+ 1. General settings
151
+ 2. JavaScript settings
152
+ 3. Widget
153
 
154
  ---
155
 
156
  == Changelog ==
157
 
158
+ = 1.1.8.1 =
159
+ * Fix - WooCommerce 3.0.1 issues
160
+ * Fix - Premium plugin link on settings page.
161
+
162
+ = 1.1.8 =
163
+ * Fix - Better compatibility with WPML
164
+
165
+ = 1.1.7 =
166
+ * Fix - Remove notices on PHP 7 and newer
167
+ * Fix - Fix fo Currency Exchange plugin
168
+ * Fix - Styles for admin panel
169
+ * Fix - Remove sliders from all filters
170
+
171
+ = 1.1.7 =
172
+ * Fix - Remove notices on PHP 7 and newer
173
+ * Fix - Fix fo Currency Exchange plugin
174
+ * Fix - Styles for admin panel
175
+ * Fix - Remove sliders from all filters
176
+
177
  = 1.1.6 =
178
  * Fix - Price for currency exchange
179
  * Fix - Optimization for price widget
323
  * Fix - better support for older PHP versions
324
 
325
  = 1.0.1 =
326
+ * First public version
templates/checkbox.php CHANGED
@@ -36,7 +36,16 @@ if ( @ $terms ):
36
  }
37
  }
38
  }
39
- ?> /><label for='checkbox_<?php echo $term->term_id ?>' class="berocket_label_widgets"> <?php echo $term->name ?></label>
 
 
 
 
 
 
 
 
 
40
  </span>
41
  </li>
42
  <?php
36
  }
37
  }
38
  }
39
+ ?> /><label for='checkbox_<?php echo $term->term_id ?>' class="berocket_label_widgets<?php
40
+ if( @ $_POST['terms'] ){
41
+ foreach( $_POST['terms'] as $p_term ){
42
+ if( @ $p_term[0] == $term->taxonomy and $term->term_id == @ $p_term[1] ){
43
+ echo ' berocket_checked';
44
+ break;
45
+ }
46
+ }
47
+ }
48
+ ?>"> <?php echo $term->name ?></label>
49
  </span>
50
  </li>
51
  <?php
templates/discount.php CHANGED
@@ -1,197 +1,153 @@
1
- <?php
2
- $start_time = 1475532000;//1475272800
3
- $end_time = 1475791200;//1475445600
4
- $time = time();
5
- $discount = 30;
6
- $d_type = 'p';
7
- if( $d_type == 'p' ) {
8
- $discount_text = $discount.'%';
9
- $discount_amount = ($dplugin_price / 100 * $discount);
10
- } else {
11
- $discount_text = '$'.$discount;
12
- $discount_amount = $discount;
13
- }
14
- $price_new = $dplugin_price - $discount_amount;
15
- $price_new = number_format ( $price_new , 2 ,"." ," " );
16
- $price_new = '$'.$price_new;
17
- $discount_amount = number_format ( $discount_amount , 2 ,"." ," " );
18
- $discount_amount = '$'.$discount_amount;
19
- if( $time > $start_time && $time < $end_time ) { ?>
20
- <div class="discount-block-check"></div>
21
- <div class="wrap discount-block">
22
- <div>
23
  <?php
24
- $text = 'Only today <strong>PRO</strong> version of %name% plugin for just %price%!<br>
25
- Get your <strong class="scale red pulse">%disc% discount</strong> and save %amount% today
26
- <a class="buy_button" href="%link%" target="_blank">Buy Now</a>';
27
- $text = str_replace('%name%', $dplugin_name, $text);
28
- $text = str_replace('%link%', $dplugin_link, $text);
29
- $text = str_replace('%disc%', $discount_text, $text);
30
- $text = str_replace('%amount%', $discount_amount, $text);
31
- $text = str_replace('%price%', $price_new, $text);
32
- echo $text;
33
- ?>
34
- </div>
35
- </div>
36
- <script>
37
- jQuery(window).scroll(function() {
38
- var top = jQuery('.discount-block-check').offset().top - 32;
39
-
40
- if( jQuery(window).width() <= 782 ) {
41
- jQuery('.discount-block').removeClass('fixed');
42
- jQuery('.discount-block-check').height(0);
43
- } else {
44
- if( jQuery(window).scrollTop() > top ) {
45
- if( ! jQuery('.discount-block').is('.fixed') ) {
46
- jQuery('.discount-block-check').height(jQuery('.discount-block').outerHeight(true));
47
- jQuery('.discount-block').addClass('fixed');
48
- }
 
 
 
 
 
 
 
 
49
  } else {
50
- if( jQuery('.discount-block').is('.fixed') ) {
51
- jQuery('.discount-block-check').height(0);
52
- jQuery('.discount-block').removeClass('fixed');
 
 
 
 
 
 
 
53
  }
54
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
  }
56
- });
57
- </script>
58
- <style>
59
- .discount-block-check {
60
- margin: 0!important;
61
- padding: 0!important;
62
- }
63
- .discount-block{
64
- text-align: center;
65
- background: #ffffff;
66
- padding: 20px;
67
- font-size: 24px;
68
- border: 4px solid #ff8800;
69
- line-height: 1.8em;
70
- transition: 0.4s all;
71
- animation-name: border_pulse;
72
- animation-duration: 4s;
73
- animation-iteration-count: infinite;
74
- }
75
- .discount-block.fixed{
76
- position: fixed;
77
- top: 32px;
78
- left: 180px;
79
- right: 0px;
80
- }
81
- @media only screen and (max-device-width: 960px) {
82
- .discount-block.fixed{
83
- left: 56px;
84
- }
85
- }
86
- @media only screen and (max-device-width: 782px) {
87
- .discount-block{
88
- font-size: 16px;
89
- padding: 5px;
90
- }
91
- }
92
- @keyframes border_pulse {
93
- 0% {border-color: #ff8800;}
94
- 50% {border-color: #0088ff;}
95
- 100% {border-color: #ff8800;}
96
- }
97
- .discount-block .buy_button {
98
- font-size: 20px;
99
- padding: 8px 30px;
100
- color: #fff;
101
- line-height: 28px;
102
- font-weight: 600;
103
- text-transform: uppercase;
104
- display: inline-block;
105
- text-align: center;
106
- text-decoration: none;
107
- background-color: #f16543;
108
- cursor: pointer;
109
- }
110
- .discount-block .buy_button:hover {
111
- background-color: #d94825;
112
- }
113
- .pulse {
114
- animation-duration: 1.5s;
115
- animation-iteration-count: infinite;
116
- animation-timing-function: linear;
117
- animation-timing-function: cubic-bezier(0.2,0.2,0.2,0.2);
118
- }
119
- .time-5 {
120
- animation-duration: 0.5s;
121
- }
122
- .time-10 {
123
- animation-duration: 1s;
124
- }
125
- .time-15 {
126
- animation-duration: 1.5s;
127
- }
128
- .time-20 {
129
- animation-duration: 2s;
130
- }
131
- .time-25 {
132
- animation-duration: 2.5s;
133
- }
134
- .time-30 {
135
- animation-duration: 3s;
136
- }
137
- .time-35 {
138
- animation-duration: 3.5s;
139
- }
140
- .time-40 {
141
- animation-duration: 4s;
142
- }
143
- .red {
144
- color: #ff0000;
145
- }
146
- .red.pulse {
147
- animation-name: red_pulse;
148
- }
149
- @keyframes red_pulse {
150
- 0% {color: #ff0000;}
151
- 50% {color: #000000;}
152
- 100% {color: #ff0000;}
153
- }
154
- .blue {
155
- color: #0000ff;
156
- }
157
- .blue.pulse {
158
- animation-name: blue_pulse;
159
- }
160
- @keyframes blue_pulse {
161
- 0% {color: #0000ff;}
162
- 50% {color: #000000;}
163
- 100% {color: #0000ff;}
164
- }
165
- .pulse.scale {
166
- display: inline-block;
167
- animation-name: scale_pulse;
168
- }
169
- @keyframes scale_pulse {
170
- 0% {transform: scale(1);}
171
- 25%{transform: scale(1.05);}
172
- 50% {transform: scale(1);}
173
- 75% {transform: scale(0.9);}
174
- 100% {transform: scale(1);}
175
- }
176
- .pulse.scale.red {
177
- animation-name: scale_red_pulse;
178
- }
179
- @keyframes scale_red_pulse {
180
- 0% {transform: scale(1);color: #ff0000;}
181
- 25%{transform: scale(1.05);color: #ff0000;}
182
- 50% {transform: scale(1);color: #ff0000;}
183
- 75% {transform: scale(0.9);color: #000000;}
184
- 100% {transform: scale(1);color: #ff0000;}
185
- }
186
- .pulse.scale.blue {
187
- animation-name: scale_blue_pulse;
188
- }
189
- @keyframes scale_blue_pulse {
190
- 0% {transform: scale(1);color: #0000ff;}
191
- 25%{transform: scale(1.05);color: #0000ff;}
192
- 50% {transform: scale(1);color: #0000ff;}
193
- 75% {transform: scale(0.9);color: #000000;}
194
- 100% {transform: scale(1);color: #0000ff;}
195
- }
196
- </style>
197
  <?php } ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  <?php
2
+ $start_time = 1490705082;
3
+ $end_time = 1496275200;
4
+ $promo_price = '$7.00';
5
+ $discount = '70%';
6
+ $save_amount = '$15.00';
7
+ $promo_plugin_name = 'WooCommerce Min/Max Quantity';
8
+ $promo_plugin_link = 'http://berocket.com/product/woocommerce-minmax-quantity';
9
+
10
+ if ( time() > $start_time && time() < $end_time ) { ?>
11
+ <div class="discount-block-check"></div>
12
+ <div class="wrap discount-block">
13
+ <img src="<?php echo plugin_dir_url( __FILE__ ) ?>../images/70p_sale.jpg" />
14
+ <div>
15
+ <?php
16
+ $text = 'Only <strong>%price%</strong> for <strong>Premium</strong> %name% plugin!<br>
17
+ <span>Get your <strong class="red">%disc% discount</strong> and save <strong>%amount%</strong> today</span>
18
+ <a class="buy_button" href="%link%" target="_blank">Buy Now</a>';
19
+ $text = str_replace('%name%', $promo_plugin_name, $text);
20
+ $text = str_replace('%link%', $promo_plugin_link, $text);
21
+ $text = str_replace('%price%', $promo_price, $text);
22
+ $text = str_replace('%disc%', $discount, $text);
23
+ $text = str_replace('%amount%', $save_amount, $text);
24
+ echo $text;
25
+ ?>
26
+ </div>
27
+ </div>
28
+ <script>
29
+ jQuery(window).scroll(function() {
30
+ var top = jQuery('.discount-block-check').offset().top - 32;
31
+
32
+ if( jQuery(window).width() <= 782 ) {
33
+ jQuery('.discount-block').removeClass('fixed');
34
+ jQuery('.discount-block-check').height(0);
35
  } else {
36
+ if( jQuery(window).scrollTop() > top ) {
37
+ if( ! jQuery('.discount-block').is('.fixed') ) {
38
+ jQuery('.discount-block-check').height(jQuery('.discount-block').outerHeight(true));
39
+ jQuery('.discount-block').addClass('fixed');
40
+ }
41
+ } else {
42
+ if( jQuery('.discount-block').is('.fixed') ) {
43
+ jQuery('.discount-block-check').height(0);
44
+ jQuery('.discount-block').removeClass('fixed');
45
+ }
46
  }
47
  }
48
+ });
49
+ </script>
50
+ <style>
51
+ .discount-block-check {
52
+ margin: 0!important;
53
+ padding: 0!important;
54
+ }
55
+ .discount-block{
56
+ text-align: center;
57
+ background: #ffffff;
58
+ padding: 0;
59
+ font-size: 24px;
60
+ border: 2px solid #ef3542;
61
+ line-height: 1.8em;
62
+ z-index: 1000;
63
+ }
64
+ .discount-block > img{
65
+ float: left;
66
+ max-height: 130px;
67
+ }
68
+ .discount-block > div{
69
+ padding: 20px;
70
+ height: 90px;
71
+ }
72
+ .discount-block.fixed{
73
+ position: fixed;
74
+ top: 32px;
75
+ left: 180px;
76
+ right: 0px;
77
+ }
78
+ .discount-block .buy_button {
79
+ font-size: 20px;
80
+ padding: 8px 30px;
81
+ color: #fff;
82
+ line-height: 28px;
83
+ font-weight: 600;
84
+ text-transform: uppercase;
85
+ display: inline-block;
86
+ text-align: center;
87
+ text-decoration: none;
88
+ background-color: #ef3542;
89
+ cursor: pointer;
90
+ }
91
+ .discount-block .buy_button:hover {
92
+ background-color: #F54C57;
93
+ }
94
+ .red {
95
+ color: #ef3542;
96
+ }
97
+ @media screen and (max-width: 1200px) {
98
+ .discount-block{
99
+ font-size: 20px;
100
+ }
101
+ }
102
+ @media screen and (max-width: 1100px) {
103
+ .discount-block{
104
+ font-size: 18px;
105
+ line-height: 1.5em;
106
+ }
107
+ }
108
+ @media screen and (max-width: 960px) {
109
+ .discount-block.fixed{
110
+ left: 56px;
111
+ }
112
+ }
113
+ @media screen and (max-width: 782px) {
114
+ .discount-block.fixed{
115
+ left: 10px;
116
+ }
117
+ }
118
+ @media screen and (max-width: 767px) {
119
+ .discount-block{
120
+ font-size: 16px;
121
+ line-height: 1.6em;
122
+ }
123
+ .discount-block > img{
124
+ max-height: 110px;
125
+ }
126
+ .discount-block > div{
127
+ padding: 10px;
128
+ height: 90px;
129
+ }
130
+ .discount-block .buy_button{
131
+ padding: 4px 15px;
132
+ margin-top: 2px;
133
+ }
134
+ }
135
+ @media screen and (max-width: 610px) {
136
+ .discount-block{
137
+ font-size: 14px;
138
+ line-height: 1.6em;
139
+ }
140
+ }
141
+ @media screen and (max-width: 570px) {
142
+ .discount-block > div > span{
143
+ display: none;
144
+ }
145
+ }
146
+ @media screen and (max-width: 400px) {
147
+ .discount-block .buy_button{
148
+ font-size: 16px;
149
+ padding: 2px 15px;
150
+ }
151
  }
152
+ </style>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
153
  <?php } ?>
templates/radio.php CHANGED
@@ -27,7 +27,16 @@ if ( $terms ):
27
  }
28
  }
29
  }
30
- ?> /><label for='radio_<?php echo $term->term_id ?>' class="berocket_label_widgets"> <?php echo $term->name ?></label>
 
 
 
 
 
 
 
 
 
31
  </span>
32
  </li>
33
  <?php endforeach; ?>
27
  }
28
  }
29
  }
30
+ ?> /><label for='radio_<?php echo $term->term_id ?>' class="berocket_label_widgets<?php
31
+ if( @ $_POST['terms'] ){
32
+ foreach( $_POST['terms'] as $p_term ){
33
+ if( $p_term[0] == $term->taxonomy and $term->term_id == $p_term[1] ){
34
+ echo ' berocket_checked';
35
+ break;
36
+ }
37
+ }
38
+ }
39
+ ?>"> <?php echo $term->name ?></label>
40
  </span>
41
  </li>
42
  <?php endforeach; ?>
woocommerce-filters.php CHANGED
@@ -1,16 +1,17 @@
1
  <?php
2
  /**
3
- * Plugin Name: Advanced AJAX Product Filters for WooCommerce
4
  * Plugin URI: https://wordpress.org/plugins/woocommerce-ajax-filters/
5
  * Description: Take a look at this fantastic AJAX products filter plugin for WooCommerce. Add unlimited filters with one widget.
6
- * Version: 1.1.6
7
  * Author: BeRocket
 
8
  * Author URI: http://berocket.com
9
  * Text Domain: BeRocket_AJAX_domain
10
  * Domain Path: /languages/
11
  */
12
 
13
- define( "BeRocket_AJAX_filters_version", '1.1.6' );
14
  define( "BeRocket_AJAX_domain", 'BeRocket_AJAX_domain' );
15
 
16
  define( "AAPF_TEMPLATE_PATH", plugin_dir_path( __FILE__ ) . "templates/" );
@@ -418,4 +419,4 @@ class BeRocket_AAPF {
418
  }
419
  }
420
 
421
- new BeRocket_AAPF;
1
  <?php
2
  /**
3
+ * Plugin Name: Advanced AJAX Product Filter for WooCommerce
4
  * Plugin URI: https://wordpress.org/plugins/woocommerce-ajax-filters/
5
  * Description: Take a look at this fantastic AJAX products filter plugin for WooCommerce. Add unlimited filters with one widget.
6
+ * Version: 1.1.8.1
7
  * Author: BeRocket
8
+ * Requires at least: 4.0
9
  * Author URI: http://berocket.com
10
  * Text Domain: BeRocket_AJAX_domain
11
  * Domain Path: /languages/
12
  */
13
 
14
+ define( "BeRocket_AJAX_filters_version", '1.1.8.1' );
15
  define( "BeRocket_AJAX_domain", 'BeRocket_AJAX_domain' );
16
 
17
  define( "AAPF_TEMPLATE_PATH", plugin_dir_path( __FILE__ ) . "templates/" );
419
  }
420
  }
421
 
422
+ new BeRocket_AAPF;
wpml-config.xml ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <wpml-config>
2
+ <admin-texts>
3
+ <key name="br_filters_options">
4
+ <key name="no_products_message" />
5
+ <key name="ub_product_text" />
6
+ <key name="ub_product_button_text" />
7
+ <key name="ajax_load_text">
8
+ <key name="top" />
9
+ <key name="bottom" />
10
+ <key name="left" />
11
+ <key name="right" />
12
+ </key>
13
+ </key>
14
+ </admin-texts>
15
+ <shortcodes>
16
+ <shortcode>
17
+ <tag>br_filters</tag>
18
+ <attributes>
19
+ <attribute>title</attribute>
20
+ </attributes>
21
+ </shortcode>
22
+ </shortcodes>
23
+ </wpml-config>