YITH WooCommerce Catalog Mode - Version 1.6.2

Version Description

Last Stable Tag 1.6.2

Download this release

Release Info

Developer yithemes
Plugin Icon 128x128 YITH WooCommerce Catalog Mode
Version 1.6.2
Comparing to
See all releases

Code changes from version 1.6.1 to 1.6.2

init.php CHANGED
@@ -2,10 +2,10 @@
2
  /**
3
  * Plugin Name: YITH WooCommerce Catalog Mode
4
  * Plugin URI: http://yithemes.com/themes/plugins/yith-woocommerce-catalog-mode/
5
- * Description: <code><strong>YITH WooCommerce Catalog Mode</strong></code> allows hiding product prices, cart and checkout from your store and turning it into a performing product catalogue. You will be able to adjust your catalogue settings as you prefer based on your requirements. <a href="https://yithemes.com/" target="_blank">Find new awesome plugins on <strong>YITH</strong></a>
6
  * Author: YITH
7
  * Text Domain: yith-woocommerce-catalog-mode
8
- * Version: 1.6.1
9
  * Author URI: http://yithemes.com/
10
  * WC requires at least: 3.3.0
11
  * WC tested up to: 3.5.x
@@ -36,7 +36,7 @@ function ywctm_install_free_admin_notice() {
36
  }
37
 
38
  if ( ! defined( 'YWCTM_VERSION' ) ) {
39
- define( 'YWCTM_VERSION', '1.6.1' );
40
  }
41
 
42
  if ( ! defined( 'YWCTM_FREE_INIT' ) ) {
2
  /**
3
  * Plugin Name: YITH WooCommerce Catalog Mode
4
  * Plugin URI: http://yithemes.com/themes/plugins/yith-woocommerce-catalog-mode/
5
+ * Description: <code><strong>YITH WooCommerce Catalog Mode</strong></code> allows hiding product prices, cart and checkout from your store and turning it into a performing product catalogue. You will be able to adjust your catalogue settings as you prefer based on your requirements. <a href="https://yithemes.com/" target="_blank">Get more plugins for your e-commerce shop on <strong>YITH</strong></a>
6
  * Author: YITH
7
  * Text Domain: yith-woocommerce-catalog-mode
8
+ * Version: 1.6.2
9
  * Author URI: http://yithemes.com/
10
  * WC requires at least: 3.3.0
11
  * WC tested up to: 3.5.x
36
  }
37
 
38
  if ( ! defined( 'YWCTM_VERSION' ) ) {
39
+ define( 'YWCTM_VERSION', '1.6.2' );
40
  }
41
 
42
  if ( ! defined( 'YWCTM_FREE_INIT' ) ) {
plugin-fw/assets/css/admin.css CHANGED
@@ -33,6 +33,14 @@
33
  line-height : 1.5em;
34
  }
35
 
 
 
 
 
 
 
 
 
36
  /*-----------------------
37
  YITH Plugins Columns
38
  ------------------------*/
33
  line-height : 1.5em;
34
  }
35
 
36
+ .notice-yith{
37
+ border-left-color: #acc327;
38
+ }
39
+
40
+ .notice-yith.notice-alt{
41
+ background-color: #ecf7ed;
42
+ }
43
+
44
  /*-----------------------
45
  YITH Plugins Columns
46
  ------------------------*/
plugin-fw/assets/js/yith-promo.js ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function ($) {
2
+ $(document).on('click', '.notice-dismiss', function () {
3
+ var t = $(this),
4
+ promo_wrapper = t.parent('div.yith-notice-is-dismissible'),
5
+ promo_id = promo_wrapper.attr('id');
6
+
7
+ if (typeof promo_id != 'undefined') {
8
+ var cname = 'hide_' + promo_id,
9
+ cvalue = 'yes',
10
+ expiry = promo_wrapper.data('expiry'),
11
+ expiry_date = new Date(expiry);
12
+
13
+ expiry_date.setUTCHours( 23 );
14
+ expiry_date.setUTCMinutes( 59 );
15
+ expiry_date.setUTCSeconds( 59 );
16
+
17
+ document.cookie = cname + "=" + cvalue + ";" + 'expires=' + expiry_date.toUTCString() + ";path=/";
18
+ }
19
+ });
20
+ })(jQuery);
plugin-fw/assets/js/yith-promo.min.js ADDED
@@ -0,0 +1 @@
 
1
+ (function(c){c(document).on("click",".notice-dismiss",function(){var a=c(this).parent("div.yith-notice-is-dismissible"),b=a.attr("id");"undefined"!=typeof b&&(b="hide_"+b,a=a.data("expiry"),a=new Date(a),a.setUTCHours(23),a.setUTCMinutes(59),a.setUTCSeconds(59),document.cookie=b+"=yes;expires="+a.toUTCString()+";path=/")})})(jQuery);
plugin-fw/init.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /**
3
  * Framework Name: YIT Plugin Framework
4
- * Version: 3.0.25
5
  * Author: YITHEMES
6
  * Text Domain: yith-plugin-fw
7
  * Domain Path: /languages/
1
  <?php
2
  /**
3
  * Framework Name: YIT Plugin Framework
4
+ * Version: 3.0.27
5
  * Author: YITHEMES
6
  * Text Domain: yith-plugin-fw
7
  * Domain Path: /languages/
plugin-fw/lib/promo/yith-promo.php ADDED
@@ -0,0 +1,130 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * This file belongs to the YIT Plugin Framework.
4
+ *
5
+ * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
6
+ * that is bundled with this package in the file LICENSE.txt.
7
+ * It is also available through the world-wide-web at this URL:
8
+ * http://www.gnu.org/licenses/gpl-3.0.txt
9
+ */
10
+
11
+ if( apply_filters( 'yith_plugin_fw_notice', true ) ){
12
+ add_action( 'admin_notices', 'yith_plugin_fw_promo_notices', 15 );
13
+ add_action( 'admin_enqueue_scripts', 'yith_plugin_fw_notice_dismiss', 20 );
14
+
15
+ if( ! function_exists( 'yith_plugin_fw_promo_notices' ) ){
16
+ function yith_plugin_fw_promo_notices(){
17
+ $xml = apply_filters( 'yith_plugin_fw_promo_xml_url', 'https://update.yithemes.com/promo/yith-promo.xml' );
18
+ $transient = "yith_promo_message";
19
+ $remote_data = get_site_transient( $transient );
20
+ $regenerate_promo_transient = isset( $_GET['yith_regenerate_promo_transient'] ) && 'yes' == $_GET['yith_regenerate_promo_transient'] ? $_GET['yith_regenerate_promo_transient'] : '';
21
+ $promo_data = false;
22
+ $create_transient = false;
23
+
24
+ if( false === $remote_data || apply_filters( 'yith_plugin_fw_force_regenerate_promo_transient', false ) || 'yes' == $regenerate_promo_transient ){
25
+ $remote_data = wp_remote_get( $xml );
26
+ $create_transient = true;
27
+ }
28
+
29
+ if ( ! is_wp_error( $remote_data ) && isset( $remote_data['response']['code'] ) && '200' == $remote_data['response']['code'] ) {
30
+ $promo_data = @simplexml_load_string( $remote_data['body'] );
31
+
32
+ if( true === $create_transient ){
33
+ $xml_expiry_date = ! empty( $promo_data->expiry_date ) ? $promo_data->expiry_date : '';
34
+ //Set Site Transient
35
+ set_site_transient( $transient, $remote_data, yith_plugin_fw_get_promo_transient_expiry_date( $xml_expiry_date ) );
36
+ }
37
+
38
+ if ( $promo_data && ! empty( $promo_data->promo ) ) {
39
+ $now = strtotime( current_time( 'Y-m-d' ), 1 );
40
+ foreach ($promo_data as $promo ){
41
+ $start_date = isset( $promo->start_date ) ? $promo->start_date : '';
42
+ $end_date = isset( $promo->end_date ) ? $promo->end_date : '';
43
+
44
+ if( ! empty( $start_date ) && ! empty( $end_date ) ){
45
+ $start_date = strtotime( $start_date );
46
+ $end_date = strtotime( $end_date );
47
+
48
+ if( $end_date >= $start_date && $now >= $start_date && $now <= $end_date ){
49
+ //is valid promo
50
+ $title = isset( $promo->title ) ? $promo->title : '';
51
+ $description = isset( $promo->description ) ? $promo->description : '';
52
+ $url = isset( $promo->link->url ) ? $promo->link->url : '';
53
+ $url_label = isset( $promo->link->label ) ? $promo->link->label : '';
54
+ $border_color = isset( $promo->style->border_color ) ? $promo->style->border_color : '';
55
+ $background_color = isset( $promo->style->background_color ) ? $promo->style->background_color : '';
56
+ $promo_id = isset( $promo->promo_id ) ? $promo->promo_id : '';
57
+ $style = $link = '';
58
+ $show_notice = false;
59
+
60
+ if( ! empty( $border_color ) ){
61
+ $style .= "border-left-color: {$border_color};";
62
+ }
63
+
64
+ if( ! empty( $background_color ) ){
65
+ $style .= "background-color: {$background_color};";
66
+ }
67
+
68
+ if( ! empty( $title ) ) {
69
+ $promo_id .= $title;
70
+ $title = sprintf( '<strong>%s</strong>: ', $title );
71
+ $show_notice = true;
72
+ }
73
+
74
+ if( ! empty( $description ) ) {
75
+ $promo_id .= $description;
76
+ $description = sprintf( '%s', $description );
77
+ $show_notice = true;
78
+ }
79
+
80
+ if( ! empty( $url ) && ! empty( $url_label )) {
81
+ $promo_id .= $url . $url_label;
82
+ $link = sprintf( '<a href="%s" target="_blank">%s</a>.', $url, $url_label );
83
+ $show_notice = true;
84
+ }
85
+
86
+ $unique_promo_id = "yith-notice-" . md5 ( $promo_id );
87
+
88
+ if( ! empty( $_COOKIE[ 'hide_' . $unique_promo_id ] ) && 'yes' == $_COOKIE[ 'hide_' . $unique_promo_id ] ){
89
+ $show_notice = false;
90
+ }
91
+
92
+ if( true === $show_notice ) :
93
+ ?>
94
+ <div id="<?php echo $unique_promo_id; ?>" class="yith-notice-is-dismissible notice notice-yith notice-alt is-dismissible" style="<?php echo $style; ?>" data-expiry = <?php echo $promo->end_date; ?>>
95
+ <p>
96
+ <?php printf( "%s %s %s", $title, $description, $link ); ?>
97
+ </p>
98
+ </div>
99
+ <?php endif;
100
+ }
101
+ }
102
+ }
103
+ }
104
+ }
105
+ }
106
+ }
107
+
108
+ if( ! function_exists( 'yith_plugin_fw_notice_dismiss' ) ){
109
+ function yith_plugin_fw_notice_dismiss(){
110
+ $script_path = defined( 'YIT_CORE_PLUGIN_URL' ) ? YIT_CORE_PLUGIN_URL : get_template_directory_uri() . '/core/plugin-fw';
111
+ $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
112
+ wp_register_script( 'yith-promo', $script_path . '/assets/js/yith-promo' . $suffix . '.js', array( 'jquery' ), '1.0.0', true );
113
+ wp_enqueue_script( 'yith-promo' );
114
+ }
115
+ }
116
+
117
+ if( ! function_exists( 'yith_plugin_fw_get_promo_transient_expiry_date' ) ){
118
+ function yith_plugin_fw_get_promo_transient_expiry_date( $expiry_date ) {
119
+ $xml_expiry_date = ! empty( $expiry_date ) ? $expiry_date : '+6 hours';
120
+ $current = strtotime( current_time( 'Y-m-d H:i:s', 1 ) );
121
+ $expiry_date = strtotime( $xml_expiry_date, $current );
122
+
123
+ if( $expiry_date <= $current ){
124
+ $expiry_date = strtotime( '+24 hours', $current );
125
+ }
126
+
127
+ return $expiry_date;
128
+ }
129
+ }
130
+ }
plugin-fw/lib/yit-upgrade.php CHANGED
@@ -620,7 +620,7 @@ if ( ! class_exists( 'YIT_Upgrade' ) ) {
620
  //Get license for YITH Plugins
621
  $enabled_license = YIT_Plugin_Licence()->get_licence();
622
 
623
- if( false !== $enabled_license[ $slug ]['activated'] ){
624
  if( isset( $enabled_license[ $slug ]['licence_key'] ) ){
625
  $license = $enabled_license[ $slug ]['licence_key'];
626
  }
620
  //Get license for YITH Plugins
621
  $enabled_license = YIT_Plugin_Licence()->get_licence();
622
 
623
+ if( isset( $enabled_license[ $slug ]['activated'] ) && false !== $enabled_license[ $slug ]['activated'] ){
624
  if( isset( $enabled_license[ $slug ]['licence_key'] ) ){
625
  $license = $enabled_license[ $slug ]['licence_key'];
626
  }
plugin-fw/yit-plugin.php CHANGED
@@ -39,6 +39,7 @@ include_once( 'lib/yit-assets.php');
39
  include_once( 'lib/yit-debug.php');
40
  include_once( 'lib/privacy/yit-privacy.php' );
41
  include_once( 'lib/privacy/yit-privacy-plugin-abstract.php' );
 
42
 
43
  // load from theme folder...
44
  load_textdomain( 'yith-plugin-fw', get_template_directory() . '/core/plugin-fw/yith-plugin-fw-' . apply_filters( 'plugin_locale', get_locale(), 'yith-plugin-fw' ) . '.mo' )
39
  include_once( 'lib/yit-debug.php');
40
  include_once( 'lib/privacy/yit-privacy.php' );
41
  include_once( 'lib/privacy/yit-privacy-plugin-abstract.php' );
42
+ include_once ( 'lib/promo/yith-promo.php' );
43
 
44
  // load from theme folder...
45
  load_textdomain( 'yith-plugin-fw', get_template_directory() . '/core/plugin-fw/yith-plugin-fw-' . apply_filters( 'plugin_locale', get_locale(), 'yith-plugin-fw' ) . '.mo' )
readme.txt CHANGED
@@ -4,7 +4,7 @@ Contributors: yithemes
4
  Tags: woocommerce catalog mode plugin, woocommerce catalog only, woocommerce, products, themes, yit, yith, yithemes, e-commerce, shop, catalog mode, catalogue mode, remove add to cart, ask for price, ask price, asking for price, asking price, button remove, call, call for price, call me, call us, contact, email, hide add to cart, hide price
5
  Requires at least: 4.0
6
  Tested up to: 4.9
7
- Stable tag: 1.6.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -113,6 +113,10 @@ yith-woocommerce-catalog-mode-<WORDPRESS LOCALE >.mo
113
 
114
  == Changelog ==
115
 
 
 
 
 
116
  = Version 1.6.1 - Released: Oct 16, 2018 =
117
 
118
  * New: Support to WooCommerce 3.5.0 RC2
@@ -258,7 +262,7 @@ yith-woocommerce-catalog-mode-<WORDPRESS LOCALE >.mo
258
 
259
  == Upgrade Notice ==
260
 
261
- Last Stable Tag 1.6.1
262
 
263
  == Suggestions ==
264
 
4
  Tags: woocommerce catalog mode plugin, woocommerce catalog only, woocommerce, products, themes, yit, yith, yithemes, e-commerce, shop, catalog mode, catalogue mode, remove add to cart, ask for price, ask price, asking for price, asking price, button remove, call, call for price, call me, call us, contact, email, hide add to cart, hide price
5
  Requires at least: 4.0
6
  Tested up to: 4.9
7
+ Stable tag: 1.6.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
113
 
114
  == Changelog ==
115
 
116
+ = Version 1.6.2 - Released: Oct 22, 2018 =
117
+
118
+ * Update: plugin framework
119
+
120
  = Version 1.6.1 - Released: Oct 16, 2018 =
121
 
122
  * New: Support to WooCommerce 3.5.0 RC2
262
 
263
  == Upgrade Notice ==
264
 
265
+ Last Stable Tag 1.6.2
266
 
267
  == Suggestions ==
268