YITH WooCommerce Wishlist - Version 1.0.3

Version Description

  • Minor bugs fixes
Download this release

Release Info

Developer yithemes
Plugin Icon 128x128 YITH WooCommerce Wishlist
Version 1.0.3
Comparing to
See all releases

Code changes from version 1.0.2 to 1.0.3

README.txt CHANGED
@@ -4,7 +4,7 @@ Contributors: yithemes
4
  Tags: wishlist, woocommerce, products, themes, yit, e-commerce, shop
5
  Requires at least: 3.5.1
6
  Tested up to: 3.5.1
7
- Stable tag: 1.0.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -74,6 +74,10 @@ Yes, you can change the colors of background, text and border or apply a custom
74
 
75
  == Changelog ==
76
 
 
 
 
 
77
  = 1.0.2 =
78
 
79
  * Fixed fatal error to yit_debug with yit themes
4
  Tags: wishlist, woocommerce, products, themes, yit, e-commerce, shop
5
  Requires at least: 3.5.1
6
  Tested up to: 3.5.1
7
+ Stable tag: 1.0.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
74
 
75
  == Changelog ==
76
 
77
+ = 1.0.3 =
78
+
79
+ * Minor bugs fixes
80
+
81
  = 1.0.2 =
82
 
83
  * Fixed fatal error to yit_debug with yit themes
class.yith-wcwl-shortcode.php CHANGED
@@ -21,7 +21,7 @@ if( !class_exists( 'YITH_WCWL_Shortcode' ) ) {
21
  *
22
  * @since 1.0.0
23
  */
24
- public function wishlist( $atts, $content = null ) {
25
  $atts = shortcode_atts( array(
26
  'per_page' => 10,
27
  'pagination' => 'no'
@@ -38,7 +38,7 @@ if( !class_exists( 'YITH_WCWL_Shortcode' ) ) {
38
  *
39
  * @since 1.0.0
40
  */
41
- public function add_to_wishlist( $atts, $content = null ) {
42
  global $product, $yith_wcwl;
43
 
44
  $html = YITH_WCWL_UI::add_to_wishlist_button( $yith_wcwl->get_wishlist_url(), $product->product_type, $yith_wcwl->is_product_in_wishlist( $product->id ) );
21
  *
22
  * @since 1.0.0
23
  */
24
+ public static function wishlist( $atts, $content = null ) {
25
  $atts = shortcode_atts( array(
26
  'per_page' => 10,
27
  'pagination' => 'no'
38
  *
39
  * @since 1.0.0
40
  */
41
+ public static function add_to_wishlist( $atts, $content = null ) {
42
  global $product, $yith_wcwl;
43
 
44
  $html = YITH_WCWL_UI::add_to_wishlist_button( $yith_wcwl->get_wishlist_url(), $product->product_type, $yith_wcwl->is_product_in_wishlist( $product->id ) );
class.yith-wcwl-ui.php CHANGED
@@ -57,12 +57,12 @@ if( !class_exists( 'YITH_WCWL_UI' ) ) {
57
 
58
  $html .= $exists ? ' hide" style="display:none;"' : ' show"';
59
 
60
- $html .= '><a href="' . $yith_wcwl->get_addtowishlist_url() . '" data-product-id="' . $product->id . '" data-product-type="' . $product_type . '" ' . $classes . ' >' . $icon . $label . '</a>';
61
  $html .= '<img src="' . esc_url( admin_url( 'images/wpspin_light.gif' ) ) . '" class="ajax-loading" id="add-items-ajax-loading" alt="" width="16" height="16" style="visibility:hidden" />';
62
  $html .= '</div>';
63
 
64
- $html .= '<div class="yith-wcwl-wishlistaddedbrowse hide" style="display:none;"><span class="feedback">' . __( 'Product added!','yit' ) . '</span> <a href="' . $url . '">' . apply_filters( 'yith-wcwl-browse-wishlist-label', __( 'Browse Wishlist', 'yit' ) ) . '</a></div>';
65
- $html .= '<div class="yith-wcwl-wishlistexistsbrowse ' . ( $exists ? 'show' : 'hide' ) . '" style="display:' . ( $exists ? 'block' : 'none' ) . '"><span class="feedback">' . __( 'The product is already in the wishlist!', 'yit' ) . '</span> <a href="' . $url . '">' . apply_filters( 'yith-wcwl-browse-wishlist-label', __( 'Browse Wishlist', 'yit' ) ) . '</a></div>';
66
  $html .= '<div style="clear:both"></div><div class="yith-wcwl-wishlistaddresponse"></div>';
67
 
68
  $html .= '</div>';
57
 
58
  $html .= $exists ? ' hide" style="display:none;"' : ' show"';
59
 
60
+ $html .= '><a href="' . esc_url( $yith_wcwl->get_addtowishlist_url() ) . '" data-product-id="' . $product->id . '" data-product-type="' . $product_type . '" ' . $classes . ' >' . $icon . $label . '</a>';
61
  $html .= '<img src="' . esc_url( admin_url( 'images/wpspin_light.gif' ) ) . '" class="ajax-loading" id="add-items-ajax-loading" alt="" width="16" height="16" style="visibility:hidden" />';
62
  $html .= '</div>';
63
 
64
+ $html .= '<div class="yith-wcwl-wishlistaddedbrowse hide" style="display:none;"><span class="feedback">' . __( 'Product added!','yit' ) . '</span> <a href="' . esc_url( $url ) . '">' . apply_filters( 'yith-wcwl-browse-wishlist-label', __( 'Browse Wishlist', 'yit' ) ) . '</a></div>';
65
+ $html .= '<div class="yith-wcwl-wishlistexistsbrowse ' . ( $exists ? 'show' : 'hide' ) . '" style="display:' . ( $exists ? 'block' : 'none' ) . '"><span class="feedback">' . __( 'The product is already in the wishlist!', 'yit' ) . '</span> <a href="' . esc_url( $url ) . '">' . apply_filters( 'yith-wcwl-browse-wishlist-label', __( 'Browse Wishlist', 'yit' ) ) . '</a></div>';
66
  $html .= '<div style="clear:both"></div><div class="yith-wcwl-wishlistaddresponse"></div>';
67
 
68
  $html .= '</div>';
class.yith-wcwl.php CHANGED
@@ -245,7 +245,7 @@ if( !class_exists( 'YITH_WCWL' ) ) {
245
  * @since 1.0.0
246
  */
247
  public function get_wishlist_url() {
248
- return home_url() . '/?page_id=' . get_option( 'yith_wcwl_wishlist_page_id' );
249
  }
250
 
251
  /**
@@ -367,7 +367,7 @@ if( !class_exists( 'YITH_WCWL' ) ) {
367
  $count = yith_wcwl_count_products();
368
 
369
  if( $this->remove( $_GET['wishlist_item_id'] ) )
370
- { _e( 'Product successfully removed.', 'yit' ); }
371
  else {
372
  echo '#' . $count . '#';
373
  _e( 'Error. Unable to remove the product from the wishlist.', 'yit' );
245
  * @since 1.0.0
246
  */
247
  public function get_wishlist_url() {
248
+ return get_permalink( get_option( 'yith_wcwl_wishlist_page_id' ) );
249
  }
250
 
251
  /**
367
  $count = yith_wcwl_count_products();
368
 
369
  if( $this->remove( $_GET['wishlist_item_id'] ) )
370
+ { echo apply_filters( 'yith_wcwl_product_removed_text', __( 'Product successfully removed.', 'yit' ) ); }
371
  else {
372
  echo '#' . $count . '#';
373
  _e( 'Error. Unable to remove the product from the wishlist.', 'yit' );
init.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: YITH WooCommerce Wishlist
4
  * Plugin URI: http://yithemes.com/
5
  * Description: YITH WooCommerce Wishlist allows you to add Wishlist functionality to your e-commerce.
6
- * Version: 1.0.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 Wishlist
14
- * @version 1.0.2
15
  */
16
  /* Copyright 2013 Your Inspiration Themes (email : plugins@yithemes.com)
17
 
@@ -36,25 +36,30 @@ 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_WCWL', true );
44
- define( 'YITH_WCWL_URL', plugin_dir_url( __FILE__ ) );
45
- define( 'YITH_WCWL_DIR', plugin_dir_path( __FILE__ ) );
46
 
47
- // Load required classes and functions
48
- require_once( 'functions.yith-wcwl.php' );
49
- require_once( 'class.yith-wcwl.php' );
50
- require_once( 'class.yith-wcwl-init.php' );
51
- require_once( 'class.yith-wcwl-install.php' );
52
 
53
- if( get_option( 'yith_wcwl_enabled' ) == 'yes' ) {
54
- require_once( 'class.yith-wcwl-ui.php' );
55
- require_once( 'class.yith-wcwl-shortcode.php' );
56
- }
 
 
 
 
 
 
57
 
58
- // Let's start the game!
59
- global $yith_wcwl;
60
- $yith_wcwl = new YITH_WCWL( $_REQUEST );
 
 
3
  * Plugin Name: YITH WooCommerce Wishlist
4
  * Plugin URI: http://yithemes.com/
5
  * Description: YITH WooCommerce Wishlist allows you to add Wishlist functionality to your e-commerce.
6
+ * Version: 1.0.3
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 Wishlist
14
+ * @version 1.0.3
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_wishlist_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_WCWL', true );
47
+ define( 'YITH_WCWL_URL', plugin_dir_url( __FILE__ ) );
48
+ define( 'YITH_WCWL_DIR', plugin_dir_path( __FILE__ ) );
 
 
49
 
50
+ // Load required classes and functions
51
+ require_once( 'functions.yith-wcwl.php' );
52
+ require_once( 'class.yith-wcwl.php' );
53
+ require_once( 'class.yith-wcwl-init.php' );
54
+ require_once( 'class.yith-wcwl-install.php' );
55
+
56
+ if( get_option( 'yith_wcwl_enabled' ) == 'yes' ) {
57
+ require_once( 'class.yith-wcwl-ui.php' );
58
+ require_once( 'class.yith-wcwl-shortcode.php' );
59
+ }
60
 
61
+ // Let's start the game!
62
+ global $yith_wcwl;
63
+ $yith_wcwl = new YITH_WCWL( $_REQUEST );
64
+ }
65
+ add_action( 'plugins_loaded', 'yith_wishlist_constructor' );
yit-common/assets/css/yith-panel.css CHANGED
@@ -63,13 +63,13 @@
63
  font-size: 12px!important;
64
  line-height: 6px;
65
  margin: -16px 0px 0px -105px;
66
- padding: 3px 8px;
67
  position: absolute;
68
  text-shadow: rgba(255, 255, 255, 1) 0 1px 0;
69
  text-decoration: none;
70
  top: 50%;
71
  left: 50%;
72
- width: 108px;
73
  height: 18px;
74
  }
75
  .typography_container button.refresh img {
63
  font-size: 12px!important;
64
  line-height: 6px;
65
  margin: -16px 0px 0px -105px;
66
+ padding: 3px 19px;
67
  position: absolute;
68
  text-shadow: rgba(255, 255, 255, 1) 0 1px 0;
69
  text-decoration: none;
70
  top: 50%;
71
  left: 50%;
72
+ width: auto;
73
  height: 18px;
74
  }
75
  .typography_container button.refresh img {
yit-common/assets/js/yith-panel.js CHANGED
@@ -42,6 +42,12 @@ jQuery(document).ready(function($){
42
  numberOfMonths: 2,
43
  minDate: 0
44
  });
 
 
 
 
 
 
45
  });
46
 
47
  // typography
42
  numberOfMonths: 2,
43
  minDate: 0
44
  });
45
+
46
+ //skin
47
+ $('select.skin').on('change', function(){
48
+ var img_path = $(this).data('path');
49
+ $(this).siblings('.skin-preview').html('<img src="'+ img_path + $(this).val() + '.jpg' +'" alt="preview" />');
50
+ }).change();
51
  });
52
 
53
  // typography
yit-common/yit-functions.php CHANGED
@@ -110,7 +110,7 @@ if( ! function_exists('yit_get_options_from_prefix') ) {
110
  $return[$option] = get_option( $option );
111
  }
112
 
113
- return yit_debug($return);
114
  }
115
  }
116
 
@@ -205,4 +205,27 @@ if( !function_exists('yit_typo_option_to_css') ) {
205
 
206
  return implode( "\n", $attrs ) . "\n";
207
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
208
  }
110
  $return[$option] = get_option( $option );
111
  }
112
 
113
+ return $return;
114
  }
115
  }
116
 
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
  }
yit-common/yith-panel.php CHANGED
@@ -360,6 +360,16 @@ if( !class_exists('YITH_Panel') ) {
360
  }
361
  break;
362
 
 
 
 
 
 
 
 
 
 
 
363
  case 'number':
364
  $mms = '';
365
  if( isset( $field['min'] ) ) {
360
  }
361
  break;
362
 
363
+ case 'skin': $echo = "<select name='{$name}' id='{$id}' class='skin' data-path='{$field['path']}'>";
364
+ foreach( $field['options'] as $v=>$label ) {
365
+ $echo .= "<option value='{$v}'". selected($value, $v, false) .">{$label}</option>";
366
+ }
367
+ $echo .= "</select>";
368
+ if( isset($field['description']) && $field['description'] != '' ) {
369
+ $echo .= "<p class='description'>{$field['description']}</p><div class='skin-preview'></div>";
370
+ }
371
+ break;
372
+
373
  case 'number':
374
  $mms = '';
375
  if( isset( $field['min'] ) ) {