YITH WooCommerce Compare - Version 2.0.3

Version Description

  • Added: Compatibility with WooPress 4.3
Download this release

Release Info

Developer yithemes
Plugin Icon 128x128 YITH WooCommerce Compare
Version 2.0.3
Comparing to
See all releases

Code changes from version 2.0.2 to 2.0.3

README.txt CHANGED
@@ -3,8 +3,8 @@
3
Contributors: yithemes
4
Tags: wc, shop, woocommerce, compare, compare products, product compare, widget, comparison, product comparison, compare table
5
Requires at least: 3.5.1
6
- Tested up to: 4.2.4
7
- Stable tag: 2.0.2
8
License: GPLv2 or later
9
License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
@@ -64,6 +64,10 @@ Yes, you can sort the fields in the compare table. You can do it in YIT Plugins
64
65
== Changelog ==
66
67
= 2.0.2 =
68
69
* Added: Compatibility with WooCommerce 2.4
3
Contributors: yithemes
4
Tags: wc, shop, woocommerce, compare, compare products, product compare, widget, comparison, product comparison, compare table
5
Requires at least: 3.5.1
6
+ Tested up to: 4.3
7
+ Stable tag: 2.0.3
8
License: GPLv2 or later
9
License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
64
65
== Changelog ==
66
67
+ = 2.0.3 =
68
+
69
+ * Added: Compatibility with WooPress 4.3
70
+
71
= 2.0.2 =
72
73
* Added: Compatibility with WooCommerce 2.4
includes/class.yith-woocompare-admin.php CHANGED
@@ -115,7 +115,9 @@ if ( ! class_exists( 'YITH_Woocompare_Admin' ) ) {
115
public function action_links( $links ) {
116
117
$links[] = '<a href="' . admin_url( "admin.php?page={$this->_panel_page}" ) . '">' . __( 'Settings', 'yith-wcmp' ) . '</a>';
118
- $links[] = '<a href="' . $this->get_premium_landing_uri() . '" target="_blank">' . __( 'Premium Version', 'yith-wcmp' ) . '</a>';
119
120
return $links;
121
}
@@ -209,9 +211,10 @@ if ( ! class_exists( 'YITH_Woocompare_Admin' ) ) {
209
*/
210
public function plugin_row_meta( $plugin_meta, $plugin_file, $plugin_data, $status ) {
211
212
- if ( defined( 'YITH_WOOCOMPARE_FREE_INIT' ) && YITH_WOOCOMPARE_FREE_INIT == $plugin_file ) {
213
$plugin_meta[] = '<a href="' . $this->doc_url . '" target="_blank">' . __( 'Plugin Documentation', 'yith-wcmp' ) . '</a>';
214
}
215
return $plugin_meta;
216
}
217
115
public function action_links( $links ) {
116
117
$links[] = '<a href="' . admin_url( "admin.php?page={$this->_panel_page}" ) . '">' . __( 'Settings', 'yith-wcmp' ) . '</a>';
118
+ if ( ! ( defined( 'YITH_WOOCOMPARE_PREMIUM' ) && YITH_WOOCOMPARE_PREMIUM ) ) {
119
+ $links[] = '<a href="' . $this->get_premium_landing_uri() . '" target="_blank">' . __( 'Premium Version', 'yith-wcmp' ) . '</a>';
120
+ }
121
122
return $links;
123
}
211
*/
212
public function plugin_row_meta( $plugin_meta, $plugin_file, $plugin_data, $status ) {
213
214
+ if ( defined( 'YITH_WOOCOMPARE_INIT' ) && YITH_WOOCOMPARE_INIT == $plugin_file ) {
215
$plugin_meta[] = '<a href="' . $this->doc_url . '" target="_blank">' . __( 'Plugin Documentation', 'yith-wcmp' ) . '</a>';
216
}
217
+
218
return $plugin_meta;
219
}
220
includes/class.yith-woocompare-frontend.php CHANGED
@@ -340,7 +340,7 @@ if( !class_exists( 'YITH_Woocompare_Frontend' ) ) {
340
341
if ( ! $product_id ) {
342
global $product;
343
- $product_id = isset( $product->id ) && $product->exists() ? $product->id : 0;
344
}
345
346
// return if product doesn't exist
@@ -415,7 +415,7 @@ if( !class_exists( 'YITH_Woocompare_Frontend' ) ) {
415
$product = $this->wc_get_product( $product_id );
416
417
// don't add the product if doesn't exist
418
- if ( $product && ! $product->exists() && ! in_array( $product_id, $this->products_list ) ) {
419
$this->add_product_to_compare( $product_id );
420
}
421
@@ -433,7 +433,7 @@ if( !class_exists( 'YITH_Woocompare_Frontend' ) ) {
433
$product = $this->wc_get_product( $product_id );
434
435
// don't add the product if doesn't exist
436
- if ( $product && $product->exists() && ! in_array( $product_id, $this->products_list ) ) {
437
$this->add_product_to_compare( $product_id );
438
}
439
@@ -605,7 +605,7 @@ if( !class_exists( 'YITH_Woocompare_Frontend' ) ) {
605
*/
606
if ( ! $atts['product'] ) {
607
global $product;
608
- $product_id = isset( $product->id ) && $product->exists() ? $product->id : 0;
609
} else {
610
global $wpdb;
611
$product = $wpdb->get_row( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE ID = %d OR post_name = %s OR post_title = %s LIMIT 1", $atts['product'], $atts['product'], $atts['product'] ) );
340
341
if ( ! $product_id ) {
342
global $product;
343
+ $product_id = isset( $product->id ) ? $product->id : 0;
344
}
345
346
// return if product doesn't exist
415
$product = $this->wc_get_product( $product_id );
416
417
// don't add the product if doesn't exist
418
+ if ( isset( $product->id ) && ! in_array( $product_id, $this->products_list ) ) {
419
$this->add_product_to_compare( $product_id );
420
}
421
433
$product = $this->wc_get_product( $product_id );
434
435
// don't add the product if doesn't exist
436
+ if ( isset( $product->id ) && ! in_array( $product_id, $this->products_list ) ) {
437
$this->add_product_to_compare( $product_id );
438
}
439
605
*/
606
if ( ! $atts['product'] ) {
607
global $product;
608
+ $product_id = isset( $product->id ) ? $product->id : 0;
609
} else {
610
global $wpdb;
611
$product = $wpdb->get_row( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE ID = %d OR post_name = %s OR post_title = %s LIMIT 1", $atts['product'], $atts['product'], $atts['product'] ) );
init.php CHANGED
@@ -3,7 +3,7 @@
3
* Plugin Name: YITH WooCommerce Compare
4
* Plugin URI: https://yithemes.com/
5
* Description: YITH WooCommerce Compare allows you to compare more products with WooCommerce plugin, through product attributes.
6
- * Version: 2.0.2
7
* Author: Yithemes
8
* Author URI: http://yithemes.com/
9
* Text Domain: yith-wcmp
@@ -11,7 +11,7 @@
11
*
12
* @author Yithemes
13
* @package YITH WooCommerce Compare
14
- * @version 2.0.2
15
*/
16
/* Copyright 2013 Your Inspiration Themes (email : plugins@yithemes.com)
17
@@ -56,7 +56,7 @@ if ( ! function_exists( 'yith_plugin_registration_hook' ) ) {
56
register_activation_hook( __FILE__, 'yith_plugin_registration_hook' );
57
58
if ( ! defined( 'YITH_WOOCOMPARE_VERSION' ) ){
59
- define( 'YITH_WOOCOMPARE_VERSION', '2.0.2' );
60
}
61
if ( ! defined( 'YITH_WOOCOMPARE_FREE_INIT' ) ) {
62
define( 'YITH_WOOCOMPARE_FREE_INIT', plugin_basename( __FILE__ ) );
3
* Plugin Name: YITH WooCommerce Compare
4
* Plugin URI: https://yithemes.com/
5
* Description: YITH WooCommerce Compare allows you to compare more products with WooCommerce plugin, through product attributes.
6
+ * Version: 2.0.3
7
* Author: Yithemes
8
* Author URI: http://yithemes.com/
9
* Text Domain: yith-wcmp
11
*
12
* @author Yithemes
13
* @package YITH WooCommerce Compare
14
+ * @version 2.0.3
15
*/
16
/* Copyright 2013 Your Inspiration Themes (email : plugins@yithemes.com)
17
56
register_activation_hook( __FILE__, 'yith_plugin_registration_hook' );
57
58
if ( ! defined( 'YITH_WOOCOMPARE_VERSION' ) ){
59
+ define( 'YITH_WOOCOMPARE_VERSION', '2.0.3' );
60
}
61
if ( ! defined( 'YITH_WOOCOMPARE_FREE_INIT' ) ) {
62
define( 'YITH_WOOCOMPARE_FREE_INIT', plugin_basename( __FILE__ ) );