YITH WooCommerce Ajax Product Filter - Version 1.2.0

Version Description

  • Added: Dropdown style
  • Added: Support to Wordpress 3.8
  • Fixed: Error with non-latin languages
  • Fixed: Improved WPML compatibility
Download this release

Release Info

Developer yithemes
Plugin Icon 128x128 YITH WooCommerce Ajax Product Filter
Version 1.2.0
Comparing to
See all releases

Code changes from version 1.1.2 to 1.2.0

README.txt CHANGED
@@ -3,8 +3,8 @@
3
  Contributors: yithemes
4
  Tags: woocommerce, widget, ajax, ajax filtered nav, ajax navigation, ajax filtered navigation
5
  Requires at least: 3.5.1
6
- Tested up to: 3.5.1
7
- Stable tag: 1.1.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -13,8 +13,8 @@ YITH WooCommerce Ajax Navigation allows you to filter the products in the Shop p
13
 
14
  == Description ==
15
 
16
- YITH WooCommerce Ajax Navigation allows you to filter the products in the Shop page without reloading the page. The plugin also includes two new types of Product Attributes visualizations: Color and Label.
17
- With Color display type you're able to assign a color (selected from a Color Picker) to each Product Attributes. With Label Color display you're able to assign a label (3 chars max) to your Product Attributes.
18
 
19
  Working demos are available here:
20
  **[LIVE DEMO 1](http://demo.yithemes.com/room09/shop/)** - **[LIVE DEMO 2](http://demo.yithemes.com/bazar/shop/)**
@@ -60,10 +60,18 @@ In order to display the widget you need to assign it to the sidebar in the Shop
60
 
61
  1. The widget in action with "Color" type selected
62
  2. The widget in action with "Label" type selected
63
- 3. The final result
 
64
 
65
  == Changelog ==
66
 
 
 
 
 
 
 
 
67
  = 1.1.2 =
68
 
69
  * Added: Title to the color filters
3
  Contributors: yithemes
4
  Tags: woocommerce, widget, ajax, ajax filtered nav, ajax navigation, ajax filtered navigation
5
  Requires at least: 3.5.1
6
+ Tested up to: 3.8
7
+ Stable tag: 1.2.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
13
 
14
  == Description ==
15
 
16
+ YITH WooCommerce Ajax Navigation allows you to filter the products in the Shop page without reloading the page. The plugin also includes four new types of Product Attributes visualizations: Color, Label, List and Dropdown.
17
+ With Color display type you're able to assign a color (selected from a Color Picker) to each Product Attributes. With Label Color display you're able to assign a label (3 chars max) to your Product Attributes. With List display your products attributes in a list. With Dropdown you're able to display your products attributes like a select.
18
 
19
  Working demos are available here:
20
  **[LIVE DEMO 1](http://demo.yithemes.com/room09/shop/)** - **[LIVE DEMO 2](http://demo.yithemes.com/bazar/shop/)**
60
 
61
  1. The widget in action with "Color" type selected
62
  2. The widget in action with "Label" type selected
63
+ 3. The widget in action with "Dropdown" type selected
64
+ 4. The final result
65
 
66
  == Changelog ==
67
 
68
+ = 1.2.0 =
69
+
70
+ * Added: Dropdown style
71
+ * Added: Support to Wordpress 3.8
72
+ * Fixed: Error with non-latin languages
73
+ * Fixed: Improved WPML compatibility
74
+
75
  = 1.1.2 =
76
 
77
  * Added: Title to the color filters
assets/css/frontend.css CHANGED
@@ -44,7 +44,6 @@
44
  .woocommerce-page .widget_layered_nav ul.yith-wcan-color li.chosen span {
45
  border: 1px solid #444;
46
  background-image: none;
47
-
48
  -webkit-border-radius: 0;
49
  -moz-border-radius: 0;
50
  border-radius: 0;
@@ -82,3 +81,62 @@
82
  border-radius: 0;
83
  }
84
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
  .woocommerce-page .widget_layered_nav ul.yith-wcan-color li.chosen span {
45
  border: 1px solid #444;
46
  background-image: none;
 
47
  -webkit-border-radius: 0;
48
  -moz-border-radius: 0;
49
  border-radius: 0;
81
  border-radius: 0;
82
  }
83
 
84
+ /* DROPDOWN STYLE */
85
+
86
+ .yit-wcan-select-open {
87
+ background: transparent url(../images/select-arrow.png) top 15px right no-repeat;
88
+ border: 1px solid #cecece;
89
+ color: #838383;
90
+ display: block;
91
+ line-height: 16px;
92
+ margin-bottom: 15px;
93
+ margin-top: 15px;
94
+ overflow: hidden;
95
+ padding: 10px 30px 10px 10px;
96
+ }
97
+
98
+ .yit-wcan-select-open.active {
99
+ background: transparent url(../images/select-arrow.png) bottom 15px right no-repeat;
100
+ }
101
+
102
+ .yith-wcan-select-wrapper {
103
+ background: #ffffff;
104
+ margin: 0 4px 4px 0;
105
+ max-height: 240px;
106
+ padding-bottom: 30px;
107
+ position: absolute;
108
+ overflow-x: hidden;
109
+ overflow-y: auto;
110
+ width: 260px;
111
+ z-index: -1;
112
+ border: 1px solid #cecece;
113
+ padding: 10px 0px;
114
+ margin-top: -16px;
115
+ }
116
+ .yith-wcan-select-wrapper ul.yith-wcan-select.yith-wcan li
117
+ {
118
+ padding: 5px 8px;
119
+ border-bottom: 1px solid transparent;
120
+ border-top: 1px solid transparent;
121
+ }
122
+ .yith-wcan-select-wrapper ul.yith-wcan-select.yith-wcan li:hover,
123
+ .woocommerce-page .widget_layered_nav .yith-wcan-select-wrapper ul li.chosen{
124
+ -webkit-box-shadow: 0px 3px 0px #F2F2F2 inset, 0px -3px 0px #F2F2F2 inset;
125
+ -moz-box-shadow: 0px 3px 0px #f2f2f2 inset, 0px -3px 0px #f2f2f2 inset;
126
+ box-shadow: 0px 3px 0px #F2F2F2 inset, 0px -3px 0px #F2F2F2 inset;
127
+ border-bottom: 1px solid #cecece;
128
+ border-top: 1px solid #cecece;
129
+ }
130
+ .yith-wcan-select-wrapper ul.yith-wcan-select.yith-wcan li a, .widget .yit-wcan-select-open {
131
+ width: 100%;
132
+ color: #838383;
133
+ }
134
+ .yith-wcan-select-wrapper ul.yith-wcan-select.yith-wcan li a:hover, .widget .yit-wcan-select-open:hover {
135
+ text-decoration: none;
136
+ color: #838383;
137
+ }
138
+
139
+ .woocommerce-page .widget_layered_nav .yith-wcan-select-wrapper ul li.chosen a, .woocommerce-page .widget_layered_nav .yith-wcan-select-wrapper ul li.chosen a{
140
+ background: transparent url(../images/cross.png) bottom 6px left no-repeat;
141
+ border: none;
142
+ }
assets/images/cross.png ADDED
Binary file
assets/images/select-arrow.png ADDED
Binary file
assets/js/yith-wcan-admin.js CHANGED
@@ -3,7 +3,7 @@
3
  *
4
  * @author Your Inspiration Themes
5
  * @package YITH WooCommerce Ajax Navigation
6
- * @version 1.1.2
7
  */
8
  jQuery(function($){
9
 
3
  *
4
  * @author Your Inspiration Themes
5
  * @package YITH WooCommerce Ajax Navigation
6
+ * @version 1.2.0
7
  */
8
  jQuery(function($){
9
 
assets/js/yith-wcan-frontend.js CHANGED
@@ -3,7 +3,7 @@
3
  *
4
  * @author Your Inspiration Themes
5
  * @package YITH WooCommerce Ajax Navigation
6
- * @version 1.1.2
7
  */
8
  jQuery(function($){
9
  /**
@@ -18,14 +18,26 @@ jQuery(function($){
18
  $.merge(j,e)}return $(h)},arrVer=function(d,c,a){for(var j=d.match(/%[^%]*%/g)||[],h=[],e=0;e<c.length;e++){for(var f=d,m=0;m<j.length;m++)var g=j[m].substr(1,j[m].length-2),f=f.replace(j[m],c[e][g]);h=$.merge(h,nonArrVer(f,a))}return $(h)};
19
  $.jseldom=function(d){if(2==arguments.length&&$.isPlainObject(arguments[1]))return arrVer.apply(this,[arguments[0],[arguments[1]]]);if(1==arguments.length||2==arguments.length&&!$.isArray(arguments[1]))return nonArrVer.apply(this,arguments);if(2==arguments.length)return arrVer.apply(this,arguments)};
20
 
21
-
22
  //wrap the container
23
  $(yith_wcan.container).wrap('<div class="yit-wcan-container"></div>');
24
  $('.woocommerce-info').wrap('<div class="yit-wcan-container"></div>');
25
 
26
- $(document).on('click', '.yith-wcan a', function(e){
27
- e.preventDefault();
28
- var href = this.href;
 
 
 
 
 
 
 
 
 
 
 
 
 
29
 
30
  //loading
31
  $(yith_wcan.container).html('').addClass('yith-wcan-loading');
@@ -84,6 +96,90 @@ jQuery(function($){
84
  $(document).trigger("ready");
85
  $(document).trigger("yith-wcan-ajax-filtered");
86
  }
 
87
  });
88
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
89
  });
3
  *
4
  * @author Your Inspiration Themes
5
  * @package YITH WooCommerce Ajax Navigation
6
+ * @version 1.2.0
7
  */
8
  jQuery(function($){
9
  /**
18
  $.merge(j,e)}return $(h)},arrVer=function(d,c,a){for(var j=d.match(/%[^%]*%/g)||[],h=[],e=0;e<c.length;e++){for(var f=d,m=0;m<j.length;m++)var g=j[m].substr(1,j[m].length-2),f=f.replace(j[m],c[e][g]);h=$.merge(h,nonArrVer(f,a))}return $(h)};
19
  $.jseldom=function(d){if(2==arguments.length&&$.isPlainObject(arguments[1]))return arrVer.apply(this,[arguments[0],[arguments[1]]]);if(1==arguments.length||2==arguments.length&&!$.isArray(arguments[1]))return nonArrVer.apply(this,arguments);if(2==arguments.length)return arrVer.apply(this,arguments)};
20
 
 
21
  //wrap the container
22
  $(yith_wcan.container).wrap('<div class="yit-wcan-container"></div>');
23
  $('.woocommerce-info').wrap('<div class="yit-wcan-container"></div>');
24
 
25
+ $(document).on('click', '.yith-wcan a', function(e){
26
+
27
+ e.preventDefault();
28
+ var href = this.href;
29
+
30
+ if( $(this).data('type') == 'select' ) {
31
+
32
+ $(this).parents('div.yith-woo-ajax-navigation').find('a.yit-wcan-select-open').removeClass('active');
33
+
34
+ $(this).parent().find('div.yith-wcan-select-wrapper').animate({
35
+
36
+ visibility: "hidden",
37
+ opacity: 0
38
+
39
+ }, 300);
40
+ }
41
 
42
  //loading
43
  $(yith_wcan.container).html('').addClass('yith-wcan-loading');
96
  $(document).trigger("ready");
97
  $(document).trigger("yith-wcan-ajax-filtered");
98
  }
99
+
100
  });
101
  });
102
+
103
+ /*AJAX NAVIGATION DROPDOWN STYLE*/
104
+
105
+ function yit_open_select_dropdown(element){
106
+
107
+ $(element).parent().find('div.yith-wcan-select-wrapper').css("z-index", "1").animate({
108
+
109
+ visibility: "visible",
110
+ opacity: 1
111
+
112
+
113
+ }, 300);
114
+
115
+ $(element).parent().find('a.yit-wcan-select-open').addClass('active');
116
+ }
117
+
118
+ function yit_close_select_dropdown(element){
119
+
120
+ $(element).parent().find('div.yith-wcan-select-wrapper').css("z-index", "-1").animate({
121
+
122
+ visibility: "hidden",
123
+ opacity: 0
124
+
125
+ }, 300);
126
+
127
+ $(element).parent().find('a.yit-wcan-select-open').removeClass('active');
128
+ }
129
+
130
+ var yit_hidden_filters_wrapper = function () {
131
+
132
+ $('div.yith-wcan-select-wrapper').animate({
133
+
134
+ visibility: "hidden",
135
+ opacity: 0
136
+
137
+ }, 0);
138
+
139
+ $('a.yit-wcan-select-open').removeClass('active');
140
+ }
141
+
142
+ var yit_active_filter = function() {
143
+
144
+ var filter_number = $('div.yith-wcan-select-wrapper ul.yith-wcan-select li.chosen').length;
145
+
146
+ yit_hidden_filters_wrapper();
147
+
148
+ $('div.yith-wcan-select-wrapper').each(function() {
149
+
150
+ var filter_name="";
151
+ var chosen = $(this).find('ul.yith-wcan-select li.chosen').each(function(){
152
+ filter_name += $(this).text() + ', ';
153
+ });
154
+
155
+ filter_name = filter_name.substring(0, filter_name.length - 2);
156
+
157
+ if(filter_name != "") {
158
+ $(this).parent().find('a.yit-wcan-select-open').text(filter_name);
159
+ }
160
+ })
161
+ }
162
+
163
+ $(document).on('click' , 'a.yit-wcan-select-open.active' , function(e) {
164
+ e.preventDefault();
165
+ yit_close_select_dropdown(this);
166
+ });
167
+
168
+ $(document).on('click' , 'a.yit-wcan-select-open:not(.active)' , function(e) {
169
+ e.preventDefault();
170
+ yit_open_select_dropdown(this);
171
+ });
172
+
173
+ $(document).on('ready yith-wcan-ajax-filtered', yit_active_filter);
174
+
175
+ $(document).on('ready', yit_hidden_filters_wrapper );
176
+
177
+ $('body').on('click', function(e){
178
+
179
+ if( !$(e.target).hasClass('yit-wcan-select-open') ) {
180
+ yit_hidden_filters_wrapper();
181
+ }
182
+
183
+ });
184
+
185
  });
assets/js/yith-wcan-frontend.min.js CHANGED
@@ -1,15 +1,11 @@
1
- /**
2
- * Frontend
3
- *
4
- * @author Your Inspiration Themes
5
- * @package YITH WooCommerce Ajax Navigation
6
- * @version 1.1.2
7
- */
8
- jQuery(function(c){var t=/(?!(\[))(\.)[^.#[]*/g,u=/(#)[^.#[]*/,v=/^[\w]+/,w=/^[\w]+$/,r=function(p,q){var a=[];if(w.test(p))a=[{tag:p}];else{for(var a=p,e={sel:[],val:[]},f=[],h=!1,g="",k=[],b=0,l=a.length;b<l;b++){var d=a.charAt(b);if(h)if("\\"===d&&b+1<a.length)k.push(a.charAt(++b));else if(g===d)g="",k.push(d);else if(("'"===d||'"'===d)&&""===g)g=d,k.push(d);else if("]"===d&&""===g)e.val.push(k.join("")),k=[],h=!1;else{if("]"!==d||""!==g)""===g&&","===d?(e.val.push(k.join("")),k=[]):k.push(d)}else"\\"===
9
- d&&b+1<a.length?h&&k.push(a.charAt(++b)):"["===d&&""===g?h=!0:" "===d||"+"===d?(e.sel=e.sel.join(""),f.push(e),"+"===d&&f.push({sel:"+",val:""}),e={sel:[],val:[]}):" "!==d&&"]"!==d&&e.sel.push(d)}if(0!=e.sel.length||0!=e.val.length)e.sel=e.sel.join(""),f.push(e);for(b=0;b<f.length;b++){e=f[b].sel;if("+"===e)m.tag=e;else{var m=[];m.tag=v.exec(e);m.id=u.exec(e);m.id&&c.isArray(m.id)&&(m.id=m.id[0].substr(1));m.tag||(m.tag="div");m.vars=[];for(a=0;a<f[b].val.length;a++)g=f[b].val[a].indexOf("="),h=f[b].val[a].substr(0,
10
- g),g=f[b].val[a].substr(g+1),g=g.replace(/^[\s]*[\"\']*|[\"\']*[\s]*$/g,""),"text"===h?m.text=g:m.vars.push([h,g]);e=e.match(t);h=[];if(e){for(a=0;a<e.length;a++)h.push(e[a].substr(1));m.className=h.join(" ")}}f[b]=m}a=f}m=[];"undefined"===typeof q&&(q=1);e=[];f=[];h=[];g=document.createElement("div");for(b=k=0;b<a.length;b++){if("+"==a[b].tag)f=h.slice(),--k;else{for(l=0;l<q;l++)if("input"==a[b].tag){d=[];d.push("<"+a[b].tag);a[b].id&&d.push("id='"+a[b].id+"'");a[b].className&&(d.push("class='"+
11
- a[b].className),b+1===a.length&&d.push(lastClass),d.push("'"));if(a[b].vars)for(var n=0;n<a[b].vars.length;n++)d.push(a[b].vars[n][0]+"='"+a[b].vars[n][1]+"'");a[b].text&&d.push("value='"+a[b].text+"'");d.push("/>");h[l]=f[l];f[l]?(f[l].innerHTML+=d.join(" "),f[l]=f[l].lastChild):(g.innerHTML=d.join(" "),f[l]=g.removeChild(g.firstChild))}else{d=document.createElement(a[b].tag);if(a[b].vars)for(n=0;n<a[b].vars.length;n++)console.log(a[b].tag,a[b].vars[n]),d.setAttribute(a[b].vars[n][0],a[b].vars[n][1]);
12
- a[b].id&&(d.id=a[b].id);a[b].className&&(d.className=a[b].className);a[b].text&&d.appendChild(document.createTextNode(a[b].text));h[l]=f[l];f[l]=f[l]?f[l].appendChild(d):d}k++||Array.prototype.push.apply(e,f)}m=c.merge(m,f)}return c(e)},s=function(p,q,a){for(var e=p.match(/%[^%]*%/g)||[],f=[],h=0;h<q.length;h++){for(var g=p,k=0;k<e.length;k++)var b=e[k].substr(1,e[k].length-2),g=g.replace(e[k],q[h][b]);f=c.merge(f,r(g,a))}return c(f)};c.jseldom=function(p){if(2==arguments.length&&c.isPlainObject(arguments[1]))return s.apply(this,
13
- [arguments[0],[arguments[1]]]);if(1==arguments.length||2==arguments.length&&!c.isArray(arguments[1]))return r.apply(this,arguments);if(2==arguments.length)return s.apply(this,arguments)};c(yith_wcan.container).wrap('<div class="yit-wcan-container"></div>');c(".woocommerce-info").wrap('<div class="yit-wcan-container"></div>');c(document).on("click",".yith-wcan a",function(p){p.preventDefault();var q=this.href;c(yith_wcan.container).html("").addClass("yith-wcan-loading");c(yith_wcan.pagination).hide();
14
- c(yith_wcan.result_count).hide();c.ajax({url:q,success:function(a){c(yith_wcan.container).removeClass("yith-wcan-loading");0<c(a).find(yith_wcan.container).length?c(".yit-wcan-container").html(c(a).find(yith_wcan.container)):c(".yit-wcan-container").html(c(a).find(".woocommerce-info"));0<c(a).find(yith_wcan.pagination).length&&(0==c(yith_wcan.pagination).length&&c.jseldom(yith_wcan.pagination).insertAfter(c(yith_wcan.container)),c(yith_wcan.pagination).html(c(a).find(yith_wcan.pagination).html()).show());
15
- 0<c(a).find(yith_wcan.result_count).length&&c(yith_wcan.result_count).html(c(a).find(yith_wcan.result_count).html()).show();c(".yith-woo-ajax-navigation").each(function(){var e=c(this).attr("id");c(this).html(c(a).find("#"+e).html());""==c(this).text()?c(this).hide():c(this).show()});navigator.userAgent.match(/msie/i)||window.history.pushState({pageTitle:a.pageTitle},"",q);c(document).trigger("ready");c(document).trigger("yith-wcan-ajax-filtered")}})})});
1
+ jQuery(function(a){var u=/(?!(\[))(\.)[^.#[]*/g,v=/(#)[^.#[]*/,w=/^[\w]+/,x=/^[\w]+$/,s=function(h,q){var b=[];if(x.test(h))b=[{tag:h}];else{for(var b=h,e={sel:[],val:[]},f=[],k=!1,g="",l=[],c=0,m=b.length;c<m;c++){var d=b.charAt(c);if(k)if("\\"===d&&c+1<b.length)l.push(b.charAt(++c));else if(g===d)g="",l.push(d);else if(("'"===d||'"'===d)&&""===g)g=d,l.push(d);else if("]"===d&&""===g)e.val.push(l.join("")),l=[],k=!1;else{if("]"!==d||""!==g)""===g&&","===d?(e.val.push(l.join("")),l=[]):l.push(d)}else"\\"===
2
+ d&&c+1<b.length?k&&l.push(b.charAt(++c)):"["===d&&""===g?k=!0:" "===d||"+"===d?(e.sel=e.sel.join(""),f.push(e),"+"===d&&f.push({sel:"+",val:""}),e={sel:[],val:[]}):" "!==d&&"]"!==d&&e.sel.push(d)}if(0!=e.sel.length||0!=e.val.length)e.sel=e.sel.join(""),f.push(e);for(c=0;c<f.length;c++){e=f[c].sel;if("+"===e)n.tag=e;else{var n=[];n.tag=w.exec(e);n.id=v.exec(e);n.id&&a.isArray(n.id)&&(n.id=n.id[0].substr(1));n.tag||(n.tag="div");n.vars=[];for(b=0;b<f[c].val.length;b++)g=f[c].val[b].indexOf("="),k=f[c].val[b].substr(0,
3
+ g),g=f[c].val[b].substr(g+1),g=g.replace(/^[\s]*[\"\']*|[\"\']*[\s]*$/g,""),"text"===k?n.text=g:n.vars.push([k,g]);e=e.match(u);k=[];if(e){for(b=0;b<e.length;b++)k.push(e[b].substr(1));n.className=k.join(" ")}}f[c]=n}b=f}n=[];"undefined"===typeof q&&(q=1);e=[];f=[];k=[];g=document.createElement("div");for(c=l=0;c<b.length;c++){if("+"==b[c].tag)f=k.slice(),--l;else{for(m=0;m<q;m++)if("input"==b[c].tag){d=[];d.push("<"+b[c].tag);b[c].id&&d.push("id='"+b[c].id+"'");b[c].className&&(d.push("class='"+
4
+ b[c].className),c+1===b.length&&d.push(lastClass),d.push("'"));if(b[c].vars)for(var p=0;p<b[c].vars.length;p++)d.push(b[c].vars[p][0]+"='"+b[c].vars[p][1]+"'");b[c].text&&d.push("value='"+b[c].text+"'");d.push("/>");k[m]=f[m];f[m]?(f[m].innerHTML+=d.join(" "),f[m]=f[m].lastChild):(g.innerHTML=d.join(" "),f[m]=g.removeChild(g.firstChild))}else{d=document.createElement(b[c].tag);if(b[c].vars)for(p=0;p<b[c].vars.length;p++)console.log(b[c].tag,b[c].vars[p]),d.setAttribute(b[c].vars[p][0],b[c].vars[p][1]);
5
+ b[c].id&&(d.id=b[c].id);b[c].className&&(d.className=b[c].className);b[c].text&&d.appendChild(document.createTextNode(b[c].text));k[m]=f[m];f[m]=f[m]?f[m].appendChild(d):d}l++||Array.prototype.push.apply(e,f)}n=a.merge(n,f)}return a(e)},t=function(h,q,b){for(var e=h.match(/%[^%]*%/g)||[],f=[],k=0;k<q.length;k++){for(var g=h,l=0;l<e.length;l++)var c=e[l].substr(1,e[l].length-2),g=g.replace(e[l],q[k][c]);f=a.merge(f,s(g,b))}return a(f)};a.jseldom=function(h){if(2==arguments.length&&a.isPlainObject(arguments[1]))return t.apply(this,
6
+ [arguments[0],[arguments[1]]]);if(1==arguments.length||2==arguments.length&&!a.isArray(arguments[1]))return s.apply(this,arguments);if(2==arguments.length)return t.apply(this,arguments)};a(yith_wcan.container).wrap('<div class="yit-wcan-container"></div>');a(".woocommerce-info").wrap('<div class="yit-wcan-container"></div>');a(document).on("click",".yith-wcan a",function(h){h.preventDefault();var q=this.href;"select"==a(this).data("type")&&(a(this).parents("div.yith-woo-ajax-navigation").find("a.yit-wcan-select-open").removeClass("active"),
7
+ a(this).parent().find("div.yith-wcan-select-wrapper").animate({visibility:"hidden",opacity:0},300));a(yith_wcan.container).html("").addClass("yith-wcan-loading");a(yith_wcan.pagination).hide();a(yith_wcan.result_count).hide();a.ajax({url:q,success:function(b){a(yith_wcan.container).removeClass("yith-wcan-loading");0<a(b).find(yith_wcan.container).length?a(".yit-wcan-container").html(a(b).find(yith_wcan.container)):a(".yit-wcan-container").html(a(b).find(".woocommerce-info"));0<a(b).find(yith_wcan.pagination).length&&
8
+ (0==a(yith_wcan.pagination).length&&a.jseldom(yith_wcan.pagination).insertAfter(a(yith_wcan.container)),a(yith_wcan.pagination).html(a(b).find(yith_wcan.pagination).html()).show());0<a(b).find(yith_wcan.result_count).length&&a(yith_wcan.result_count).html(a(b).find(yith_wcan.result_count).html()).show();a(".yith-woo-ajax-navigation").each(function(){var e=a(this).attr("id");a(this).html(a(b).find("#"+e).html());""==a(this).text()?a(this).hide():a(this).show()});navigator.userAgent.match(/msie/i)||
9
+ window.history.pushState({pageTitle:b.pageTitle},"",q);a(document).trigger("ready");a(document).trigger("yith-wcan-ajax-filtered")}})});var r=function(){a("div.yith-wcan-select-wrapper").animate({visibility:"hidden",opacity:0},0);a("a.yit-wcan-select-open").removeClass("active")};a(document).on("click","a.yit-wcan-select-open.active",function(h){h.preventDefault();a(this).parent().find("div.yith-wcan-select-wrapper").css("z-index","-1").animate({visibility:"hidden",opacity:0},300);a(this).parent().find("a.yit-wcan-select-open").removeClass("active")});
10
+ a(document).on("click","a.yit-wcan-select-open:not(.active)",function(h){h.preventDefault();a(this).parent().find("div.yith-wcan-select-wrapper").css("z-index","1").animate({visibility:"visible",opacity:1},300);a(this).parent().find("a.yit-wcan-select-open").addClass("active")});a(document).on("ready yith-wcan-ajax-filtered",function(){a("div.yith-wcan-select-wrapper ul.yith-wcan-select li.chosen");r();a("div.yith-wcan-select-wrapper").each(function(){var h="";a(this).find("ul.yith-wcan-select li.chosen").each(function(){h+=
11
+ a(this).text()+", "});h=h.substring(0,h.length-2);""!=h&&a(this).parent().find("a.yit-wcan-select-open").text(h)})});a(document).on("ready",r);a("body").on("click",function(h){a(h.target).hasClass("yit-wcan-select-open")||r()})});
 
 
 
 
class.yith-wcan-admin.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @author Your Inspiration Themes
6
  * @package YITH WooCommerce Ajax Navigation
7
- * @version 1.1.2
8
  */
9
 
10
  if ( !defined( 'YITH_WCAN' ) ) { exit; } // Exit if accessed directly
4
  *
5
  * @author Your Inspiration Themes
6
  * @package YITH WooCommerce Ajax Navigation
7
+ * @version 1.2.0
8
  */
9
 
10
  if ( !defined( 'YITH_WCAN' ) ) { exit; } // Exit if accessed directly
class.yith-wcan-frontend.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @author Your Inspiration Themes
6
  * @package YITH WooCommerce Ajax Navigation
7
- * @version 1.1.2
8
  */
9
 
10
  if ( !defined( 'YITH_WCAN' ) ) { exit; } // Exit if accessed directly
@@ -96,12 +96,26 @@ if( !class_exists( 'YITH_WCAN_Frontend' ) ) {
96
 
97
  $_chosen_attributes = $_attributes_array = array();
98
 
99
- $attribute_taxonomies = $woocommerce->get_attribute_taxonomies();
 
 
 
 
 
 
 
100
  if ( $attribute_taxonomies ) {
101
  foreach ( $attribute_taxonomies as $tax ) {
102
 
103
  $attribute = sanitize_title( $tax->attribute_name );
104
- $taxonomy = $woocommerce->attribute_taxonomy_name( $attribute );
 
 
 
 
 
 
 
105
 
106
  // create an array of product attribute taxonomies
107
  $_attributes_array[] = $taxonomy;
@@ -122,9 +136,17 @@ if( !class_exists( 'YITH_WCAN_Frontend' ) ) {
122
  }
123
  }
124
 
125
- add_filter('loop_shop_post_in', 'woocommerce_layered_nav_query');
 
 
 
 
 
 
126
  }
127
  }
128
 
 
 
129
  }
130
  }
4
  *
5
  * @author Your Inspiration Themes
6
  * @package YITH WooCommerce Ajax Navigation
7
+ * @version 1.2.0
8
  */
9
 
10
  if ( !defined( 'YITH_WCAN' ) ) { exit; } // Exit if accessed directly
96
 
97
  $_chosen_attributes = $_attributes_array = array();
98
 
99
+ /* FIX TO WOOCOMMERCE 2.1 */
100
+ if( function_exists( 'wc_get_attribute_taxonomies' ) ){
101
+ $attribute_taxonomies = wc_get_attribute_taxonomies();
102
+ } else {
103
+ $attribute_taxonomies = $woocommerce->get_attribute_taxonomies();
104
+ }
105
+
106
+
107
  if ( $attribute_taxonomies ) {
108
  foreach ( $attribute_taxonomies as $tax ) {
109
 
110
  $attribute = sanitize_title( $tax->attribute_name );
111
+
112
+ /* FIX TO WOOCOMMERCE 2.1 */
113
+ if ( function_exists( 'wc_attribute_taxonomy_name' ) ) {
114
+ $taxonomy = wc_attribute_taxonomy_name($attribute);
115
+ } else {
116
+ $taxonomy = $woocommerce->attribute_taxonomy_name( $attribute );
117
+ }
118
+
119
 
120
  // create an array of product attribute taxonomies
121
  $_attributes_array[] = $taxonomy;
136
  }
137
  }
138
 
139
+ if( version_compare( preg_replace( '/-beta-([0-9]+)/', '', $woocommerce->version ), '2.1', '<' ) ) {
140
+ add_filter('loop_shop_post_in', 'woocommerce_layered_nav_query' );
141
+ } else {
142
+ add_filter('loop_shop_post_in', array( WC()->query, 'layered_nav_query' ));
143
+ }
144
+
145
+
146
  }
147
  }
148
 
149
+
150
+
151
  }
152
  }
class.yith-wcan-helper.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @author Your Inspiration Themes
6
  * @package YITH WooCommerce Ajax Navigation
7
- * @version 1.1.2
8
  */
9
 
10
  if ( !defined( 'YITH_WCAN' ) ) { exit; } // Exit if accessed directly
@@ -29,11 +29,24 @@ if( !class_exists( 'YITH_WCAN_Helper' ) ) {
29
  if ( ! isset( $woocommerce ) ) return array();
30
 
31
  $attributes = array();
32
- $attribute_taxonomies = $woocommerce->get_attribute_taxonomies();
 
 
 
 
33
 
34
  if( empty( $attribute_taxonomies ) ) return array();
35
  foreach( $attribute_taxonomies as $attribute ) {
36
- if ( taxonomy_exists( $woocommerce->attribute_taxonomy_name( $attribute->attribute_name ) ) ) {
 
 
 
 
 
 
 
 
 
37
  $attributes[] = $attribute->attribute_name;
38
  }
39
  }
4
  *
5
  * @author Your Inspiration Themes
6
  * @package YITH WooCommerce Ajax Navigation
7
+ * @version 1.2.0
8
  */
9
 
10
  if ( !defined( 'YITH_WCAN' ) ) { exit; } // Exit if accessed directly
29
  if ( ! isset( $woocommerce ) ) return array();
30
 
31
  $attributes = array();
32
+ if ( function_exists( 'wc_get_attribute_taxonomies' ) ) {
33
+ $attribute_taxonomies = wc_get_attribute_taxonomies();
34
+ } else {
35
+ $attribute_taxonomies = $woocommerce->get_attribute_taxonomies();
36
+ }
37
 
38
  if( empty( $attribute_taxonomies ) ) return array();
39
  foreach( $attribute_taxonomies as $attribute ) {
40
+
41
+ /* FIX TO WOOCOMMERCE 2.1 */
42
+ if ( function_exists( 'wc_attribute_taxonomy_name' ) ) {
43
+ $taxonomy = wc_attribute_taxonomy_name($attribute->attribute_name);
44
+ } else {
45
+ $taxonomy = $woocommerce->attribute_taxonomy_name( $attribute->attribute_name );
46
+ }
47
+
48
+
49
+ if ( taxonomy_exists( $taxonomy ) ) {
50
  $attributes[] = $attribute->attribute_name;
51
  }
52
  }
class.yith-wcan.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @author Your Inspiration Themes
6
  * @package YITH WooCommerce Ajax Navigation
7
- * @version 1.1.2
8
  */
9
 
10
  if ( !defined( 'YITH_WCAN' ) ) { exit; } // Exit if accessed directly
@@ -22,7 +22,7 @@ if( !class_exists( 'YITH_WCAN' ) ) {
22
  * @var string
23
  * @since 1.0.0
24
  */
25
- public $version = '1.0.0';
26
 
27
  /**
28
  * Plugin object
4
  *
5
  * @author Your Inspiration Themes
6
  * @package YITH WooCommerce Ajax Navigation
7
+ * @version 1.2.0
8
  */
9
 
10
  if ( !defined( 'YITH_WCAN' ) ) { exit; } // Exit if accessed directly
22
  * @var string
23
  * @since 1.0.0
24
  */
25
+ public $version = '1.2.0';
26
 
27
  /**
28
  * Plugin object
functions.yith-wcan.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @author Your Inspiration Themes
6
  * @package YITH WooCommerce Ajax Navigation
7
- * @version 1.1.2
8
  */
9
 
10
  if ( !defined( 'YITH_WCAN' ) ) { exit; } // Exit if accessed directly
4
  *
5
  * @author Your Inspiration Themes
6
  * @package YITH WooCommerce Ajax Navigation
7
+ * @version 1.2.0
8
  */
9
 
10
  if ( !defined( 'YITH_WCAN' ) ) { exit; } // Exit if accessed directly
init.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: YITH WooCommerce Ajax Navigation
4
  * Plugin URI: http://yithemes.com/
5
  * Description: YITH WooCommerce Ajax Navigation allows user to filter products in Shop page without reloading the page.
6
- * Version: 1.1.2
7
  * Author: Your Inspiration Themes
8
  * Author URI: http://yithemes.com/
9
  * Text Domain: yit
@@ -11,7 +11,7 @@
11
  *
12
  * @author Your Inspiration Themes
13
  * @package YITH WooCommerce Ajax Navigation
14
- * @version 1.1.2
15
  */
16
  /* Copyright 2013 Your Inspiration Themes (email : plugins@yithemes.com)
17
 
@@ -46,7 +46,7 @@ function yith_wcan_constructor() {
46
  define( 'YITH_WCAN', true );
47
  define( 'YITH_WCAN_URL', plugin_dir_url( __FILE__ ) );
48
  define( 'YITH_WCAN_DIR', plugin_dir_path( __FILE__ ) );
49
- define( 'YITH_WCAN_VERSION', '1.1.1' );
50
 
51
  // Load required classes and functions
52
  require_once('functions.yith-wcan.php');
3
  * Plugin Name: YITH WooCommerce Ajax Navigation
4
  * Plugin URI: http://yithemes.com/
5
  * Description: YITH WooCommerce Ajax Navigation allows user to filter products in Shop page without reloading the page.
6
+ * Version: 1.2.0
7
  * Author: Your Inspiration Themes
8
  * Author URI: http://yithemes.com/
9
  * Text Domain: yit
11
  *
12
  * @author Your Inspiration Themes
13
  * @package YITH WooCommerce Ajax Navigation
14
+ * @version 1.2.0
15
  */
16
  /* Copyright 2013 Your Inspiration Themes (email : plugins@yithemes.com)
17
 
46
  define( 'YITH_WCAN', true );
47
  define( 'YITH_WCAN_URL', plugin_dir_url( __FILE__ ) );
48
  define( 'YITH_WCAN_DIR', plugin_dir_path( __FILE__ ) );
49
+ define( 'YITH_WCAN_VERSION', '1.2.0' );
50
 
51
  // Load required classes and functions
52
  require_once('functions.yith-wcan.php');
languages/default.po CHANGED
@@ -2,8 +2,8 @@ msgid ""
2
  msgstr ""
3
  "Project-Id-Version: YITH WooCommerce Ajax Navigation v1.0.0\n"
4
  "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2013-07-19 09:27+0100\n"
6
- "PO-Revision-Date: 2013-07-19 09:29+0100\n"
7
  "Last-Translator: Your Inspiration Themes <plugins@yithemes.com>\n"
8
  "Language-Team: \n"
9
  "Language: en_US\n"
@@ -26,7 +26,7 @@ msgstr ""
26
 
27
  # @ yit
28
  #: functions.yith-wcan.php:52
29
- #: widgets/class.yith-wcan-navigation-widget.php:535
30
  msgid "Color"
31
  msgstr ""
32
 
@@ -45,47 +45,55 @@ msgstr ""
45
  msgid "YITH WooCommerce Ajax Navigation"
46
  msgstr ""
47
 
 
 
 
 
48
  # @ yit
49
- #: widgets/class.yith-wcan-navigation-widget.php:516
50
  #: widgets/class.yith-wcan-reset-navigation-widget.php:85
51
  msgid "Title"
52
  msgstr ""
53
 
54
  # @ yit
55
- #: widgets/class.yith-wcan-navigation-widget.php:521
56
  msgid "Attribute:"
57
  msgstr ""
58
 
59
  # @ yit
60
- #: widgets/class.yith-wcan-navigation-widget.php:526
61
  msgid "Query Type:"
62
  msgstr ""
63
 
64
  # @ yit
65
- #: widgets/class.yith-wcan-navigation-widget.php:528
66
  msgid "AND"
67
  msgstr ""
68
 
69
  # @ yit
70
- #: widgets/class.yith-wcan-navigation-widget.php:529
71
  msgid "OR"
72
  msgstr ""
73
 
74
  # @ yit
75
- #: widgets/class.yith-wcan-navigation-widget.php:532
76
  msgid "Type:"
77
  msgstr ""
78
 
79
  # @ yit
80
- #: widgets/class.yith-wcan-navigation-widget.php:534
81
  msgid "List"
82
  msgstr ""
83
 
84
  # @ yit
85
- #: widgets/class.yith-wcan-navigation-widget.php:536
86
  msgid "Label"
87
  msgstr ""
88
 
 
 
 
 
89
  #: widgets/class.yith-wcan-reset-navigation-widget.php:21
90
  msgid "Reset all filters setted by YITH WooCommerce Ajax Navigation"
91
  msgstr ""
@@ -103,76 +111,76 @@ msgid "Button Label"
103
  msgstr ""
104
 
105
  # @ yit
106
- #: yit-common/yith-panel.php:396
107
  msgid "Select a date"
108
  msgstr ""
109
 
110
  # @ yit
111
- #: yit-common/yith-panel.php:397
112
  msgid "Hours"
113
  msgstr ""
114
 
115
  # @ yit
116
- #: yit-common/yith-panel.php:398 yit-common/yith-panel.php:399
117
  msgid "Minutes"
118
  msgstr ""
119
 
120
  # @ yit
121
- #: yit-common/yith-panel.php:407
122
  msgid "Upload"
123
  msgstr ""
124
 
125
  # @ yit
126
- #: yit-common/yith-panel.php:434
127
  msgid "px"
128
  msgstr ""
129
 
130
  # @ yit
131
- #: yit-common/yith-panel.php:435
132
  msgid "em"
133
  msgstr ""
134
 
135
  # @ yit
136
- #: yit-common/yith-panel.php:436
137
  msgid "pt"
138
  msgstr ""
139
 
140
  # @ yit
141
- #: yit-common/yith-panel.php:437
142
  msgid "rem"
143
  msgstr ""
144
 
145
  # @ yit
146
- #: yit-common/yith-panel.php:447
147
  msgid "Select a font family"
148
  msgstr ""
149
 
150
  # @ yit
151
- #: yit-common/yith-panel.php:455
152
  msgid "Regular"
153
  msgstr ""
154
 
155
  # @ yit
156
- #: yit-common/yith-panel.php:456
157
  msgid "Bold"
158
  msgstr ""
159
 
160
  # @ yit
161
- #: yit-common/yith-panel.php:457
162
  msgid "Extra bold"
163
  msgstr ""
164
 
165
  # @ yit
166
- #: yit-common/yith-panel.php:458
167
  msgid "Italic"
168
  msgstr ""
169
 
170
  # @ yit
171
- #: yit-common/yith-panel.php:459
172
  msgid "Italic bold"
173
  msgstr ""
174
 
175
  # @ yit
176
- #: yit-common/yith-panel.php:471
177
  msgid "Click to preview"
178
  msgstr ""
2
  msgstr ""
3
  "Project-Id-Version: YITH WooCommerce Ajax Navigation v1.0.0\n"
4
  "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2014-01-10 10:28+0100\n"
6
+ "PO-Revision-Date: 2014-01-10 10:28+0100\n"
7
  "Last-Translator: Your Inspiration Themes <plugins@yithemes.com>\n"
8
  "Language-Team: \n"
9
  "Language: en_US\n"
26
 
27
  # @ yit
28
  #: functions.yith-wcan.php:52
29
+ #: widgets/class.yith-wcan-navigation-widget.php:695
30
  msgid "Color"
31
  msgstr ""
32
 
45
  msgid "YITH WooCommerce Ajax Navigation"
46
  msgstr ""
47
 
48
+ #: widgets/class.yith-wcan-navigation-widget.php:215
49
+ msgid "Filters List:"
50
+ msgstr ""
51
+
52
  # @ yit
53
+ #: widgets/class.yith-wcan-navigation-widget.php:676
54
  #: widgets/class.yith-wcan-reset-navigation-widget.php:85
55
  msgid "Title"
56
  msgstr ""
57
 
58
  # @ yit
59
+ #: widgets/class.yith-wcan-navigation-widget.php:681
60
  msgid "Attribute:"
61
  msgstr ""
62
 
63
  # @ yit
64
+ #: widgets/class.yith-wcan-navigation-widget.php:686
65
  msgid "Query Type:"
66
  msgstr ""
67
 
68
  # @ yit
69
+ #: widgets/class.yith-wcan-navigation-widget.php:688
70
  msgid "AND"
71
  msgstr ""
72
 
73
  # @ yit
74
+ #: widgets/class.yith-wcan-navigation-widget.php:689
75
  msgid "OR"
76
  msgstr ""
77
 
78
  # @ yit
79
+ #: widgets/class.yith-wcan-navigation-widget.php:692
80
  msgid "Type:"
81
  msgstr ""
82
 
83
  # @ yit
84
+ #: widgets/class.yith-wcan-navigation-widget.php:694
85
  msgid "List"
86
  msgstr ""
87
 
88
  # @ yit
89
+ #: widgets/class.yith-wcan-navigation-widget.php:696
90
  msgid "Label"
91
  msgstr ""
92
 
93
+ #: widgets/class.yith-wcan-navigation-widget.php:697
94
+ msgid "Dropdown"
95
+ msgstr ""
96
+
97
  #: widgets/class.yith-wcan-reset-navigation-widget.php:21
98
  msgid "Reset all filters setted by YITH WooCommerce Ajax Navigation"
99
  msgstr ""
111
  msgstr ""
112
 
113
  # @ yit
114
+ #: yit-common/yith-panel.php:406
115
  msgid "Select a date"
116
  msgstr ""
117
 
118
  # @ yit
119
+ #: yit-common/yith-panel.php:407
120
  msgid "Hours"
121
  msgstr ""
122
 
123
  # @ yit
124
+ #: yit-common/yith-panel.php:408 yit-common/yith-panel.php:409
125
  msgid "Minutes"
126
  msgstr ""
127
 
128
  # @ yit
129
+ #: yit-common/yith-panel.php:417
130
  msgid "Upload"
131
  msgstr ""
132
 
133
  # @ yit
134
+ #: yit-common/yith-panel.php:444
135
  msgid "px"
136
  msgstr ""
137
 
138
  # @ yit
139
+ #: yit-common/yith-panel.php:445
140
  msgid "em"
141
  msgstr ""
142
 
143
  # @ yit
144
+ #: yit-common/yith-panel.php:446
145
  msgid "pt"
146
  msgstr ""
147
 
148
  # @ yit
149
+ #: yit-common/yith-panel.php:447
150
  msgid "rem"
151
  msgstr ""
152
 
153
  # @ yit
154
+ #: yit-common/yith-panel.php:457
155
  msgid "Select a font family"
156
  msgstr ""
157
 
158
  # @ yit
159
+ #: yit-common/yith-panel.php:465
160
  msgid "Regular"
161
  msgstr ""
162
 
163
  # @ yit
164
+ #: yit-common/yith-panel.php:466
165
  msgid "Bold"
166
  msgstr ""
167
 
168
  # @ yit
169
+ #: yit-common/yith-panel.php:467
170
  msgid "Extra bold"
171
  msgstr ""
172
 
173
  # @ yit
174
+ #: yit-common/yith-panel.php:468
175
  msgid "Italic"
176
  msgstr ""
177
 
178
  # @ yit
179
+ #: yit-common/yith-panel.php:469
180
  msgid "Italic bold"
181
  msgstr ""
182
 
183
  # @ yit
184
+ #: yit-common/yith-panel.php:481
185
  msgid "Click to preview"
186
  msgstr ""
languages/yit-it_IT.mo CHANGED
Binary file
languages/yit-it_IT.po CHANGED
@@ -2,8 +2,8 @@ msgid ""
2
  msgstr ""
3
  "Project-Id-Version: YITH WooCommerce Ajax Navigation v1.0.0\n"
4
  "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2013-07-19 09:29+0100\n"
6
- "PO-Revision-Date: 2013-07-19 09:30+0100\n"
7
  "Last-Translator: Your Inspiration Themes <plugins@yithemes.com>\n"
8
  "Language-Team: \n"
9
  "Language: it_IT\n"
@@ -26,7 +26,7 @@ msgstr "Proprietà"
26
 
27
  # @ yit
28
  #: functions.yith-wcan.php:52
29
- #: widgets/class.yith-wcan-navigation-widget.php:535
30
  msgid "Color"
31
  msgstr "Colore"
32
 
@@ -45,47 +45,55 @@ msgstr "Filtra la lista dei prodotti senza ricaricare la pagina"
45
  msgid "YITH WooCommerce Ajax Navigation"
46
  msgstr "YITH WooCommerce Ajax Navigation"
47
 
 
 
 
 
48
  # @ yit
49
- #: widgets/class.yith-wcan-navigation-widget.php:516
50
  #: widgets/class.yith-wcan-reset-navigation-widget.php:85
51
  msgid "Title"
52
  msgstr "Titolo"
53
 
54
  # @ yit
55
- #: widgets/class.yith-wcan-navigation-widget.php:521
56
  msgid "Attribute:"
57
  msgstr "Attributo:"
58
 
59
  # @ yit
60
- #: widgets/class.yith-wcan-navigation-widget.php:526
61
  msgid "Query Type:"
62
  msgstr "Tipo Query:"
63
 
64
  # @ yit
65
- #: widgets/class.yith-wcan-navigation-widget.php:528
66
  msgid "AND"
67
  msgstr "AND"
68
 
69
  # @ yit
70
- #: widgets/class.yith-wcan-navigation-widget.php:529
71
  msgid "OR"
72
  msgstr "OR"
73
 
74
  # @ yit
75
- #: widgets/class.yith-wcan-navigation-widget.php:532
76
  msgid "Type:"
77
  msgstr "Tipo:"
78
 
79
  # @ yit
80
- #: widgets/class.yith-wcan-navigation-widget.php:534
81
  msgid "List"
82
  msgstr "Lista"
83
 
84
  # @ yit
85
- #: widgets/class.yith-wcan-navigation-widget.php:536
86
  msgid "Label"
87
  msgstr "Label"
88
 
 
 
 
 
89
  # @ yit
90
  #: widgets/class.yith-wcan-reset-navigation-widget.php:21
91
  msgid "Reset all filters setted by YITH WooCommerce Ajax Navigation"
@@ -105,76 +113,76 @@ msgid "Button Label"
105
  msgstr "Label Pulsante"
106
 
107
  # @ yit
108
- #: yit-common/yith-panel.php:396
109
  msgid "Select a date"
110
  msgstr "Seleziona una data"
111
 
112
  # @ yit
113
- #: yit-common/yith-panel.php:397
114
  msgid "Hours"
115
  msgstr "Ore"
116
 
117
  # @ yit
118
- #: yit-common/yith-panel.php:398 yit-common/yith-panel.php:399
119
  msgid "Minutes"
120
  msgstr "Minuti"
121
 
122
  # @ yit
123
- #: yit-common/yith-panel.php:407
124
  msgid "Upload"
125
  msgstr "Upload"
126
 
127
  # @ yit
128
- #: yit-common/yith-panel.php:434
129
  msgid "px"
130
  msgstr "px"
131
 
132
  # @ yit
133
- #: yit-common/yith-panel.php:435
134
  msgid "em"
135
  msgstr "em"
136
 
137
  # @ yit
138
- #: yit-common/yith-panel.php:436
139
  msgid "pt"
140
  msgstr "pt"
141
 
142
  # @ yit
143
- #: yit-common/yith-panel.php:437
144
  msgid "rem"
145
  msgstr "rem"
146
 
147
  # @ yit
148
- #: yit-common/yith-panel.php:447
149
  msgid "Select a font family"
150
  msgstr "Seleziona un font"
151
 
152
  # @ yit
153
- #: yit-common/yith-panel.php:455
154
  msgid "Regular"
155
  msgstr "Regular"
156
 
157
  # @ yit
158
- #: yit-common/yith-panel.php:456
159
  msgid "Bold"
160
  msgstr "Bold"
161
 
162
  # @ yit
163
- #: yit-common/yith-panel.php:457
164
  msgid "Extra bold"
165
  msgstr "Extra bold"
166
 
167
  # @ yit
168
- #: yit-common/yith-panel.php:458
169
  msgid "Italic"
170
  msgstr "Italic"
171
 
172
  # @ yit
173
- #: yit-common/yith-panel.php:459
174
  msgid "Italic bold"
175
  msgstr "Italic bold"
176
 
177
  # @ yit
178
- #: yit-common/yith-panel.php:471
179
  msgid "Click to preview"
180
  msgstr "Clicca per anteprima"
2
  msgstr ""
3
  "Project-Id-Version: YITH WooCommerce Ajax Navigation v1.0.0\n"
4
  "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2014-01-10 10:28+0100\n"
6
+ "PO-Revision-Date: 2014-01-10 10:30+0100\n"
7
  "Last-Translator: Your Inspiration Themes <plugins@yithemes.com>\n"
8
  "Language-Team: \n"
9
  "Language: it_IT\n"
26
 
27
  # @ yit
28
  #: functions.yith-wcan.php:52
29
+ #: widgets/class.yith-wcan-navigation-widget.php:695
30
  msgid "Color"
31
  msgstr "Colore"
32
 
45
  msgid "YITH WooCommerce Ajax Navigation"
46
  msgstr "YITH WooCommerce Ajax Navigation"
47
 
48
+ #: widgets/class.yith-wcan-navigation-widget.php:215
49
+ msgid "Filters List:"
50
+ msgstr "Lista Filtri:"
51
+
52
  # @ yit
53
+ #: widgets/class.yith-wcan-navigation-widget.php:676
54
  #: widgets/class.yith-wcan-reset-navigation-widget.php:85
55
  msgid "Title"
56
  msgstr "Titolo"
57
 
58
  # @ yit
59
+ #: widgets/class.yith-wcan-navigation-widget.php:681
60
  msgid "Attribute:"
61
  msgstr "Attributo:"
62
 
63
  # @ yit
64
+ #: widgets/class.yith-wcan-navigation-widget.php:686
65
  msgid "Query Type:"
66
  msgstr "Tipo Query:"
67
 
68
  # @ yit
69
+ #: widgets/class.yith-wcan-navigation-widget.php:688
70
  msgid "AND"
71
  msgstr "AND"
72
 
73
  # @ yit
74
+ #: widgets/class.yith-wcan-navigation-widget.php:689
75
  msgid "OR"
76
  msgstr "OR"
77
 
78
  # @ yit
79
+ #: widgets/class.yith-wcan-navigation-widget.php:692
80
  msgid "Type:"
81
  msgstr "Tipo:"
82
 
83
  # @ yit
84
+ #: widgets/class.yith-wcan-navigation-widget.php:694
85
  msgid "List"
86
  msgstr "Lista"
87
 
88
  # @ yit
89
+ #: widgets/class.yith-wcan-navigation-widget.php:696
90
  msgid "Label"
91
  msgstr "Label"
92
 
93
+ #: widgets/class.yith-wcan-navigation-widget.php:697
94
+ msgid "Dropdown"
95
+ msgstr "Dropdown"
96
+
97
  # @ yit
98
  #: widgets/class.yith-wcan-reset-navigation-widget.php:21
99
  msgid "Reset all filters setted by YITH WooCommerce Ajax Navigation"
113
  msgstr "Label Pulsante"
114
 
115
  # @ yit
116
+ #: yit-common/yith-panel.php:406
117
  msgid "Select a date"
118
  msgstr "Seleziona una data"
119
 
120
  # @ yit
121
+ #: yit-common/yith-panel.php:407
122
  msgid "Hours"
123
  msgstr "Ore"
124
 
125
  # @ yit
126
+ #: yit-common/yith-panel.php:408 yit-common/yith-panel.php:409
127
  msgid "Minutes"
128
  msgstr "Minuti"
129
 
130
  # @ yit
131
+ #: yit-common/yith-panel.php:417
132
  msgid "Upload"
133
  msgstr "Upload"
134
 
135
  # @ yit
136
+ #: yit-common/yith-panel.php:444
137
  msgid "px"
138
  msgstr "px"
139
 
140
  # @ yit
141
+ #: yit-common/yith-panel.php:445
142
  msgid "em"
143
  msgstr "em"
144
 
145
  # @ yit
146
+ #: yit-common/yith-panel.php:446
147
  msgid "pt"
148
  msgstr "pt"
149
 
150
  # @ yit
151
+ #: yit-common/yith-panel.php:447
152
  msgid "rem"
153
  msgstr "rem"
154
 
155
  # @ yit
156
+ #: yit-common/yith-panel.php:457
157
  msgid "Select a font family"
158
  msgstr "Seleziona un font"
159
 
160
  # @ yit
161
+ #: yit-common/yith-panel.php:465
162
  msgid "Regular"
163
  msgstr "Regular"
164
 
165
  # @ yit
166
+ #: yit-common/yith-panel.php:466
167
  msgid "Bold"
168
  msgstr "Bold"
169
 
170
  # @ yit
171
+ #: yit-common/yith-panel.php:467
172
  msgid "Extra bold"
173
  msgstr "Extra bold"
174
 
175
  # @ yit
176
+ #: yit-common/yith-panel.php:468
177
  msgid "Italic"
178
  msgstr "Italic"
179
 
180
  # @ yit
181
+ #: yit-common/yith-panel.php:469
182
  msgid "Italic bold"
183
  msgstr "Italic bold"
184
 
185
  # @ yit
186
+ #: yit-common/yith-panel.php:481
187
  msgid "Click to preview"
188
  msgstr "Clicca per anteprima"
languages/yit.pot CHANGED
@@ -2,8 +2,8 @@ msgid ""
2
  msgstr ""
3
  "Project-Id-Version: YITH WooCommerce Ajax Navigation v1.0.0\n"
4
  "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2013-07-19 09:27+0100\n"
6
- "PO-Revision-Date: 2013-07-19 09:33+0100\n"
7
  "Last-Translator: Your Inspiration Themes <plugins@yithemes.com>\n"
8
  "Language-Team: \n"
9
  "Language: en_US\n"
@@ -12,10 +12,12 @@ msgstr ""
12
  "Content-Transfer-Encoding: 8bit\n"
13
  "Plural-Forms: nplurals=2; plural=n != 1;\n"
14
  "X-Generator: Poedit 1.5.5\n"
15
- "X-Poedit-SourceCharset: UTF-8\n"
16
  "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;"
17
  "_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2\n"
 
18
  "X-Textdomain-Support: yes\n"
 
19
 
20
  # @ yit
21
  #: functions.yith-wcan.php:52 functions.yith-wcan.php:64
@@ -24,7 +26,7 @@ msgstr ""
24
 
25
  # @ yit
26
  #: functions.yith-wcan.php:52
27
- #: widgets/class.yith-wcan-navigation-widget.php:535
28
  msgid "Color"
29
  msgstr ""
30
 
@@ -43,47 +45,55 @@ msgstr ""
43
  msgid "YITH WooCommerce Ajax Navigation"
44
  msgstr ""
45
 
 
 
 
 
46
  # @ yit
47
- #: widgets/class.yith-wcan-navigation-widget.php:516
48
  #: widgets/class.yith-wcan-reset-navigation-widget.php:85
49
  msgid "Title"
50
  msgstr ""
51
 
52
  # @ yit
53
- #: widgets/class.yith-wcan-navigation-widget.php:521
54
  msgid "Attribute:"
55
  msgstr ""
56
 
57
  # @ yit
58
- #: widgets/class.yith-wcan-navigation-widget.php:526
59
  msgid "Query Type:"
60
  msgstr ""
61
 
62
  # @ yit
63
- #: widgets/class.yith-wcan-navigation-widget.php:528
64
  msgid "AND"
65
  msgstr ""
66
 
67
  # @ yit
68
- #: widgets/class.yith-wcan-navigation-widget.php:529
69
  msgid "OR"
70
  msgstr ""
71
 
72
  # @ yit
73
- #: widgets/class.yith-wcan-navigation-widget.php:532
74
  msgid "Type:"
75
  msgstr ""
76
 
77
  # @ yit
78
- #: widgets/class.yith-wcan-navigation-widget.php:534
79
  msgid "List"
80
  msgstr ""
81
 
82
  # @ yit
83
- #: widgets/class.yith-wcan-navigation-widget.php:536
84
  msgid "Label"
85
  msgstr ""
86
 
 
 
 
 
87
  #: widgets/class.yith-wcan-reset-navigation-widget.php:21
88
  msgid "Reset all filters setted by YITH WooCommerce Ajax Navigation"
89
  msgstr ""
@@ -101,76 +111,76 @@ msgid "Button Label"
101
  msgstr ""
102
 
103
  # @ yit
104
- #: yit-common/yith-panel.php:396
105
  msgid "Select a date"
106
  msgstr ""
107
 
108
  # @ yit
109
- #: yit-common/yith-panel.php:397
110
  msgid "Hours"
111
  msgstr ""
112
 
113
  # @ yit
114
- #: yit-common/yith-panel.php:398 yit-common/yith-panel.php:399
115
  msgid "Minutes"
116
  msgstr ""
117
 
118
  # @ yit
119
- #: yit-common/yith-panel.php:407
120
  msgid "Upload"
121
  msgstr ""
122
 
123
  # @ yit
124
- #: yit-common/yith-panel.php:434
125
  msgid "px"
126
  msgstr ""
127
 
128
  # @ yit
129
- #: yit-common/yith-panel.php:435
130
  msgid "em"
131
  msgstr ""
132
 
133
  # @ yit
134
- #: yit-common/yith-panel.php:436
135
  msgid "pt"
136
  msgstr ""
137
 
138
  # @ yit
139
- #: yit-common/yith-panel.php:437
140
  msgid "rem"
141
  msgstr ""
142
 
143
  # @ yit
144
- #: yit-common/yith-panel.php:447
145
  msgid "Select a font family"
146
  msgstr ""
147
 
148
  # @ yit
149
- #: yit-common/yith-panel.php:455
150
  msgid "Regular"
151
  msgstr ""
152
 
153
  # @ yit
154
- #: yit-common/yith-panel.php:456
155
  msgid "Bold"
156
  msgstr ""
157
 
158
  # @ yit
159
- #: yit-common/yith-panel.php:457
160
  msgid "Extra bold"
161
  msgstr ""
162
 
163
  # @ yit
164
- #: yit-common/yith-panel.php:458
165
  msgid "Italic"
166
  msgstr ""
167
 
168
  # @ yit
169
- #: yit-common/yith-panel.php:459
170
  msgid "Italic bold"
171
  msgstr ""
172
 
173
  # @ yit
174
- #: yit-common/yith-panel.php:471
175
  msgid "Click to preview"
176
  msgstr ""
2
  msgstr ""
3
  "Project-Id-Version: YITH WooCommerce Ajax Navigation v1.0.0\n"
4
  "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2014-01-10 10:28+0100\n"
6
+ "PO-Revision-Date: 2014-01-10 10:28+0100\n"
7
  "Last-Translator: Your Inspiration Themes <plugins@yithemes.com>\n"
8
  "Language-Team: \n"
9
  "Language: en_US\n"
12
  "Content-Transfer-Encoding: 8bit\n"
13
  "Plural-Forms: nplurals=2; plural=n != 1;\n"
14
  "X-Generator: Poedit 1.5.5\n"
15
+ "X-Poedit-SourceCharset: utf-8\n"
16
  "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;"
17
  "_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2\n"
18
+ "X-Poedit-Basepath: ../\n"
19
  "X-Textdomain-Support: yes\n"
20
+ "X-Poedit-SearchPath-0: .\n"
21
 
22
  # @ yit
23
  #: functions.yith-wcan.php:52 functions.yith-wcan.php:64
26
 
27
  # @ yit
28
  #: functions.yith-wcan.php:52
29
+ #: widgets/class.yith-wcan-navigation-widget.php:695
30
  msgid "Color"
31
  msgstr ""
32
 
45
  msgid "YITH WooCommerce Ajax Navigation"
46
  msgstr ""
47
 
48
+ #: widgets/class.yith-wcan-navigation-widget.php:215
49
+ msgid "Filters List:"
50
+ msgstr ""
51
+
52
  # @ yit
53
+ #: widgets/class.yith-wcan-navigation-widget.php:676
54
  #: widgets/class.yith-wcan-reset-navigation-widget.php:85
55
  msgid "Title"
56
  msgstr ""
57
 
58
  # @ yit
59
+ #: widgets/class.yith-wcan-navigation-widget.php:681
60
  msgid "Attribute:"
61
  msgstr ""
62
 
63
  # @ yit
64
+ #: widgets/class.yith-wcan-navigation-widget.php:686
65
  msgid "Query Type:"
66
  msgstr ""
67
 
68
  # @ yit
69
+ #: widgets/class.yith-wcan-navigation-widget.php:688
70
  msgid "AND"
71
  msgstr ""
72
 
73
  # @ yit
74
+ #: widgets/class.yith-wcan-navigation-widget.php:689
75
  msgid "OR"
76
  msgstr ""
77
 
78
  # @ yit
79
+ #: widgets/class.yith-wcan-navigation-widget.php:692
80
  msgid "Type:"
81
  msgstr ""
82
 
83
  # @ yit
84
+ #: widgets/class.yith-wcan-navigation-widget.php:694
85
  msgid "List"
86
  msgstr ""
87
 
88
  # @ yit
89
+ #: widgets/class.yith-wcan-navigation-widget.php:696
90
  msgid "Label"
91
  msgstr ""
92
 
93
+ #: widgets/class.yith-wcan-navigation-widget.php:697
94
+ msgid "Dropdown"
95
+ msgstr ""
96
+
97
  #: widgets/class.yith-wcan-reset-navigation-widget.php:21
98
  msgid "Reset all filters setted by YITH WooCommerce Ajax Navigation"
99
  msgstr ""
111
  msgstr ""
112
 
113
  # @ yit
114
+ #: yit-common/yith-panel.php:406
115
  msgid "Select a date"
116
  msgstr ""
117
 
118
  # @ yit
119
+ #: yit-common/yith-panel.php:407
120
  msgid "Hours"
121
  msgstr ""
122
 
123
  # @ yit
124
+ #: yit-common/yith-panel.php:408 yit-common/yith-panel.php:409
125
  msgid "Minutes"
126
  msgstr ""
127
 
128
  # @ yit
129
+ #: yit-common/yith-panel.php:417
130
  msgid "Upload"
131
  msgstr ""
132
 
133
  # @ yit
134
+ #: yit-common/yith-panel.php:444
135
  msgid "px"
136
  msgstr ""
137
 
138
  # @ yit
139
+ #: yit-common/yith-panel.php:445
140
  msgid "em"
141
  msgstr ""
142
 
143
  # @ yit
144
+ #: yit-common/yith-panel.php:446
145
  msgid "pt"
146
  msgstr ""
147
 
148
  # @ yit
149
+ #: yit-common/yith-panel.php:447
150
  msgid "rem"
151
  msgstr ""
152
 
153
  # @ yit
154
+ #: yit-common/yith-panel.php:457
155
  msgid "Select a font family"
156
  msgstr ""
157
 
158
  # @ yit
159
+ #: yit-common/yith-panel.php:465
160
  msgid "Regular"
161
  msgstr ""
162
 
163
  # @ yit
164
+ #: yit-common/yith-panel.php:466
165
  msgid "Bold"
166
  msgstr ""
167
 
168
  # @ yit
169
+ #: yit-common/yith-panel.php:467
170
  msgid "Extra bold"
171
  msgstr ""
172
 
173
  # @ yit
174
+ #: yit-common/yith-panel.php:468
175
  msgid "Italic"
176
  msgstr ""
177
 
178
  # @ yit
179
+ #: yit-common/yith-panel.php:469
180
  msgid "Italic bold"
181
  msgstr ""
182
 
183
  # @ yit
184
+ #: yit-common/yith-panel.php:481
185
  msgid "Click to preview"
186
  msgstr ""
screenshot-3.png CHANGED
Binary file
screenshot-4.png ADDED
Binary file
widgets/class.yith-wcan-navigation-widget.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @author Your Inspiration Themes
6
  * @package YITH WooCommerce Ajax Navigation
7
- * @version 1.1.2
8
  */
9
 
10
  if ( !defined( 'YITH_WCAN' ) ) { exit; } // Exit if accessed directly
@@ -36,7 +36,17 @@ if( !class_exists( 'YITH_WCAN' ) ) {
36
  $current_tax = $_attributes_array && is_tax( $_attributes_array ) ? get_queried_object()->taxonomy : '';
37
 
38
  $title = apply_filters('widget_title', $instance['title'], $instance, $this->id_base);
39
- $taxonomy = $woocommerce->attribute_taxonomy_name($instance['attribute']);
 
 
 
 
 
 
 
 
 
 
40
  $query_type = isset( $instance['query_type'] ) ? $instance['query_type'] : 'and';
41
  $display_type = isset( $instance['type'] ) ? $instance['type'] : 'list';
42
 
@@ -120,7 +130,7 @@ if( !class_exists( 'YITH_WCAN' ) ) {
120
  // Base Link decided by current page
121
  if ( defined( 'SHOP_IS_ON_FRONT' ) ) {
122
  $link = home_url();
123
- } elseif ( is_post_type_archive( 'product' ) || is_page( woocommerce_get_page_id('shop') ) ) {
124
  $link = get_post_type_archive_link( 'product' );
125
  } else {
126
  $link = get_term_link( get_query_var('term'), get_query_var('taxonomy') );
@@ -200,7 +210,157 @@ if( !class_exists( 'YITH_WCAN' ) ) {
200
 
201
  echo "</ul>";
202
 
203
- } elseif ( $display_type == 'color' ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
204
  // List display
205
  echo "<ul class='yith-wcan-color yith-wcan yith-wcan-group'>";
206
 
@@ -262,7 +422,7 @@ if( !class_exists( 'YITH_WCAN' ) ) {
262
  // Base Link decided by current page
263
  if ( defined( 'SHOP_IS_ON_FRONT' ) ) {
264
  $link = home_url();
265
- } elseif ( is_post_type_archive( 'product' ) || is_page( woocommerce_get_page_id('shop') ) ) {
266
  $link = get_post_type_archive_link( 'product' );
267
  } else {
268
  $link = get_term_link( get_query_var('term'), get_query_var('taxonomy') );
@@ -404,7 +564,7 @@ if( !class_exists( 'YITH_WCAN' ) ) {
404
  // Base Link decided by current page
405
  if ( defined( 'SHOP_IS_ON_FRONT' ) ) {
406
  $link = home_url();
407
- } elseif ( is_post_type_archive( 'product' ) || is_page( woocommerce_get_page_id('shop') ) ) {
408
  $link = get_post_type_archive_link( 'product' );
409
  } else {
410
  $link = get_term_link( get_query_var('term'), get_query_var('taxonomy') );
@@ -534,6 +694,7 @@ if( !class_exists( 'YITH_WCAN' ) ) {
534
  <option value="list" <?php selected( 'list', $instance['type'] ) ?>><?php _e( 'List', 'yit' ) ?></option>
535
  <option value="color" <?php selected( 'color', $instance['type'] ) ?>><?php _e( 'Color', 'yit' ) ?></option>
536
  <option value="label" <?php selected( 'label', $instance['type'] ) ?>><?php _e( 'Label', 'yit' ) ?></option>
 
537
  </select></p>
538
 
539
  <div class="yith_wcan_placeholder">
@@ -560,8 +721,9 @@ if( !class_exists( 'YITH_WCAN' ) ) {
560
 
561
  $instance = $old_instance;
562
 
563
- if ( empty( $new_instance['title'] ) )
564
- $new_instance['title'] = $woocommerce->attribute_label( $new_instance['attribute'] );
 
565
 
566
  $instance['title'] = strip_tags( $new_instance['title'] );
567
  $instance['attribute'] = stripslashes( $new_instance['attribute'] );
4
  *
5
  * @author Your Inspiration Themes
6
  * @package YITH WooCommerce Ajax Navigation
7
+ * @version 1.2.0
8
  */
9
 
10
  if ( !defined( 'YITH_WCAN' ) ) { exit; } // Exit if accessed directly
36
  $current_tax = $_attributes_array && is_tax( $_attributes_array ) ? get_queried_object()->taxonomy : '';
37
 
38
  $title = apply_filters('widget_title', $instance['title'], $instance, $this->id_base);
39
+
40
+ /* FIX TO WOOCOMMERCE 2.1 */
41
+ if ( function_exists( 'wc_attribute_taxonomy_name' ) ) {
42
+ $taxonomy = wc_attribute_taxonomy_name($instance['attribute']);
43
+ } else {
44
+ $taxonomy = $woocommerce->attribute_taxonomy_name($instance['attribute'] );
45
+ }
46
+
47
+
48
+
49
+
50
  $query_type = isset( $instance['query_type'] ) ? $instance['query_type'] : 'and';
51
  $display_type = isset( $instance['type'] ) ? $instance['type'] : 'list';
52
 
130
  // Base Link decided by current page
131
  if ( defined( 'SHOP_IS_ON_FRONT' ) ) {
132
  $link = home_url();
133
+ } elseif ( is_post_type_archive( 'product' ) || is_page( function_exists( 'wc_get_page_id' ) ? wc_get_page_id('shop') : woocommerce_get_page_id('shop') ) ) {
134
  $link = get_post_type_archive_link( 'product' );
135
  } else {
136
  $link = get_term_link( get_query_var('term'), get_query_var('taxonomy') );
210
 
211
  echo "</ul>";
212
 
213
+ }elseif ( $display_type == 'select' ){ ?>
214
+
215
+ <a class="yit-wcan-select-open" href="#"><?php _e('Filters List:', 'yit') ?></a>
216
+
217
+ <?php
218
+ // Select display
219
+ echo "<div class='yith-wcan-select-wrapper'>";
220
+
221
+ echo "<ul class='yith-wcan-select yith-wcan'>";
222
+
223
+ foreach ( $terms as $term ) {
224
+
225
+ // Get count based on current view - uses transients
226
+ $transient_name = 'wc_ln_count_' . md5( sanitize_key( $taxonomy ) . sanitize_key( $term->term_id ) );
227
+
228
+ if ( false === ( $_products_in_term = get_transient( $transient_name ) ) ) {
229
+
230
+ $_products_in_term = get_objects_in_term( $term->term_id, $taxonomy );
231
+
232
+ set_transient( $transient_name, $_products_in_term );
233
+ }
234
+
235
+ $option_is_set = ( isset( $_chosen_attributes[ $taxonomy ] ) && in_array( $term->term_id, $_chosen_attributes[ $taxonomy ]['terms'] ) );
236
+
237
+ // If this is an AND query, only show options with count > 0
238
+ if ( $query_type == 'and' ) {
239
+
240
+ $count = sizeof( array_intersect( $_products_in_term, $woocommerce->query->filtered_product_ids ) );
241
+
242
+ // skip the term for the current archive
243
+ if ( $current_term == $term->term_id )
244
+ continue;
245
+
246
+ if ( $count > 0 && $current_term !== $term->term_id )
247
+ $found = true;
248
+
249
+ if ( $count == 0 && ! $option_is_set )
250
+ continue;
251
+
252
+ // If this is an OR query, show all options so search can be expanded
253
+ } else {
254
+
255
+ // skip the term for the current archive
256
+ if ( $current_term == $term->term_id )
257
+ continue;
258
+
259
+ $count = sizeof( array_intersect( $_products_in_term, $woocommerce->query->unfiltered_product_ids ) );
260
+
261
+ if ( $count > 0 )
262
+ $found = true;
263
+
264
+ }
265
+
266
+ $arg = 'filter_' . urldecode( sanitize_title( $instance['attribute'] ) );
267
+
268
+ $current_filter = ( isset( $_GET[ $arg ] ) ) ? explode( ',', $_GET[ $arg ] ) : array();
269
+
270
+ if ( ! is_array( $current_filter ) )
271
+ $current_filter = array();
272
+
273
+ $current_filter = array_map( 'esc_attr', $current_filter );
274
+
275
+ if ( ! in_array( $term->term_id, $current_filter ) )
276
+ $current_filter[] = $term->term_id;
277
+
278
+ // Base Link decided by current page
279
+ if ( defined( 'SHOP_IS_ON_FRONT' ) ) {
280
+ $link = home_url();
281
+ } elseif ( is_post_type_archive( 'product' ) || is_page( woocommerce_get_page_id('shop') ) ) {
282
+ $link = get_post_type_archive_link( 'product' );
283
+ } else {
284
+ $link = get_term_link( get_query_var('term'), get_query_var('taxonomy') );
285
+ }
286
+
287
+ // All current filters
288
+ if ( $_chosen_attributes ) {
289
+ foreach ( $_chosen_attributes as $name => $data ) {
290
+ if ( $name !== $taxonomy ) {
291
+
292
+ // Exclude query arg for current term archive term
293
+ while ( in_array( $current_term, $data['terms'] ) ) {
294
+ $key = array_search( $current_term, $data );
295
+ unset( $data['terms'][$key] );
296
+ }
297
+
298
+ // Remove pa_ and sanitize
299
+ $filter_name = urldecode( sanitize_title( str_replace( 'pa_', '', $name ) ) );
300
+
301
+ if ( ! empty( $data['terms'] ) )
302
+ $link = add_query_arg( 'filter_' . $filter_name, implode( ',', $data['terms'] ), $link );
303
+
304
+ if ( $data['query_type'] == 'or' )
305
+ $link = add_query_arg( 'query_type_' . $filter_name, 'or', $link );
306
+ }
307
+ }
308
+ }
309
+
310
+ // Min/Max
311
+ if ( isset( $_GET['min_price'] ) )
312
+ $link = add_query_arg( 'min_price', $_GET['min_price'], $link );
313
+
314
+ if ( isset( $_GET['max_price'] ) )
315
+ $link = add_query_arg( 'max_price', $_GET['max_price'], $link );
316
+
317
+ // Current Filter = this widget
318
+ if ( isset( $_chosen_attributes[ $taxonomy ] ) && is_array( $_chosen_attributes[ $taxonomy ]['terms'] ) && in_array( $term->term_id, $_chosen_attributes[ $taxonomy ]['terms'] ) ) {
319
+
320
+ $class = 'class="chosen"';
321
+
322
+ // Remove this term is $current_filter has more than 1 term filtered
323
+ if ( sizeof( $current_filter ) > 1 ) {
324
+ $current_filter_without_this = array_diff( $current_filter, array( $term->term_id ) );
325
+ $link = add_query_arg( $arg, implode( ',', $current_filter_without_this ), $link );
326
+ }
327
+
328
+ } else {
329
+
330
+ $class = '';
331
+ $link = add_query_arg( $arg, implode( ',', $current_filter ), $link );
332
+
333
+ }
334
+
335
+ // Search Arg
336
+ if ( get_search_query() )
337
+ $link = add_query_arg( 's', get_search_query(), $link );
338
+
339
+ // Post Type Arg
340
+ if ( isset( $_GET['post_type'] ) )
341
+ $link = add_query_arg( 'post_type', $_GET['post_type'], $link );
342
+
343
+ // Query type Arg
344
+ if ( $query_type == 'or' && ! ( sizeof( $current_filter ) == 1 && isset( $_chosen_attributes[ $taxonomy ]['terms'] ) && is_array( $_chosen_attributes[ $taxonomy ]['terms'] ) && in_array( $term->term_id, $_chosen_attributes[ $taxonomy ]['terms'] ) ) )
345
+ $link = add_query_arg( 'query_type_' . sanitize_title( $instance['attribute'] ), 'or', $link );
346
+
347
+ echo '<li ' . $class . '>';
348
+
349
+ echo ( $count > 0 || $option_is_set ) ? '<a data-type="select" href="' . esc_url( apply_filters( 'woocommerce_layered_nav_link', $link ) ) . '">' : '<span>';
350
+
351
+ echo $term->name;
352
+
353
+ echo ( $count > 0 || $option_is_set ) ? '</a>' : '</span>';
354
+
355
+ echo '</li>';
356
+
357
+ }
358
+
359
+ echo "</ul>";
360
+
361
+ echo "</div>";
362
+
363
+ } elseif ( $display_type == 'color' ) {
364
  // List display
365
  echo "<ul class='yith-wcan-color yith-wcan yith-wcan-group'>";
366
 
422
  // Base Link decided by current page
423
  if ( defined( 'SHOP_IS_ON_FRONT' ) ) {
424
  $link = home_url();
425
+ } elseif ( is_post_type_archive( 'product' ) || is_page( function_exists( 'wc_get_page_id' ) ? wc_get_page_id('shop') : woocommerce_get_page_id('shop') ) ) {
426
  $link = get_post_type_archive_link( 'product' );
427
  } else {
428
  $link = get_term_link( get_query_var('term'), get_query_var('taxonomy') );
564
  // Base Link decided by current page
565
  if ( defined( 'SHOP_IS_ON_FRONT' ) ) {
566
  $link = home_url();
567
+ } elseif ( is_post_type_archive( 'product' ) || is_page( function_exists( 'wc_get_page_id' ) ? wc_get_page_id('shop') : woocommerce_get_page_id('shop') ) ) {
568
  $link = get_post_type_archive_link( 'product' );
569
  } else {
570
  $link = get_term_link( get_query_var('term'), get_query_var('taxonomy') );
694
  <option value="list" <?php selected( 'list', $instance['type'] ) ?>><?php _e( 'List', 'yit' ) ?></option>
695
  <option value="color" <?php selected( 'color', $instance['type'] ) ?>><?php _e( 'Color', 'yit' ) ?></option>
696
  <option value="label" <?php selected( 'label', $instance['type'] ) ?>><?php _e( 'Label', 'yit' ) ?></option>
697
+ <option value="select" <?php selected( 'select', $instance['type'] ) ?>><?php _e( 'Dropdown', 'yit' ) ?></option>
698
  </select></p>
699
 
700
  <div class="yith_wcan_placeholder">
721
 
722
  $instance = $old_instance;
723
 
724
+ if ( empty( $new_instance['title'] ) ) {
725
+ $new_instance['title'] = function_exists('wc_attribute_label') ? wc_attribute_label( $new_instance['attribute'] ) : $woocommerce->attribute_label( $new_instance['attribute'] );
726
+ }
727
 
728
  $instance['title'] = strip_tags( $new_instance['title'] );
729
  $instance['attribute'] = stripslashes( $new_instance['attribute'] );
widgets/class.yith-wcan-reset-navigation-widget.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @author Your Inspiration Themes
6
  * @package YITH WooCommerce Ajax Navigation
7
- * @version 1.1.2
8
  */
9
 
10
  if ( !defined( 'YITH_WCAN' ) ) { exit; } // Exit if accessed directly
@@ -102,7 +102,7 @@ function form( $instance ) {
102
  $instance = $old_instance;
103
 
104
  if ( empty( $new_instance['title'] ) )
105
- $new_instance['title'] = $woocommerce->attribute_label( $new_instance['attribute'] );
106
 
107
  $instance['label'] = strip_tags($new_instance['label']);
108
 
4
  *
5
  * @author Your Inspiration Themes
6
  * @package YITH WooCommerce Ajax Navigation
7
+ * @version 1.2.0
8
  */
9
 
10
  if ( !defined( 'YITH_WCAN' ) ) { exit; } // Exit if accessed directly
102
  $instance = $old_instance;
103
 
104
  if ( empty( $new_instance['title'] ) )
105
+ $new_instance['title'] = function_exists('wc_attribute_label') ? wc_attribute_label( $new_instance['attribute'] ) : $woocommerce->attribute_label( $new_instance['attribute'] );
106
 
107
  $instance['label'] = strip_tags($new_instance['label']);
108