YITH WooCommerce Ajax Product Filter - Version 1.1.0

Version Description

  • Added new widget YITH WooCommerce Ajax Reset Navigation
Download this release

Release Info

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

Code changes from version 1.0.0 to 1.1.0

README.txt CHANGED
@@ -4,7 +4,7 @@ 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.0.0
8
License: GPLv2 or later
9
License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
@@ -64,6 +64,10 @@ In order to display the widget you need to assign it to the sidebar in the Shop
64
65
== Changelog ==
66
67
= 1.0.0 =
68
69
* Initial release
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.0
8
License: GPLv2 or later
9
License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
64
65
== Changelog ==
66
67
+ = 1.1.0 =
68
+
69
+ * Added new widget YITH WooCommerce Ajax Reset Navigation
70
+
71
= 1.0.0 =
72
73
* Initial release
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.0.0
7
*/
8
jQuery(function($){
9
3
*
4
* @author Your Inspiration Themes
5
* @package YITH WooCommerce Ajax Navigation
6
+ * @version 1.1.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.0.0
7
*/
8
jQuery(function($){
9
/**
3
*
4
* @author Your Inspiration Themes
5
* @package YITH WooCommerce Ajax Navigation
6
+ * @version 1.1.0
7
*/
8
jQuery(function($){
9
/**
assets/js/yith-wcan-frontend.min.js CHANGED
@@ -3,13 +3,13 @@
3
*
4
* @author Your Inspiration Themes
5
* @package YITH WooCommerce Ajax Navigation
6
- * @version 1.0.0
7
*/
8
- jQuery(function(c){var s=/(?!(\[))(\.)[^.#[]*/g,t=/(#)[^.#[]*/,u=/^[\w]+/,v=/^[\w]+#x2F;,q=function(n,p){var a=[];if(v.test(n))a=[{tag:n}];else{for(var a=n,e={sel:[],val:[]},f=[],h=!1,g="",j=[],b=0,k=a.length;b<k;b++){var d=a.charAt(b);if(h)if("\\"===d&&b+1<a.length)j.push(a.charAt(++b));else if(g===d)g="",j.push(d);else if(("'"===d||'"'===d)&&""===g)g=d,j.push(d);else if("]"===d&&""===g)e.val.push(j.join("")),j=[],h=!1;else{if("]"!==d||""!==g)""===g&&","===d?(e.val.push(j.join("")),j=[]):j.push(d)}else"\\"===
9
- d&&b+1<a.length?h&&j.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)l.tag=e;else{var l=[];l.tag=u.exec(e);l.id=t.exec(e);l.id&&c.isArray(l.id)&&(l.id=l.id[0].substr(1));l.tag||(l.tag="div");l.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]*#x2F;g,""),"text"===h?l.text=g:l.vars.push([h,g]);e=e.match(s);h=[];if(e){for(a=0;a<e.length;a++)h.push(e[a].substr(1));l.className=h.join(" ")}}f[b]=l}a=f}l=[];"undefined"===typeof p&&(p=1);e=[];f=[];h=[];g=document.createElement("div");for(b=j=0;b<a.length;b++){if("+"==a[b].tag)f=h.slice(),--j;else{for(k=0;k<p;k++)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 m=0;m<a[b].vars.length;m++)d.push(a[b].vars[m][0]+"='"+a[b].vars[m][1]+"'");a[b].text&&d.push("value='"+a[b].text+"'");d.push("/>");h[k]=f[k];f[k]?(f[k].innerHTML+=d.join(" "),f[k]=f[k].lastChild):(g.innerHTML=d.join(" "),f[k]=g.removeChild(g.firstChild))}else{d=document.createElement(a[b].tag);if(a[b].vars)for(m=0;m<a[b].vars.length;m++)console.log(a[b].tag,a[b].vars[m]),d.setAttribute(a[b].vars[m][0],a[b].vars[m][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[k]=f[k];f[k]=f[k]?f[k].appendChild(d):d}j++||Array.prototype.push.apply(e,f)}l=c.merge(l,f)}return c(e)},r=function(n,p,a){for(var e=n.match(/%[^%]*%/g)||[],f=[],h=0;h<p.length;h++){for(var g=n,j=0;j<e.length;j++)var b=e[j].substr(1,e[j].length-2),g=g.replace(e[j],p[h][b]);f=c.merge(f,q(g,a))}return c(f)};c.jseldom=function(n){if(2==arguments.length&&c.isPlainObject(arguments[1]))return r.apply(this,
13
- [arguments[0],[arguments[1]]]);if(1==arguments.length||2==arguments.length&&!c.isArray(arguments[1]))return q.apply(this,arguments);if(2==arguments.length)return r.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(n){n.preventDefault();var p=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:p,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},"",p);c(document).trigger("ready");c(document).trigger("yith-wcan-ajax-filtered")}})})});
3
*
4
* @author Your Inspiration Themes
5
* @package YITH WooCommerce Ajax Navigation
6
+ * @version 1.1.0
7
*/
8
+ jQuery(function(c){var t=/(?!(\[))(\.)[^.#[]*/g,u=/(#)[^.#[]*/,v=/^[\w]+/,w=/^[\w]+#x2F;,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]*#x2F;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")}})})});
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.0.0
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.1.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.0.0
8
*/
9
10
if ( !defined( 'YITH_WCAN' ) ) { exit; } // Exit if accessed directly
@@ -12,7 +12,7 @@ if ( !defined( 'YITH_WCAN' ) ) { exit; } // Exit if accessed directly
12
if( !class_exists( 'YITH_WCAN_Frontend' ) ) {
13
/**
14
* Frontend class.
15
- * The class manage all the frontend behaviors.
16
*
17
* @since 1.0.0
18
*/
4
*
5
* @author Your Inspiration Themes
6
* @package YITH WooCommerce Ajax Navigation
7
+ * @version 1.1.0
8
*/
9
10
if ( !defined( 'YITH_WCAN' ) ) { exit; } // Exit if accessed directly
12
if( !class_exists( 'YITH_WCAN_Frontend' ) ) {
13
/**
14
* Frontend class.
15
+ * The class manage all the frontend behaviors.
16
*
17
* @since 1.0.0
18
*/
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.0.0
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.1.0
8
*/
9
10
if ( !defined( 'YITH_WCAN' ) ) { exit; } // Exit if accessed directly
class.yith-wcan.php CHANGED
@@ -4,7 +4,7 @@
4
*
5
* @author Your Inspiration Themes
6
* @package YITH WooCommerce Ajax Navigation
7
- * @version 1.0.0
8
*/
9
10
if ( !defined( 'YITH_WCAN' ) ) { exit; } // Exit if accessed directly
@@ -72,7 +72,7 @@ if( !class_exists( 'YITH_WCAN' ) ) {
72
*/
73
public function registerWidgets() {
74
register_widget( 'YITH_WCAN_Navigation_Widget' );
75
-
76
}
77
78
}
4
*
5
* @author Your Inspiration Themes
6
* @package YITH WooCommerce Ajax Navigation
7
+ * @version 1.1.0
8
*/
9
10
if ( !defined( 'YITH_WCAN' ) ) { exit; } // Exit if accessed directly
72
*/
73
public function registerWidgets() {
74
register_widget( 'YITH_WCAN_Navigation_Widget' );
75
+ register_widget( 'YITH_WCAN_Reset_Navigation_Widget' );
76
}
77
78
}
functions.yith-wcan.php CHANGED
@@ -4,7 +4,7 @@
4
*
5
* @author Your Inspiration Themes
6
* @package YITH WooCommerce Ajax Navigation
7
- * @version 1.0.0
8
*/
9
10
if ( !defined( 'YITH_WCAN' ) ) { exit; } // Exit if accessed directly
@@ -98,4 +98,27 @@ function yith_wcan_can_be_displayed() {
98
} else {
99
return false;
100
}
101
}
4
*
5
* @author Your Inspiration Themes
6
* @package YITH WooCommerce Ajax Navigation
7
+ * @version 1.1.0
8
*/
9
10
if ( !defined( 'YITH_WCAN' ) ) { exit; } // Exit if accessed directly
98
} else {
99
return false;
100
}
101
+ }
102
+
103
+
104
+ if( !function_exists('yit_curPageURL') ) {
105
+ /**
106
+ * Retrieve the current complete url
107
+ *
108
+ * @since 1.0
109
+ */
110
+ function yit_curPageURL() {
111
+ $pageURL = 'http';
112
+ if ( isset( $_SERVER["HTTPS"] ) AND $_SERVER["HTTPS"] == "on" )
113
+ $pageURL .= "s";
114
+
115
+ $pageURL .= "://";
116
+
117
+ if ( isset( $_SERVER["SERVER_PORT"] ) AND $_SERVER["SERVER_PORT"] != "80" )
118
+ $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
119
+ else
120
+ $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
121
+
122
+ return $pageURL;
123
+ }
124
}
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.0.0
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.0.0
15
*/
16
/* Copyright 2013 Your Inspiration Themes (email : plugins@yithemes.com)
17
@@ -36,22 +36,29 @@ if ( !defined( 'ABSPATH' ) ) { exit; } // Exit if accessed directly
36
if( !defined('YITH_FUNCTIONS') ) {
37
require_once( 'yit-common/yit-functions.php' );
38
}
39
- if ( ! yit_is_woocommerce_active() ) return;
40
41
- load_plugin_textdomain( 'yit', false, dirname( plugin_basename( __FILE__ ) ). '/languages/' );
42
43
- define( 'YITH_WCAN', true );
44
- define( 'YITH_WCAN_URL', plugin_dir_url( __FILE__ ) );
45
- define( 'YITH_WCAN_DIR', plugin_dir_path( __FILE__ ) );
46
47
- // Load required classes and functions
48
- require_once('functions.yith-wcan.php');
49
- require_once('class.yith-wcan-admin.php');
50
- require_once('class.yith-wcan-frontend.php');
51
- require_once('class.yith-wcan-helper.php');
52
- require_once('widgets/class.yith-wcan-navigation-widget.php');
53
- require_once('class.yith-wcan.php');
54
55
- // Let's start the game!
56
- global $yith_wcan;
57
- $yith_wcan = new YITH_WCAN();
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.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.1.0
15
*/
16
/* Copyright 2013 Your Inspiration Themes (email : plugins@yithemes.com)
17
36
if( !defined('YITH_FUNCTIONS') ) {
37
require_once( 'yit-common/yit-functions.php' );
38
}
39
40
+ function yith_wcan_constructor() {
41
+ global $woocommerce;
42
+ if ( ! isset( $woocommerce ) ) return;
43
44
+ load_plugin_textdomain( 'yit', false, dirname( plugin_basename( __FILE__ ) ). '/languages/' );
45
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.0' );
50
51
+ // Load required classes and functions
52
+ require_once('functions.yith-wcan.php');
53
+ require_once('class.yith-wcan-admin.php');
54
+ require_once('class.yith-wcan-frontend.php');
55
+ require_once('class.yith-wcan-helper.php');
56
+ require_once('widgets/class.yith-wcan-navigation-widget.php');
57
+ require_once('widgets/class.yith-wcan-reset-navigation-widget.php');
58
+ require_once('class.yith-wcan.php');
59
+
60
+ // Let's start the game!
61
+ global $yith_wcan;
62
+ $yith_wcan = new YITH_WCAN();
63
+ }
64
+ add_action( 'plugins_loaded', 'yith_wcan_constructor' );
languages/default.po CHANGED
@@ -2,191 +2,177 @@ 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: \n"
6
- "PO-Revision-Date: 2013-06-17 12:59:26+0000\n"
7
"Last-Translator: Your Inspiration Themes <plugins@yithemes.com>\n"
8
"Language-Team: \n"
9
"MIME-Version: 1.0\n"
10
"Content-Type: text/plain; charset=UTF-8\n"
11
"Content-Transfer-Encoding: 8bit\n"
12
"Plural-Forms: nplurals=2; plural=n != 1;\n"
13
- "X-Generator: CSL v1.x\n"
14
- "X-Poedit-Language: English\n"
15
- "X-Poedit-Country: UNITED STATES\n"
16
"X-Poedit-SourceCharset: utf-8\n"
17
- "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;_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-Poedit-Bookmarks: \n"
20
"X-Poedit-SearchPath-0: .\n"
21
- "X-Textdomain-Support: yes"
22
23
- #: functions.yith-wcan.php:52
24
- #: functions.yith-wcan.php:64
25
- #@ yit
26
msgid "Term"
27
msgstr ""
28
29
#: functions.yith-wcan.php:52
30
#: widgets/class.yith-wcan-navigation-widget.php:535
31
- #@ yit
32
msgid "Color"
33
msgstr ""
34
35
#: functions.yith-wcan.php:64
36
- #@ yit
37
msgid "Labels"
38
msgstr ""
39
40
- #. translators: plugin header field 'Name'
41
- #: init.php:0
42
- #: widgets/class.yith-wcan-navigation-widget.php:23
43
- #@ yit
44
- msgid "YITH WooCommerce Ajax Navigation"
45
- msgstr ""
46
-
47
- #. translators: plugin header field 'PluginURI'
48
- #. translators: plugin header field 'AuthorURI'
49
- #: init.php:0
50
- #@ yit
51
- msgid "http://yithemes.com/"
52
- msgstr ""
53
-
54
- #. translators: plugin header field 'Description'
55
- #: init.php:0
56
- #@ yit
57
- msgid "YITH WooCommerce Ajax Navigation allows user to filter products in Shop page without reloading the page."
58
- msgstr ""
59
-
60
- #. translators: plugin header field 'Author'
61
- #: init.php:0
62
- #@ yit
63
- msgid "Your Inspiration Themes"
64
- msgstr ""
65
-
66
- #. translators: plugin header field 'Version'
67
- #: init.php:0
68
- #@ yit
69
- msgid "1.0.0"
70
- msgstr ""
71
-
72
#: widgets/class.yith-wcan-navigation-widget.php:21
73
- #@ yit
74
msgid "Narrow down the products list without reloading the page"
75
msgstr ""
76
77
#: widgets/class.yith-wcan-navigation-widget.php:516
78
- #@ yit
79
msgid "Title"
80
msgstr ""
81
82
#: widgets/class.yith-wcan-navigation-widget.php:521
83
- #@ yit
84
msgid "Attribute:"
85
msgstr ""
86
87
#: widgets/class.yith-wcan-navigation-widget.php:526
88
- #@ yit
89
msgid "Query Type:"
90
msgstr ""
91
92
#: widgets/class.yith-wcan-navigation-widget.php:528
93
- #@ yit
94
msgid "AND"
95
msgstr ""
96
97
#: widgets/class.yith-wcan-navigation-widget.php:529
98
- #@ yit
99
msgid "OR"
100
msgstr ""
101
102
#: widgets/class.yith-wcan-navigation-widget.php:532
103
- #@ yit
104
msgid "Type:"
105
msgstr ""
106
107
#: widgets/class.yith-wcan-navigation-widget.php:534
108
- #@ yit
109
msgid "List"
110
msgstr ""
111
112
#: widgets/class.yith-wcan-navigation-widget.php:536
113
- #@ yit
114
msgid "Label"
115
msgstr ""
116
117
#: yit-common/yith-panel.php:396
118
- #@ yit
119
msgid "Select a date"
120
msgstr ""
121
122
#: yit-common/yith-panel.php:397
123
- #@ yit
124
msgid "Hours"
125
msgstr ""
126
127
- #: yit-common/yith-panel.php:398
128
- #: yit-common/yith-panel.php:399
129
- #@ yit
130
msgid "Minutes"
131
msgstr ""
132
133
#: yit-common/yith-panel.php:407
134
- #@ yit
135
msgid "Upload"
136
msgstr ""
137
138
#: yit-common/yith-panel.php:434
139
- #@ yit
140
msgid "px"
141
msgstr ""
142
143
#: yit-common/yith-panel.php:435
144
- #@ yit
145
msgid "em"
146
msgstr ""
147
148
#: yit-common/yith-panel.php:436
149
- #@ yit
150
msgid "pt"
151
msgstr ""
152
153
#: yit-common/yith-panel.php:437
154
- #@ yit
155
msgid "rem"
156
msgstr ""
157
158
#: yit-common/yith-panel.php:447
159
- #@ yit
160
msgid "Select a font family"
161
msgstr ""
162
163
#: yit-common/yith-panel.php:455
164
- #@ yit
165
msgid "Regular"
166
msgstr ""
167
168
#: yit-common/yith-panel.php:456
169
- #@ yit
170
msgid "Bold"
171
msgstr ""
172
173
#: yit-common/yith-panel.php:457
174
- #@ yit
175
msgid "Extra bold"
176
msgstr ""
177
178
#: yit-common/yith-panel.php:458
179
- #@ yit
180
msgid "Italic"
181
msgstr ""
182
183
#: yit-common/yith-panel.php:459
184
- #@ yit
185
msgid "Italic bold"
186
msgstr ""
187
188
#: yit-common/yith-panel.php:471
189
- #@ yit
190
msgid "Click to preview"
191
msgstr ""
192
-
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"
10
"MIME-Version: 1.0\n"
11
"Content-Type: text/plain; charset=UTF-8\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
24
msgid "Term"
25
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
33
+ # @ yit
34
#: functions.yith-wcan.php:64
35
msgid "Labels"
36
msgstr ""
37
38
+ # @ yit
39
#: widgets/class.yith-wcan-navigation-widget.php:21
40
msgid "Narrow down the products list without reloading the page"
41
msgstr ""
42
43
+ # @ yit
44
+ #: widgets/class.yith-wcan-navigation-widget.php:23
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 ""
92
+
93
+ #: widgets/class.yith-wcan-reset-navigation-widget.php:23
94
+ msgid "YITH WooCommerce Ajax Reset Navigation"
95
+ msgstr ""
96
+
97
+ #: widgets/class.yith-wcan-reset-navigation-widget.php:78
98
+ msgid "Reset All Filters"
99
+ msgstr ""
100
+
101
+ #: widgets/class.yith-wcan-reset-navigation-widget.php:91
102
+ 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 ""
languages/yit-it_IT.mo CHANGED
Binary file
languages/yit-it_IT.po CHANGED
@@ -2,10 +2,11 @@ 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: \n"
6
- "PO-Revision-Date: 2013-06-17 15:07+0100\n"
7
"Last-Translator: Your Inspiration Themes <plugins@yithemes.com>\n"
8
"Language-Team: \n"
9
"MIME-Version: 1.0\n"
10
"Content-Type: text/plain; charset=UTF-8\n"
11
"Content-Transfer-Encoding: 8bit\n"
@@ -16,7 +17,6 @@ msgstr ""
16
"_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"
17
"X-Poedit-Basepath: ../\n"
18
"X-Textdomain-Support: yes\n"
19
- "Language: it_IT\n"
20
"X-Poedit-SearchPath-0: .\n"
21
22
# @ yit
@@ -35,48 +35,19 @@ msgstr "Colore"
35
msgid "Labels"
36
msgstr "Label"
37
38
- # @ yit
39
- #. translators: plugin header field 'Name'
40
- #: init.php:0 widgets/class.yith-wcan-navigation-widget.php:23
41
- msgid "YITH WooCommerce Ajax Navigation"
42
- msgstr "YITH WooCommerce Ajax Navigation"
43
-
44
- # @ yit
45
- #. translators: plugin header field 'PluginURI'
46
- #. translators: plugin header field 'AuthorURI'
47
- #: init.php:0
48
- msgid "http://yithemes.com/"
49
- msgstr "http://yithemes.com/"
50
-
51
- # @ yit
52
- #. translators: plugin header field 'Description'
53
- #: init.php:0
54
- msgid ""
55
- "YITH WooCommerce Ajax Navigation allows user to filter products in Shop page "
56
- "without reloading the page."
57
- msgstr ""
58
- "YITH WooCommerce Ajax Navigation consente all'utente di filtrare i prodotti "
59
- "contenuti nella pagina Shop senza ricaricare la pagina."
60
-
61
- # @ yit
62
- #. translators: plugin header field 'Author'
63
- #: init.php:0
64
- msgid "Your Inspiration Themes"
65
- msgstr "Your Inspiration Themes"
66
-
67
- # @ yit
68
- #. translators: plugin header field 'Version'
69
- #: init.php:0
70
- msgid "1.0.0"
71
- msgstr "1.0.0"
72
-
73
# @ yit
74
#: widgets/class.yith-wcan-navigation-widget.php:21
75
msgid "Narrow down the products list without reloading the page"
76
msgstr "Filtra la lista dei prodotti senza ricaricare la pagina"
77
78
# @ yit
79
#: widgets/class.yith-wcan-navigation-widget.php:516
80
msgid "Title"
81
msgstr "Titolo"
82
@@ -115,6 +86,24 @@ msgstr "Lista"
115
msgid "Label"
116
msgstr "Label"
117
118
# @ yit
119
#: yit-common/yith-panel.php:396
120
msgid "Select a date"
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"
10
"MIME-Version: 1.0\n"
11
"Content-Type: text/plain; charset=UTF-8\n"
12
"Content-Transfer-Encoding: 8bit\n"
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
35
msgid "Labels"
36
msgstr "Label"
37
38
# @ yit
39
#: widgets/class.yith-wcan-navigation-widget.php:21
40
msgid "Narrow down the products list without reloading the page"
41
msgstr "Filtra la lista dei prodotti senza ricaricare la pagina"
42
43
+ # @ yit
44
+ #: widgets/class.yith-wcan-navigation-widget.php:23
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
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"
92
+ msgstr "Resetta tutti i filtri settati da YITH WooCommerce Ajax Navigation"
93
+
94
+ # @ yit
95
+ #: widgets/class.yith-wcan-reset-navigation-widget.php:23
96
+ msgid "YITH WooCommerce Ajax Reset Navigation"
97
+ msgstr "YITH WooCommerce Ajax Navigation"
98
+
99
+ #: widgets/class.yith-wcan-reset-navigation-widget.php:78
100
+ msgid "Reset All Filters"
101
+ msgstr "Resetta tutti i filtri"
102
+
103
+ #: widgets/class.yith-wcan-reset-navigation-widget.php:91
104
+ msgid "Button Label"
105
+ msgstr "Label Pulsante"
106
+
107
# @ yit
108
#: yit-common/yith-panel.php:396
109
msgid "Select a date"
languages/yit.pot CHANGED
@@ -2,10 +2,11 @@ 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: \n"
6
- "PO-Revision-Date: 2013-06-17 15:02+0100\n"
7
"Last-Translator: Your Inspiration Themes <plugins@yithemes.com>\n"
8
"Language-Team: \n"
9
"MIME-Version: 1.0\n"
10
"Content-Type: text/plain; charset=UTF-8\n"
11
"Content-Transfer-Encoding: 8bit\n"
@@ -15,7 +16,6 @@ msgstr ""
15
"X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;"
16
"_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"
17
"X-Textdomain-Support: yes\n"
18
- "Language: en_US\n"
19
20
# @ yit
21
#: functions.yith-wcan.php:52 functions.yith-wcan.php:64
@@ -34,45 +34,18 @@ msgid "Labels"
34
msgstr ""
35
36
# @ yit
37
- #. translators: plugin header field 'Name'
38
- #: init.php:0 widgets/class.yith-wcan-navigation-widget.php:23
39
- msgid "YITH WooCommerce Ajax Navigation"
40
- msgstr ""
41
-
42
- # @ yit
43
- #. translators: plugin header field 'PluginURI'
44
- #. translators: plugin header field 'AuthorURI'
45
- #: init.php:0
46
- msgid "http://yithemes.com/"
47
- msgstr ""
48
-
49
- # @ yit
50
- #. translators: plugin header field 'Description'
51
- #: init.php:0
52
- msgid ""
53
- "YITH WooCommerce Ajax Navigation allows user to filter products in Shop page "
54
- "without reloading the page."
55
- msgstr ""
56
-
57
- # @ yit
58
- #. translators: plugin header field 'Author'
59
- #: init.php:0
60
- msgid "Your Inspiration Themes"
61
- msgstr ""
62
-
63
- # @ yit
64
- #. translators: plugin header field 'Version'
65
- #: init.php:0
66
- msgid "1.0.0"
67
msgstr ""
68
69
# @ yit
70
- #: widgets/class.yith-wcan-navigation-widget.php:21
71
- msgid "Narrow down the products list without reloading the page"
72
msgstr ""
73
74
# @ yit
75
#: widgets/class.yith-wcan-navigation-widget.php:516
76
msgid "Title"
77
msgstr ""
78
@@ -111,6 +84,22 @@ msgstr ""
111
msgid "Label"
112
msgstr ""
113
114
# @ yit
115
#: yit-common/yith-panel.php:396
116
msgid "Select a date"
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"
10
"MIME-Version: 1.0\n"
11
"Content-Type: text/plain; charset=UTF-8\n"
12
"Content-Transfer-Encoding: 8bit\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
34
msgstr ""
35
36
# @ yit
37
+ #: widgets/class.yith-wcan-navigation-widget.php:21
38
+ msgid "Narrow down the products list without reloading the page"
39
msgstr ""
40
41
# @ yit
42
+ #: widgets/class.yith-wcan-navigation-widget.php:23
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
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 ""
90
+
91
+ #: widgets/class.yith-wcan-reset-navigation-widget.php:23
92
+ msgid "YITH WooCommerce Ajax Reset Navigation"
93
+ msgstr ""
94
+
95
+ #: widgets/class.yith-wcan-reset-navigation-widget.php:78
96
+ msgid "Reset All Filters"
97
+ msgstr ""
98
+
99
+ #: widgets/class.yith-wcan-reset-navigation-widget.php:91
100
+ msgid "Button Label"
101
+ msgstr ""
102
+
103
# @ yit
104
#: yit-common/yith-panel.php:396
105
msgid "Select a date"
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.0.0
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.1.0
8
*/
9
10
if ( !defined( 'YITH_WCAN' ) ) { exit; } // Exit if accessed directly
widgets/class.yith-wcan-reset-navigation-widget.php ADDED
@@ -0,0 +1,113 @@
1
+ <?php
2
+ /**
3
+ * Main class
4
+ *
5
+ * @author Your Inspiration Themes
6
+ * @package YITH WooCommerce Ajax Navigation
7
+ * @version 1.1.0
8
+ */
9
+
10
+ if ( !defined( 'YITH_WCAN' ) ) { exit; } // Exit if accessed directly
11
+
12
+ if( !class_exists( 'YITH_WCAN' ) ) {
13
+ /**
14
+ * YITH WooCommerce Ajax Navigation Widget
15
+ *
16
+ * @since 1.0.0
17
+ */
18
+ class YITH_WCAN_Reset_Navigation_Widget extends WP_Widget {
19
+
20
+ function __construct() {
21
+ $widget_ops = array('classname' => 'yith-woo-ajax-reset-navigation yith-woo-ajax-navigation woocommerce widget_layered_nav', 'description' => __( 'Reset all filters setted by YITH WooCommerce Ajax Navigation', 'yit') );
22
+ $control_ops = array('width' => 400, 'height' => 350);
23
+ parent::__construct('yith-woo-ajax-reset-navigation', __('YITH WooCommerce Ajax Reset Navigation', 'yit'), $widget_ops, $control_ops);
24
+ }
25
+
26
+
27
+ function widget( $args, $instance ) {
28
+ global $_chosen_attributes, $woocommerce, $_attributes_array;
29
+
30
+ extract( $args );
31
+
32
+ if ( ! is_post_type_archive( 'product' ) && ! is_tax( array_merge( $_attributes_array, array( 'product_cat', 'product_tag' ) ) ) )
33
+ return;
34
+
35
+ // Price
36
+ $min_price = isset( $_GET['min_price'] ) ? esc_attr( $_GET['min_price'] ) : 0;
37
+ $max_price = isset( $_GET['max_price'] ) ? esc_attr( $_GET['max_price'] ) : 0;
38
+
39
+ ob_start();
40
+
41
+ if ( count( $_chosen_attributes ) > 0 || $min_price > 0 || $max_price > 0 ) {
42
+ $title = isset($instance['title']) ? apply_filters('widget_title', $instance['title'], $instance, $this->id_base) : '';
43
+ $label = isset($instance['label']) ? apply_filters('yith-wcan-reset-navigation-label', $instance['label'], $instance, $this->id_base) : '';
44
+
45
+ //clean the url
46
+ $link = yit_curPageURL();
47
+ foreach( $_chosen_attributes as $taxonomy => $data ) {
48
+ $taxonomy_filter = str_replace( 'pa_', '', $taxonomy );
49
+ $link = remove_query_arg( 'filter_' . $taxonomy_filter, $link );
50
+ }
51
+ if( isset( $_GET['min_price'] ) ) {
52
+ $link = remove_query_arg( 'min_price', $link );
53
+ }
54
+ if( isset( $_GET['max_price'] ) ) {
55
+ $link = remove_query_arg( 'max_price', $link );
56
+ }
57
+
58
+ echo $before_widget;
59
+ if( $title ) {
60
+ echo $before_title . $title . $after_title;
61
+ }
62
+
63
+ echo "<div class='yith-wcan'><a class='yith-wcan-reset-navigation button' href='{$link}'>". __( $label, 'yit' ) ."</a></div>";
64
+ echo $after_widget;
65
+ echo ob_get_clean();
66
+ } else {
67
+ ob_end_clean();
68
+ echo substr($before_widget, 0, strlen($before_widget) - 1) . ' style="display:none">' . $after_widget;
69
+ }
70
+ }
71
+
72
+
73
+ function form( $instance ) {
74
+ global $woocommerce;
75
+
76
+ $defaults = array(
77
+ 'title' => '',
78
+ 'label' => __('Reset All Filters', 'yit')
79
+ );
80
+
81
+ $instance = wp_parse_args( (array) $instance, $defaults ); ?>
82
+
83
+ <p>
84
+ <label>
85
+ <strong><?php _e( 'Title', 'yit' ) ?>:</strong><br />
86
+ <input class="widefat" type="text" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo $instance['title']; ?>" />
87
+ </label>
88
+ </p>
89
+ <p>
90
+ <label>
91
+ <strong><?php _e( 'Button Label', 'yit' ) ?>:</strong><br />
92
+ <input class="widefat" type="text" id="<?php echo $this->get_field_id( 'label' ); ?>" name="<?php echo $this->get_field_name( 'label' ); ?>" value="<?php echo $instance['label']; ?>" />
93
+ </label>
94
+ </p>
95
+
96
+ <?php
97
+ }
98
+
99
+ function update( $new_instance, $old_instance ) {
100
+ global $woocommerce;
101
+
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
+
109
+ return $instance;
110
+ }
111
+
112
+ }
113
+ }
yit-common/yit-functions.php CHANGED
@@ -205,4 +205,27 @@ if( !function_exists('yit_typo_option_to_css') ) {
205
206
return implode( "\n", $attrs ) . "\n";
207
}
208
}
205
206
return implode( "\n", $attrs ) . "\n";
207
}
208
+ }
209
+
210
+
211
+ if( !function_exists('yit_curPageURL') ) {
212
+ /**
213
+ * Retrieve the current complete url
214
+ *
215
+ * @since 1.0
216
+ */
217
+ function yit_curPageURL() {
218
+ $pageURL = 'http';
219
+ if ( isset( $_SERVER["HTTPS"] ) AND $_SERVER["HTTPS"] == "on" )
220
+ $pageURL .= "s";
221
+
222
+ $pageURL .= "://";
223
+
224
+ if ( isset( $_SERVER["SERVER_PORT"] ) AND $_SERVER["SERVER_PORT"] != "80" )
225
+ $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
226
+ else
227
+ $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
228
+
229
+ return $pageURL;
230
+ }
231
}