Version Description
- Added: Link/Button text option in plugin options
- Added: ability to add a link in the menu top open the popup
- Fixed: bug with attributes added after installation
- Fixed: bug with plugin activated but not working for multisites
Download this release
Release Info
Developer | yithemes |
Plugin | YITH WooCommerce Compare |
Version | 1.0.1 |
Comparing to | |
See all releases |
Code changes from version 1.0.0 to 1.0.1
- README.txt +12 -1
- assets/js/woocompare-admin.js +2 -19
- assets/js/woocompare.js +6 -165
- class.yith-woocompare-admin.php +3 -2
- class.yith-woocompare-frontend.php +2 -2
- class.yith-woocompare-helper.php +1 -1
- class.yith-woocompare.php +1 -1
- functions.yith-woocompare.php +1 -1
- init.php +22 -19
- templates/compare.php +2 -2
- widgets/class.yith-woocompare-widget.php +1 -1
- yith-woocompare-options.php +9 -1
README.txt
CHANGED
@@ -4,7 +4,7 @@ Contributors: yithemes
|
|
4 |
Tags: woocommerce, compare, compare products, product compare, widget
|
5 |
Requires at least: 3.5.1
|
6 |
Tested up to: 3.5.1
|
7 |
-
Stable tag: 1.0.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -19,6 +19,10 @@ set with the woocommerce attributes in the product configuration.
|
|
19 |
You can also add a simple widget with the list of products the users have added, where you can manage them.
|
20 |
Also you can simply customize the compare table with your style, by editing the specific template.
|
21 |
|
|
|
|
|
|
|
|
|
22 |
Full documentation is available [here](http://yithemes.com/docs-plugins/yith_woocommerce_compare/).
|
23 |
|
24 |
|
@@ -75,6 +79,13 @@ Yes, you can sort the fields in the compare table. You can do it in Woocommerce
|
|
75 |
|
76 |
== Changelog ==
|
77 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
= 1.0.0 =
|
79 |
|
80 |
* Initial release
|
4 |
Tags: woocommerce, compare, compare products, product compare, widget
|
5 |
Requires at least: 3.5.1
|
6 |
Tested up to: 3.5.1
|
7 |
+
Stable tag: 1.0.1
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
19 |
You can also add a simple widget with the list of products the users have added, where you can manage them.
|
20 |
Also you can simply customize the compare table with your style, by editing the specific template.
|
21 |
|
22 |
+
Working demos are available here:
|
23 |
+
**[LIVE DEMO 1](http://demo.yithemes.com/room09/shop/)** - **[LIVE DEMO 2](http://demo.yithemes.com/bazar/shop/)**
|
24 |
+
|
25 |
+
|
26 |
Full documentation is available [here](http://yithemes.com/docs-plugins/yith_woocommerce_compare/).
|
27 |
|
28 |
|
79 |
|
80 |
== Changelog ==
|
81 |
|
82 |
+
= 1.0.1 =
|
83 |
+
|
84 |
+
* Added: Link/Button text option in plugin options
|
85 |
+
* Added: ability to add a link in the menu top open the popup
|
86 |
+
* Fixed: bug with attributes added after installation
|
87 |
+
* Fixed: bug with plugin activated but not working for multisites
|
88 |
+
|
89 |
= 1.0.0 =
|
90 |
|
91 |
* Initial release
|
assets/js/woocompare-admin.js
CHANGED
@@ -1,19 +1,2 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
$( ".attributes .fields" ).sortable({
|
4 |
-
cursor: "move",
|
5 |
-
scrollSensitivity: 10,
|
6 |
-
tolerance: "pointer",
|
7 |
-
axis: "y",
|
8 |
-
stop: function(event, ui) {
|
9 |
-
var list = ui.item.parents('.fields'),
|
10 |
-
fields = new Array();
|
11 |
-
$('input[type="checkbox"]', list).each(function(i){
|
12 |
-
fields[i] = $(this).val();
|
13 |
-
});
|
14 |
-
|
15 |
-
list.next().val( fields.join(',') );
|
16 |
-
}
|
17 |
-
});
|
18 |
-
|
19 |
-
});
|
1 |
+
|
2 |
+
jQuery(document).ready(function($){$(".attributes .fields").sortable({cursor:"move",scrollSensitivity:10,tolerance:"pointer",axis:"y",stop:function(event,ui){var list=ui.item.parents('.fields'),fields=new Array();$('input[type="checkbox"]',list).each(function(i){fields[i]=$(this).val();});list.next().val(fields.join(','));}});});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/js/woocompare.js
CHANGED
@@ -1,165 +1,6 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
var button = $(this),
|
8 |
-
data = {
|
9 |
-
_yitnonce_ajax: yith_woocompare.nonceadd,
|
10 |
-
action: yith_woocompare.actionadd,
|
11 |
-
id: button.data('product_id'),
|
12 |
-
context: 'frontend'
|
13 |
-
},
|
14 |
-
widget_list = $('.yith-woocompare-widget ul.products-list');
|
15 |
-
|
16 |
-
// add ajax loader
|
17 |
-
button.block({message: null, overlayCSS: {background: '#fff url(' + woocommerce_params.ajax_loader_url + ') no-repeat center', backgroundSize: '16px 16px', opacity: 0.6}});
|
18 |
-
widget_list.block({message: null, overlayCSS: {background: '#fff url(' + woocommerce_params.ajax_loader_url + ') no-repeat center', backgroundSize: '16px 16px', opacity: 0.6}});
|
19 |
-
|
20 |
-
$.ajax({
|
21 |
-
type: 'post',
|
22 |
-
url: yith_woocompare.ajaxurl,
|
23 |
-
data: data,
|
24 |
-
dataType: 'json',
|
25 |
-
success: function(response){
|
26 |
-
button.unblock().addClass('added').text( yith_woocompare.added_label );
|
27 |
-
|
28 |
-
// add the product in the widget
|
29 |
-
widget_list.unblock().html( response.widget_table );
|
30 |
-
|
31 |
-
if (yith_woocompare.auto_open == 'yes') $('body').trigger( 'yith_woocompare_open_popup', { response: response.table_url } );
|
32 |
-
}
|
33 |
-
});
|
34 |
-
});
|
35 |
-
|
36 |
-
// open popup
|
37 |
-
$('body').on( 'yith_woocompare_open_popup', function( e, data ) {
|
38 |
-
var response = data.response;
|
39 |
-
|
40 |
-
if ($(window).width() >= 768) {
|
41 |
-
$.colorbox({
|
42 |
-
href: response,
|
43 |
-
iframe: true,
|
44 |
-
width: '90%',
|
45 |
-
height: '90%',
|
46 |
-
onClosed: function(){
|
47 |
-
var widget_list = $('.yith-woocompare-widget ul.products-list'),
|
48 |
-
data = {
|
49 |
-
action: yith_woocompare.actionview,
|
50 |
-
context: 'frontend'
|
51 |
-
};
|
52 |
-
|
53 |
-
widget_list.block({message: null, overlayCSS: {background: '#fff url(' + woocommerce_params.ajax_loader_url + ') no-repeat center', backgroundSize: '16px 16px', opacity: 0.6}});
|
54 |
-
|
55 |
-
$.ajax({
|
56 |
-
type: 'post',
|
57 |
-
url: yith_woocompare.ajaxurl,
|
58 |
-
data: data,
|
59 |
-
success: function(response){
|
60 |
-
// add the product in the widget
|
61 |
-
widget_list.unblock().html( response );
|
62 |
-
}
|
63 |
-
});
|
64 |
-
}
|
65 |
-
});
|
66 |
-
|
67 |
-
$(window).resize(function () {
|
68 |
-
$.colorbox.resize({
|
69 |
-
width: '90%',
|
70 |
-
height: '90%'
|
71 |
-
});
|
72 |
-
});
|
73 |
-
|
74 |
-
} else {
|
75 |
-
var urlparts = response.split('?');
|
76 |
-
var parameter = 'iframe';
|
77 |
-
if (urlparts.length >= 2) {
|
78 |
-
var prefix = encodeURIComponent(parameter) + '=';
|
79 |
-
var pars = urlparts[1].split(/[&;]/g);
|
80 |
-
for (var i = pars.length; i-- > 0;)
|
81 |
-
if (pars[i].lastIndexOf(prefix, 0) !== -1)
|
82 |
-
pars.splice(i, 1);
|
83 |
-
response = urlparts[0] + '?' + pars.join('&');
|
84 |
-
}
|
85 |
-
|
86 |
-
window.open(response, yith_woocompare.table_title);
|
87 |
-
}
|
88 |
-
});
|
89 |
-
|
90 |
-
// remove from table
|
91 |
-
$(document).on( 'click', '.remove a', function(e){
|
92 |
-
e.preventDefault();
|
93 |
-
|
94 |
-
var button = $(this),
|
95 |
-
data = {
|
96 |
-
_yitnonce_ajax: yith_woocompare.nonceremove,
|
97 |
-
action: yith_woocompare.actionremove,
|
98 |
-
id: button.data('product_id'),
|
99 |
-
context: 'frontend'
|
100 |
-
},
|
101 |
-
product_cell = $( 'td.product_' + data.id + ', th.product_' + data.id );
|
102 |
-
|
103 |
-
// add ajax loader
|
104 |
-
button.block({message: null, overlayCSS: {background: '#fff url(' + woocommerce_params.ajax_loader_url + ') no-repeat center', backgroundSize: '16px 16px', opacity: 0.6}});
|
105 |
-
|
106 |
-
$.ajax({
|
107 |
-
type: 'post',
|
108 |
-
url: yith_woocompare.ajaxurl,
|
109 |
-
data: data,
|
110 |
-
dataType:'html',
|
111 |
-
success: function(response){
|
112 |
-
button.unblock();
|
113 |
-
|
114 |
-
// in compare table
|
115 |
-
var table = $(response).filter('table.compare-list');
|
116 |
-
$('body > table.compare-list').replaceWith( table );
|
117 |
-
|
118 |
-
// removed trigger
|
119 |
-
$(window).trigger('yith_woocompare_product_removed');
|
120 |
-
}
|
121 |
-
});
|
122 |
-
});
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
// ##### WIDGET ######
|
127 |
-
|
128 |
-
$('.yith-woocompare-widget')
|
129 |
-
|
130 |
-
// view table (click on compare
|
131 |
-
.on('click', 'a.compare', function (e) {
|
132 |
-
e.preventDefault();
|
133 |
-
$('body').trigger('yith_woocompare_open_popup', { response: $(this).attr('href') });
|
134 |
-
})
|
135 |
-
|
136 |
-
// remove product & clear all
|
137 |
-
.on('click', 'li a.remove, a.clear-all', function (e) {
|
138 |
-
e.preventDefault();
|
139 |
-
|
140 |
-
var button = $(this),
|
141 |
-
data = {
|
142 |
-
_yitnonce_ajax: yith_woocompare.nonceremove,
|
143 |
-
action: yith_woocompare.actionremove,
|
144 |
-
id: button.data('product_id'),
|
145 |
-
context: 'frontend',
|
146 |
-
responseType: 'product_list'
|
147 |
-
},
|
148 |
-
product_list = button.parents('.yith-woocompare-widget').find('ul.products-list');
|
149 |
-
|
150 |
-
// add ajax loader
|
151 |
-
product_list.block({message: null, overlayCSS: {background: '#fff url(' + woocommerce_params.ajax_loader_url + ') no-repeat center', backgroundSize: '16px 16px', opacity: 0.6}});
|
152 |
-
|
153 |
-
$.ajax({
|
154 |
-
type: 'post',
|
155 |
-
url: yith_woocompare.ajaxurl,
|
156 |
-
data: data,
|
157 |
-
dataType: 'html',
|
158 |
-
success: function (response) {
|
159 |
-
product_list.html(response);
|
160 |
-
product_list.unblock();
|
161 |
-
}
|
162 |
-
});
|
163 |
-
});
|
164 |
-
|
165 |
-
});
|
1 |
+
|
2 |
+
jQuery(document).ready(function($){$(document).on('click','.product .compare',function(e){e.preventDefault();var button=$(this),data={_yitnonce_ajax:yith_woocompare.nonceadd,action:yith_woocompare.actionadd,id:button.data('product_id'),context:'frontend'},widget_list=$('.yith-woocompare-widget ul.products-list');button.block({message:null,overlayCSS:{background:'#fff url('+woocommerce_params.ajax_loader_url+') no-repeat center',backgroundSize:'16px 16px',opacity:0.6}});widget_list.block({message:null,overlayCSS:{background:'#fff url('+woocommerce_params.ajax_loader_url+') no-repeat center',backgroundSize:'16px 16px',opacity:0.6}});$.ajax({type:'post',url:yith_woocompare.ajaxurl,data:data,dataType:'json',success:function(response){button.unblock().addClass('added').text(yith_woocompare.added_label);widget_list.unblock().html(response.widget_table);if(yith_woocompare.auto_open=='yes')$('body').trigger('yith_woocompare_open_popup',{response:response.table_url});}});});$('body').on('yith_woocompare_open_popup',function(e,data){var response=data.response;if($(window).width()>=768){$.colorbox({href:response,iframe:true,width:'90%',height:'90%',onClosed:function(){var widget_list=$('.yith-woocompare-widget ul.products-list'),data={action:yith_woocompare.actionview,context:'frontend'};widget_list.block({message:null,overlayCSS:{background:'#fff url('+woocommerce_params.ajax_loader_url+') no-repeat center',backgroundSize:'16px 16px',opacity:0.6}});$.ajax({type:'post',url:yith_woocompare.ajaxurl,data:data,success:function(response){widget_list.unblock().html(response);}});}});$(window).resize(function(){$.colorbox.resize({width:'90%',height:'90%'});});}else{var urlparts=response.split('?');var parameter='iframe';if(urlparts.length>=2){var prefix=encodeURIComponent(parameter)+'=';var pars=urlparts[1].split(/[&;]/g);for(var i=pars.length;i-->0;)
|
3 |
+
if(pars[i].lastIndexOf(prefix,0)!==-1)
|
4 |
+
pars.splice(i,1);response=urlparts[0]+'?'+pars.join('&');}
|
5 |
+
window.open(response,yith_woocompare.table_title);}});$(document).on('click','.remove a',function(e){e.preventDefault();var button=$(this),data={_yitnonce_ajax:yith_woocompare.nonceremove,action:yith_woocompare.actionremove,id:button.data('product_id'),context:'frontend'},product_cell=$('td.product_'+data.id+', th.product_'+data.id);button.block({message:null,overlayCSS:{background:'#fff url('+woocommerce_params.ajax_loader_url+') no-repeat center',backgroundSize:'16px 16px',opacity:0.6}});$.ajax({type:'post',url:yith_woocompare.ajaxurl,data:data,dataType:'html',success:function(response){button.unblock();var table=$(response).filter('table.compare-list');$('body > table.compare-list').replaceWith(table);$(window).trigger('yith_woocompare_product_removed');}});});$('.yith-woocompare-open a, a.yith-woocompare-open').on('click',function(e){e.preventDefault();$('body').trigger('yith_woocompare_open_popup',{response:yith_add_query_arg('action',yith_woocompare.actionview)+'&iframe=true'});});$('.yith-woocompare-widget').on('click','a.compare',function(e){e.preventDefault();$('body').trigger('yith_woocompare_open_popup',{response:$(this).attr('href')});}).on('click','li a.remove, a.clear-all',function(e){e.preventDefault();var button=$(this),data={_yitnonce_ajax:yith_woocompare.nonceremove,action:yith_woocompare.actionremove,id:button.data('product_id'),context:'frontend',responseType:'product_list'},product_list=button.parents('.yith-woocompare-widget').find('ul.products-list');product_list.block({message:null,overlayCSS:{background:'#fff url('+woocommerce_params.ajax_loader_url+') no-repeat center',backgroundSize:'16px 16px',opacity:0.6}});$.ajax({type:'post',url:yith_woocompare.ajaxurl,data:data,dataType:'html',success:function(response){product_list.html(response);product_list.unblock();}});});function yith_add_query_arg(key,value)
|
6 |
+
{key=escape(key);value=escape(value);var s=document.location.search;var kvp=key+"="+value;var r=new RegExp("(&|\\?)"+key+"=[^\&]*");s=s.replace(r,"$1"+kvp);if(!RegExp.$1){s+=(s.length>0?'&':'?')+kvp;};return s;}});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class.yith-woocompare-admin.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* @author Your Inspiration Themes
|
6 |
* @package YITH WooCommerce Magnifier
|
7 |
-
* @version 1.0.
|
8 |
*/
|
9 |
|
10 |
if ( !defined( 'YITH_WOOCOMPARE' ) ) { exit; } // Exit if accessed directly
|
@@ -288,7 +288,8 @@ class YITH_Woocompare_Admin {
|
|
288 |
$checkboxes = get_option( $value['id'], $value['default'] == 'all' ? $all : array() );
|
289 |
|
290 |
// add fields that are not still saved
|
291 |
-
$checkboxes =
|
|
|
292 |
?>
|
293 |
<tr valign="top">
|
294 |
<th scope="row" class="titledesc">
|
4 |
*
|
5 |
* @author Your Inspiration Themes
|
6 |
* @package YITH WooCommerce Magnifier
|
7 |
+
* @version 1.0.1
|
8 |
*/
|
9 |
|
10 |
if ( !defined( 'YITH_WOOCOMPARE' ) ) { exit; } // Exit if accessed directly
|
288 |
$checkboxes = get_option( $value['id'], $value['default'] == 'all' ? $all : array() );
|
289 |
|
290 |
// add fields that are not still saved
|
291 |
+
$checkboxes = wp_parse_args( $checkboxes, $all );
|
292 |
+
//$checkboxes = array_merge( $checkboxes, array_diff_assoc( $checkboxes, $all ) );
|
293 |
?>
|
294 |
<tr valign="top">
|
295 |
<th scope="row" class="titledesc">
|
class.yith-woocompare-frontend.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* @author Your Inspiration Themes
|
6 |
* @package YITH Woocommerce Compare
|
7 |
-
* @version 1.0.
|
8 |
*/
|
9 |
|
10 |
if ( !defined( 'YITH_WOOCOMPARE' ) ) { exit; } // Exit if accessed directly
|
@@ -326,7 +326,7 @@ if( !class_exists( 'YITH_Woocompare_Frontend' ) ) {
|
|
326 |
|
327 |
$is_button = !isset( $button_or_link ) || !$button_or_link ? get_option( 'yith_woocompare_is_button' ) : $button_or_link;
|
328 |
|
329 |
-
printf( '<a href="%s" class="%s" data-product_id="%d">%s</a>', $this->add_product_url( $product_id ), 'compare' . ( $is_button == 'button' ? ' button' : '' ), $product_id, ( isset( $button_text ) && $button_text != 'default' ? $button_text : __( 'Compare','yit' ) ) );
|
330 |
}
|
331 |
|
332 |
/**
|
4 |
*
|
5 |
* @author Your Inspiration Themes
|
6 |
* @package YITH Woocommerce Compare
|
7 |
+
* @version 1.0.1
|
8 |
*/
|
9 |
|
10 |
if ( !defined( 'YITH_WOOCOMPARE' ) ) { exit; } // Exit if accessed directly
|
326 |
|
327 |
$is_button = !isset( $button_or_link ) || !$button_or_link ? get_option( 'yith_woocompare_is_button' ) : $button_or_link;
|
328 |
|
329 |
+
printf( '<a href="%s" class="%s" data-product_id="%d">%s</a>', $this->add_product_url( $product_id ), 'compare' . ( $is_button == 'button' ? ' button' : '' ), $product_id, ( isset( $button_text ) && $button_text != 'default' ? $button_text : get_option( 'yith_woocompare_button_text', __( 'Compare', 'yit' ) ) ) );
|
330 |
}
|
331 |
|
332 |
/**
|
class.yith-woocompare-helper.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* @author Your Inspiration Themes
|
6 |
* @package YITH WooCommerce Compare
|
7 |
-
* @version 1.0.
|
8 |
*/
|
9 |
|
10 |
if ( !defined( 'YITH_WOOCOMPARE' ) ) { exit; } // Exit if accessed directly
|
4 |
*
|
5 |
* @author Your Inspiration Themes
|
6 |
* @package YITH WooCommerce Compare
|
7 |
+
* @version 1.0.1
|
8 |
*/
|
9 |
|
10 |
if ( !defined( 'YITH_WOOCOMPARE' ) ) { exit; } // Exit if accessed directly
|
class.yith-woocompare.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* @author Your Inspiration Themes
|
6 |
* @package YITH Woocommerce Compare
|
7 |
-
* @version 1.0.
|
8 |
*/
|
9 |
|
10 |
if ( !defined( 'YITH_WOOCOMPARE' ) ) { exit; } // Exit if accessed directly
|
4 |
*
|
5 |
* @author Your Inspiration Themes
|
6 |
* @package YITH Woocommerce Compare
|
7 |
+
* @version 1.0.1
|
8 |
*/
|
9 |
|
10 |
if ( !defined( 'YITH_WOOCOMPARE' ) ) { exit; } // Exit if accessed directly
|
functions.yith-woocompare.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* @author Your Inspiration Themes
|
6 |
* @package YITH Woocommerce Compare
|
7 |
-
* @version 1.0.
|
8 |
*/
|
9 |
|
10 |
if ( !defined( 'YITH_WOOCOMPARE' ) ) { exit; } // Exit if accessed directly
|
4 |
*
|
5 |
* @author Your Inspiration Themes
|
6 |
* @package YITH Woocommerce Compare
|
7 |
+
* @version 1.0.1
|
8 |
*/
|
9 |
|
10 |
if ( !defined( 'YITH_WOOCOMPARE' ) ) { exit; } // Exit if accessed directly
|
init.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: YITH Woocommerce Compare
|
4 |
* Plugin URI: http://yithemes.com/
|
5 |
* Description: YITH Woocommerce Compare allows you to compare more products with woocommerce plugin, through product attributes.
|
6 |
-
* Version: 1.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 Compare
|
14 |
-
* @version 1.0.
|
15 |
*/
|
16 |
/* Copyright 2013 Your Inspiration Themes (email : plugins@yithemes.com)
|
17 |
|
@@ -37,24 +37,27 @@ if( !defined('YITH_FUNCTIONS') ) {
|
|
37 |
require_once( 'yit-common/yith-panel.php' );
|
38 |
}
|
39 |
|
40 |
-
|
41 |
-
|
|
|
42 |
|
43 |
-
load_plugin_textdomain( 'yit', false, dirname( plugin_basename( __FILE__ ) ). '/languages/' );
|
44 |
|
45 |
-
define( 'YITH_WOOCOMPARE', true );
|
46 |
-
define( 'YITH_WOOCOMPARE_VERSION', '1.0.
|
47 |
-
define( 'YITH_WOOCOMPARE_URL', plugin_dir_url( __FILE__ ) );
|
48 |
-
define( 'YITH_WOOCOMPARE_DIR', plugin_dir_path( __FILE__ ) );
|
49 |
|
50 |
-
// Load required classes and functions
|
51 |
-
require_once('class.yith-woocompare-helper.php');
|
52 |
-
require_once('functions.yith-woocompare.php');
|
53 |
-
require_once('class.yith-woocompare-admin.php');
|
54 |
-
require_once('class.yith-woocompare-frontend.php');
|
55 |
-
require_once('widgets/class.yith-woocompare-widget.php');
|
56 |
-
require_once('class.yith-woocompare.php');
|
57 |
|
58 |
-
// Let's start the game!
|
59 |
-
global $yith_woocompare;
|
60 |
-
$yith_woocompare = new YITH_Woocompare();
|
|
|
|
3 |
* Plugin Name: YITH Woocommerce Compare
|
4 |
* Plugin URI: http://yithemes.com/
|
5 |
* Description: YITH Woocommerce Compare allows you to compare more products with woocommerce plugin, through product attributes.
|
6 |
+
* Version: 1.0.1
|
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 Compare
|
14 |
+
* @version 1.0.1
|
15 |
*/
|
16 |
/* Copyright 2013 Your Inspiration Themes (email : plugins@yithemes.com)
|
17 |
|
37 |
require_once( 'yit-common/yith-panel.php' );
|
38 |
}
|
39 |
|
40 |
+
function yith_woocompare_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_WOOCOMPARE', true );
|
47 |
+
define( 'YITH_WOOCOMPARE_VERSION', '1.0.1' );
|
48 |
+
define( 'YITH_WOOCOMPARE_URL', plugin_dir_url( __FILE__ ) );
|
49 |
+
define( 'YITH_WOOCOMPARE_DIR', plugin_dir_path( __FILE__ ) );
|
50 |
|
51 |
+
// Load required classes and functions
|
52 |
+
require_once('class.yith-woocompare-helper.php');
|
53 |
+
require_once('functions.yith-woocompare.php');
|
54 |
+
require_once('class.yith-woocompare-admin.php');
|
55 |
+
require_once('class.yith-woocompare-frontend.php');
|
56 |
+
require_once('widgets/class.yith-woocompare-widget.php');
|
57 |
+
require_once('class.yith-woocompare.php');
|
58 |
|
59 |
+
// Let's start the game!
|
60 |
+
global $yith_woocompare;
|
61 |
+
$yith_woocompare = new YITH_Woocompare();
|
62 |
+
}
|
63 |
+
add_action( 'plugins_loaded', 'yith_woocompare_constructor' );
|
templates/compare.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* @author Your Inspiration Themes
|
6 |
* @package YITH Woocommerce Compare
|
7 |
-
* @version 1.0.
|
8 |
*/
|
9 |
|
10 |
global $product;
|
@@ -164,7 +164,7 @@ foreach( $products as $product ) $widths[] = '{ "sWidth": "205px", resizeable:tr
|
|
164 |
</tbody>
|
165 |
</table>
|
166 |
|
167 |
-
<?php
|
168 |
|
169 |
<script type="text/javascript">
|
170 |
|
4 |
*
|
5 |
* @author Your Inspiration Themes
|
6 |
* @package YITH Woocommerce Compare
|
7 |
+
* @version 1.0.1
|
8 |
*/
|
9 |
|
10 |
global $product;
|
164 |
</tbody>
|
165 |
</table>
|
166 |
|
167 |
+
<?php do_action('wp_print_footer_scripts'); ?>
|
168 |
|
169 |
<script type="text/javascript">
|
170 |
|
widgets/class.yith-woocompare-widget.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* @author Your Inspiration Themes
|
6 |
* @package YITH WooCommerce Ajax Navigation
|
7 |
-
* @version 1.0.
|
8 |
*/
|
9 |
|
10 |
if ( !defined( 'YITH_WOOCOMPARE' ) ) { exit; } // Exit if accessed directly
|
4 |
*
|
5 |
* @author Your Inspiration Themes
|
6 |
* @package YITH WooCommerce Ajax Navigation
|
7 |
+
* @version 1.0.1
|
8 |
*/
|
9 |
|
10 |
if ( !defined( 'YITH_WOOCOMPARE' ) ) { exit; } // Exit if accessed directly
|
yith-woocompare-options.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
*
|
5 |
* @author Your Inspiration Themes
|
6 |
* @package YITH Woocommerce Compare
|
7 |
-
* @version 1.0.
|
8 |
*/
|
9 |
|
10 |
if ( !defined( 'YITH_WOOCOMPARE' ) ) { exit; } // Exit if accessed directly
|
@@ -31,6 +31,14 @@ $options = array(
|
|
31 |
)
|
32 |
),
|
33 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
array(
|
35 |
'name' => __( 'Show button in single product page', 'yit' ),
|
36 |
'desc' => __( 'Say if you want to show the button in the single product page.', 'yit' ),
|
4 |
*
|
5 |
* @author Your Inspiration Themes
|
6 |
* @package YITH Woocommerce Compare
|
7 |
+
* @version 1.0.1
|
8 |
*/
|
9 |
|
10 |
if ( !defined( 'YITH_WOOCOMPARE' ) ) { exit; } // Exit if accessed directly
|
31 |
)
|
32 |
),
|
33 |
|
34 |
+
array(
|
35 |
+
'name' => __( 'Link/Button text', 'yit' ),
|
36 |
+
'desc' => __( 'Type the text to use for the button or the link of the compare.', 'yit' ),
|
37 |
+
'id' => 'yith_woocompare_button_text',
|
38 |
+
'std' => __( 'Compare', 'yit' ),
|
39 |
+
'type' => 'text'
|
40 |
+
),
|
41 |
+
|
42 |
array(
|
43 |
'name' => __( 'Show button in single product page', 'yit' ),
|
44 |
'desc' => __( 'Say if you want to show the button in the single product page.', 'yit' ),
|