Perfect Brands for WooCommerce - Version 1.8.6

Version Description

  • New: remove filters button
Download this release

Release Info

Developer quadlayers
Plugin Icon 128x128 Perfect Brands for WooCommerce
Version 1.8.6
Comparing to
See all releases

Code changes from version 1.8.5 to 1.8.6

assets/js/functions-frontend.js CHANGED
@@ -117,7 +117,18 @@ jQuery(function ($) {
117
 
118
  }
119
 
120
- $('.pwb-filter-products button').on('click', function () { PWBFilterByBrand(); });
 
 
 
 
 
 
 
 
 
 
 
121
  $('.pwb-filter-products.pwb-hide-submit-btn input').on('change', function () { PWBFilterByBrand(); });
122
 
123
  var brands = PWBgetUrlParameter('pwb-brand-filter');
117
 
118
  }
119
 
120
+ var PWBRemoveFilterByBrand = function () {
121
+ var baseUrl = [location.protocol, '//', location.host, location.pathname].join('');
122
+ var currentUrl = window.location.href;
123
+ //removes previous "pwb-brand" from url
124
+ currentUrl = currentUrl.replace(/&?pwb-brand-filter=([^&]$|[^&]*)/i, "");
125
+ //removes pagination
126
+ currentUrl = currentUrl.replace(/\/page\/\d*\//i, "");
127
+ location.href = currentUrl;
128
+ }
129
+
130
+ $('.pwb-apply-filter').on('click', function () { PWBFilterByBrand(); });
131
+ $('.pwb-remove-filter').on('click', function () { PWBRemoveFilterByBrand(); });
132
  $('.pwb-filter-products.pwb-hide-submit-btn input').on('change', function () { PWBFilterByBrand(); });
133
 
134
  var brands = PWBgetUrlParameter('pwb-brand-filter');
assets/js/functions-frontend.min.js CHANGED
@@ -1 +1 @@
1
- jQuery((function($){"use strict";$(".pwb-dropdown-widget").on("change",(function(){var href=$(this).find(":selected").val();location.href=href})),"function"==typeof $.fn.slick&&($(".pwb-carousel").slick({slide:".pwb-slick-slide",infinite:!0,draggable:!1,prevArrow:'<div class="slick-prev"><span>'+pwb_ajax_object.carousel_prev+"</span></div>",nextArrow:'<div class="slick-next"><span>'+pwb_ajax_object.carousel_next+"</span></div>",speed:300,lazyLoad:"progressive",responsive:[{breakpoint:1024,settings:{slidesToShow:4,draggable:!0,arrows:!1}},{breakpoint:600,settings:{slidesToShow:3,draggable:!0,arrows:!1}},{breakpoint:480,settings:{slidesToShow:2,draggable:!0,arrows:!1}}]}),$(".pwb-product-carousel").slick({slide:".pwb-slick-slide",infinite:!0,draggable:!1,prevArrow:'<div class="slick-prev"><span>'+pwb_ajax_object.carousel_prev+"</span></div>",nextArrow:'<div class="slick-next"><span>'+pwb_ajax_object.carousel_next+"</span></div>",speed:300,lazyLoad:"progressive",responsive:[{breakpoint:1024,settings:{slidesToShow:3,draggable:!0,arrows:!1}},{breakpoint:600,settings:{slidesToShow:2,draggable:!0,arrows:!1}},{breakpoint:480,settings:{slidesToShow:1,draggable:!0,arrows:!1}}]}));var PWBFilterByBrand=function(){var baseUrl=[location.protocol,"//",location.host,location.pathname].join(""),currentUrl=window.location.href,marcas=[];$('.pwb-filter-products input[type="checkbox"]').each((function(index){$(this).prop("checked")&&marcas.push($(this).val())})),currentUrl=(marcas=marcas.join())?-1===(currentUrl=(currentUrl=currentUrl.replace(/&?pwb-brand-filter=([^&]$|[^&]*)/i,"")).replace(/\/page\/\d*\//i,"")).indexOf("?")?currentUrl+"?pwb-brand-filter="+marcas:currentUrl+"&pwb-brand-filter="+marcas:baseUrl,location.href=currentUrl};$(".pwb-filter-products button").on("click",(function(){PWBFilterByBrand()})),$(".pwb-filter-products.pwb-hide-submit-btn input").on("change",(function(){PWBFilterByBrand()}));var brands=PWBgetUrlParameter("pwb-brand-filter");if(null!=brands){var brands_array=brands.split(",");$('.pwb-filter-products input[type="checkbox"]').prop("checked",!1);for(var i=0,l=brands_array.length;i<l;i++)$('.pwb-filter-products input[type="checkbox"]').each((function(index){$(this).val()&&brands_array[i]==$(this).val()&&$(this).prop("checked",!0)}))}else $('.pwb-filter-products input[type="checkbox"]').prop("checked",!1)}));var PWBgetUrlParameter=function PWBgetUrlParameter(sParam){var sPageURL,sURLVariables=decodeURIComponent(window.location.search.substring(1)).split("&"),sParameterName,i;for(i=0;i<sURLVariables.length;i++)if((sParameterName=sURLVariables[i].split("="))[0]===sParam)return void 0===sParameterName[1]||sParameterName[1]};
1
+ jQuery((function($){"use strict";$(".pwb-dropdown-widget").on("change",(function(){var href=$(this).find(":selected").val();location.href=href})),"function"==typeof $.fn.slick&&($(".pwb-carousel").slick({slide:".pwb-slick-slide",infinite:!0,draggable:!1,prevArrow:'<div class="slick-prev"><span>'+pwb_ajax_object.carousel_prev+"</span></div>",nextArrow:'<div class="slick-next"><span>'+pwb_ajax_object.carousel_next+"</span></div>",speed:300,lazyLoad:"progressive",responsive:[{breakpoint:1024,settings:{slidesToShow:4,draggable:!0,arrows:!1}},{breakpoint:600,settings:{slidesToShow:3,draggable:!0,arrows:!1}},{breakpoint:480,settings:{slidesToShow:2,draggable:!0,arrows:!1}}]}),$(".pwb-product-carousel").slick({slide:".pwb-slick-slide",infinite:!0,draggable:!1,prevArrow:'<div class="slick-prev"><span>'+pwb_ajax_object.carousel_prev+"</span></div>",nextArrow:'<div class="slick-next"><span>'+pwb_ajax_object.carousel_next+"</span></div>",speed:300,lazyLoad:"progressive",responsive:[{breakpoint:1024,settings:{slidesToShow:3,draggable:!0,arrows:!1}},{breakpoint:600,settings:{slidesToShow:2,draggable:!0,arrows:!1}},{breakpoint:480,settings:{slidesToShow:1,draggable:!0,arrows:!1}}]}));var PWBFilterByBrand=function(){var baseUrl=[location.protocol,"//",location.host,location.pathname].join(""),currentUrl=window.location.href,marcas=[];$('.pwb-filter-products input[type="checkbox"]').each((function(index){$(this).prop("checked")&&marcas.push($(this).val())})),currentUrl=(marcas=marcas.join())?-1===(currentUrl=(currentUrl=currentUrl.replace(/&?pwb-brand-filter=([^&]$|[^&]*)/i,"")).replace(/\/page\/\d*\//i,"")).indexOf("?")?currentUrl+"?pwb-brand-filter="+marcas:currentUrl+"&pwb-brand-filter="+marcas:baseUrl,location.href=currentUrl},PWBRemoveFilterByBrand=function(){var baseUrl=[location.protocol,"//",location.host,location.pathname].join(""),currentUrl=window.location.href;currentUrl=(currentUrl=currentUrl.replace(/&?pwb-brand-filter=([^&]$|[^&]*)/i,"")).replace(/\/page\/\d*\//i,""),location.href=currentUrl};$(".pwb-apply-filter").on("click",(function(){PWBFilterByBrand()})),$(".pwb-remove-filter").on("click",(function(){PWBRemoveFilterByBrand()})),$(".pwb-filter-products.pwb-hide-submit-btn input").on("change",(function(){PWBFilterByBrand()}));var brands=PWBgetUrlParameter("pwb-brand-filter");if(null!=brands){var brands_array=brands.split(",");$('.pwb-filter-products input[type="checkbox"]').prop("checked",!1);for(var i=0,l=brands_array.length;i<l;i++)$('.pwb-filter-products input[type="checkbox"]').each((function(index){$(this).val()&&brands_array[i]==$(this).val()&&$(this).prop("checked",!0)}))}else $('.pwb-filter-products input[type="checkbox"]').prop("checked",!1)}));var PWBgetUrlParameter=function PWBgetUrlParameter(sParam){var sPageURL,sURLVariables=decodeURIComponent(window.location.search.substring(1)).split("&"),sParameterName,i;for(i=0;i<sURLVariables.length;i++)if((sParameterName=sURLVariables[i].split("="))[0]===sParam)return void 0===sParameterName[1]||sParameterName[1]};
classes/admin/class-edit-brands-page.php CHANGED
@@ -1,143 +1,154 @@
1
  <?php
 
2
  namespace Perfect_Woocommerce_Brands\Admin;
3
 
4
- defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
5
 
6
- class Edit_Brands_Page {
 
7
 
8
  private static $current_user;
9
 
10
- function __construct(){
11
- add_filter( 'get_terms', array( $this, 'brand_list_admin_filter' ), 10, 3 );
12
- add_filter( 'manage_edit-pwb-brand_columns', array( $this, 'brand_taxonomy_columns_head' ) );
13
- add_filter( 'manage_pwb-brand_custom_column', array( $this, 'brand_taxonomy_columns' ), 10, 3 );
14
- add_action( 'wp_ajax_pwb_admin_set_featured_brand', array( $this, 'set_featured_brand' ) );
15
- add_filter( 'screen_settings', array( $this, 'add_screen_options' ), 10, 2 );
16
- add_action( 'wp_ajax_pwb_admin_save_screen_settings', array( $this, 'save_screen_options' ) );
17
- add_action( 'plugins_loaded', function(){ \Perfect_Woocommerce_Brands\Admin\Edit_Brands_Page::$current_user = wp_get_current_user(); } );
18
- add_action( 'after-pwb-brand-table', array( $this, 'add_brands_count' ) );
 
 
 
19
  }
20
 
21
- private static function is_edit_brands_page(){
 
22
  global $pagenow;
23
- return ( $pagenow == 'edit-tags.php' && isset( $_GET['taxonomy'] ) && $_GET['taxonomy'] == 'pwb-brand' ) ? true : false;
24
  }
25
 
26
- public function add_brands_count( $tax_name ){
 
27
  $brands = get_terms(
28
  $tax_name,
29
- array( 'hide_empty' => false )
30
  );
31
  $brands_featured = get_terms(
32
  $tax_name,
33
- array( 'hide_empty' => false, 'meta_query' => array( array( 'key' => 'pwb_featured_brand', 'value' => true ) ) )
34
  );
35
 
36
  echo \Perfect_Woocommerce_Brands\Perfect_Woocommerce_Brands::render_template(
37
  'edit-brands-bottom',
38
  'admin',
39
- array( 'featured_count' => count( $brands_featured ), 'text_featured' => esc_html__('featured', 'perfect-woocommerce-brands') )
40
  );
41
-
42
  }
43
 
44
- public function brand_list_admin_filter( $brands, $taxonomies, $args ) {
 
45
 
46
- if( self::is_edit_brands_page() ){
47
-
48
- $featured = get_user_option( 'pwb-first-featured-brands', self::$current_user->ID );
49
- if( $featured ){
50
  $featured_brands = array();
51
  $other_brands = array();
52
- foreach( $brands as $brand ) {
53
- if( get_term_meta( $brand->term_id, 'pwb_featured_brand', true ) ){
54
  $featured_brands[] = $brand;
55
- }else{
56
  $other_brands[] = $brand;
57
  }
58
  }
59
- return array_merge( $featured_brands, $other_brands );
60
  }
61
-
62
  }
63
  return $brands;
64
-
65
  }
66
 
67
- public function brand_taxonomy_columns_head( $columns ){
 
68
  $new_columns = array();
69
 
70
- if ( isset( $columns['cb'] ) ) {
71
  $new_columns['cb'] = $columns['cb'];
72
- unset( $columns['cb'] );
73
  }
74
 
75
- if( isset( $columns['description'] ) ) unset( $columns['description'] );
76
 
77
- $new_columns['logo'] = __( 'Logo', 'perfect-woocommerce-brands' );
78
- $columns['featured'] = '<span class="pwb-featured-col-title">'.__( 'Featured', 'perfect-woocommerce-brands' ).'</span>';
79
 
80
- return array_merge( $new_columns, $columns );
81
  }
82
 
83
- public function brand_taxonomy_columns($c, $column_name, $term_id){
84
- switch( $column_name ){
 
85
  case 'logo':
86
- $image = wp_get_attachment_image( get_term_meta( $term_id, 'pwb_brand_image', 1 ), array('40','40') );
87
- return ( $image ) ? $image : wc_placeholder_img( array('40','40') );
88
  break;
89
  case 'featured':
90
- $featured_class = ( $this->is_featured_brand( $term_id ) ) ? 'dashicons-star-filled' : 'dashicons-star-empty';
91
  printf(
92
  '<span class="dashicons %1$s" title="%2$s" data-brand-id="%3$s"></span>',
93
- $featured_class, esc_html__('Set as featured', 'perfect-woocommerce-brands'), $term_id
 
 
94
  );
95
  break;
96
  }
97
  }
98
 
99
- private function is_featured_brand( $brand_id ){
100
- return ( get_term_meta( $brand_id, 'pwb_featured_brand', true ) );
 
101
  }
102
 
103
- public function set_featured_brand(){
104
- if( isset( $_POST['brand'] ) ){
 
105
  $direction = 'up';
106
- $brand = intval( $_POST['brand'] );
107
- if( $this->is_featured_brand( $brand ) ){
108
- delete_term_meta( $brand, 'pwb_featured_brand', true );
109
  $direction = 'down';
110
- }else{
111
- update_term_meta( $brand, 'pwb_featured_brand', true );
112
  }
113
- wp_send_json_success( array( 'success' => true, 'direction' => $direction ) );
114
- }else{
115
- wp_send_json_error( array( 'success' => false, 'error_msg' => __( 'Error!','perfect-woocommerce-brands' ) ) );
116
  }
117
  wp_die();
118
  }
119
 
120
- public function add_screen_options( $status, $args ){
121
- if( self::is_edit_brands_page() ){
122
- $featured = get_user_option( 'pwb-first-featured-brands', self::$current_user->ID );
 
123
  ob_start();
124
- ?>
125
- <legend><?php esc_html_e('Brands','perfect-woocommerce-brands');?></legend>
126
  <label>
127
- <input id="pwb-first-featured-brands" type="checkbox" <?php checked($featured,true);?>>
128
- <?php esc_html_e('Show featured brands first','perfect-woocommerce-brands');?>
129
  </label>
130
- <?php
131
  return ob_get_clean();
132
  }
133
  }
134
 
135
- public function save_screen_options(){
136
- if( isset( $_POST['new_val'] ) ){
137
- $new_val = ( $_POST['new_val'] == 'true' ) ? true : false;
138
- update_user_option( self::$current_user->ID, 'pwb-first-featured-brands', $new_val );
 
139
  }
140
  wp_die();
141
  }
142
-
143
  }
1
  <?php
2
+
3
  namespace Perfect_Woocommerce_Brands\Admin;
4
 
5
+ defined('ABSPATH') or die('No script kiddies please!');
6
 
7
+ class Edit_Brands_Page
8
+ {
9
 
10
  private static $current_user;
11
 
12
+ function __construct()
13
+ {
14
+ add_filter('get_terms', array($this, 'brand_list_admin_filter'), 10, 3);
15
+ add_filter('manage_edit-pwb-brand_columns', array($this, 'brand_taxonomy_columns_head'));
16
+ add_filter('manage_pwb-brand_custom_column', array($this, 'brand_taxonomy_columns'), 10, 3);
17
+ add_action('wp_ajax_pwb_admin_set_featured_brand', array($this, 'set_featured_brand'));
18
+ add_filter('screen_settings', array($this, 'add_screen_options'), 10, 2);
19
+ add_action('wp_ajax_pwb_admin_save_screen_settings', array($this, 'save_screen_options'));
20
+ add_action('plugins_loaded', function () {
21
+ \Perfect_Woocommerce_Brands\Admin\Edit_Brands_Page::$current_user = wp_get_current_user();
22
+ });
23
+ add_action('after-pwb-brand-table', array($this, 'add_brands_count'));
24
  }
25
 
26
+ private static function is_edit_brands_page()
27
+ {
28
  global $pagenow;
29
+ return ($pagenow == 'edit-tags.php' && isset($_GET['taxonomy']) && $_GET['taxonomy'] == 'pwb-brand') ? true : false;
30
  }
31
 
32
+ public function add_brands_count($tax_name)
33
+ {
34
  $brands = get_terms(
35
  $tax_name,
36
+ array('hide_empty' => false)
37
  );
38
  $brands_featured = get_terms(
39
  $tax_name,
40
+ array('hide_empty' => false, 'meta_query' => array(array('key' => 'pwb_featured_brand', 'value' => true)))
41
  );
42
 
43
  echo \Perfect_Woocommerce_Brands\Perfect_Woocommerce_Brands::render_template(
44
  'edit-brands-bottom',
45
  'admin',
46
+ array('featured_count' => count($brands_featured), 'text_featured' => esc_html__('featured', 'perfect-woocommerce-brands'))
47
  );
 
48
  }
49
 
50
+ public function brand_list_admin_filter($brands, $taxonomies, $args)
51
+ {
52
 
53
+ if (self::is_edit_brands_page() && !empty(self::$current_user->ID)) {
54
+ $featured = get_user_option('pwb-first-featured-brands', self::$current_user->ID);
55
+ if ($featured) {
 
56
  $featured_brands = array();
57
  $other_brands = array();
58
+ foreach ($brands as $brand) {
59
+ if (get_term_meta($brand->term_id, 'pwb_featured_brand', true)) {
60
  $featured_brands[] = $brand;
61
+ } else {
62
  $other_brands[] = $brand;
63
  }
64
  }
65
+ return array_merge($featured_brands, $other_brands);
66
  }
 
67
  }
68
  return $brands;
 
69
  }
70
 
71
+ public function brand_taxonomy_columns_head($columns)
72
+ {
73
  $new_columns = array();
74
 
75
+ if (isset($columns['cb'])) {
76
  $new_columns['cb'] = $columns['cb'];
77
+ unset($columns['cb']);
78
  }
79
 
80
+ if (isset($columns['description'])) unset($columns['description']);
81
 
82
+ $new_columns['logo'] = __('Logo', 'perfect-woocommerce-brands');
83
+ $columns['featured'] = '<span class="pwb-featured-col-title">' . __('Featured', 'perfect-woocommerce-brands') . '</span>';
84
 
85
+ return array_merge($new_columns, $columns);
86
  }
87
 
88
+ public function brand_taxonomy_columns($c, $column_name, $term_id)
89
+ {
90
+ switch ($column_name) {
91
  case 'logo':
92
+ $image = wp_get_attachment_image(get_term_meta($term_id, 'pwb_brand_image', 1), array('40', '40'));
93
+ return ($image) ? $image : wc_placeholder_img(array('40', '40'));
94
  break;
95
  case 'featured':
96
+ $featured_class = ($this->is_featured_brand($term_id)) ? 'dashicons-star-filled' : 'dashicons-star-empty';
97
  printf(
98
  '<span class="dashicons %1$s" title="%2$s" data-brand-id="%3$s"></span>',
99
+ $featured_class,
100
+ esc_html__('Set as featured', 'perfect-woocommerce-brands'),
101
+ $term_id
102
  );
103
  break;
104
  }
105
  }
106
 
107
+ private function is_featured_brand($brand_id)
108
+ {
109
+ return (get_term_meta($brand_id, 'pwb_featured_brand', true));
110
  }
111
 
112
+ public function set_featured_brand()
113
+ {
114
+ if (isset($_POST['brand'])) {
115
  $direction = 'up';
116
+ $brand = intval($_POST['brand']);
117
+ if ($this->is_featured_brand($brand)) {
118
+ delete_term_meta($brand, 'pwb_featured_brand', true);
119
  $direction = 'down';
120
+ } else {
121
+ update_term_meta($brand, 'pwb_featured_brand', true);
122
  }
123
+ wp_send_json_success(array('success' => true, 'direction' => $direction));
124
+ } else {
125
+ wp_send_json_error(array('success' => false, 'error_msg' => __('Error!', 'perfect-woocommerce-brands')));
126
  }
127
  wp_die();
128
  }
129
 
130
+ public function add_screen_options($status, $args)
131
+ {
132
+ if (self::is_edit_brands_page()) {
133
+ $featured = get_user_option('pwb-first-featured-brands', self::$current_user->ID);
134
  ob_start();
135
+ ?>
136
+ <legend><?php esc_html_e('Brands', 'perfect-woocommerce-brands'); ?></legend>
137
  <label>
138
+ <input id="pwb-first-featured-brands" type="checkbox" <?php checked($featured, true); ?>>
139
+ <?php esc_html_e('Show featured brands first', 'perfect-woocommerce-brands'); ?>
140
  </label>
141
+ <?php
142
  return ob_get_clean();
143
  }
144
  }
145
 
146
+ public function save_screen_options()
147
+ {
148
+ if (isset($_POST['new_val'])) {
149
+ $new_val = ($_POST['new_val'] == 'true') ? true : false;
150
+ update_user_option(self::$current_user->ID, 'pwb-first-featured-brands', $new_val);
151
  }
152
  wp_die();
153
  }
 
154
  }
perfect-woocommerce-brands.php CHANGED
@@ -4,13 +4,13 @@
4
  * Plugin Name: Perfect Brands for WooCommerce
5
  * Plugin URI: https://quadlayers.com/portfolio/perfect-woocommerce-brands/
6
  * Description: Perfect WooCommerce Brands allows you to show product brands in your WooCommerce based store.
7
- * Version: 1.8.5
8
  * Author: QuadLayers
9
  * Author URI: https://quadlayers.com
10
  * Text Domain: perfect-woocommerce-brands
11
  * Domain Path: /lang
12
  * License: GPLv3
13
- * Perfect WooCommerce Brands version 1.8.5, Copyright (C) 2019 QuadLayers
14
  * Perfect WooCommerce Brands is free software: you can redistribute it and/or modify
15
  * it under the terms of the GNU General Public License as published by
16
  * the Free Software Foundation, either version 3 of the License, or
@@ -36,7 +36,7 @@ define('PWB_PLUGIN_FILE', __FILE__);
36
  define('PWB_PLUGIN_URL', plugins_url('', __FILE__));
37
  define('PWB_PLUGIN_DIR', __DIR__ . DIRECTORY_SEPARATOR);
38
  define('PWB_PLUGIN_BASENAME', plugin_basename(__FILE__));
39
- define('PWB_PLUGIN_VERSION', '1.8.5');
40
  define('PWB_PLUGIN_NAME', 'Perfect WooCommerce Brands');
41
  define('PWB_PREFIX', 'pwb');
42
  define('PWB_REVIEW_URL', 'https://wordpress.org/support/plugin/perfect-woocommerce-brands/reviews/?filter=5#new-post');
4
  * Plugin Name: Perfect Brands for WooCommerce
5
  * Plugin URI: https://quadlayers.com/portfolio/perfect-woocommerce-brands/
6
  * Description: Perfect WooCommerce Brands allows you to show product brands in your WooCommerce based store.
7
+ * Version: 1.8.6
8
  * Author: QuadLayers
9
  * Author URI: https://quadlayers.com
10
  * Text Domain: perfect-woocommerce-brands
11
  * Domain Path: /lang
12
  * License: GPLv3
13
+ * Perfect WooCommerce Brands version 1.8.6, Copyright (C) 2019 QuadLayers
14
  * Perfect WooCommerce Brands is free software: you can redistribute it and/or modify
15
  * it under the terms of the GNU General Public License as published by
16
  * the Free Software Foundation, either version 3 of the License, or
36
  define('PWB_PLUGIN_URL', plugins_url('', __FILE__));
37
  define('PWB_PLUGIN_DIR', __DIR__ . DIRECTORY_SEPARATOR);
38
  define('PWB_PLUGIN_BASENAME', plugin_basename(__FILE__));
39
+ define('PWB_PLUGIN_VERSION', '1.8.6');
40
  define('PWB_PLUGIN_NAME', 'Perfect WooCommerce Brands');
41
  define('PWB_PREFIX', 'pwb');
42
  define('PWB_REVIEW_URL', 'https://wordpress.org/support/plugin/perfect-woocommerce-brands/reviews/?filter=5#new-post');
readme.txt CHANGED
@@ -3,11 +3,11 @@ Contributors: quadlayers, titodevera
3
  Donate link: https://quadlayers.com
4
  Tags: woocommerce, woocommerce brands, woocommerce product, woocommerce manufacturer, woocommerce supplier, e-commerce
5
  Requires at least: 4.7
6
- Tested up to: 5.5.1
7
  Requires PHP: 5.6
8
- Stable tag: 1.8.5
9
  WC requires at least: 3.0
10
- WC tested up to: 4.6.3
11
  License: GPLv3
12
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
13
 
@@ -90,6 +90,8 @@ You can also contribute [translating the plugin](https://translate.wordpress.org
90
 
91
 
92
  == Changelog ==
 
 
93
  = 1.8.5 =
94
  * Fix: security issues
95
  = 1.8.4 =
3
  Donate link: https://quadlayers.com
4
  Tags: woocommerce, woocommerce brands, woocommerce product, woocommerce manufacturer, woocommerce supplier, e-commerce
5
  Requires at least: 4.7
6
+ Tested up to: 5.6
7
  Requires PHP: 5.6
8
+ Stable tag: 1.8.6
9
  WC requires at least: 3.0
10
+ WC tested up to: 4.9.1
11
  License: GPLv3
12
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
13
 
90
 
91
 
92
  == Changelog ==
93
+ = 1.8.6 =
94
+ * New: remove filters button
95
  = 1.8.5 =
96
  * Fix: security issues
97
  = 1.8.4 =
templates/widgets/filter-by-brand.php CHANGED
@@ -19,6 +19,9 @@ defined('ABSPATH') or die('No script kiddies please!');
19
  <?php endforeach; ?>
20
  </ul>
21
  <?php if (!$hide_submit_btn) : ?>
22
- <button><?php esc_html_e('Apply filter', 'perfect-woocommerce-brands') ?></button>
 
 
 
23
  <?php endif; ?>
24
  </div>
19
  <?php endforeach; ?>
20
  </ul>
21
  <?php if (!$hide_submit_btn) : ?>
22
+ <button class="pwb-apply-filter"><?php esc_html_e('Apply filter', 'perfect-woocommerce-brands') ?></button>
23
+ <?php endif; ?>
24
+ <?php if (!$hide_submit_btn && !empty($_GET['pwb-brand-filter'])) : ?>
25
+ <button class="pwb-remove-filter"><?php esc_html_e('Remove filter', 'perfect-woocommerce-brands') ?></button>
26
  <?php endif; ?>
27
  </div>