YITH WooCommerce Catalog Mode - Version 1.0.7

Version Description

  • Fixed: Added functions for themes and plugins compatibility
Download this release

Release Info

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

Code changes from version 1.0.6 to 1.0.7

class.yith-woocommerce-catalog-mode.php CHANGED
@@ -151,7 +151,16 @@ class YITH_WC_Catalog_Mode {
151
 
152
  } else {
153
 
154
- remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', $priority );
 
 
 
 
 
 
 
 
 
155
 
156
  }
157
 
151
 
152
  } else {
153
 
154
+ //remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', $priority );
155
+
156
+ $inline_js = "$( 'form.cart button.single_add_to_cart_button' ).hide();";
157
+
158
+ if ( !class_exists( 'YITH_YWRAQ_Frontend' ) ) {
159
+
160
+ $inline_js .= "$( 'form.cart .quantity' ).hide();";
161
+ }
162
+
163
+ wc_enqueue_js( $inline_js );
164
 
165
  }
166
 
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.6
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.6' );
38
  }
39
 
40
  if ( ! defined( 'YWCTM_FREE_INIT' ) ) {
5
  Description: YITH Woocommerce Catalog Mode allows you to disable shop functions.
6
  Author: Yithemes
7
  Text Domain: ywctm
8
+ Version: 1.0.7
9
  Author URI: http://yithemes.com/
10
  */
11
 
34
  }
35
 
36
  if ( ! defined( 'YWCTM_VERSION' ) ) {
37
+ define( 'YWCTM_VERSION', '1.0.7' );
38
  }
39
 
40
  if ( ! defined( 'YWCTM_FREE_INIT' ) ) {
plugin-fw/assets/js/metabox.js CHANGED
@@ -42,22 +42,26 @@
42
  $(document).on('click', '.metaboxes-tab .upload_button', function(e) {
43
  var send_attachment_bkp = wp.media.editor.send.attachment;
44
  var button = $(this);
45
- var id = button.attr('id').replace('-button', '');
46
- _custom_media = true;
47
- wp.media.editor.send.attachment = function(props, attachment){
48
- if ( _custom_media ) {
49
- if( $("#"+id).is('input[type=text]') ) {
50
- $("#"+id).val(attachment.url);
 
 
 
 
 
51
  } else {
52
- $("#"+id + '_custom').val(attachment.url);
53
- }
54
- } else {
55
- return _orig_send_attachment.apply( this, [props, attachment] );
56
- };
 
57
  }
58
 
59
- wp.media.editor.open(button);
60
- return false;
61
  });
62
 
63
  $('.metaboxes-tab .add_media').on('click', function(){
42
  $(document).on('click', '.metaboxes-tab .upload_button', function(e) {
43
  var send_attachment_bkp = wp.media.editor.send.attachment;
44
  var button = $(this);
45
+ if( typeof button.attr('id') != 'undefined' ) {
46
+
47
+ var id = button.attr('id').replace('-button', '');
48
+ _custom_media = true;
49
+ wp.media.editor.send.attachment = function(props, attachment){
50
+ if ( _custom_media ) {
51
+ if( $("#"+id).is('input[type=text]') ) {
52
+ $("#"+id).val(attachment.url);
53
+ } else {
54
+ $("#"+id + '_custom').val(attachment.url);
55
+ }
56
  } else {
57
+ return _orig_send_attachment.apply( this, [props, attachment] );
58
+ };
59
+ }
60
+
61
+ wp.media.editor.open(button);
62
+ return false;
63
  }
64
 
 
 
65
  });
66
 
67
  $('.metaboxes-tab .add_media').on('click', function(){
plugin-fw/assets/js/yit-plugin-panel.js CHANGED
@@ -113,36 +113,13 @@
113
  var url = $(this).val();
114
  var re = new RegExp("(http|ftp|https)://[a-zA-Z0-9@?^=%&:/~+#-_.]*.(gif|jpg|jpeg|png|ico)");
115
 
116
- var preview = $(this).parent().siblings('.upload_img_preview');
117
  if (re.test(url)) {
118
  preview.html('<img src="' + url + '" style="max-width:600px; max-height:300px;" />');
119
  } else {
120
  preview.html('');
121
  }
122
- }).change();
123
-
124
- //$(document).on('click', '.plugin-option .upload_button', function (e) {
125
- // var send_attachment_bkp = wp.media.editor.send.attachment;
126
- // var button = $(this);
127
- // var id = button.attr('id').replace('-button', '');
128
- // _custom_media = true;
129
- // wp.media.editor.send.attachment = function (props, attachment) {
130
- // if (_custom_media) {
131
- // if ($("#" + id).is('input[type=text]')) {
132
- // $("#" + id).val(attachment.url);
133
- // } else {
134
- // $("#" + id + '_custom').val(attachment.url);
135
- // }
136
- //
137
- // } else {
138
- // return _orig_send_attachment.apply(this, [props, attachment]);
139
- // }
140
- // ;
141
- // }
142
- //
143
- // wp.media.editor.open(button);
144
- // return false;
145
- //});
146
 
147
  $( document ).on( 'click', '.plugin-option .upload_button', function(e) {
148
  e.preventDefault();
@@ -188,6 +165,7 @@
188
  var attachment = custom_uploader.state().get( 'selection' ).first().toJSON();
189
 
190
  $("#" + id).val( attachment.url );
 
191
  });
192
 
193
  //Open the uploader dialog
113
  var url = $(this).val();
114
  var re = new RegExp("(http|ftp|https)://[a-zA-Z0-9@?^=%&amp;:/~+#-_.]*.(gif|jpg|jpeg|png|ico)");
115
 
116
+ var preview = $(this).parents().siblings('.upload_img_preview');
117
  if (re.test(url)) {
118
  preview.html('<img src="' + url + '" style="max-width:600px; max-height:300px;" />');
119
  } else {
120
  preview.html('');
121
  }
122
+ }).trigger( 'change' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
123
 
124
  $( document ).on( 'click', '.plugin-option .upload_button', function(e) {
125
  e.preventDefault();
165
  var attachment = custom_uploader.state().get( 'selection' ).first().toJSON();
166
 
167
  $("#" + id).val( attachment.url );
168
+ $('.plugin-option .upload_img_url').trigger('change');
169
  });
170
 
171
  //Open the uploader dialog
plugin-fw/assets/js/yit-plugin-panel.min.js CHANGED
@@ -1,10 +1,10 @@
1
  (function(a){var l=function(){var b="";a(this).attr("multiple")?(a(this).children("option:selected").each(function(c,d){0!=c&&(b+=", ");b+=a(d).text()}),""==b&&a(this).children().children("option:selected").each(function(c,d){0!=c&&(b+=", ");b+=a(d).text()})):(b=a(this).children("option:selected").text(),""==b&&(b=a(this).children().children("option:selected").text()));0>=a(this).parent().find("span").length&&a(this).before("<span></span>");a(this).parent().children("span").replaceWith("<span>"+b+
2
  "</span>")};a(".plugin-option .select_wrapper select").not(".chosen").each(l).change(l);a(".plugin-option .select_wrapper").click(function(b){b.stopPropagation();a(this).find("select[multiple]").not(".chosen").toggle()});a(".plugin-option .select_wrapper select[multiple]").not(".chosen").click(function(a){a.stopPropagation()});a(window).click(function(){a(".plugin-option .select_wrapper select[multiple]").not(".chosen").hide()});a(".plugin-option .chosen .select_wrapper select").chosen();a(".plugin-option .on_off_container span").on("click",
3
- function(){var b=a(this).prev("input");b.prop("checked")?b.prop("checked",!1).attr("value","no").removeClass("onoffchecked"):b.prop("checked",!0).attr("value","yes").addClass("onoffchecked");b.change()});a(".plugin-option .slider_container .ui-slider-horizontal").each(function(){var b=a(this).data("val"),c=a(this).data("min"),d=a(this).data("max"),e=a(this).data("step"),f=a(this).data("labels");a(this).slider({value:b,min:c,max:d,range:"min",step:e,slide:function(b,c){a(this).find("input").val(c.value);
4
- a(this).siblings(".feedback").find("strong").text(c.value+f)}})});"undefined"!==typeof wp&&"undefined"!==typeof wp.media&&(a(".plugin-option .upload_img_url").change(function(){var b=a(this).val(),c=a(this).parent().siblings(".upload_img_preview");/(http|ftp|https):\/\/[a-zA-Z0-9@?^=%&amp;:/~+#-_.]*.(gif|jpg|jpeg|png|ico)/.test(b)?c.html('<img src="'+b+'" style="max-width:600px; max-height:300px;" />'):c.html("")}).change(),a(document).on("click",".plugin-option .upload_button",function(b){b.preventDefault();
5
- var c,d=a(this).attr("id").replace(/-button$/,"");c||(b=[new wp.media.controller.Library({library:wp.media.query(),multiple:!1,title:"Choose Image",priority:20,filterable:"uploaded"})],c=wp.media.frames.downloadable_file=wp.media({title:"Choose Image",library:{type:""},button:{text:"Choose Image"},multiple:!1,states:b}),c.on("select",function(){var b=c.state().get("selection").first().toJSON();a("#"+d).val(b.url)}));c.open()}));a(".plugin-option .add_media").on("click",function(){});a("[data-field]").each(function(){var b=
6
- a(this),c="#"+b.data("field"),d="#"+b.data("dep"),e=b.data("value");a(d).on("change",function(){var b=d,g=e.toString(),h=!0;if("string"==typeof b){":radio"==b.substr(0,6)&&(b+=":checked");for(var g=g.split(","),k=0;k<g.length;k++)if(a(b).val()!=g[k])h=!1;else{h=!0;break}}h?a(c+"-container").closest("tr").show():a(c+"-container").closest("tr").hide()}).change()});a(".rm_connectedlist").each(function(){var b=a(this).find("ul"),c=a(this).find(":hidden");b.sortable({connectWith:b,update:function(d,e){var f=
7
- {};b.each(function(){var b={};a(this).children().each(function(){b[a(this).data("option")]=a(this).text()});f[a(this).data("list")]=b});c.val(JSON.stringify(f).replace(/[\\"']/g,"\\$&").replace(/\u0000/g,"\\0"))}}).disableSelection()});a(document).ready(function(){a(".yith-video-link").click(function(b){b.preventDefault();b=a(this).data("video-id");a("."+b).dialog({dialogClass:"wp-dialog yit-dialog yit-video-dialog",modal:!0,closeOnEscape:!0,width:"auto",resizable:!1,draggable:!1,create:function(b,
8
- d){a(this).css("maxWidth","853px")},open:function(b,d){a(".ui-widget-overlay").bind("click",function(){a(this).siblings(".ui-dialog").find(".ui-dialog-content").dialog("close")})}});a(".ui-dialog :button").blur()})});a(document).ready(function(){a(".codemirror").each(function(b,c){var d=CodeMirror.fromTextArea(c,{lineNumbers:1,mode:"javascript",showCursorWhenSelecting:!0});a(c).data("codemirrorInstance",d)})});a(document).ready(function(){a(".google-analytic-generate").click(function(){var b=a("#"+
9
- a(this).data("textarea")).data("codemirrorInstance"),c=a("#"+a(this).data("input")).val(),d=a(this).data("basename"),e;e="(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement( o ),\nm=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n";e+="})(window,document,'script','//www.google-analytics.com/analytics.js','ga');\n\n";e+="ga('create', '"+c+"', '"+d+"');\n";e+="ga('send', 'pageview');\n";
10
- b.replaceRange(e,b.getCursor("start"),b.getCursor("end"))})})})(jQuery);
1
  (function(a){var l=function(){var b="";a(this).attr("multiple")?(a(this).children("option:selected").each(function(c,d){0!=c&&(b+=", ");b+=a(d).text()}),""==b&&a(this).children().children("option:selected").each(function(c,d){0!=c&&(b+=", ");b+=a(d).text()})):(b=a(this).children("option:selected").text(),""==b&&(b=a(this).children().children("option:selected").text()));0>=a(this).parent().find("span").length&&a(this).before("<span></span>");a(this).parent().children("span").replaceWith("<span>"+b+
2
  "</span>")};a(".plugin-option .select_wrapper select").not(".chosen").each(l).change(l);a(".plugin-option .select_wrapper").click(function(b){b.stopPropagation();a(this).find("select[multiple]").not(".chosen").toggle()});a(".plugin-option .select_wrapper select[multiple]").not(".chosen").click(function(a){a.stopPropagation()});a(window).click(function(){a(".plugin-option .select_wrapper select[multiple]").not(".chosen").hide()});a(".plugin-option .chosen .select_wrapper select").chosen();a(".plugin-option .on_off_container span").on("click",
3
+ function(){var b=a(this).prev("input");b.prop("checked")?b.prop("checked",!1).attr("value","no").removeClass("onoffchecked"):b.prop("checked",!0).attr("value","yes").addClass("onoffchecked");b.change()});a(".plugin-option .slider_container .ui-slider-horizontal").each(function(){var b=a(this).data("val"),c=a(this).data("min"),d=a(this).data("max"),e=a(this).data("step"),f=a(this).data("labels");a(this).slider({value:b,min:c,max:d,range:"min",step:e,slide:function(b,c){a(this).find("input").val(c.value);
4
+ a(this).siblings(".feedback").find("strong").text(c.value+f)}})});"undefined"!==typeof wp&&"undefined"!==typeof wp.media&&(a(".plugin-option .upload_img_url").change(function(){var b=a(this).val(),c=a(this).parents().siblings(".upload_img_preview");/(http|ftp|https):\/\/[a-zA-Z0-9@?^=%&amp;:/~+#-_.]*.(gif|jpg|jpeg|png|ico)/.test(b)?c.html('<img src="'+b+'" style="max-width:600px; max-height:300px;" />'):c.html("")}).trigger("change"),a(document).on("click",".plugin-option .upload_button",function(b){b.preventDefault();
5
+ var c,d=a(this).attr("id").replace(/-button$/,"");c||(b=[new wp.media.controller.Library({library:wp.media.query(),multiple:!1,title:"Choose Image",priority:20,filterable:"uploaded"})],c=wp.media.frames.downloadable_file=wp.media({title:"Choose Image",library:{type:""},button:{text:"Choose Image"},multiple:!1,states:b}),c.on("select",function(){var b=c.state().get("selection").first().toJSON();a("#"+d).val(b.url);a(".plugin-option .upload_img_url").trigger("change")}));c.open()}));a(".plugin-option .add_media").on("click",
6
+ function(){});a("[data-field]").each(function(){var b=a(this),c="#"+b.data("field"),d="#"+b.data("dep"),e=b.data("value");a(d).on("change",function(){var b=d,g=e.toString(),h=!0;if("string"==typeof b){":radio"==b.substr(0,6)&&(b+=":checked");for(var g=g.split(","),k=0;k<g.length;k++)if(a(b).val()!=g[k])h=!1;else{h=!0;break}}h?a(c+"-container").closest("tr").show():a(c+"-container").closest("tr").hide()}).change()});a(".rm_connectedlist").each(function(){var b=a(this).find("ul"),c=a(this).find(":hidden");
7
+ b.sortable({connectWith:b,update:function(d,e){var f={};b.each(function(){var b={};a(this).children().each(function(){b[a(this).data("option")]=a(this).text()});f[a(this).data("list")]=b});c.val(JSON.stringify(f).replace(/[\\"']/g,"\\$&").replace(/\u0000/g,"\\0"))}}).disableSelection()});a(document).ready(function(){a(".yith-video-link").click(function(b){b.preventDefault();b=a(this).data("video-id");a("."+b).dialog({dialogClass:"wp-dialog yit-dialog yit-video-dialog",modal:!0,closeOnEscape:!0,width:"auto",
8
+ resizable:!1,draggable:!1,create:function(b,d){a(this).css("maxWidth","853px")},open:function(b,d){a(".ui-widget-overlay").bind("click",function(){a(this).siblings(".ui-dialog").find(".ui-dialog-content").dialog("close")})}});a(".ui-dialog :button").blur()})});a(document).ready(function(){a(".codemirror").each(function(b,c){var d=CodeMirror.fromTextArea(c,{lineNumbers:1,mode:"javascript",showCursorWhenSelecting:!0});a(c).data("codemirrorInstance",d)})});a(document).ready(function(){a(".google-analytic-generate").click(function(){var b=
9
+ a("#"+a(this).data("textarea")).data("codemirrorInstance"),c=a("#"+a(this).data("input")).val(),d=a(this).data("basename"),e;e="(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement( o ),\nm=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n";e+="})(window,document,'script','//www.google-analytics.com/analytics.js','ga');\n\n";e+="ga('create', '"+c+"', '"+d+"');\n";e+="ga('send', 'pageview');\n";
10
+ b.replaceRange(e,b.getCursor("start"),b.getCursor("end"))})})})(jQuery);
plugin-fw/lib/yit-plugin-common.php CHANGED
@@ -27,6 +27,7 @@ class YIT_Plugin_Common {
27
 
28
 
29
  'awesome_icons' => array(
 
30
  'f042' => 'adjust',
31
  'f170' => 'adn',
32
  'f037' => 'align-center',
27
 
28
 
29
  'awesome_icons' => array(
30
+ '' => '00 no-icon',
31
  'f042' => 'adjust',
32
  'f170' => 'adn',
33
  'f037' => 'align-center',
plugin-fw/lib/yit-plugin-panel.php CHANGED
@@ -92,7 +92,8 @@ if ( ! class_exists( 'YIT_Plugin_Panel' ) ) {
92
  * @author Andrea Grillo <andrea.grillo@yithemes.com>
93
  */
94
  public function add_menu_page() {
95
- add_menu_page( 'yit_plugin_panel', __( 'YIT Plugins', 'yith-plugin-fw' ), 'manage_options', 'yit_plugin_panel', NULL, YIT_CORE_PLUGIN_URL . '/assets/images/yithemes-icon.png', 62 );
 
96
  }
97
 
98
  /**
92
  * @author Andrea Grillo <andrea.grillo@yithemes.com>
93
  */
94
  public function add_menu_page() {
95
+ $position = apply_filters( 'yit_plugins_menu_item_position', '62.32' );
96
+ add_menu_page( 'yit_plugin_panel', __( 'YIT Plugins', 'yith-plugin-fw' ), 'manage_options', 'yit_plugin_panel', NULL, YIT_CORE_PLUGIN_URL . '/assets/images/yithemes-icon.png', $position );
97
  }
98
 
99
  /**
plugin-fw/lib/yit-plugin-subpanel.php CHANGED
@@ -97,8 +97,9 @@ if ( ! class_exists( 'YIT_Plugin_SubPanel' ) ) {
97
  if ( isset( $admin_logo ) && ! empty( $admin_logo ) && $admin_logo != '' && $admin_logo) {
98
  $logo = $admin_logo;
99
  }
 
 
100
 
101
- add_menu_page( 'yit_plugin_panel', __( 'YIT Plugins', 'yith-plugin-fw' ), 'nosuchcapability', 'yit_plugin_panel', NULL, $logo, 62 );
102
  add_submenu_page( 'yit_plugin_panel', $this->settings['label'], $this->settings['label'], 'manage_options', $this->settings['page'], array( $this, 'yit_panel' ) );
103
  remove_submenu_page( 'yit_plugin_panel', 'yit_plugin_panel' );
104
 
97
  if ( isset( $admin_logo ) && ! empty( $admin_logo ) && $admin_logo != '' && $admin_logo) {
98
  $logo = $admin_logo;
99
  }
100
+ $position = apply_filters( 'yit_plugins_menu_item_position', '62.32' );
101
+ add_menu_page( 'yit_plugin_panel', __( 'YIT Plugins', 'yith-plugin-fw' ), 'nosuchcapability', 'yit_plugin_panel', NULL, $logo, $position );
102
 
 
103
  add_submenu_page( 'yit_plugin_panel', $this->settings['label'], $this->settings['label'], 'manage_options', $this->settings['page'], array( $this, 'yit_panel' ) );
104
  remove_submenu_page( 'yit_plugin_panel', 'yit_plugin_panel' );
105
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ 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.2.2
7
- Stable tag: 1.0.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -48,6 +48,10 @@ YITH WooCommerce Catalog Mode will add a new tab called "Catalog Mode" inside th
48
 
49
  == Changelog ==
50
 
 
 
 
 
51
  = 1.0.6 =
52
 
53
  * Fixed: Added functions for themes compatibility
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.2.2
7
+ Stable tag: 1.0.7
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
48
 
49
  == Changelog ==
50
 
51
+ = 1.0.7 =
52
+
53
+ * Fixed: Added functions for themes and plugins compatibility
54
+
55
  = 1.0.6 =
56
 
57
  * Fixed: Added functions for themes compatibility