YITH WooCommerce Catalog Mode - Version 1.0.2

Version Description

  • Fixed: Added functions for themes compatibility
Download this release

Release Info

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

Code changes from version 1.0.1 to 1.0.2

class.yith-woocommerce-catalog-mode.php CHANGED
@@ -69,14 +69,14 @@ class YITH_WC_Catalog_Mode {
69
 
70
  if ( get_option( 'ywctm_enable_plugin' ) == 'yes' ){
71
 
72
- if ( !( current_user_can( 'administrator' ) && is_user_logged_in() && get_option( 'ywctm_admin_view' ) == 'no' ) ){
73
 
74
  add_action( 'init', array( $this, 'check_pages_status' ) );
75
 
76
  if ( ! is_admin() ) {
77
 
78
  add_action( 'woocommerce_single_product_summary', array( $this, 'hide_add_to_cart_single' ), 10 );
79
- add_action( 'woocommerce_after_shop_loop_item', array( $this, 'hide_add_to_cart_loop' ), 5 );
80
  add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_styles' ) );
81
 
82
  }
@@ -92,7 +92,33 @@ class YITH_WC_Catalog_Mode {
92
  }
93
 
94
  /**
95
- * Hides "Add to cart" button, if not excluded, from single product page
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
96
  *
97
  * @since 1.0.0
98
  * @author Alberto Ruggiero
@@ -100,22 +126,54 @@ class YITH_WC_Catalog_Mode {
100
  */
101
  public function hide_add_to_cart_single() {
102
 
103
- if ( get_option( 'ywctm_hide_add_to_cart_single' ) == 'yes' ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
104
 
105
  global $post;
106
 
107
  $exclude_catalog = get_post_meta( $post->ID, '_ywctm_exclude_catalog_mode', true );
108
  $enable_exclusion = get_option( 'ywctm_exclude_hide_add_to_cart' );
109
 
110
- if ( $enable_exclusion == '' || $enable_exclusion == 'no' ) {
111
- remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 );
112
- } else {
113
- if ( $exclude_catalog == '' || $exclude_catalog == 'no' ) {
114
- remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 );
 
 
 
 
 
 
 
 
115
  }
116
  }
117
  }
118
 
 
 
119
  }
120
 
121
  /**
@@ -275,6 +333,17 @@ class YITH_WC_Catalog_Mode {
275
  }
276
  }
277
 
 
 
 
 
 
 
 
 
 
 
 
278
  /**
279
  * Action Links
280
  *
@@ -293,7 +362,7 @@ class YITH_WC_Catalog_Mode {
293
  $links[] = '<a href="' . admin_url( "admin.php?page={$this->_panel_page}" ) . '">' . __( 'Settings', 'ywctm' ) . '</a>';
294
 
295
  if ( defined( 'YWCTM_FREE_INIT' ) ) {
296
- $links[] = '<a href="' . $this->_premium_landing . '" target="_blank">' . __( 'Premium Version', 'ywctm' ) . '</a>';
297
  }
298
 
299
  return $links;
@@ -325,32 +394,6 @@ class YITH_WC_Catalog_Mode {
325
  return $plugin_meta;
326
  }
327
 
328
- public function register_pointer() {
329
- if ( ! class_exists( 'YIT_Pointers' ) ) {
330
-
331
- include_once( 'plugin-fw/lib/yit-pointers.php' );
332
- }
333
-
334
- $premium_message = defined( 'YWCTM_PREMIUM' )
335
- ? ''
336
- : __( 'YITH WooCommerce Catalog Mode is available in an outstanding PREMIUM version with many new options, discover it now.', 'ywctm' ) .
337
- ' <a href="' . $this->_premium_landing . '">' . __( 'Premium version', 'ywctm' ) . '</a>';
338
-
339
- $args[] = array(
340
- 'screen_id' => 'plugins',
341
- 'pointer_id' => $this->_panel_page,
342
- 'target' => '#toplevel_page_yit_plugin_panel',
343
- 'content' => sprintf( '<h3> %s </h3> <p> %s </p>',
344
- __( 'YITH WooCommerce Catalog Mode', 'ywctm' ),
345
- __( 'In YIT Plugins tab you can find YITH WooCommerce Catalog Mode options. From this menu you can access all settings of YITH plugins activated.', 'ywctm' ) . '<br>' . $premium_message
346
- ),
347
- 'position' => array( 'edge' => 'left', 'align' => 'center' ),
348
- 'init' => defined( 'YWCTM_PREMIUM' ) ? YWCTM_INIT : YWCTM_FREE_INIT
349
- );
350
-
351
- YIT_Pointers()->register( $args );
352
- }
353
-
354
  /**
355
  * On plugin deactivation, publish cart and checkout pages if se to draft
356
  *
69
 
70
  if ( get_option( 'ywctm_enable_plugin' ) == 'yes' ){
71
 
72
+ if ( $this->check_user_admin_enable() ){
73
 
74
  add_action( 'init', array( $this, 'check_pages_status' ) );
75
 
76
  if ( ! is_admin() ) {
77
 
78
  add_action( 'woocommerce_single_product_summary', array( $this, 'hide_add_to_cart_single' ), 10 );
79
+ add_action( 'woocommerce_before_shop_loop_item_title', array( $this, 'hide_add_to_cart_loop' ), 5 );
80
  add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_styles' ) );
81
 
82
  }
92
  }
93
 
94
  /**
95
+ * Check if catalog mode is enabled for administrator
96
+ *
97
+ * @since 1.0.2
98
+ * @author Alberto Ruggiero
99
+ * @return bool
100
+ */
101
+ public function check_user_admin_enable() {
102
+
103
+ return !( current_user_can( 'administrator' ) && is_user_logged_in() && get_option( 'ywctm_admin_view' ) == 'no' );
104
+
105
+ }
106
+
107
+ /**
108
+ * Checks if "Cart & Checkout pages" needs to be hidden
109
+ *
110
+ * @since 1.0.2
111
+ * @author Alberto Ruggiero
112
+ * @return bool
113
+ */
114
+ public function check_hide_cart_checkout_pages() {
115
+
116
+ return get_option( 'ywctm_enable_plugin' ) == 'yes' && $this->check_user_admin_enable() && get_option('ywctm_hide_cart_header') == 'yes';
117
+
118
+ }
119
+
120
+ /**
121
+ * Hides "Add to cart" button from single product page
122
  *
123
  * @since 1.0.0
124
  * @author Alberto Ruggiero
126
  */
127
  public function hide_add_to_cart_single() {
128
 
129
+ $priority = has_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart' );
130
+
131
+ if( $this->check_add_to_cart_single( $priority ) ) {
132
+
133
+ remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', $priority );
134
+
135
+ }
136
+
137
+ }
138
+
139
+ /**
140
+ * Checks if "Add to cart" needs to be hidden
141
+ *
142
+ * @since 1.0.2
143
+ * @author Alberto Ruggiero
144
+ * @param $priority
145
+ * @return bool
146
+ */
147
+ public function check_add_to_cart_single( $priority = true ) {
148
+
149
+ $hide = false;
150
+
151
+ if ( get_option( 'ywctm_enable_plugin' ) == 'yes' && $this->check_user_admin_enable() && get_option( 'ywctm_hide_add_to_cart_single' ) == 'yes' ) {
152
 
153
  global $post;
154
 
155
  $exclude_catalog = get_post_meta( $post->ID, '_ywctm_exclude_catalog_mode', true );
156
  $enable_exclusion = get_option( 'ywctm_exclude_hide_add_to_cart' );
157
 
158
+ if ( $priority ) {
159
+
160
+ if ( $enable_exclusion == '' || $enable_exclusion == 'no' ) {
161
+
162
+ $hide = true;
163
+
164
+ } else {
165
+
166
+ if ( $exclude_catalog == '' || $exclude_catalog == 'no' ) {
167
+
168
+ $hide = true;
169
+
170
+ }
171
  }
172
  }
173
  }
174
 
175
+ return $hide;
176
+
177
  }
178
 
179
  /**
333
  }
334
  }
335
 
336
+ /**
337
+ * Get the premium landing uri
338
+ *
339
+ * @since 1.0.0
340
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
341
+ * @return string The premium landing link
342
+ */
343
+ public function get_premium_landing_uri(){
344
+ return defined( 'YITH_REFER_ID' ) ? $this->_premium_landing . '?refer_id=' . YITH_REFER_ID : $this->_premium_landing;
345
+ }
346
+
347
  /**
348
  * Action Links
349
  *
362
  $links[] = '<a href="' . admin_url( "admin.php?page={$this->_panel_page}" ) . '">' . __( 'Settings', 'ywctm' ) . '</a>';
363
 
364
  if ( defined( 'YWCTM_FREE_INIT' ) ) {
365
+ $links[] = '<a href="' . $this->get_premium_landing_uri() . '" target="_blank">' . __( 'Premium Version', 'ywctm' ) . '</a>';
366
  }
367
 
368
  return $links;
394
  return $plugin_meta;
395
  }
396
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
397
  /**
398
  * On plugin deactivation, publish cart and checkout pages if se to draft
399
  *
init.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://yithemes.com/themes/plugins/yith-woocommerce-catalog-mode/
5
  Description: YITH Woocommerce Catalog Mode allows you to disable shop functions.
6
  Author: Yithemes
7
  Text Domain: ywctm
8
- Version: 1.0.1
9
  Author URI: http://yithemes.com/
10
  */
11
 
@@ -34,7 +34,7 @@ function ywctm_install_free_admin_notice() {
34
  }
35
 
36
  if ( ! defined( 'YWCTM_VERSION' ) ) {
37
- define( 'YWCTM_VERSION', '1.0.1' );
38
  }
39
 
40
  if ( ! defined( 'YWCTM_FREE_INIT' ) ) {
@@ -66,18 +66,10 @@ function ywctm_init() {
66
  /* Load YWCTM text domain */
67
  load_plugin_textdomain( 'ywctm', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
68
 
69
- /**
70
- * Init default plugin settings
71
- */
72
- if ( !function_exists( 'yith_plugin_registration_hook' ) ) {
73
- require_once 'plugin-fw/yit-plugin-registration-hook.php';
74
- }
75
-
76
- require_once( YWCTM_DIR . 'class.yith-woocommerce-catalog-mode.php' );
77
 
78
- register_activation_hook( __FILE__, 'yith_plugin_registration_hook' );
79
  register_deactivation_hook( __FILE__, array('YITH_WC_Catalog_Mode', 'reactivate_hidden_pages' ) );
80
 
 
81
  $YITH_WC_Catalog_Mode = new YITH_WC_Catalog_Mode();
82
  }
83
  add_action( 'ywctm_init', 'ywctm_init' );
@@ -97,7 +89,16 @@ function ywctm_install() {
97
  }
98
  add_action( 'plugins_loaded', 'ywctm_install', 11 );
99
 
 
 
 
 
 
 
 
 
100
 
 
101
 
102
 
103
 
5
  Description: YITH Woocommerce Catalog Mode allows you to disable shop functions.
6
  Author: Yithemes
7
  Text Domain: ywctm
8
+ Version: 1.0.2
9
  Author URI: http://yithemes.com/
10
  */
11
 
34
  }
35
 
36
  if ( ! defined( 'YWCTM_VERSION' ) ) {
37
+ define( 'YWCTM_VERSION', '1.0.2' );
38
  }
39
 
40
  if ( ! defined( 'YWCTM_FREE_INIT' ) ) {
66
  /* Load YWCTM text domain */
67
  load_plugin_textdomain( 'ywctm', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
68
 
 
 
 
 
 
 
 
 
69
 
 
70
  register_deactivation_hook( __FILE__, array('YITH_WC_Catalog_Mode', 'reactivate_hidden_pages' ) );
71
 
72
+ global $YITH_WC_Catalog_Mode;
73
  $YITH_WC_Catalog_Mode = new YITH_WC_Catalog_Mode();
74
  }
75
  add_action( 'ywctm_init', 'ywctm_init' );
89
  }
90
  add_action( 'plugins_loaded', 'ywctm_install', 11 );
91
 
92
+ /**
93
+ * Init default plugin settings
94
+ */
95
+ if ( !function_exists( 'yith_plugin_registration_hook' ) ) {
96
+ require_once 'plugin-fw/yit-plugin-registration-hook.php';
97
+ }
98
+
99
+ require_once( YWCTM_DIR . 'class.yith-woocommerce-catalog-mode.php' );
100
 
101
+ register_activation_hook( __FILE__, 'yith_plugin_registration_hook' );
102
 
103
 
104
 
plugin-fw/lib/yit-plugin-panel-wc.php CHANGED
@@ -65,9 +65,9 @@ if ( ! class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
65
  add_action( 'admin_init', array( $this, 'woocommerce_update_options' ) );
66
  add_filter( 'woocommerce_screen_ids', array( $this, 'add_allowed_screen_id' ) );
67
 
68
- add_action( 'woocommerce_admin_field_boxinfo', array( $this, 'yit_boxinfo' ), 10, 1 );
69
- add_action( 'woocommerce_admin_field_videobox', array( $this, 'yit_videobox' ), 10, 1 );
70
-
71
  }
72
  }
73
 
@@ -97,36 +97,6 @@ if ( ! class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
97
  require_once( YIT_CORE_PLUGIN_TEMPLATE_PATH . '/panel/woocommerce/woocommerce-panel.php' );
98
  }
99
 
100
- /**
101
- * Show a box panel with specific content in two columns as a new woocommerce type
102
- *
103
- *
104
- * @return void
105
- * @since 1.0
106
- * @author Emanuela Castorina <emanuela.castorina@yithemes.com>
107
- */
108
- public function yit_boxinfo( $args = array() ) {
109
- if ( !empty( $args ) ) {
110
- extract( $args );
111
- require_once( YIT_CORE_PLUGIN_TEMPLATE_PATH . '/panel/woocommerce/woocommerce-boxinfo.php' );
112
- }
113
- }
114
-
115
- /**
116
- * Show a box panel with specific content in two columns as a new woocommerce type
117
- *
118
- *
119
- * @return void
120
- * @since 1.0
121
- * @author Emanuela Castorina <emanuela.castorina@yithemes.com>
122
- */
123
- public function yit_videobox( $args = array() ) {
124
- if ( ! empty( $args ) ) {
125
- extract( $args );
126
- require_once( YIT_CORE_PLUGIN_TEMPLATE_PATH . '/panel/woocommerce/woocommerce-videobox.php' );
127
- }
128
- }
129
-
130
  /**
131
  * Show a input fields to upload images
132
  *
65
  add_action( 'admin_init', array( $this, 'woocommerce_update_options' ) );
66
  add_filter( 'woocommerce_screen_ids', array( $this, 'add_allowed_screen_id' ) );
67
 
68
+ /* Add VideoBox and InfoBox */
69
+ add_action( 'woocommerce_admin_field_boxinfo', array( $this, 'add_infobox' ), 10, 1 );
70
+ add_action( 'woocommerce_admin_field_videobox', array( $this, 'add_videobox' ), 10, 1 );
71
  }
72
  }
73
 
97
  require_once( YIT_CORE_PLUGIN_TEMPLATE_PATH . '/panel/woocommerce/woocommerce-panel.php' );
98
  }
99
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
100
  /**
101
  * Show a input fields to upload images
102
  *
plugin-fw/lib/yit-plugin-panel.php CHANGED
@@ -75,7 +75,9 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
75
  add_action( 'admin_bar_menu', array( &$this, 'add_admin_bar_menu' ), 100 );
76
  add_action( 'admin_init', array( &$this, 'add_fields' ) );
77
 
78
-
 
 
79
  }
80
 
81
  add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
@@ -677,6 +679,16 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
677
  $option = $param ['option'];
678
  $db_options = $this->get_options();
679
 
 
 
 
 
 
 
 
 
 
 
680
  $db_value = ( isset( $db_options[$option['id']] ) ) ? $db_options[$option['id']] : '';
681
  if ( isset( $option['deps'] ) ) {
682
  $deps = $option['deps'];
@@ -686,7 +698,7 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
686
  include $type;
687
  }
688
  else {
689
- do_action( "yit_panel_{$option['type']}" );
690
  }
691
  }
692
  }
@@ -709,6 +721,38 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
709
  return $options;
710
  }
711
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
712
 
713
  }
714
 
75
  add_action( 'admin_bar_menu', array( &$this, 'add_admin_bar_menu' ), 100 );
76
  add_action( 'admin_init', array( &$this, 'add_fields' ) );
77
 
78
+ /* Add VideoBox and InfoBox */
79
+ add_action( 'woocommerce_admin_field_boxinfo', array( $this, 'add_infobox' ), 10, 1 );
80
+ add_action( 'woocommerce_admin_field_videobox', array( $this, 'add_videobox' ), 10, 1 );
81
  }
82
 
83
  add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
679
  $option = $param ['option'];
680
  $db_options = $this->get_options();
681
 
682
+ $custom_attributes = array();
683
+
684
+ if ( ! empty( $option['custom_attributes'] ) && is_array( $option['custom_attributes'] ) ) {
685
+ foreach ( $option['custom_attributes'] as $attribute => $attribute_value ) {
686
+ $custom_attributes[] = esc_attr( $attribute ) . '="' . esc_attr( $attribute_value ) . '"';
687
+ }
688
+ }
689
+
690
+ $custom_attributes = implode( ' ', $custom_attributes );
691
+
692
  $db_value = ( isset( $db_options[$option['id']] ) ) ? $db_options[$option['id']] : '';
693
  if ( isset( $option['deps'] ) ) {
694
  $deps = $option['deps'];
698
  include $type;
699
  }
700
  else {
701
+ do_action( "yit_panel_{$option['type']}", $option, $db_value );
702
  }
703
  }
704
  }
721
  return $options;
722
  }
723
 
724
+ /**
725
+ * Show a box panel with specific content in two columns as a new woocommerce type
726
+ *
727
+ *
728
+ * @param array $args
729
+ *
730
+ * @return void
731
+ * @since 1.0
732
+ * @author Emanuela Castorina <emanuela.castorina@yithemes.com>
733
+ */
734
+ public function add_infobox( $args = array() ) {
735
+ if ( ! empty( $args ) ) {
736
+ extract( $args );
737
+ require_once( YIT_CORE_PLUGIN_TEMPLATE_PATH . '/panel/boxinfo.php' );
738
+ }
739
+ }
740
+
741
+ /**
742
+ * Show a box panel with specific content in two columns as a new woocommerce type
743
+ *
744
+ * @param array $args
745
+ *
746
+ * @return void
747
+ * @since 1.0
748
+ * @author Emanuela Castorina <emanuela.castorina@yithemes.com>
749
+ */
750
+ public function add_videobox( $args = array() ) {
751
+ if ( ! empty( $args ) ) {
752
+ extract( $args );
753
+ require_once( YIT_CORE_PLUGIN_TEMPLATE_PATH . '/panel/videobox.php' );
754
+ }
755
+ }
756
 
757
  }
758
 
plugin-fw/templates/panel/{woocommerce/woocommerce-boxinfo.php → infobox.php} RENAMED
File without changes
plugin-fw/templates/panel/types/chosen.php CHANGED
@@ -23,7 +23,7 @@ $db_value = ( $is_multiple && ! is_array( $db_value ) ) ? array() : $db_value;
23
  <div id="<?php echo $id ?>-container" class="chosen yit_options rm_option rm_input rm_text" <?php if ( isset( $option['deps'] ) ): ?>data-field="<?php echo $id ?>" data-dep="<?php echo $this->get_id_field( $option['deps']['ids'] ) ?>" data-value="<?php echo $option['deps']['values'] ?>" <?php endif ?>>
24
  <div class="option">
25
  <div class="select_wrapper">
26
- <select name="<?php echo $name ?><?php if( $is_multiple ) echo "[]" ?>" class="chosen" id="<?php echo $id ?>" <?php echo $multiple ?> >
27
  <?php foreach ( $option['options'] as $key => $value ) : ?>
28
  <option value="<?php echo esc_attr( $key ) ?>"<?php ($is_multiple) ? selected( true, in_array( $key, $db_value) ) : selected( $key, $db_value ) ?>><?php echo $value ?></option>
29
  <?php endforeach; ?>
23
  <div id="<?php echo $id ?>-container" class="chosen yit_options rm_option rm_input rm_text" <?php if ( isset( $option['deps'] ) ): ?>data-field="<?php echo $id ?>" data-dep="<?php echo $this->get_id_field( $option['deps']['ids'] ) ?>" data-value="<?php echo $option['deps']['values'] ?>" <?php endif ?>>
24
  <div class="option">
25
  <div class="select_wrapper">
26
+ <select name="<?php echo $name ?><?php if( $is_multiple ) echo "[]" ?>" class="chosen" id="<?php echo $id ?>" <?php echo $multiple ?> <?php echo $custom_attributes ?> >
27
  <?php foreach ( $option['options'] as $key => $value ) : ?>
28
  <option value="<?php echo esc_attr( $key ) ?>"<?php ($is_multiple) ? selected( true, in_array( $key, $db_value) ) : selected( $key, $db_value ) ?>><?php echo $value ?></option>
29
  <?php endforeach; ?>
plugin-fw/templates/panel/types/connected-list.php CHANGED
@@ -11,7 +11,7 @@ $name = $this->get_name_field( $option['id'] );
11
  <?php foreach( $lists as $list => $options ): ?>
12
  <div class="list_container">
13
  <h4><?php echo $option['heads'][ $list ] ?></h4>
14
- <ul id="list_<?php echo $list ?>" class="connectedSortable" data-list="<?php echo $list ?>">
15
  <?php foreach( $options as $value => $label ): ?>
16
  <li data-option="<?php echo $value ?>" class="ui-state-default"><?php echo $label ?></li>
17
  <?php endforeach ?>
11
  <?php foreach( $lists as $list => $options ): ?>
12
  <div class="list_container">
13
  <h4><?php echo $option['heads'][ $list ] ?></h4>
14
+ <ul id="list_<?php echo $list ?>" class="connectedSortable" data-list="<?php echo $list ?>" <?php echo $custom_attributes ?>>
15
  <?php foreach( $options as $value => $label ): ?>
16
  <li data-option="<?php echo $value ?>" class="ui-state-default"><?php echo $label ?></li>
17
  <?php endforeach ?>
plugin-fw/templates/panel/types/on-off.php CHANGED
@@ -26,7 +26,7 @@ $name = $this->get_name_field( $option['id'] );
26
  ?>
27
  <div id="<?php echo $id ?>-container" <?php if ( isset( $option['deps'] ) ): ?>data-field="<?php echo $id ?>" data-dep="<?php echo $this->get_id_field( $option['deps']['ids'] ) ?>" data-value="<?php echo $option['deps']['values'] ?>" <?php endif ?> class="on_off_container yit_options rm_option rm_input rm_onoff">
28
  <div class="option">
29
- <input type="checkbox" name="<?php echo $name ?>" id="<?php echo $id ?>" value="<?php echo esc_attr( $db_value ) ?>" <?php checked( $db_value, 'yes' ); ?> class="on_off<?php if ( $db_value == 'yes' ): ?> onoffchecked<?php endif ?>" />
30
  <span>&nbsp;</span>
31
  </div>
32
  <span class="description"><?php echo $option['desc'] ?></span>
26
  ?>
27
  <div id="<?php echo $id ?>-container" <?php if ( isset( $option['deps'] ) ): ?>data-field="<?php echo $id ?>" data-dep="<?php echo $this->get_id_field( $option['deps']['ids'] ) ?>" data-value="<?php echo $option['deps']['values'] ?>" <?php endif ?> class="on_off_container yit_options rm_option rm_input rm_onoff">
28
  <div class="option">
29
+ <input type="checkbox" name="<?php echo $name ?>" id="<?php echo $id ?>" value="<?php echo esc_attr( $db_value ) ?>" <?php checked( $db_value, 'yes' ); ?> class="on_off<?php if ( $db_value == 'yes' ): ?> onoffchecked<?php endif ?>" <?php echo $custom_attributes ?>/>
30
  <span>&nbsp;</span>
31
  </div>
32
  <span class="description"><?php echo $option['desc'] ?></span>
plugin-fw/templates/panel/types/select-mailchimp.php CHANGED
@@ -22,7 +22,7 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
22
  <div id="<?php echo $this->get_id_field( $option['id'] ) ?>-container" class="yit_options rm_option rm_input rm_text" <?php if ( isset( $option['deps'] ) ): ?>data-field="<?php echo $id ?>" data-dep="<?php echo $this->get_id_field( $option['deps']['ids'] ) ?>" data-value="<?php echo $option['deps']['values'] ?>" <?php endif ?>>
23
  <div class="option">
24
  <div class="select_wrapper">
25
- <select name="<?php echo $this->get_name_field( $option['id'] ) ?>" id="<?php echo $this->get_id_field( $option['id'] ) ?>">
26
  <?php foreach( $option['options'] as $key => $value ) : ?>
27
  <option value="<?php echo esc_attr( $key ) ?>"<?php selected( $key, $db_value ) ?>><?php echo $value ?></option>
28
  <?php endforeach; ?>
22
  <div id="<?php echo $this->get_id_field( $option['id'] ) ?>-container" class="yit_options rm_option rm_input rm_text" <?php if ( isset( $option['deps'] ) ): ?>data-field="<?php echo $id ?>" data-dep="<?php echo $this->get_id_field( $option['deps']['ids'] ) ?>" data-value="<?php echo $option['deps']['values'] ?>" <?php endif ?>>
23
  <div class="option">
24
  <div class="select_wrapper">
25
+ <select name="<?php echo $this->get_name_field( $option['id'] ) ?>" id="<?php echo $this->get_id_field( $option['id'] ) ?>" <?php echo $custom_attributes ?>>
26
  <?php foreach( $option['options'] as $key => $value ) : ?>
27
  <option value="<?php echo esc_attr( $key ) ?>"<?php selected( $key, $db_value ) ?>><?php echo $value ?></option>
28
  <?php endforeach; ?>
plugin-fw/templates/panel/types/select.php CHANGED
@@ -28,7 +28,7 @@ $multiple = ( $is_multiple ) ? ' multiple' : '';
28
  <div id="<?php echo $id ?>-container" class="yit_options rm_option rm_input rm_text" <?php if ( isset( $option['deps'] ) ): ?>data-field="<?php echo $id ?>" data-dep="<?php echo $this->get_id_field( $option['deps']['ids'] ) ?>" data-value="<?php echo $option['deps']['values'] ?>" <?php endif ?>>
29
  <div class="option">
30
  <div class="select_wrapper">
31
- <select name="<?php echo $name ?><?php if( $is_multiple ) echo "[]" ?>" id="<?php echo $id ?>" <?php echo $multiple ?> >
32
  <?php foreach ( $option['options'] as $key => $value ) : ?>
33
  <option value="<?php echo esc_attr( $key ) ?>"<?php ($is_multiple) ? selected( true, in_array( $key, $db_value) ) : selected( $key, $db_value ) ?>><?php echo $value ?></option>
34
  <?php endforeach; ?>
28
  <div id="<?php echo $id ?>-container" class="yit_options rm_option rm_input rm_text" <?php if ( isset( $option['deps'] ) ): ?>data-field="<?php echo $id ?>" data-dep="<?php echo $this->get_id_field( $option['deps']['ids'] ) ?>" data-value="<?php echo $option['deps']['values'] ?>" <?php endif ?>>
29
  <div class="option">
30
  <div class="select_wrapper">
31
+ <select name="<?php echo $name ?><?php if( $is_multiple ) echo "[]" ?>" id="<?php echo $id ?>" <?php echo $multiple ?> <?php echo $custom_attributes ?> >
32
  <?php foreach ( $option['options'] as $key => $value ) : ?>
33
  <option value="<?php echo esc_attr( $key ) ?>"<?php ($is_multiple) ? selected( true, in_array( $key, $db_value) ) : selected( $key, $db_value ) ?>><?php echo $value ?></option>
34
  <?php endforeach; ?>
plugin-fw/templates/panel/types/text.php CHANGED
@@ -20,13 +20,13 @@ if ( ! defined( 'ABSPATH' ) ) {
20
  exit;
21
  } // Exit if accessed directly
22
 
23
- $id = $this->get_id_field( $option['id'] );
24
- $name = $this->get_name_field( $option['id'] );
25
 
26
  ?>
27
  <div id="<?php echo $id ?>-container" <?php if ( isset( $option['deps'] ) ): ?>data-field="<?php echo $id ?>" data-dep="<?php echo $this->get_id_field( $option['deps']['ids'] ) ?>" data-value="<?php echo $option['deps']['values'] ?>" <?php endif ?> class="yit_options rm_option rm_input rm_text">
28
  <div class="option">
29
- <input type="text" name="<?php echo $name ?>" id="<?php echo $id ?>" value="<?php echo esc_attr( $db_value ) ?>" />
30
  </div>
31
  <span class="description"><?php echo $option['desc'] ?></span>
32
 
20
  exit;
21
  } // Exit if accessed directly
22
 
23
+ $id = $this->get_id_field( $option['id'] );
24
+ $name = $this->get_name_field( $option['id'] );
25
 
26
  ?>
27
  <div id="<?php echo $id ?>-container" <?php if ( isset( $option['deps'] ) ): ?>data-field="<?php echo $id ?>" data-dep="<?php echo $this->get_id_field( $option['deps']['ids'] ) ?>" data-value="<?php echo $option['deps']['values'] ?>" <?php endif ?> class="yit_options rm_option rm_input rm_text">
28
  <div class="option">
29
+ <input type="text" name="<?php echo $name ?>" id="<?php echo $id ?>" value="<?php echo esc_attr( $db_value ) ?>" <?php echo $custom_attributes ?> />
30
  </div>
31
  <span class="description"><?php echo $option['desc'] ?></span>
32
 
plugin-fw/templates/panel/types/textarea-codemirror.php CHANGED
@@ -26,7 +26,7 @@ $name = $this->get_name_field( $option['id'] );
26
  ?>
27
  <div id="<?php echo $id ?>-container" class="yit_options rm_option rm_input rm_text" <?php if ( isset( $option['deps'] ) ): ?>data-field="<?php echo $id ?>" data-dep="<?php echo $this->get_id_field( $option['deps']['ids'] ) ?>" data-value="<?php echo $option['deps']['values'] ?>" <?php endif ?>>
28
  <div class="option">
29
- <textarea name="<?php echo $name ?>" class="codemirror" id="<?php echo $id ?>" rows="8" cols="50"><?php echo $db_value ?></textarea>
30
  </div>
31
  <span class="description"><?php echo $option['desc'] ?></span>
32
 
26
  ?>
27
  <div id="<?php echo $id ?>-container" class="yit_options rm_option rm_input rm_text" <?php if ( isset( $option['deps'] ) ): ?>data-field="<?php echo $id ?>" data-dep="<?php echo $this->get_id_field( $option['deps']['ids'] ) ?>" data-value="<?php echo $option['deps']['values'] ?>" <?php endif ?>>
28
  <div class="option">
29
+ <textarea name="<?php echo $name ?>" class="codemirror" id="<?php echo $id ?>" rows="8" cols="50" <?php echo $custom_attributes ?>><?php echo $db_value ?></textarea>
30
  </div>
31
  <span class="description"><?php echo $option['desc'] ?></span>
32
 
plugin-fw/templates/panel/types/textarea.php CHANGED
@@ -26,7 +26,7 @@ $name = $this->get_name_field( $option['id'] );
26
  ?>
27
  <div id="<?php echo $id ?>-container" class="yit_options rm_option rm_input rm_text" <?php if ( isset( $option['deps'] ) ): ?>data-field="<?php echo $id ?>" data-dep="<?php echo $this->get_id_field( $option['deps']['ids'] ) ?>" data-value="<?php echo $option['deps']['values'] ?>" <?php endif ?>>
28
  <div class="option">
29
- <textarea name="<?php echo $name ?>" id="<?php echo $id ?>" rows="8" cols="50"><?php echo $db_value ?></textarea>
30
  </div>
31
  <span class="description"><?php echo $option['desc'] ?></span>
32
 
26
  ?>
27
  <div id="<?php echo $id ?>-container" class="yit_options rm_option rm_input rm_text" <?php if ( isset( $option['deps'] ) ): ?>data-field="<?php echo $id ?>" data-dep="<?php echo $this->get_id_field( $option['deps']['ids'] ) ?>" data-value="<?php echo $option['deps']['values'] ?>" <?php endif ?>>
28
  <div class="option">
29
+ <textarea name="<?php echo $name ?>" id="<?php echo $id ?>" rows="8" cols="50" <?php echo $custom_attributes ?>><?php echo $db_value ?></textarea>
30
  </div>
31
  <span class="description"><?php echo $option['desc'] ?></span>
32
 
plugin-fw/templates/panel/{woocommerce/woocommerce-videobox.php → videobox.php} RENAMED
File without changes
plugin-options/settings-options.php CHANGED
@@ -11,6 +11,7 @@
11
  if ( ! defined( 'ABSPATH' ) ) {
12
  exit;
13
  } // Exit if accessed directly
 
14
 
15
  $videobox = defined( 'YWCTM_PREMIUM' ) ? '' : array(
16
  'name' => __( 'Upgrade to the PREMIUM VERSION', 'ywctm' ),
@@ -27,7 +28,7 @@ $videobox = defined( 'YWCTM_PREMIUM' ) ? '' : array(
27
  'title_second_column' => __( 'Get Support and Pro Features', 'ywctm' ),
28
  'description_second_column' => __( 'By purchasing the premium version of the plugin, you will take advantage of the advanced features of the product and you will get one year of free updates and support through our platform available 24h/24.', 'ywctm' ),
29
  'button' => array(
30
- 'href' => 'http://yithemes.com/themes/plugins/yith-woocommerce-catalog-mode/',
31
  'title' => 'Get Support and Pro Features'
32
  )
33
  ),
11
  if ( ! defined( 'ABSPATH' ) ) {
12
  exit;
13
  } // Exit if accessed directly
14
+ global $YITH_WC_Catalog_Mode;
15
 
16
  $videobox = defined( 'YWCTM_PREMIUM' ) ? '' : array(
17
  'name' => __( 'Upgrade to the PREMIUM VERSION', 'ywctm' ),
28
  'title_second_column' => __( 'Get Support and Pro Features', 'ywctm' ),
29
  'description_second_column' => __( 'By purchasing the premium version of the plugin, you will take advantage of the advanced features of the product and you will get one year of free updates and support through our platform available 24h/24.', 'ywctm' ),
30
  'button' => array(
31
+ 'href' => $YITH_WC_Catalog_Mode->get_premium_landing_uri(),
32
  'title' => 'Get Support and Pro Features'
33
  )
34
  ),
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === YITH WooCommerce Catalog Mode ===
2
 
3
  Contributors: yithemes
4
- Tags: woocommerce, products, themes, yit, yith, e-commerce, shop, catalog mode, catalogue mode, remove add to cart
5
  Requires at least: 4.0
6
  Tested up to: 4.1.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
 
@@ -44,6 +44,10 @@ YITH WooCommerce Catalog Mode will add a new tab called "Catalog Mode" inside th
44
 
45
  == Changelog ==
46
 
 
 
 
 
47
  = 1.0.1 =
48
 
49
  * Fixed: Minor bugs
@@ -61,7 +65,7 @@ That's the way:
61
 
62
  == Upgrade Notice ==
63
 
64
- Last Stable Tag 1.0.1
65
 
66
  == Suggestions ==
67
 
1
  === YITH WooCommerce Catalog Mode ===
2
 
3
  Contributors: yithemes
4
+ Tags: woocommerce, products, themes, yit, yith, 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.1.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
 
44
 
45
  == Changelog ==
46
 
47
+ = 1.0.2 =
48
+
49
+ * Fixed: Added functions for themes compatibility
50
+
51
  = 1.0.1 =
52
 
53
  * Fixed: Minor bugs
65
 
66
  == Upgrade Notice ==
67
 
68
+ Last Stable Tag 1.0.2
69
 
70
  == Suggestions ==
71
 
templates/admin/premium.php CHANGED
@@ -198,7 +198,7 @@
198
  Upgrade to the <span class="highlight">premium version</span>
199
  of <span class="highlight">YITH WooCommerce Catalog Mode</span> to benefit from all features!
200
  </p>
201
- <a href="http://yithemes.com/themes/plugins/yith-woocommerce-catalog-mode/" target="_blank" class="premium-cta-button button btn">
202
  <span class="highlight">UPGRADE</span>
203
  <span>to the premium version</span>
204
  </a>
@@ -286,7 +286,7 @@
286
  Upgrade to the <span class="highlight">premium version</span>
287
  of <span class="highlight">YITH WooCommerce Catalog Mode</span> to benefit from all features!
288
  </p>
289
- <a href="http://yithemes.com/themes/plugins/yith-woocommerce-catalog-mode/" target="_blank" class="premium-cta-button button btn">
290
  <span class="highlight">UPGRADE</span>
291
  <span>to the premium version</span>
292
  </a>
198
  Upgrade to the <span class="highlight">premium version</span>
199
  of <span class="highlight">YITH WooCommerce Catalog Mode</span> to benefit from all features!
200
  </p>
201
+ <a href="<?php $this->get_premium_landing_uri() ?>" target="_blank" class="premium-cta-button button btn">
202
  <span class="highlight">UPGRADE</span>
203
  <span>to the premium version</span>
204
  </a>
286
  Upgrade to the <span class="highlight">premium version</span>
287
  of <span class="highlight">YITH WooCommerce Catalog Mode</span> to benefit from all features!
288
  </p>
289
+ <a href="<?php $this->get_premium_landing_uri() ?>" target="_blank" class="premium-cta-button button btn">
290
  <span class="highlight">UPGRADE</span>
291
  <span>to the premium version</span>
292
  </a>