YITH Essential Kit for WooCommerce #1 - Version 1.3.4

Version Description

  • Updated: All YITH plugins to latest version
Download this release

Release Info

Developer yithemes
Plugin Icon 128x128 YITH Essential Kit for WooCommerce #1
Version 1.3.4
Comparing to
See all releases

Code changes from version 1.3.2 to 1.3.4

Files changed (56) hide show
  1. README.txt +10 -2
  2. assets/css/list-layout.css +1 -0
  3. init.php +1 -1
  4. modules/yith-woocommerce-advanced-reviews/init.php +3 -3
  5. modules/yith-woocommerce-ajax-navigation/assets/js/yith-wcan-frontend.js +9 -5
  6. modules/yith-woocommerce-ajax-navigation/assets/js/yith-wcan-frontend.min.js +1 -1
  7. modules/yith-woocommerce-ajax-navigation/includes/class.yith-wcan-frontend.php +30 -78
  8. modules/yith-woocommerce-ajax-navigation/includes/class.yith-wcan.php +24 -0
  9. modules/yith-woocommerce-ajax-navigation/includes/functions.yith-wcan.php +39 -17
  10. modules/yith-woocommerce-ajax-navigation/init.php +2 -2
  11. modules/yith-woocommerce-ajax-navigation/widgets/class.yith-wcan-navigation-widget.php +6 -5
  12. modules/yith-woocommerce-authorizenet-payment-gateway/includes/class.yith-wcauthnet-credit-card-gateway.php +17 -0
  13. modules/yith-woocommerce-authorizenet-payment-gateway/init.php +2 -2
  14. modules/yith-woocommerce-colors-labels-variations/class.yith-wccl-admin.php +0 -88
  15. modules/yith-woocommerce-product-add-ons/assets/js/yith-wapo-frontend.js +1 -1
  16. modules/yith-woocommerce-product-add-ons/assets/js/yith-wapo-frontend.min.js +1 -1
  17. modules/yith-woocommerce-product-add-ons/includes/class.yith-wapo-admin.php +2 -2
  18. modules/yith-woocommerce-product-add-ons/init.php +3 -3
  19. modules/yith-woocommerce-product-vendors/assets/css/admin.css +2 -0
  20. modules/yith-woocommerce-product-vendors/includes/class.yith-commission.php +1 -1
  21. modules/yith-woocommerce-product-vendors/includes/class.yith-commissions.php +22 -22
  22. modules/yith-woocommerce-product-vendors/includes/class.yith-orders.php +172 -13
  23. modules/yith-woocommerce-product-vendors/includes/class.yith-vendor.php +6 -2
  24. modules/yith-woocommerce-product-vendors/includes/class.yith-vendors-admin.php +57 -35
  25. modules/yith-woocommerce-product-vendors/includes/class.yith-vendors-frontend.php +46 -0
  26. modules/yith-woocommerce-product-vendors/includes/class.yith-vendors.php +16 -16
  27. modules/yith-woocommerce-product-vendors/includes/lib/class.yith-commissions-list-table.php +22 -22
  28. modules/yith-woocommerce-product-vendors/includes/widgets/class.yith-woocommerce-vendors-widget.php +7 -7
  29. modules/yith-woocommerce-product-vendors/init.php +5 -5
  30. modules/yith-woocommerce-product-vendors/languages/yith-woocommerce-product-vendors-it_IT.mo +0 -0
  31. modules/yith-woocommerce-product-vendors/languages/yith-woocommerce-product-vendors-it_IT.po +3014 -0
  32. modules/yith-woocommerce-product-vendors/languages/yith-woocommerce-product-vendors.pot +1205 -0
  33. modules/yith-woocommerce-product-vendors/plugin-options/commissions-options.php +3 -3
  34. modules/yith-woocommerce-product-vendors/plugin-options/vendors-options.php +8 -8
  35. modules/yith-woocommerce-product-vendors/templates/admin/commission-view.php +26 -26
  36. modules/yith-woocommerce-product-vendors/templates/admin/commissions.php +1 -1
  37. modules/yith-woocommerce-product-vendors/templates/woocommerce/single-product/vendor-tab.php +2 -2
  38. modules/yith-woocommerce-tab-manager/includes/metabox/tab-metabox.php +1 -1
  39. modules/yith-woocommerce-tab-manager/init.php +3 -3
  40. modules/yith-woocommerce-tab-manager/templates/default.php +2 -7
  41. modules/yith-woocommerce-zoom-magnifier/assets/js/yith_magnifier.js +1 -1
  42. modules/yith-woocommerce-zoom-magnifier/assets/js/yith_magnifier.min.js +1 -1
  43. modules/yith-woocommerce-zoom-magnifier/init.php +3 -3
  44. modules/yith-woocommerce-zoom-magnifier/plugin-options/general-options.php +1 -1
  45. plugin-fw/assets/js/yit-plugin-panel.js +11 -0
  46. plugin-fw/assets/js/yit-plugin-panel.min.js +1 -10
  47. plugin-fw/init.php +1 -1
  48. plugin-fw/lib/yit-plugin-panel-sidebar.php +8 -5
  49. plugin-fw/lib/yit-plugin-panel-wc.php +1 -1
  50. plugin-fw/lib/yit-plugin-panel.php +2 -2
  51. plugin-fw/lib/yit-pointers.php +5 -5
  52. plugin-fw/lib/yit-upgrade.php +16 -7
  53. plugin-fw/templates/panel/types/colorpicker.php +38 -0
  54. plugin-fw/templates/panel/types/number.php +35 -0
  55. plugin-fw/templates/panel/types/upload.php +1 -1
  56. templates/yith-single-plugin.php +12 -2
README.txt CHANGED
@@ -4,7 +4,7 @@ Contributors: yithemes
4
Tags: woocommerce,yith woocommerce colors and labels variations,yith woocommerce zoom magnifier,yith woocommerce wishlist,yith woocommerce ajax product filter,yith woocommerce ajax search,yith woocommerce catalog mode,yith woocommerce advanced reviews, yith woocommerce badges management,yith woocommerce cart messages,yith woocommerce review reminder,yith woocommerce quick view,yith woocommerce mailchimp,yith woocommerce stripe,yith woocommerce request a quote,yith woocommerce tab manager,yith woocommerce multi vendor
5
Requires at least: 3.5.1
6
Tested up to: 4.5.2
7
- Stable tag: 1.3.2
8
License: GPLv2 or later
9
License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
@@ -155,6 +155,14 @@ YITH Essential Kit for WooCommerce #1 will add a new submenu called "YITH Essent
155
156
== Changelog ==
157
158
= 1.3.2 =
159
160
* Updated: YITH WooCommerce Ajax Navigation to 3.0.6 version
@@ -336,4 +344,4 @@ YITH Essential Kit for WooCommerce #1 will add a new submenu called "YITH Essent
336
337
== Upgrade Notice ==
338
339
- Last Stable Tag 1.3.2
4
Tags: woocommerce,yith woocommerce colors and labels variations,yith woocommerce zoom magnifier,yith woocommerce wishlist,yith woocommerce ajax product filter,yith woocommerce ajax search,yith woocommerce catalog mode,yith woocommerce advanced reviews, yith woocommerce badges management,yith woocommerce cart messages,yith woocommerce review reminder,yith woocommerce quick view,yith woocommerce mailchimp,yith woocommerce stripe,yith woocommerce request a quote,yith woocommerce tab manager,yith woocommerce multi vendor
5
Requires at least: 3.5.1
6
Tested up to: 4.5.2
7
+ Stable tag: 1.3.4
8
License: GPLv2 or later
9
License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
155
156
== Changelog ==
157
158
+ = 1.3.4 =
159
+
160
+ * Updated: All YITH plugins to latest version
161
+
162
+ = 1.3.3 =
163
+
164
+ * Updated: YITH WooCommerce Ajax Navigation to 3.0.8 version
165
+
166
= 1.3.2 =
167
168
* Updated: YITH WooCommerce Ajax Navigation to 3.0.6 version
344
345
== Upgrade Notice ==
346
347
+ Last Stable Tag 1.3.4
assets/css/list-layout.css CHANGED
@@ -63,6 +63,7 @@
63
background: url('../images/cart.png');
64
}
65
66
.yith-jetpack .plugin-card .column-downloaded {
67
display: block;
68
width: 100%;
63
background: url('../images/cart.png');
64
}
65
66
+
67
.yith-jetpack .plugin-card .column-downloaded {
68
display: block;
69
width: 100%;
init.php CHANGED
@@ -7,7 +7,7 @@ Text Domain: yith-essential-kit-for-woocommerce-1
7
Domain Path: /languages/
8
Author: YIThemes
9
Author URI: http://yithemes.com/
10
- Version: 1.3.2
11
*/
12
13
if ( ! defined( 'ABSPATH' ) ) {
7
Domain Path: /languages/
8
Author: YIThemes
9
Author URI: http://yithemes.com/
10
+ Version: 1.3.4
11
*/
12
13
if ( ! defined( 'ABSPATH' ) ) {
modules/yith-woocommerce-advanced-reviews/init.php CHANGED
@@ -2,10 +2,10 @@
2
/*
3
Plugin Name: YITH WooCommerce Advanced Reviews
4
Plugin URI: http://yithemes.com/themes/plugins/yith-woocommerce-advanced-reviews/
5
- Description: Extends the basic functionality of woocommerce reviews and add a histogram table to the reviews of your products, as well as you see in most trendy e-commerce sites.
6
Author: YITHEMES
7
Text Domain: yith-woocommerce-advanced-reviews
8
- Version: 1.2.2
9
Author URI: http://yithemes.com/
10
*/
11
@@ -45,7 +45,7 @@ register_activation_hook ( __FILE__, 'yith_plugin_registration_hook' );
45
46
require_once ( plugin_dir_path ( __FILE__ ) . 'functions.php' );
47
yith_define ( 'YITH_YWAR_FREE_INIT', plugin_basename ( __FILE__ ) );
48
- yith_define ( 'YITH_YWAR_VERSION', '1.2.2' );
49
yith_define ( 'YITH_YWAR_FILE', __FILE__ );
50
yith_define ( 'YITH_YWAR_DIR', plugin_dir_path ( __FILE__ ) );
51
yith_define ( 'YITH_YWAR_URL', plugins_url ( '/', __FILE__ ) );
2
/*
3
Plugin Name: YITH WooCommerce Advanced Reviews
4
Plugin URI: http://yithemes.com/themes/plugins/yith-woocommerce-advanced-reviews/
5
+ Description: Extends the basic functionality of woocommerce reviews and add a histogram table to the reviews of your products, such as you see in most trendy e-commerce sites.
6
Author: YITHEMES
7
Text Domain: yith-woocommerce-advanced-reviews
8
+ Version: 1.2.3
9
Author URI: http://yithemes.com/
10
*/
11
45
46
require_once ( plugin_dir_path ( __FILE__ ) . 'functions.php' );
47
yith_define ( 'YITH_YWAR_FREE_INIT', plugin_basename ( __FILE__ ) );
48
+ yith_define ( 'YITH_YWAR_VERSION', '1.2.3' );
49
yith_define ( 'YITH_YWAR_FILE', __FILE__ );
50
yith_define ( 'YITH_YWAR_DIR', plugin_dir_path ( __FILE__ ) );
51
yith_define ( 'YITH_YWAR_URL', plugins_url ( '/', __FILE__ ) );
modules/yith-woocommerce-ajax-navigation/assets/js/yith-wcan-frontend.js CHANGED
@@ -212,13 +212,17 @@ jQuery(function ($) {
212
}
213
214
215
- var widget_reload = function (t) {
216
- var id = t.attr('id');
217
- t.html($(response).find('#' + id).html());
218
219
- if (t.text() == '') {
220
t.hide();
221
- } else {
222
t.show();
223
}
224
};
212
}
213
214
215
+ var widget_reload = function(t) {
216
217
+ var id = t.attr('id'),
218
+ widget_in_response = $(response).find('#' + id);
219
+
220
+ if( widget_in_response.length == 0 ){
221
t.hide();
222
+ }
223
+
224
+ else {
225
+ t.html(widget_in_response.html());
226
t.show();
227
}
228
};
modules/yith-woocommerce-ajax-navigation/assets/js/yith-wcan-frontend.min.js CHANGED
@@ -8,7 +8,7 @@ jQuery(function(a){function u(a,p){return a.replace(new RegExp("[?&]"+p+"=[^&#]*
8
"&")+a.param({min_price:l,max_price:g})}"select"==e.data("type")&&(e.parents("div.yith-woo-ajax-navigation").find("a.yit-wcan-select-open").removeClass("active"),e.parent().find("div.yith-wcan-select-wrapper").css("z-index","-1").animate({visibility:"hidden",opacity:0},300));a(yith_wcan.container).not(".ywcps-products").html("").addClass("yith-wcan-loading");a(document).trigger("yith-wcan-ajax-loading");"undefined"!=typeof yith_wcan_frontend&&a(yith_wcan.container).not(".ywcps-products").css("backgroundImage",
9
"url("+yith_wcan_frontend.loader_url+")");1==yith_wcan.is_mobile&&a(window).scrollTop(a(yith_wcan.scroll_top).offset().top);a(yith_wcan.pagination).hide();a(yith_wcan.result_count).hide();0!=r&&(r.abort(),r=!1);r=a.ajax({url:b,success:function(c){r=!1;a(yith_wcan.container).not(".ywcps-products").removeClass("yith-wcan-loading");0<a(c).find(yith_wcan.container).not(".ywcps-products").length?a(".yit-wcan-container").html(a(c).find(yith_wcan.container).not(".ywcps-products")):a(".yit-wcan-container").html(a(c).find(".woocommerce-info"));
10
0<a(c).find(yith_wcan.pagination).length?(0==a(yith_wcan.pagination).length&&a.jseldom(yith_wcan.pagination).insertAfter(a(yith_wcan.container).not(".ywcps-products")),a(yith_wcan.pagination).html(a(c).find(yith_wcan.pagination).html()).show()):a(yith_wcan.pagination).empty();a("div.quantity:not(.buttons_added), td.quantity:not(.buttons_added)").addClass("buttons_added").append('<input type="button" value="+" class="plus" />').prepend('<input type="button" value="-" class="minus" />');0<a(c).find(yith_wcan.result_count).length&&
11
- a(yith_wcan.result_count).html(a(c).find(yith_wcan.result_count).html()).show();a(".yith-woo-ajax-navigation").add(".yith-wcan-sort-by").add(".yith-wcan-stock-on-sale").add(".yith-wcan-list-price-filter").each(function(){var b=a(this),d=b.attr("id");b.html(a(c).find("#"+d).html());""==b.text()?b.hide():b.show()});if(1==yith_wcan.avada.is_enabled){var d=a(yith_wcan.avada.sort_count);d.html(a(c).find(yith_wcan.avada.sort_count).html());""==e.text()?d.hide():d.show()}1!=yith_wcan.change_browser_url||
12
navigator.userAgent.match(/msie/i)||window.history.pushState({pageTitle:c.pageTitle},"",b);a(document).trigger("ready");a(document).trigger("yith-wcan-ajax-filtered");a(window).trigger("scroll");if(n){if("undefined"!=typeof a.fn.slider){var d=parseInt(a(yith_wcan.wc_price_slider.min_price).data("min")),f=parseInt(a(yith_wcan.wc_price_slider.max_price).data("max"));a(yith_wcan.wc_price_slider.wrapper).slider("values",[d,f]);a(document.body).trigger("price_slider_slide",[d,f])}a(document).trigger("yith-wcan-ajax-reset-filtered")}x()}})};
13
a(yith_wcan.container).not(".ywcps-products").wrap('<div class="yit-wcan-container"></div>');a(document).on("yith-wcan-wrapped",function(){x()});a(document).trigger("yith-wcan-wrapped");a(document).on("click",".yith-wcan a",function(k){a(this).yith_wcan_ajax_filters(k,this)});var t=function(){a("div.yith-wcan-select-wrapper").css("z-index","-1").animate({visibility:"hidden",opacity:0},0);a("a.yit-wcan-select-open").removeClass("active")};a(document).on("click","a.yit-wcan-select-open.active",function(k){k.preventDefault();
14
a(this).parent().find("div.yith-wcan-select-wrapper").css("z-index","-1").animate({visibility:"hidden",opacity:0},300);a(this).parent().find("a.yit-wcan-select-open").removeClass("active")});a(document).on("click","a.yit-wcan-select-open:not(.active)",function(k){k.preventDefault();a(this).parent().find("div.yith-wcan-select-wrapper").css("z-index","1").animate({visibility:"visible",opacity:1},300);a(this).parent().find("a.yit-wcan-select-open").addClass("active")});a(document).on("ready yith-wcan-ajax-filtered",
8
"&")+a.param({min_price:l,max_price:g})}"select"==e.data("type")&&(e.parents("div.yith-woo-ajax-navigation").find("a.yit-wcan-select-open").removeClass("active"),e.parent().find("div.yith-wcan-select-wrapper").css("z-index","-1").animate({visibility:"hidden",opacity:0},300));a(yith_wcan.container).not(".ywcps-products").html("").addClass("yith-wcan-loading");a(document).trigger("yith-wcan-ajax-loading");"undefined"!=typeof yith_wcan_frontend&&a(yith_wcan.container).not(".ywcps-products").css("backgroundImage",
9
"url("+yith_wcan_frontend.loader_url+")");1==yith_wcan.is_mobile&&a(window).scrollTop(a(yith_wcan.scroll_top).offset().top);a(yith_wcan.pagination).hide();a(yith_wcan.result_count).hide();0!=r&&(r.abort(),r=!1);r=a.ajax({url:b,success:function(c){r=!1;a(yith_wcan.container).not(".ywcps-products").removeClass("yith-wcan-loading");0<a(c).find(yith_wcan.container).not(".ywcps-products").length?a(".yit-wcan-container").html(a(c).find(yith_wcan.container).not(".ywcps-products")):a(".yit-wcan-container").html(a(c).find(".woocommerce-info"));
10
0<a(c).find(yith_wcan.pagination).length?(0==a(yith_wcan.pagination).length&&a.jseldom(yith_wcan.pagination).insertAfter(a(yith_wcan.container).not(".ywcps-products")),a(yith_wcan.pagination).html(a(c).find(yith_wcan.pagination).html()).show()):a(yith_wcan.pagination).empty();a("div.quantity:not(.buttons_added), td.quantity:not(.buttons_added)").addClass("buttons_added").append('<input type="button" value="+" class="plus" />').prepend('<input type="button" value="-" class="minus" />');0<a(c).find(yith_wcan.result_count).length&&
11
+ a(yith_wcan.result_count).html(a(c).find(yith_wcan.result_count).html()).show();a(".yith-woo-ajax-navigation").add(".yith-wcan-sort-by").add(".yith-wcan-stock-on-sale").add(".yith-wcan-list-price-filter").each(function(){var b=a(this),d=b.attr("id"),d=a(c).find("#"+d);0==d.length?b.hide():(b.html(d.html()),b.show())});if(1==yith_wcan.avada.is_enabled){var d=a(yith_wcan.avada.sort_count);d.html(a(c).find(yith_wcan.avada.sort_count).html());""==e.text()?d.hide():d.show()}1!=yith_wcan.change_browser_url||
12
navigator.userAgent.match(/msie/i)||window.history.pushState({pageTitle:c.pageTitle},"",b);a(document).trigger("ready");a(document).trigger("yith-wcan-ajax-filtered");a(window).trigger("scroll");if(n){if("undefined"!=typeof a.fn.slider){var d=parseInt(a(yith_wcan.wc_price_slider.min_price).data("min")),f=parseInt(a(yith_wcan.wc_price_slider.max_price).data("max"));a(yith_wcan.wc_price_slider.wrapper).slider("values",[d,f]);a(document.body).trigger("price_slider_slide",[d,f])}a(document).trigger("yith-wcan-ajax-reset-filtered")}x()}})};
13
a(yith_wcan.container).not(".ywcps-products").wrap('<div class="yit-wcan-container"></div>');a(document).on("yith-wcan-wrapped",function(){x()});a(document).trigger("yith-wcan-wrapped");a(document).on("click",".yith-wcan a",function(k){a(this).yith_wcan_ajax_filters(k,this)});var t=function(){a("div.yith-wcan-select-wrapper").css("z-index","-1").animate({visibility:"hidden",opacity:0},0);a("a.yit-wcan-select-open").removeClass("active")};a(document).on("click","a.yit-wcan-select-open.active",function(k){k.preventDefault();
14
a(this).parent().find("div.yith-wcan-select-wrapper").css("z-index","-1").animate({visibility:"hidden",opacity:0},300);a(this).parent().find("a.yit-wcan-select-open").removeClass("active")});a(document).on("click","a.yit-wcan-select-open:not(.active)",function(k){k.preventDefault();a(this).parent().find("div.yith-wcan-select-wrapper").css("z-index","1").animate({visibility:"visible",opacity:1},300);a(this).parent().find("a.yit-wcan-select-open").addClass("active")});a(document).on("ready yith-wcan-ajax-filtered",
modules/yith-woocommerce-ajax-navigation/includes/class.yith-wcan-frontend.php CHANGED
@@ -50,7 +50,7 @@ if ( ! class_exists( 'YITH_WCAN_Frontend' ) ) {
50
)
51
);
52
53
- if( in_array( strtolower( wp_get_theme()->name ), $theme_support ) ){
54
add_filter( 'yith_wcan_use_wp_the_query_object', '__return_true' );
55
}
56
@@ -58,9 +58,6 @@ if ( ! class_exists( 'YITH_WCAN_Frontend' ) ) {
58
$is_ajax_navigation_active = is_active_widget( false, false, 'yith-woo-ajax-navigation', true );
59
60
//Actions
61
- //TODO: Remove woocommerce_layered_nav_init method
62
- //add_action( 'init', array( $this, 'woocommerce_layered_nav_init' ), 90 );
63
-
64
if( $is_ajax_navigation_active ) {
65
add_filter( 'woocommerce_is_layered_nav_active', '__return_true' );
66
}
@@ -108,7 +105,6 @@ if ( ! class_exists( 'YITH_WCAN_Frontend' ) ) {
108
* @return array
109
*/
110
public function the_posts( $posts, $query = false ) {
111
-
112
if( YITH_WCAN()->is_wc_older_2_6 ){
113
add_action( 'wp', array( $this, 'layered_navigation_array_for_wc_older_26' ) );
114
}
@@ -147,7 +143,7 @@ if ( ! class_exists( 'YITH_WCAN_Frontend' ) ) {
147
$current_wp_query,
148
array(
149
'post_type' => 'product',
150
- 'numberposts' => -1,
151
'post_status' => 'publish',
152
'meta_query' => is_object( $current_wp_query ) ? $current_wp_query->meta_query : array(),
153
'fields' => 'ids',
@@ -155,9 +151,21 @@ if ( ! class_exists( 'YITH_WCAN_Frontend' ) ) {
155
'update_post_meta_cache' => false,
156
'update_post_term_cache' => false,
157
'pagename' => '',
158
- 'wc_query' => 'get_products_in_view'
159
)
160
);
161
$this->unfiltered_product_ids = get_posts( $unfiltered_args );
162
$this->filtered_product_ids = $queried_post_ids;
163
@@ -174,7 +182,6 @@ if ( ! class_exists( 'YITH_WCAN_Frontend' ) ) {
174
$this->layered_nav_product_ids = $this->unfiltered_product_ids;
175
}
176
}
177
-
178
return $posts;
179
}
180
@@ -219,68 +226,7 @@ if ( ! class_exists( 'YITH_WCAN_Frontend' ) ) {
219
wp_localize_script( 'yith-wcan-script', 'yith_wcan', apply_filters( 'yith-wcan-frontend-args', $args ) );
220
}
221
}
222
-
223
-
224
- /**
225
- * Layered Nav Init
226
- *
227
- * @package WooCommerce/Widgets
228
- * @access public
229
- * @return void
230
- */
231
- public function woocommerce_layered_nav_init() {
232
- $is_ajax_navigation_active = is_active_widget( false, false, 'yith-woo-ajax-navigation', true );
233
-
234
-
235
-
236
- if ( ! YITH_WCAN()->is_wc_older_2_6 && $is_ajax_navigation_active && ! is_admin() ) {
237
-
238
- $_chosen_attributes = YITH_WCAN()->get_layered_nav_chosen_attributes();
239
-
240
- /* FIX TO WOOCOMMERCE 2.1 */
241
- $attibute_taxonomies = function_exists( 'wc_get_attribute_taxonomies' ) ? $attribute_taxonomies = wc_get_attribute_taxonomies() : $attribute_taxonomies = WC()->get_attribute_taxonomies();
242
-
243
- if ( $attribute_taxonomies ) {
244
- foreach ( $attribute_taxonomies as $tax ) {
245
-
246
- $attribute = wc_sanitize_taxonomy_name( $tax->attribute_name );
247
-
248
- /* FIX TO WOOCOMMERCE 2.1 */
249
- if ( function_exists( 'wc_attribute_taxonomy_name' ) ) {
250
- $taxonomy = wc_attribute_taxonomy_name( $attribute );
251
- }
252
- else {
253
- $taxonomy = WC()->attribute_taxonomy_name( $attribute );
254
- }
255
-
256
- $name = 'filter_' . $attribute;
257
- $query_type_name = 'query_type_' . $attribute;
258
-
259
- if ( ! empty( $_GET[$name] ) && taxonomy_exists( $taxonomy ) ) {
260
-
261
- $_chosen_attributes[ $taxonomy ]['terms'] = explode( ',', $_GET[ $name ] );
262
-
263
- if ( empty( $_GET[ $query_type_name ] ) || ! in_array( strtolower( $_GET[ $query_type_name ] ), array( 'and', 'or' ) ) )
264
- $_chosen_attributes[ $taxonomy ]['query_type'] = apply_filters( 'woocommerce_layered_nav_default_query_type', 'and' );
265
- else
266
- $_chosen_attributes[ $taxonomy ]['query_type'] = strtolower( $_GET[ $query_type_name ] );
267
-
268
- }
269
- }
270
- }
271
-
272
- if ( YITH_WCAN()->is_wc_older_2_1 ) {
273
- add_filter( 'woocommerce_is_layered_nav_active', '__return_true' );
274
- //add_filter( 'loop_shop_post_in', 'woocommerce_layered_nav_query' );
275
- }
276
-
277
- elseif ( YITH_WCAN()->is_wc_older_2_6 ) {
278
- add_filter( 'woocommerce_is_layered_nav_active', '__return_true' );
279
- //add_filter( 'loop_shop_post_in', array( WC()->query, 'layered_nav_query' ) );
280
- }
281
- //Nothing to do for WooCommerce 2.6
282
- }
283
- }
284
/**
285
* Layered Nav post filter.
286
*
@@ -294,7 +240,7 @@ if ( ! class_exists( 'YITH_WCAN_Frontend' ) ) {
294
if( is_product_taxonomy() ){
295
$is_product_taxonomy = array(
296
'taxonomy' => get_queried_object()->taxonomy,
297
- 'terms' => get_queried_object()->slug,
298
'field' => YITH_WCAN()->filter_term_field
299
);
300
}
@@ -321,8 +267,11 @@ if ( ! class_exists( 'YITH_WCAN_Frontend' ) ) {
321
'post_type' => 'product',
322
'numberposts' => -1,
323
'post_status' => 'publish',
324
'fields' => 'ids',
325
'no_found_rows' => true,
326
'tax_query' => array(
327
array(
328
'taxonomy' => $attribute,
@@ -388,13 +337,16 @@ if ( ! class_exists( 'YITH_WCAN_Frontend' ) ) {
388
389
else {
390
391
- $args = array(
392
- 'post_type' => 'product',
393
- 'numberposts' => -1,
394
- 'post_status' => 'publish',
395
- 'fields' => 'ids',
396
- 'no_found_rows' => true,
397
- 'tax_query' => array()
398
);
399
400
50
)
51
);
52
53
+ if( in_array( strtolower( wp_get_theme()->name ), $theme_support ) || class_exists( 'QTX_Translator' ) ){
54
add_filter( 'yith_wcan_use_wp_the_query_object', '__return_true' );
55
}
56
58
$is_ajax_navigation_active = is_active_widget( false, false, 'yith-woo-ajax-navigation', true );
59
60
//Actions
61
if( $is_ajax_navigation_active ) {
62
add_filter( 'woocommerce_is_layered_nav_active', '__return_true' );
63
}
105
* @return array
106
*/
107
public function the_posts( $posts, $query = false ) {
108
if( YITH_WCAN()->is_wc_older_2_6 ){
109
add_action( 'wp', array( $this, 'layered_navigation_array_for_wc_older_26' ) );
110
}
143
$current_wp_query,
144
array(
145
'post_type' => 'product',
146
+ 'numberposts' => - 1,
147
'post_status' => 'publish',
148
'meta_query' => is_object( $current_wp_query ) ? $current_wp_query->meta_query : array(),
149
'fields' => 'ids',
151
'update_post_meta_cache' => false,
152
'update_post_term_cache' => false,
153
'pagename' => '',
154
+ 'wc_query' => 'get_products_in_view',
155
+ 'suppress_filters' => true
156
)
157
);
158
+
159
+ $hide_out_of_stock_items = apply_filters( 'yith_wcan_hide_out_of_stock_items', 'yes' == get_option( 'woocommerce_hide_out_of_stock_items' ) ? true : false );
160
+
161
+ if( $hide_out_of_stock_items ){
162
+ $unfiltered_args['meta_query'][] = array(
163
+ 'key' => '_stock_status',
164
+ 'value' => 'instock',
165
+ 'compare' => 'AND'
166
+ );
167
+ }
168
+
169
$this->unfiltered_product_ids = get_posts( $unfiltered_args );
170
$this->filtered_product_ids = $queried_post_ids;
171
182
$this->layered_nav_product_ids = $this->unfiltered_product_ids;
183
}
184
}
185
return $posts;
186
}
187
226
wp_localize_script( 'yith-wcan-script', 'yith_wcan', apply_filters( 'yith-wcan-frontend-args', $args ) );
227
}
228
}
229
+
230
/**
231
* Layered Nav post filter.
232
*
240
if( is_product_taxonomy() ){
241
$is_product_taxonomy = array(
242
'taxonomy' => get_queried_object()->taxonomy,
243
+ 'terms' => get_queried_object()->slug,
244
'field' => YITH_WCAN()->filter_term_field
245
);
246
}
267
'post_type' => 'product',
268
'numberposts' => -1,
269
'post_status' => 'publish',
270
+ 'meta_key' => '_visibility',
271
+ 'meta_value' => 'visible',
272
'fields' => 'ids',
273
'no_found_rows' => true,
274
+ 'suppress_filters' => true,
275
'tax_query' => array(
276
array(
277
'taxonomy' => $attribute,
337
338
else {
339
340
+ $args = array(
341
+ 'post_type' => 'product',
342
+ 'numberposts' => - 1,
343
+ 'post_status' => 'publish',
344
+ 'meta_key' => '_visibility',
345
+ 'meta_value' => 'visible',
346
+ 'fields' => 'ids',
347
+ 'no_found_rows' => true,
348
+ 'suppress_filters' => true,
349
+ 'tax_query' => array()
350
);
351
352
modules/yith-woocommerce-ajax-navigation/includes/class.yith-wcan.php CHANGED
@@ -99,6 +99,11 @@ if ( ! class_exists( 'YITH_WCAN' ) ) {
99
$this->required();
100
101
$this->init();
102
}
103
104
/**
@@ -218,5 +223,24 @@ if ( ! class_exists( 'YITH_WCAN' ) ) {
218
return $chosen_attributes;
219
}
220
221
}
222
}
99
$this->required();
100
101
$this->init();
102
+
103
+ // Support to Ultimate Member plugin
104
+ if( class_exists( 'UM_API' ) ){
105
+ add_action( 'init', array( $this, 'ultimate_member_support' ), 0 );
106
+ }
107
}
108
109
/**
223
return $chosen_attributes;
224
}
225
226
+ /**
227
+ * Support to ultimate members functions
228
+ *
229
+ * The method set_predefined_fields call a WP_Query that generate
230
+ * an issue with shop filtered query. Move this step to init with priority 2
231
+ * instead of 1
232
+ *
233
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
234
+ * @since 3.0.9
235
+ * @return void
236
+ */
237
+ public function ultimate_member_support(){
238
+ global $ultimatemember;
239
+ if( $ultimatemember ){
240
+ remove_action('init', array($ultimatemember->builtin, 'set_predefined_fields'), 1);
241
+ add_action('init', array($ultimatemember->builtin, 'set_predefined_fields'), 2);
242
+ }
243
+ }
244
+
245
}
246
}
modules/yith-woocommerce-ajax-navigation/includes/functions.yith-wcan.php CHANGED
@@ -46,7 +46,7 @@ function yith_wcan_dropdown_attributes( $selected, $echo = true ) {
46
function yith_wcan_attributes_table( $type, $attribute, $id, $name, $values = array(), $echo = true ) {
47
$return = '';
48
49
- $terms = get_terms( 'pa_' . $attribute, array( 'hide_empty' => '0' ) );
50
51
if ( 'list' == $type ) {
52
$return = '<input type="hidden" name="' . $name . '[colors]" value="" /><input type="hidden" name="' . $name . '[labels]" value="" />';
@@ -252,11 +252,11 @@ if ( ! function_exists( 'yit_get_terms' ) ) {
252
switch ( $case ) {
253
254
case 'all':
255
- $terms = get_terms( $taxonomy, array( 'hide_empty' => true, 'exclude' => $exclude ) );
256
break;
257
258
case 'hierarchical':
259
- $terms = get_terms( $taxonomy, array( 'hide_empty' => true, 'exclude' => $exclude ) );
260
if( ! in_array( $instance['type'], apply_filters( 'yith_wcan_display_type_list', array( 'list' ) ) ) ) {
261
$terms = yit_reorder_terms_by_parent( $terms, $taxonomy );
262
$reordered = true;
@@ -264,16 +264,16 @@ if ( ! function_exists( 'yit_get_terms' ) ) {
264
break;
265
266
case 'parent' :
267
- $terms = get_terms( $taxonomy, array( 'hide_empty' => true, 'parent' => false, 'exclude' => $exclude ) );
268
break;
269
270
default:
271
- $args = array( 'hide_empty' => true, 'exclude' => $exclude, 'include' => $include );
272
if ( 'parent' == $instance['display'] ) {
273
$args['parent'] = false;
274
}
275
276
- $terms = get_terms( $taxonomy, $args );
277
278
if ( 'hierarchical' == $instance['display'] ) {
279
if( ! in_array( $instance['type'], apply_filters( 'yith_wcan_display_type_list', array( 'list' ) ) ) ) {
@@ -336,12 +336,12 @@ if ( ! function_exists( 'yit_term_has_child' ) ) {
336
*/
337
function yit_term_has_child( $term, $taxonomy ) {
338
$count = 0;
339
- $child_terms = get_terms( $taxonomy, array( 'child_of' => $term->term_id ) );
340
341
if( ! is_wp_error( $child_terms ) ){
342
foreach ( $child_terms as $child_term ) {
343
$_products_in_term = get_objects_in_term( $child_term->term_id, $taxonomy );
344
- $count += sizeof( array_intersect( $_products_in_term, YITH_WCAN()->frontend->filtered_product_ids ) );
345
}
346
}
347
@@ -488,16 +488,17 @@ if ( ! function_exists( 'yit_get_woocommerce_layered_nav_link' ) ) {
488
}
489
490
else {
491
- $taxonomy = get_query_var( 'taxonomy' );
492
$brands_taxonomy = yit_get_brands_taxonomy();
493
494
if( ! empty( $brands_taxonomy ) && $brands_taxonomy == $taxonomy ){
495
- $return = add_query_arg( array( $taxonomy => get_query_var( 'term' ) ), get_post_type_archive_link( 'product' ) );
496
}
497
498
else {
499
- $term = get_query_var( 'term' );
500
- $return = get_term_link( yith_wcan_is_product_attribute() && is_numeric( $term ) ? intval( $term ) : $term, $taxonomy );
501
}
502
503
return apply_filters( 'yith_wcan_untrailingslashit', true ) && is_string( $return ) ? untrailingslashit( $return ) : $return;
@@ -599,12 +600,12 @@ if( ! function_exists( 'yit_reorder_hierachical_categories' ) ) {
599
* @author Andrea Grillo <andrea.grillo@yithemes.com>
600
*/
601
function yit_reorder_hierachical_categories( $parent_term_id, $taxonomy = 'product_cat' ) {
602
- $childs = get_terms(
603
- $taxonomy,
604
array(
605
- 'parent' => $parent_term_id,
606
- 'hierarchical' => true,
607
- 'hide_empty' => false
608
)
609
);
610
@@ -700,4 +701,25 @@ if( !function_exists( 'yith_wcan_is_product_attribute' ) ) {
700
function yith_wcan_is_product_attribute( $attribute = '' ) {
701
return preg_match( '/pa_' . $attribute . '.*/', get_query_var( 'taxonomy' ) );
702
}
703
}
46
function yith_wcan_attributes_table( $type, $attribute, $id, $name, $values = array(), $echo = true ) {
47
$return = '';
48
49
+ $terms = get_terms( array( 'taxonomy' => 'pa_' . $attribute, 'hide_empty' => '0' ) );
50
51
if ( 'list' == $type ) {
52
$return = '<input type="hidden" name="' . $name . '[colors]" value="" /><input type="hidden" name="' . $name . '[labels]" value="" />';
252
switch ( $case ) {
253
254
case 'all':
255
+ $terms = yith_wcan_wp_get_terms( array( 'taxonomy' => $taxonomy, 'hide_empty' => true, 'exclude' => $exclude ) );
256
break;
257
258
case 'hierarchical':
259
+ $terms = yith_wcan_wp_get_terms( array( 'taxonomy' => $taxonomy, 'hide_empty' => true, 'exclude' => $exclude ) );
260
if( ! in_array( $instance['type'], apply_filters( 'yith_wcan_display_type_list', array( 'list' ) ) ) ) {
261
$terms = yit_reorder_terms_by_parent( $terms, $taxonomy );
262
$reordered = true;
264
break;
265
266
case 'parent' :
267
+ $terms = yith_wcan_wp_get_terms( array( 'taxonomy' => $taxonomy, 'hide_empty' => true, 'parent' => false, 'exclude' => $exclude ) );
268
break;
269
270
default:
271
+ $args = array( 'taxonomy' => $taxonomy, 'hide_empty' => true, 'exclude' => $exclude, 'include' => $include );
272
if ( 'parent' == $instance['display'] ) {
273
$args['parent'] = false;
274
}
275
276
+ $terms = yith_wcan_wp_get_terms( $args );
277
278
if ( 'hierarchical' == $instance['display'] ) {
279
if( ! in_array( $instance['type'], apply_filters( 'yith_wcan_display_type_list', array( 'list' ) ) ) ) {
336
*/
337
function yit_term_has_child( $term, $taxonomy ) {
338
$count = 0;
339
+ $child_terms = yith_wcan_wp_get_terms( array( 'taxonomy' => $taxonomy, 'child_of' => $term->term_id ) );
340
341
if( ! is_wp_error( $child_terms ) ){
342
foreach ( $child_terms as $child_term ) {
343
$_products_in_term = get_objects_in_term( $child_term->term_id, $taxonomy );
344
+ $count += sizeof( array_intersect( $_products_in_term, YITH_WCAN()->frontend->layered_nav_product_ids ) );
345
}
346
}
347
488
}
489
490
else {
491
+ $queried_object = get_queried_object();
492
+ $taxonomy = $queried_object instanceof WP_Term ? $queried_object->taxonomy : get_query_var( 'taxonomy' );
493
+ $term = $queried_object instanceof WP_Term ? $queried_object : get_query_var( 'term' );
494
$brands_taxonomy = yit_get_brands_taxonomy();
495
496
if( ! empty( $brands_taxonomy ) && $brands_taxonomy == $taxonomy ){
497
+ $return = add_query_arg( array( $taxonomy => $term ), get_post_type_archive_link( 'product' ) );
498
}
499
500
else {
501
+ $return = get_term_link( yith_wcan_is_product_attribute() && is_numeric( $term ) ? intval( $term ) : $term, $taxonomy );
502
}
503
504
return apply_filters( 'yith_wcan_untrailingslashit', true ) && is_string( $return ) ? untrailingslashit( $return ) : $return;
600
* @author Andrea Grillo <andrea.grillo@yithemes.com>
601
*/
602
function yit_reorder_hierachical_categories( $parent_term_id, $taxonomy = 'product_cat' ) {
603
+ $childs = yith_wcan_wp_get_terms(
604
array(
605
+ 'taxonomy' => $taxonomy,
606
+ 'parent' => $parent_term_id,
607
+ 'hierarchical' => true,
608
+ 'hide_empty' => false
609
)
610
);
611
701
function yith_wcan_is_product_attribute( $attribute = '' ) {
702
return preg_match( '/pa_' . $attribute . '.*/', get_query_var( 'taxonomy' ) );
703
}
704
+ }
705
+
706
+ if( ! function_exists( 'yith_wcan_wp_get_terms' ) ) {
707
+ /**
708
+ * get_terms function support for old WordPress Version
709
+ *
710
+ * @param string $args
711
+ *
712
+ * @return bool
713
+ */
714
+ function yith_wcan_wp_get_terms( $args ) {
715
+ global $wp_version;
716
+
717
+ if( version_compare( $wp_version, '4.6', '<' ) ){
718
+ return get_terms( $args['taxonomy'], $args );
719
+ }
720
+
721
+ else {
722
+ return get_terms( $args );
723
+ }
724
+ }
725
}
modules/yith-woocommerce-ajax-navigation/init.php CHANGED
@@ -3,7 +3,7 @@
3
* Plugin Name: YITH WooCommerce Ajax Product Filter
4
* Plugin URI: http://yithemes.com/
5
* Description: YITH WooCommerce Ajax Product Filter offers the perfect way to filter all the products of your shop.
6
- * Version: 3.0.6
7
* Author: YITHEMES
8
* Author URI: http://yithemes.com/
9
* Text Domain: yith-woocommerce-ajax-navigation
@@ -64,7 +64,7 @@ load_plugin_textdomain( 'yith-woocommerce-ajax-navigation', false, dirname( plug
64
! defined( 'YITH_WCAN' ) && define( 'YITH_WCAN', true );
65
! defined( 'YITH_WCAN_URL' ) && define( 'YITH_WCAN_URL', plugin_dir_url( __FILE__ ) );
66
! defined( 'YITH_WCAN_DIR' ) && define( 'YITH_WCAN_DIR', plugin_dir_path( __FILE__ ) );
67
- ! defined( 'YITH_WCAN_VERSION' ) && define( 'YITH_WCAN_VERSION', '3.0.6' );
68
! defined( 'YITH_WCAN_FREE_INIT') && define( 'YITH_WCAN_FREE_INIT', plugin_basename( __FILE__ ) );
69
! defined( 'YITH_WCAN_FILE' ) && define( 'YITH_WCAN_FILE', __FILE__ );
70
3
* Plugin Name: YITH WooCommerce Ajax Product Filter
4
* Plugin URI: http://yithemes.com/
5
* Description: YITH WooCommerce Ajax Product Filter offers the perfect way to filter all the products of your shop.
6
+ * Version: 3.0.9
7
* Author: YITHEMES
8
* Author URI: http://yithemes.com/
9
* Text Domain: yith-woocommerce-ajax-navigation
64
! defined( 'YITH_WCAN' ) && define( 'YITH_WCAN', true );
65
! defined( 'YITH_WCAN_URL' ) && define( 'YITH_WCAN_URL', plugin_dir_url( __FILE__ ) );
66
! defined( 'YITH_WCAN_DIR' ) && define( 'YITH_WCAN_DIR', plugin_dir_path( __FILE__ ) );
67
+ ! defined( 'YITH_WCAN_VERSION' ) && define( 'YITH_WCAN_VERSION', '3.0.9' );
68
! defined( 'YITH_WCAN_FREE_INIT') && define( 'YITH_WCAN_FREE_INIT', plugin_basename( __FILE__ ) );
69
! defined( 'YITH_WCAN_FILE' ) && define( 'YITH_WCAN_FILE', __FILE__ );
70
modules/yith-woocommerce-ajax-navigation/widgets/class.yith-wcan-navigation-widget.php CHANGED
@@ -110,9 +110,9 @@ if ( ! class_exists( 'YITH_WCAN_Navigation_Widget' ) ) {
110
}
111
112
if ( in_array( $display_type, apply_filters( 'yith_wcan_display_type_list', array( 'list' ) ) ) ) {
113
- $ancestors = get_terms(
114
- $taxonomy,
115
array(
116
'parent' => 0,
117
'hierarchical' => true,
118
'hide_empty' => false,
@@ -824,7 +824,7 @@ if ( ! class_exists( 'YITH_WCAN_Navigation_Widget' ) ) {
824
$attribute = $_POST['attribute'];
825
$return = array( 'message' => '', 'content' => $_POST );
826
827
- $terms = get_terms( 'pa_' . $attribute, array( 'hide_empty' => '0' ) );
828
829
$settings = $this->get_settings();
830
$widget_settings = $settings[ $this->number ];
@@ -859,7 +859,8 @@ if ( ! class_exists( 'YITH_WCAN_Navigation_Widget' ) ) {
859
860
public function get_list_html( $terms, $taxonomy, $query_type, $display_type, $instance, $terms_type_list, $current_term, $args, $is_child_class, $is_parent_class, $is_chosen_class, $level = 0, $filter_term_field = 'slug' ){
861
$_chosen_attributes = YITH_WCAN()->get_layered_nav_chosen_attributes();
862
- $in_array_function = apply_filters( 'yith_wcan_in_array_ignor_case', false ) ? 'yit_in_array_ignore_case' : 'in_array';
863
foreach ( $terms as $parent_id => $term_ids ) {
864
$term = get_term_by( 'id', $parent_id, $taxonomy );
865
@@ -936,7 +937,7 @@ if ( ! class_exists( 'YITH_WCAN_Navigation_Widget' ) ) {
936
if ($name !== $taxonomy) {
937
938
// Exclude query arg for current term archive
939
- while ($in_array_function($term->slug, $data['terms'])) {
940
$key = array_search($current_term, $data);
941
unset($data['terms'][$key]);
942
}
110
}
111
112
if ( in_array( $display_type, apply_filters( 'yith_wcan_display_type_list', array( 'list' ) ) ) ) {
113
+ $ancestors = yith_wcan_wp_get_terms(
114
array(
115
+ 'taxonomy' => $taxonomy,
116
'parent' => 0,
117
'hierarchical' => true,
118
'hide_empty' => false,
824
$attribute = $_POST['attribute'];
825
$return = array( 'message' => '', 'content' => $_POST );
826
827
+ $terms = yith_wcan_wp_get_terms( array( 'taxonomy' => 'pa_' . $attribute, 'hide_empty' => '0' ) );
828
829
$settings = $this->get_settings();
830
$widget_settings = $settings[ $this->number ];
859
860
public function get_list_html( $terms, $taxonomy, $query_type, $display_type, $instance, $terms_type_list, $current_term, $args, $is_child_class, $is_parent_class, $is_chosen_class, $level = 0, $filter_term_field = 'slug' ){
861
$_chosen_attributes = YITH_WCAN()->get_layered_nav_chosen_attributes();
862
+ $in_array_function = apply_filters( 'yith_wcan_in_array_ignor_case', false ) ? 'yit_in_array_ignore_case' : 'in_array';
863
+ $terms = apply_filters( 'yith_wcan_get_list_html_terms', $terms, $taxonomy, $instance );
864
foreach ( $terms as $parent_id => $term_ids ) {
865
$term = get_term_by( 'id', $parent_id, $taxonomy );
866
937
if ($name !== $taxonomy) {
938
939
// Exclude query arg for current term archive
940
+ if ($in_array_function($term->slug, $data['terms'])) {
941
$key = array_search($current_term, $data);
942
unset($data['terms'][$key]);
943
}
modules/yith-woocommerce-authorizenet-payment-gateway/includes/class.yith-wcauthnet-credit-card-gateway.php CHANGED
@@ -103,6 +103,7 @@ if( ! class_exists( 'YITH_WCAUTHNET_Credit_Card_Gateway' ) ){
103
$this->sandbox = $this->get_option( 'sandbox' );
104
$this->transaction_type = $this->get_option( 'transaction_type' );
105
$this->debug = $this->get_option( 'debug' );
106
107
// Logs
108
if ( 'yes' == $this->debug ) {
@@ -125,6 +126,22 @@ if( ! class_exists( 'YITH_WCAUTHNET_Credit_Card_Gateway' ) ){
125
add_action( 'admin_notices', array( $this, 'admin_notices' ) );
126
}
127
128
/**
129
* Initialize options field for payment gateway
130
*
103
$this->sandbox = $this->get_option( 'sandbox' );
104
$this->transaction_type = $this->get_option( 'transaction_type' );
105
$this->debug = $this->get_option( 'debug' );
106
+ $this->has_fields = false;
107
108
// Logs
109
if ( 'yes' == $this->debug ) {
126
add_action( 'admin_notices', array( $this, 'admin_notices' ) );
127
}
128
129
+ /**
130
+ * Print payment method fields (if any)
131
+ *
132
+ * @return void
133
+ * @since 1.0.10
134
+ */
135
+ public function payment_fields() {
136
+ if ( $description = $this->get_description() ) {
137
+ echo wpautop( wptexturize( $description ) );
138
+ }
139
+
140
+ if ( $this->has_fields() ) {
141
+ parent::payment_fields();
142
+ }
143
+ }
144
+
145
/**
146
* Initialize options field for payment gateway
147
*
modules/yith-woocommerce-authorizenet-payment-gateway/init.php CHANGED
@@ -3,7 +3,7 @@
3
* Plugin Name: YITH WooCommerce Authorize.net Payment Gateway
4
* Plugin URI: http://yithemes.com/themes/plugins/yith-woocommerce-authorize-net/
5
* Description: YITH WooCommerce Authorize.net allows you to add Authorize.net payment gateway to WooCommerce
6
- * Version: 1.0.9
7
* Author: Yithemes
8
* Author URI: http://yithemes.com/
9
* Text Domain: yith-wcauthnet
@@ -45,7 +45,7 @@ if ( ! defined( 'YITH_WCAUTHNET' ) ) {
45
}
46
47
if( ! defined( 'YITH_WCAUTHNET_VERSION' ) ){
48
- define( 'YITH_WCAUTHNET_VERSION', '1.0.9' );
49
}
50
51
if ( ! defined( 'YITH_WCAUTHNET_URL' ) ) {
3
* Plugin Name: YITH WooCommerce Authorize.net Payment Gateway
4
* Plugin URI: http://yithemes.com/themes/plugins/yith-woocommerce-authorize-net/
5
* Description: YITH WooCommerce Authorize.net allows you to add Authorize.net payment gateway to WooCommerce
6
+ * Version: 1.0.10
7
* Author: Yithemes
8
* Author URI: http://yithemes.com/
9
* Text Domain: yith-wcauthnet
45
}
46
47
if( ! defined( 'YITH_WCAUTHNET_VERSION' ) ){
48
+ define( 'YITH_WCAUTHNET_VERSION', '1.0.10' );
49
}
50
51
if ( ! defined( 'YITH_WCAUTHNET_URL' ) ) {
modules/yith-woocommerce-colors-labels-variations/class.yith-wccl-admin.php CHANGED
@@ -28,27 +28,6 @@ if( !class_exists( 'YITH_WCCL_Admin' ) ) {
28
public $videotutorial_360_url = 'http://player.vimeo.com/external/81998290.sd.mp4?s=fefd139405de59b562007645d4b03e08';
29
public $videotutorial_1080_url = 'http://player.vimeo.com/external/81998290.hd.mp4?s=2cd578463c2771ecc30c036217b86691';
30
31
- /**
32
- * Docs url
33
- *
34
- * @var string Official documentation url
35
- * @since 1.2.4
36
- */
37
- public $doc_url = 'http://yithemes.com/docs-plugins/yith-woocommerce-color-label-variations/';
38
-
39
- /**
40
- * Premium landing url
41
- *
42
- * @var string Premium landing url
43
- * @since 1.2.4
44
- */
45
- public $premium_landing_url = 'http://yithemes.com/themes/plugins/yith-woocommerce-color-and-label-variations';
46
-
47
- /**
48
- * @var string Quick View panel page
49
- */
50
- protected $_panel_page = 'yith_ywcl_panel';
51
-
52
/**
53
* Constructor
54
*
@@ -80,11 +59,6 @@ if( !class_exists( 'YITH_WCCL_Admin' ) ) {
80
//Add videotutorials link
81
add_filter( 'plugin_action_links_' . plugin_basename( dirname(__FILE__) . '/init.php' ), array( $this, 'action_links' ) );
82
83
- //Add YITH Plugin Panel
84
- add_action( 'admin_menu', array( $this, 'register_panel' ),5 );
85
- //Add premium tab
86
- add_action( 'ywcl_premium_tab', array( $this, 'print_premium_tab' ) );
87
-
88
// YITH WCCL Loaded
89
do_action( 'yith_wccl_loaded' );
90
@@ -342,67 +316,5 @@ if( !class_exists( 'YITH_WCCL_Admin' ) ) {
342
<?php
343
}
344
}
345
-
346
-
347
- /**
348
- * Register YITH Pnale
349
- *
350
- * @since 1.2.4
351
- * @author Alessio Torrisi <alessio.torrisi@yithemes.com>
352
- * @return void
353
- */
354
- public function register_panel() {
355
-
356
- if ( !empty( $this->_panel ) ) {
357
- return;
358
- }
359
-
360
- $admin_tabs = array(
361
- 'premium' => __( 'Premium Version', 'ywcl' ),
362
- );
363
-
364
- $args = array(
365
- 'create_menu_page' => true,
366
- 'parent_slug' => '',
367
- 'page_title' => _x( 'Color and Label Variations', 'plugin name in admin page title', 'ywcl' ),
368
- 'menu_title' => _x( 'Color and Label Variations', 'plugin name in admin WP menu', 'ywcl' ),
369
- 'capability' => 'manage_options',
370
- 'parent' => '',
371
- 'parent_page' => 'yit_plugin_panel',
372
- 'page' => $this->_panel_page,
373
- 'admin-tabs' => $admin_tabs,
374
- 'options-path' => YITH_WCCL_DIR . '/plugin-options'
375
- );
376
-
377
- /* === Fixed: not updated theme === */
378
- if ( !class_exists( 'YIT_Plugin_Panel_WooCommerce' ) ) {
379
- require_once( 'plugin-fw/lib/yit-plugin-panel-wc.php' );
380
- }
381
-
382
- $this->_panel = new YIT_Plugin_Panel_WooCommerce( $args );
383
- }
384
-
385
- /**
386
- * Prints premium tab
387
- *
388
- * @since 1.2.4
389
- * @author Alessio Torrisi <alessio.torrisi@yithemes.com>
390
- * @return void
391
- */
392
- public function print_premium_tab() {
393
- include( YITH_WCCL_DIR . '/templates/admin/premium.php' );
394
- }
395
-
396
- /**
397
- * Get the premium landing uri
398
- *
399
- * @since 1.2.4
400
- * @author Alessio Torrisi <alessio.torrisi@yithemes.com>
401
- * @return string The premium landing link
402
- */
403
- public function get_premium_landing_uri(){
404
- return defined( 'YITH_REFER_ID' ) ? $this->premium_landing_url . '?refer_id=' . YITH_REFER_ID : $this->premium_landing_url .'?refer_id=1030585';
405
- }
406
-
407
}
408
}
28
public $videotutorial_360_url = 'http://player.vimeo.com/external/81998290.sd.mp4?s=fefd139405de59b562007645d4b03e08';
29
public $videotutorial_1080_url = 'http://player.vimeo.com/external/81998290.hd.mp4?s=2cd578463c2771ecc30c036217b86691';
30
31
/**
32
* Constructor
33
*
59
//Add videotutorials link
60
add_filter( 'plugin_action_links_' . plugin_basename( dirname(__FILE__) . '/init.php' ), array( $this, 'action_links' ) );
61
62
// YITH WCCL Loaded
63
do_action( 'yith_wccl_loaded' );
64
316
<?php
317
}
318
}
319
}
320
}
modules/yith-woocommerce-product-add-ons/assets/js/yith-wapo-frontend.js CHANGED
@@ -232,7 +232,7 @@ jQuery(document).ready( function($) {
232
$(this).on( 'yith-wapo-product-option-conditional', function( e , data ) {
233
'use strict';
234
235
- var current_group_container = $(data.closest('.ywapo_group_container'));
236
237
doConditionaLoop( $(this) , data , current_group_container );
238
232
$(this).on( 'yith-wapo-product-option-conditional', function( e , data ) {
233
'use strict';
234
235
+ var current_group_container = $(data).closest('.ywapo_group_container');
236
237
doConditionaLoop( $(this) , data , current_group_container );
238
modules/yith-woocommerce-product-add-ons/assets/js/yith-wapo-frontend.min.js CHANGED
@@ -1 +1 @@
1
- jQuery(document).ready(function(t){"use strict";function i(){"use strcit";t("body").find("form:not(.in_loop).cart").each(function(){t(this).init_yith_wapo_totals(),t(this).find(".variations select").change()}),t("body").find(".ywapo_option_description").each(function(){var i=t(this).data("tooltip");i&&a(t(this),i)}),t(".ywapo_input_container_color .wp-color-picker").wpColorPicker({change:function(i,a){var e=t(this).closest(".ywapo_input_container_color"),n=e.find("input.ywapo_input_color");n.val(a.color.toString()),n.change()},clear:function(){var i=t(this).closest(".ywapo_input_container_color"),a=i.find("input.ywapo_input_color");a.val(""),a.change()}}),t(".ywapo_datepicker").each(function(){t(this).datepicker()})}function a(i,a){"use strcit";var e=t('<span class="yith_wccl_tooltip"></span>'),n=yith_wapo_general.tooltip_pos+" "+yith_wapo_general.tooltip_ani;e.addClass(n),i.append(e.html("<span>"+a+"</span>"))}return"undefined"==typeof yith_wapo_general?!1:(t.fn.init_yith_wapo_totals=function(){function i(i){"use strcit";var a=t(".yith_wapo_groups_container");if("undefined"!=typeof a){var o=a.find("input.ywapo_input.ywapo_price_percentage, select.ywapo_input option.ywapo_price_percentage, textarea.ywapo_input.ywapo_price_percentage"),r=0;o.each(function(){var p=t(this);if("undefined"!=typeof p.data("pricetype")&&"fixed"!=p.data("pricetype")){var c=p.closest(".ywapo_input_container");t.ajax({url:yith_wapo_general.wc_ajax_url.toString().replace("%%endpoint%%","yith_wapo_update_variation_price"),type:"POST",data:{variation_id:i.variation_id,variation_price:i.display_price,type_id:p.data("typeid"),option_index:p.data("index")},beforeSend:function(){0==r&&e(a)},success:function(i){if(!i.error&&""!=i){p.attr("data-price",i);var e=_(parseFloat(i));if(c.find("span.amount").html(e),""!=p.text()){var s=p.text().split("+");if(s.length>0){s=s[0]+" + "+e,p.addClass("ywapo_option_price_chaged");var d=p.closest(".ywapo_group_container"),u=d.find("select"),l=u.attr("sb");if("undefined"!=typeof l){var h=p.data("index"),f=t(t("#sbOptions_"+l).find("li").get(parseInt(h)+1)).find("a");f.html(s)}}p.html(s)}r++,r==o.length&&n(a)}}})}})}}function a(i){var a=!0;return i.find(".ywapo_group_container").each(function(){var i=t(this);if("undefined"!=typeof i&&!i.hasClass("ywapo_conditional_hidden")){var e=i.data("type"),n="1"==i.data("requested"),o=!0;switch(e){case"text":case"textarea":case"number":case"file":case"date":case"range":i.find("input.ywapo_input, textarea.ywapo_input").each(function(){return""==t(this).val()&&"required"==t(this).attr("required")?(n=!0,void(o=!1)):""==t(this).val()?void(o=!1):void 0});break;case"color":i.find("input.ywapo_input_color").each(function(){return""==t(this).val()?void(o=!1):void 0});break;case"select":o=""!=i.find("select.ywapo_input").val();break;case"labels":o=i.find(".ywapo_input_container_labels.ywapo_selected").length>0;break;case"checkbox":if(n){var r=i.find(".ywapo_input").length,p=i.find(".ywapo_input:checked").length;o=r>0&&r==p}else i.find(".ywapo_input").each(function(){return t(this).is(":checked")||"required"!=t(this).attr("required")?void 0:(n=!0,void(o=!1))});break;case"radio":o=!1,i.find("input.ywapo_input").each(function(){return t(this).is(":checked")?void(o=!0):void 0})}if(n&&!o)return a=!1,void i.addClass("ywapo_miss_required");i.removeClass("ywapo_miss_required")}}),a||t("html, body").animate({scrollTop:t("#yith_wapo_groups_container").offset().top},2e3),a}function e(t){"use strcit";t.block({message:"",overlayCSS:{backgroundColor:"#fff",opacity:.6,cursor:"wait"}})}function n(t){"use strcit";t.unblock()}function o(i,a){var e=a.data("type"),n=!1;if("select"==e||"radio"==e)n=""!=i.val()?!0:!1;else switch(e){case"checkbox":a.find('input[type="checkbox"].ywapo_input').each(function(){return t(this).is(":checked")?void(n=!0):void 0});break;case"labels":var o=0;a.find('input[type="hidden"].ywapo_input').each(function(){return""!=t(this).val()?(o++,!0):void 0}),n=o>0;break;case"text":case"textarea":case"number":case"file":case"color":case"date":case"range":a.find("input.ywapo_input").each(function(){return""!=t(this).val()?void(n=!0):void 0});break;case"textarea":a.find("textarea.ywapo_input").each(function(){return""!=t(this).val()?void(n=!0):void 0})}return n&&a.removeClass("ywapo_miss_required"),n}function r(i,a,e){"use strcit";var n=e.data("id");if("undefined"!=typeof n){var r=o(t(a),e);i.find(".ywapo_group_container").each(function(){var i=t(this).closest(".ywapo_group_container");if("undefined"!=typeof i){var a=i.data("id");if(n!=a){var e=i.data("condition");if(""!=e){e=e.toString().split(",");var o=s(e);if(o){if(!i.hasClass("ywapo_conditional_hidden"))return i.addClass("ywapo_conditional_hidden"),c(i),!0}else{var d=t.inArray(n.toString(),e);0==d&&(r?(i.removeClass("ywapo_conditional_hidden"),p(i)):(i.addClass("ywapo_conditional_hidden"),c(i)))}}}}})}}function p(i){"use strcit";i.find("input, select, textarea").each(function(){t(this).removeAttr("disabled"),t(this).change()})}function c(i){"use strcit";i.find("input, select, textarea").each(function(){t(this).attr("disabled","disabled")})}function s(i){var a=!1;return t(".yith_wapo_groups_container").find(".ywapo_group_container").each(function(){var e=t(this).data("id");return 0==t.inArray(e.toString(),i)&&t(this).hasClass("ywapo_conditional_hidden")?void(a=!0):void 0}),a}function d(i){var a=0;return i.find('.ywapo_input:checked, select.ywapo_input option:selected, input[type="text"].ywapo_input, input[type="number"].ywapo_input, input[type="file"].ywapo_input, input[type="color"].ywapo_input, input[type="date"].ywapo_input,input[type="hidden"].ywapo_input ,textarea.ywapo_input').each(function(){var i=t(this).closest(".ywapo_group_container");if("undefined"!=typeof i&&!i.hasClass("ywapo_conditional_hidden")){var e=i.data("type"),n=!1;switch(e){case"text":case"textarea":case"number":case"file":case"color":case"date":case"labels":""!=t(this).val().trim()&&(n=!0);break;default:n=!0}if(n){var o=t(this).data("price");"undefined"!=typeof o&&o>=0&&(a+=parseFloat(o))}}}),a}function _(t){var i=accounting.formatMoney(t,{symbol:yith_wapo_general.currency_format_symbol,decimal:yith_wapo_general.currency_format_decimal_sep,thousand:yith_wapo_general.currency_format_thousand_sep,precision:yith_wapo_general.currency_format_num_decimals,format:yith_wapo_general.currency_format});return i}t(this).on("change",".yith_wapo_groups_container input, .yith_wapo_groups_container select, .yith_wapo_groups_container textarea, input.qty",function(i){var a=t(this);t(this).trigger("yith-wapo-product-option-conditional",a),t(this).trigger("yith-wapo-product-option-update")}),t(this).on("found_variation",function(a,e){var n=(t(this),t(".yith_wapo_group_total")),o=0;if("undefined"!=typeof e.display_price)o=e.display_price;else if(t(e.price_html).find(".amount:last").size()){t(".cart");o=t(e.price_html).find(".amount:last").text(),o=_(o)}n.data("product-price",o),i(e),t(this).trigger("yith-wapo-product-option-update")}),t(this).on("yith-wapo-product-option-update",function(){var i=t(this),a=t(".yith_wapo_group_total"),e=d(i);if(e>0){if(i.find("input.qty").size())var n=parseFloat(i.find("input.qty").val());else var n=1;e*=n;var o=t(".yith-wcpb-product-bundled-items"),r=i.find(".single_variation");"undefined"!=typeof r&&0==o.length&&r.after(a);var p=_(e),c=0,a=t(".yith_wapo_group_total"),s=parseFloat(a.data("product-price")),u=a.find(".yith_wapo_group_option_total span.price"),l=a.find(".yith_wapo_group_final_total span.price");u.html(p),c=s*n+e;var h=_(c);l.html(h),a.fadeIn()}else a.fadeOut()}),t(this).on("click",".ywapo_input_container.ywapo_input_container_labels",function(i){var a=t(this).find('input[type="hidden"]');if(""!=a.val())a.val(""),t(this).removeClass("ywapo_selected");else{var e=t(".ywapo_input_container.ywapo_input_container_labels");e.removeClass("ywapo_selected"),e.find('input[type="hidden"]').val(""),t(this).addClass("ywapo_selected"),a.val(a.data("index"))}t(this).trigger("yith-wapo-product-option-conditional",a),t(this).trigger("yith-wapo-product-option-update")}),t(this).on("yith-wapo-product-option-conditional",function(i,a){var e=t(a.closest(".ywapo_group_container"));r(t(this),a,e)}),t(this).on("click",".single_add_to_cart_button",function(i){var e=t(this).closest("form.cart");return yith_wapo_general.do_submit=a(e),yith_wapo_general.do_submit}),t(document).on("yith_ywraq_action_before",function(){return u=t("form.cart"),yith_wapo_general.do_submit=a(u),yith_wapo_general.do_submit});var u=t(this);u.find(".yith_wapo_groups_container input, .yith_wapo_groups_container select, .yith_wapo_groups_container textarea").each(function(){u.trigger("yith-wapo-product-option-conditional",t(this))}),u.trigger("yith-wapo-product-option-update")},i(),void t(document).on("qv_loader_stop yit_quick_view_loaded",function(){i()}))});
1
+ jQuery(document).ready(function(a){"use strict";function b(){"use strcit";a("body").find("form:not(.in_loop).cart").each(function(){a(this).init_yith_wapo_totals(),a(this).find(".variations select").change()}),a("body").find(".ywapo_option_description").each(function(){var b=a(this).data("tooltip");b&&c(a(this),b)}),a(".ywapo_input_container_color .wp-color-picker").wpColorPicker({change:function(b,c){var d=a(this).closest(".ywapo_input_container_color"),e=d.find("input.ywapo_input_color");e.val(c.color.toString()),e.change()},clear:function(){var b=a(this).closest(".ywapo_input_container_color"),c=b.find("input.ywapo_input_color");c.val(""),c.change()}}),a(".ywapo_datepicker").each(function(){a(this).datepicker()})}function c(b,c){"use strcit";var d=a('<span class="yith_wccl_tooltip"></span>'),e=yith_wapo_general.tooltip_pos+" "+yith_wapo_general.tooltip_ani;d.addClass(e),b.append(d.html("<span>"+c+"</span>"))}return"undefined"!=typeof yith_wapo_general&&(a.fn.init_yith_wapo_totals=function(){function b(b){"use strcit";var c=a(".yith_wapo_groups_container");if("undefined"!=typeof c){var f=c.find("input.ywapo_input.ywapo_price_percentage, select.ywapo_input option.ywapo_price_percentage, textarea.ywapo_input.ywapo_price_percentage"),g=0;f.each(function(){var h=a(this);if("undefined"!=typeof h.data("pricetype")&&"fixed"!=h.data("pricetype")){var i=h.closest(".ywapo_input_container");a.ajax({url:yith_wapo_general.wc_ajax_url.toString().replace("%%endpoint%%","yith_wapo_update_variation_price"),type:"POST",data:{variation_id:b.variation_id,variation_price:b.display_price,type_id:h.data("typeid"),option_index:h.data("index")},beforeSend:function(){0==g&&d(c)},success:function(b){if(!b.error&&""!=b){h.attr("data-price",b);var d=l(parseFloat(b));if(i.find("span.amount").html(d),""!=h.text()){var j=h.text().split("+");if(j.length>0){j=j[0]+" + "+d,h.addClass("ywapo_option_price_chaged");var k=h.closest(".ywapo_group_container"),m=k.find("select"),n=m.attr("sb");if("undefined"!=typeof n){var o=h.data("index"),p=a(a("#sbOptions_"+n).find("li").get(parseInt(o)+1)).find("a");p.html(j)}}h.html(j)}g++,g==f.length&&e(c)}}})}})}}function c(b){var c=!0;return b.find(".ywapo_group_container").each(function(){var b=a(this);if("undefined"!=typeof b&&!b.hasClass("ywapo_conditional_hidden")){var d=b.data("type"),e="1"==b.data("requested"),f=!0;switch(d){case"text":case"textarea":case"number":case"file":case"date":case"range":b.find("input.ywapo_input, textarea.ywapo_input").each(function(){return""==a(this).val()&&"required"==a(this).attr("required")?(e=!0,void(f=!1)):""==a(this).val()?void(f=!1):void 0});break;case"color":b.find("input.ywapo_input_color").each(function(){if(""==a(this).val())return void(f=!1)});break;case"select":f=""!=b.find("select.ywapo_input").val();break;case"labels":f=b.find(".ywapo_input_container_labels.ywapo_selected").length>0;break;case"checkbox":if(e){var g=b.find(".ywapo_input").length,h=b.find(".ywapo_input:checked").length;f=g>0&&g==h}else b.find(".ywapo_input").each(function(){if(!a(this).is(":checked")&&"required"==a(this).attr("required"))return e=!0,void(f=!1)});break;case"radio":f=!1,b.find("input.ywapo_input").each(function(){if(a(this).is(":checked"))return void(f=!0)})}if(e&&!f)return c=!1,void b.addClass("ywapo_miss_required");b.removeClass("ywapo_miss_required")}}),c||a("html, body").animate({scrollTop:a("#yith_wapo_groups_container").offset().top},2e3),c}function d(a){"use strcit";a.block({message:"",overlayCSS:{backgroundColor:"#fff",opacity:.6,cursor:"wait"}})}function e(a){"use strcit";a.unblock()}function f(b,c){var d=c.data("type"),e=!1;if("select"==d||"radio"==d)e=""!=b.val();else switch(d){case"checkbox":c.find('input[type="checkbox"].ywapo_input').each(function(){if(a(this).is(":checked"))return void(e=!0)});break;case"labels":var f=0;c.find('input[type="hidden"].ywapo_input').each(function(){if(""!=a(this).val())return f++,!0}),e=f>0;break;case"text":case"textarea":case"number":case"file":case"color":case"date":case"range":c.find("input.ywapo_input").each(function(){if(""!=a(this).val())return void(e=!0)});break;case"textarea":c.find("textarea.ywapo_input").each(function(){if(""!=a(this).val())return void(e=!0)})}return e&&c.removeClass("ywapo_miss_required"),e}function g(b,c,d){"use strcit";var e=d.data("id");if("undefined"!=typeof e){var g=f(a(c),d);b.find(".ywapo_group_container").each(function(){var b=a(this).closest(".ywapo_group_container");if("undefined"!=typeof b){var c=b.data("id");if(e!=c){var d=b.data("condition");if(""!=d){d=d.toString().split(",");var f=j(d);if(f){if(!b.hasClass("ywapo_conditional_hidden"))return b.addClass("ywapo_conditional_hidden"),i(b),!0}else{var k=a.inArray(e.toString(),d);0==k&&(g?(b.removeClass("ywapo_conditional_hidden"),h(b)):(b.addClass("ywapo_conditional_hidden"),i(b)))}}}}})}}function h(b){"use strcit";b.find("input, select, textarea").each(function(){a(this).removeAttr("disabled"),a(this).change()})}function i(b){"use strcit";b.find("input, select, textarea").each(function(){a(this).attr("disabled","disabled")})}function j(b){var c=!1;return a(".yith_wapo_groups_container").find(".ywapo_group_container").each(function(){var d=a(this).data("id");if(0==a.inArray(d.toString(),b)&&a(this).hasClass("ywapo_conditional_hidden"))return void(c=!0)}),c}function k(b){var c=0;return b.find('.ywapo_input:checked, select.ywapo_input option:selected, input[type="text"].ywapo_input, input[type="number"].ywapo_input, input[type="file"].ywapo_input, input[type="color"].ywapo_input, input[type="date"].ywapo_input,input[type="hidden"].ywapo_input ,textarea.ywapo_input').each(function(){var b=a(this).closest(".ywapo_group_container");if("undefined"!=typeof b&&!b.hasClass("ywapo_conditional_hidden")){var d=b.data("type"),e=!1;switch(d){case"text":case"textarea":case"number":case"file":case"color":case"date":case"labels":""!=a(this).val().trim()&&(e=!0);break;default:e=!0}if(e){var f=a(this).data("price");"undefined"!=typeof f&&f>=0&&(c+=parseFloat(f))}}}),c}function l(a){var b=accounting.formatMoney(a,{symbol:yith_wapo_general.currency_format_symbol,decimal:yith_wapo_general.currency_format_decimal_sep,thousand:yith_wapo_general.currency_format_thousand_sep,precision:yith_wapo_general.currency_format_num_decimals,format:yith_wapo_general.currency_format});return b}a(this).on("change",".yith_wapo_groups_container input, .yith_wapo_groups_container select, .yith_wapo_groups_container textarea, input.qty",function(b){var c=a(this);a(this).trigger("yith-wapo-product-option-conditional",c),a(this).trigger("yith-wapo-product-option-update")}),a(this).on("found_variation",function(c,d){var f=(a(this),a(".yith_wapo_group_total")),g=0;if("undefined"!=typeof d.display_price)g=d.display_price;else if(a(d.price_html).find(".amount:last").size()){a(".cart");g=a(d.price_html).find(".amount:last").text(),g=l(g)}f.data("product-price",g),b(d),a(this).trigger("yith-wapo-product-option-update")}),a(this).on("yith-wapo-product-option-update",function(){var b=a(this),c=a(".yith_wapo_group_total"),d=k(b);if(d>0){if(b.find("input.qty").size())var e=parseFloat(b.find("input.qty").val());else var e=1;d*=e;var f=a(".yith-wcpb-product-bundled-items"),g=b.find(".single_variation");"undefined"!=typeof g&&0==f.length&&g.after(c);var h=l(d),i=0,c=a(".yith_wapo_group_total"),j=parseFloat(c.data("product-price")),m=c.find(".yith_wapo_group_option_total span.price"),n=c.find(".yith_wapo_group_final_total span.price");m.html(h),i=j*e+d;var o=l(i);n.html(o),c.fadeIn()}else c.fadeOut()}),a(this).on("click",".ywapo_input_container.ywapo_input_container_labels",function(b){var c=a(this).find('input[type="hidden"]');if(""!=c.val())c.val(""),a(this).removeClass("ywapo_selected");else{var d=a(".ywapo_input_container.ywapo_input_container_labels");d.removeClass("ywapo_selected"),d.find('input[type="hidden"]').val(""),a(this).addClass("ywapo_selected"),c.val(c.data("index"))}a(this).trigger("yith-wapo-product-option-conditional",c),a(this).trigger("yith-wapo-product-option-update")}),a(this).on("yith-wapo-product-option-conditional",function(b,c){var d=a(c).closest(".ywapo_group_container");g(a(this),c,d)}),a(this).on("click",".single_add_to_cart_button",function(b){var d=a(this).closest("form.cart");return yith_wapo_general.do_submit=c(d),yith_wapo_general.do_submit}),a(document).on("yith_ywraq_action_before",function(){return m=a("form.cart"),yith_wapo_general.do_submit=c(m),yith_wapo_general.do_submit});var m=a(this);m.find(".yith_wapo_groups_container input, .yith_wapo_groups_container select, .yith_wapo_groups_container textarea").each(function(){m.trigger("yith-wapo-product-option-conditional",a(this))}),m.trigger("yith-wapo-product-option-update")},b(),void a(document).on("qv_loader_stop yit_quick_view_loaded",function(){b()}))});
modules/yith-woocommerce-product-add-ons/includes/class.yith-wapo-admin.php CHANGED
@@ -411,8 +411,8 @@ if ( ! class_exists( 'YITH_WAPO_Admin' ) ) {
411
<?php
412
}
413
414
- add_action( 'admin_footer', 'my_action_javascript' );
415
- function my_action_javascript() {
416
global $post; ?>
417
<script type="text/javascript" >
418
jQuery(document).ready(function($) {
411
<?php
412
}
413
414
+ add_action( 'admin_footer', 'yith_wapo_my_action_javascript' );
415
+ function yith_wapo_my_action_javascript() {
416
global $post; ?>
417
<script type="text/javascript" >
418
jQuery(document).ready(function($) {
modules/yith-woocommerce-product-add-ons/init.php CHANGED
@@ -2,7 +2,7 @@
2
/**
3
* Plugin Name: YITH WooCommerce Product Add-Ons
4
* Description: YITH WooCommerce Product Add-Ons
5
- * Version: 1.0.1
6
* Author: YITHEMES
7
* Author URI: http://yithemes.com/
8
* Text Domain: yith-woocommerce-product-add-ons
@@ -13,7 +13,7 @@
13
*
14
* @author YITHEMES
15
* @package YITH WooCommerce Product Add-Ons
16
- * @version 1.0.1
17
*/
18
/* Copyright 2016 Your Inspiration Themes (email : plugins@yithemes.com)
19
@@ -82,7 +82,7 @@ if ( defined( 'YITH_WAPO_PREMIUM' ) ) {
82
! defined( 'YITH_WAPO_TEMPLATE_ADMIN_PATH' ) && define( 'YITH_WAPO_TEMPLATE_ADMIN_PATH', YITH_WAPO_TEMPLATE_PATH . '/yith_wapo/admin/' );
83
! defined( 'YITH_WAPO_TEMPLATE_FRONTEND_PATH' ) && define( 'YITH_WAPO_TEMPLATE_FRONTEND_PATH', YITH_WAPO_TEMPLATE_PATH . '/yith_wapo/frontend/' );
84
! defined( 'YITH_WAPO_ASSETS_URL' ) && define( 'YITH_WAPO_ASSETS_URL', YITH_WAPO_URL . 'assets' );
85
- ! defined( 'YITH_WAPO_VERSION' ) && define( 'YITH_WAPO_VERSION', '1.0.1' );
86
! defined( 'YITH_WAPO_DB_VERSION' ) && define( 'YITH_WAPO_DB_VERSION', '1.0.1' );
87
! defined( 'YITH_WAPO_FILE' ) && define( 'YITH_WAPO_FILE', __FILE__ );
88
! defined( 'YITH_WAPO_SLUG' ) && define( 'YITH_WAPO_SLUG', 'yith-woocommerce-advanced-product-options' );
2
/**
3
* Plugin Name: YITH WooCommerce Product Add-Ons
4
* Description: YITH WooCommerce Product Add-Ons
5
+ * Version: 1.0.3
6
* Author: YITHEMES
7
* Author URI: http://yithemes.com/
8
* Text Domain: yith-woocommerce-product-add-ons
13
*
14
* @author YITHEMES
15
* @package YITH WooCommerce Product Add-Ons
16
+ * @version 1.0.3
17
*/
18
/* Copyright 2016 Your Inspiration Themes (email : plugins@yithemes.com)
19
82
! defined( 'YITH_WAPO_TEMPLATE_ADMIN_PATH' ) && define( 'YITH_WAPO_TEMPLATE_ADMIN_PATH', YITH_WAPO_TEMPLATE_PATH . '/yith_wapo/admin/' );
83
! defined( 'YITH_WAPO_TEMPLATE_FRONTEND_PATH' ) && define( 'YITH_WAPO_TEMPLATE_FRONTEND_PATH', YITH_WAPO_TEMPLATE_PATH . '/yith_wapo/frontend/' );
84
! defined( 'YITH_WAPO_ASSETS_URL' ) && define( 'YITH_WAPO_ASSETS_URL', YITH_WAPO_URL . 'assets' );
85
+ ! defined( 'YITH_WAPO_VERSION' ) && define( 'YITH_WAPO_VERSION', '1.0.3' );
86
! defined( 'YITH_WAPO_DB_VERSION' ) && define( 'YITH_WAPO_DB_VERSION', '1.0.1' );
87
! defined( 'YITH_WAPO_FILE' ) && define( 'YITH_WAPO_FILE', __FILE__ );
88
! defined( 'YITH_WAPO_SLUG' ) && define( 'YITH_WAPO_SLUG', 'yith-woocommerce-advanced-product-options' );
modules/yith-woocommerce-product-vendors/assets/css/admin.css CHANGED
@@ -75,9 +75,11 @@ select#tax-input-yith_shop_vendor {
75
76
/* Add-ons tab */
77
78
#yith_wpv_panel_add-ons #plugin-fw-wc h3,
79
#yith_wpv_panel_add-ons #plugin-fw-wc > p {
80
display: inline-block;
81
}
82
83
75
76
/* Add-ons tab */
77
78
+ #yith_wpv_panel_add-ons #plugin-fw-wc h2,
79
#yith_wpv_panel_add-ons #plugin-fw-wc h3,
80
#yith_wpv_panel_add-ons #plugin-fw-wc > p {
81
display: inline-block;
82
+ margin-right: 10px;
83
}
84
85
modules/yith-woocommerce-product-vendors/includes/class.yith-commission.php CHANGED
@@ -458,7 +458,7 @@ if ( ! class_exists( 'YITH_Commission' ) ) {
458
$this->status = $new_status;
459
460
$all_status = YITH_Commissions()->get_status();
461
- $this->add_note( trim( $note . ' ' . sprintf( __( 'Commission status changed from %s to %s.', 'yith_wc_product_vendors' ), $all_status[ $old_status ], $all_status[ $new_status ] ) ) );
462
463
// Status was changed
464
do_action( 'yith_commission_status_' . $new_status, $this->id );
458
$this->status = $new_status;
459
460
$all_status = YITH_Commissions()->get_status();
461
+ $this->add_note( trim( $note . ' ' . sprintf( __( 'Commission status changed from %s to %s.', 'yith-woocommerce-product-vendors' ), $all_status[ $old_status ], $all_status[ $new_status ] ) ) );
462
463
// Status was changed
464
do_action( 'yith_commission_status_' . $new_status, $this->id );
modules/yith-woocommerce-product-vendors/includes/class.yith-commissions.php CHANGED
@@ -185,10 +185,10 @@ if ( ! class_exists( 'YITH_Commissions' ) ) {
185
//Set messages
186
$this->_messages = apply_filters( 'yith_commissions_admin_notice',
187
array(
188
- 'error' => __( 'Commission status not updated!', 'yith_wc_product_vendors' ),
189
- 'updated' => __( 'Commission status updated!', 'yith_wc_product_vendors' ),
190
- 'pay-process' => __( 'Payment successful. In a few minutes you will receive an email with the outcome of the payment and the commission state will be changed accordingly.', 'yith_wc_product_vendors' ),
191
- 'pay-failed' => __( 'Payment failed.', 'yith_wc_product_vendors' )
192
)
193
);
194
@@ -223,12 +223,12 @@ if ( ! class_exists( 'YITH_Commissions' ) ) {
223
*
224
*/
225
return array(
226
- 'paid' => __( 'Paid', 'yith_wc_product_vendors' ),
227
- 'unpaid' => __( 'Unpaid', 'yith_wc_product_vendors' ),
228
- 'pending' => __( 'Pending', 'yith_wc_product_vendors' ),
229
- 'refunded' => __( 'Refunded', 'yith_wc_product_vendors' ),
230
- 'cancelled' => __( 'Cancelled', 'yith_wc_product_vendors' ),
231
- 'processing' => __( 'Processing', 'yith_wc_product_vendors' ),
232
);
233
}
234
@@ -287,8 +287,8 @@ if ( ! class_exists( 'YITH_Commissions' ) ) {
287
if( $is_super_user || $vendor->is_valid() && $vendor->has_limited_access() && $vendor->is_owner() ) {
288
289
$args = apply_filters( 'yith_wc_product_vendors_commissions_menu_items', array(
290
- 'page_title' => __( 'Commissions', 'yith_wc_product_vendors' ),
291
- 'menu_title' => __( 'Commissions', 'yith_wc_product_vendors' ),
292
'capability' => 'edit_products',
293
'menu_slug' => $this->_screen,
294
'function' => array( $this, 'commissions_details_page' ),
@@ -303,12 +303,12 @@ if ( ! class_exists( 'YITH_Commissions' ) ) {
303
}
304
305
// if ( $is_super_user ) {
306
- // add_submenu_page( $this->_screen, $page_title, __( 'Commissions report', 'yith_wc_product_vendors' ), $capability, $menu_slug );
307
//
308
// $submenu_args = apply_filters( 'yith_wc_product_vendors_commissions_submenu_items', array(
309
// 'parent_slug' => $this->_screen,
310
- // 'page_title' => __( 'Unpaid earnings', 'yith_wc_product_vendors' ),
311
- // 'menu_title' => __( 'Unpaid earnings', 'yith_wc_product_vendors' ),
312
// 'capability' => 'manage_options',
313
// 'menu_slug' => 'yith_commissions_by_vendor',
314
// 'function' => array( $this, 'earnings_by_vendor' )
@@ -355,7 +355,7 @@ if ( ! class_exists( 'YITH_Commissions' ) ) {
355
356
$args = apply_filters( 'yith_vendors_commissions_template', array(
357
'commissions_table' => $commissions_table,
358
- 'page_title' => __( 'Vendor Commissions', 'yith_wc_product_vendors' )
359
)
360
);
361
@@ -392,7 +392,7 @@ if ( ! class_exists( 'YITH_Commissions' ) ) {
392
393
$args = apply_filters( 'yith_vendors_commissions_template', array(
394
'commissions_table' => $commissions_table,
395
- 'page_title' => __( 'Earnings by vendor', 'yith_wc_product_vendors' )
396
)
397
);
398
@@ -410,7 +410,7 @@ if ( ! class_exists( 'YITH_Commissions' ) ) {
410
*/
411
public function change_commission_view_page_title( $admin_title, $title ) {
412
if ( isset( $_GET['page'] ) && $_GET['page'] == $this->_screen && ! empty( $_GET['view'] ) ) {
413
- $title = sprintf( __( 'Commission #%d details', 'yith_wc_product_vendors' ), absint( $_GET['view'] ) );
414
$admin_title = sprintf( __( '%1$s &lsaquo; %2$s &#8212; WordPress' ), $title, get_bloginfo( 'name' ) );
415
}
416
@@ -1169,7 +1169,7 @@ if ( ! class_exists( 'YITH_Commissions' ) ) {
1169
foreach ( $refunds as $refund_id => $commissions_refunded ) {
1170
foreach ( $commissions_refunded as $commission_id => $amount ) {
1171
$commission = YITH_Commission( $commission_id );
1172
- $note = $refund_id == $new_refund_id ? sprintf( __( 'Refunded %s from order', 'yith_wc_product_vendors' ), wc_price( abs( $amount ) ) ) : '';
1173
$commission->update_amount( $amount, $note );
1174
}
1175
update_post_meta( $refund_id, '_refunded_commissions', $commissions_refunded );
@@ -1202,7 +1202,7 @@ if ( ! class_exists( 'YITH_Commissions' ) ) {
1202
$commission = YITH_Commission( $commission_id );
1203
1204
// update commission
1205
- $commission->update_amount( abs( $amount ), $note ? sprintf( __( 'Cancelled %s refund from order', 'yith_wc_product_vendors' ), wc_price( abs( $amount ) ) ) : '' );
1206
}
1207
1208
// remove post meta to delete every track of refunds
@@ -1286,7 +1286,7 @@ if ( ! class_exists( 'YITH_Commissions' ) ) {
1286
*/
1287
public function add_screen_option() {
1288
if ( 'toplevel_page_' . $this->_screen == get_current_screen()->id ) {
1289
- add_screen_option( 'per_page', array( 'label' => __( 'Commissions', 'yith_wc_product_vendors' ), 'default' => 20, 'option' => 'edit_commissions_per_page' ) );
1290
1291
}
1292
}
@@ -1322,7 +1322,7 @@ if ( ! class_exists( 'YITH_Commissions' ) ) {
1322
if( $line_item['product_id'] == $product->id ){
1323
$commission_id = wc_get_order_item_meta( $line_item_id, '_commission_id', true );
1324
$admin_url = YITH_Commission( $commission_id )->get_view_url( 'admin' );
1325
- $attribute_label = '_commission_id' == $meta_key ? sprintf( "<a href='%s' class='%s'>" . __( 'commission_id', 'yith_wc_product_vendors' ) . '</a>', $admin_url, 'commission-id-label' ) : $attribute_label;
1326
}
1327
}
1328
}
185
//Set messages
186
$this->_messages = apply_filters( 'yith_commissions_admin_notice',
187
array(
188
+ 'error' => __( 'Commission status not updated!', 'yith-woocommerce-product-vendors' ),
189
+ 'updated' => __( 'Commission status updated!', 'yith-woocommerce-product-vendors' ),
190
+ 'pay-process' => __( 'Payment successful. In a few minutes you will receive an email with the outcome of the payment and the commission state will be changed accordingly.', 'yith-woocommerce-product-vendors' ),
191
+ 'pay-failed' => __( 'Payment failed.', 'yith-woocommerce-product-vendors' )
192
)
193
);
194
223
*
224
*/
225
return array(
226
+ 'paid' => __( 'Paid', 'yith-woocommerce-product-vendors' ),
227
+ 'unpaid' => __( 'Unpaid', 'yith-woocommerce-product-vendors' ),
228
+ 'pending' => __( 'Pending', 'yith-woocommerce-product-vendors' ),
229
+ 'refunded' => __( 'Refunded', 'yith-woocommerce-product-vendors' ),
230
+ 'cancelled' => __( 'Cancelled', 'yith-woocommerce-product-vendors' ),
231
+ 'processing' => __( 'Processing', 'yith-woocommerce-product-vendors' ),
232
);
233
}
234
287
if( $is_super_user || $vendor->is_valid() && $vendor->has_limited_access() && $vendor->is_owner() ) {
288
289
$args = apply_filters( 'yith_wc_product_vendors_commissions_menu_items', array(
290
+ 'page_title' => __( 'Commissions', 'yith-woocommerce-product-vendors' ),
291
+ 'menu_title' => __( 'Commissions', 'yith-woocommerce-product-vendors' ),
292
'capability' => 'edit_products',
293
'menu_slug' => $this->_screen,
294
'function' => array( $this, 'commissions_details_page' ),
303
}
304
305
// if ( $is_super_user ) {
306
+ // add_submenu_page( $this->_screen, $page_title, __( 'Commissions report', 'yith-woocommerce-product-vendors' ), $capability, $menu_slug );
307
//
308
// $submenu_args = apply_filters( 'yith_wc_product_vendors_commissions_submenu_items', array(
309
// 'parent_slug' => $this->_screen,
310
+ // 'page_title' => __( 'Unpaid earnings', 'yith-woocommerce-product-vendors' ),
311
+ // 'menu_title' => __( 'Unpaid earnings', 'yith-woocommerce-product-vendors' ),
312
// 'capability' => 'manage_options',
313
// 'menu_slug' => 'yith_commissions_by_vendor',
314
// 'function' => array( $this, 'earnings_by_vendor' )
355
356
$args = apply_filters( 'yith_vendors_commissions_template', array(
357
'commissions_table' => $commissions_table,
358
+ 'page_title' => __( 'Vendor Commissions', 'yith-woocommerce-product-vendors' )
359
)
360
);
361
392
393
$args = apply_filters( 'yith_vendors_commissions_template', array(
394
'commissions_table' => $commissions_table,
395
+ 'page_title' => __( 'Earnings by vendor', 'yith-woocommerce-product-vendors' )
396
)
397
);
398
410
*/
411
public function change_commission_view_page_title( $admin_title, $title ) {
412
if ( isset( $_GET['page'] ) && $_GET['page'] == $this->_screen && ! empty( $_GET['view'] ) ) {
413
+ $title = sprintf( __( 'Commission #%d details', 'yith-woocommerce-product-vendors' ), absint( $_GET['view'] ) );
414
$admin_title = sprintf( __( '%1$s &lsaquo; %2$s &#8212; WordPress' ), $title, get_bloginfo( 'name' ) );
415
}
416
1169
foreach ( $refunds as $refund_id => $commissions_refunded ) {
1170
foreach ( $commissions_refunded as $commission_id => $amount ) {
1171
$commission = YITH_Commission( $commission_id );
1172
+ $note = $refund_id == $new_refund_id ? sprintf( __( 'Refunded %s from order', 'yith-woocommerce-product-vendors' ), wc_price( abs( $amount ) ) ) : '';
1173
$commission->update_amount( $amount, $note );
1174
}
1175
update_post_meta( $refund_id, '_refunded_commissions', $commissions_refunded );
1202
$commission = YITH_Commission( $commission_id );
1203
1204
// update commission
1205
+ $commission->update_amount( abs( $amount ), $note ? sprintf( __( 'Cancelled %s refund from order', 'yith-woocommerce-product-vendors' ), wc_price( abs( $amount ) ) ) : '' );
1206
}
1207
1208
// remove post meta to delete every track of refunds
1286
*/
1287
public function add_screen_option() {
1288
if ( 'toplevel_page_' . $this->_screen == get_current_screen()->id ) {
1289
+ add_screen_option( 'per_page', array( 'label' => __( 'Commissions', 'yith-woocommerce-product-vendors' ), 'default' => 20, 'option' => 'edit_commissions_per_page' ) );
1290
1291
}
1292
}
1322
if( $line_item['product_id'] == $product->id ){
1323
$commission_id = wc_get_order_item_meta( $line_item_id, '_commission_id', true );
1324
$admin_url = YITH_Commission( $commission_id )->get_view_url( 'admin' );
1325
+ $attribute_label = '_commission_id' == $meta_key ? sprintf( "<a href='%s' class='%s'>" . __( 'commission_id', 'yith-woocommerce-product-vendors' ) . '</a>', $admin_url, 'commission-id-label' ) : $attribute_label;
1326
}
1327
}
1328
}
modules/yith-woocommerce-product-vendors/includes/class.yith-orders.php CHANGED
@@ -50,6 +50,7 @@ if ( ! class_exists ( 'YITH_Orders' ) ) {
50
add_filter ( 'woocommerce_email_enabled_customer_completed_order', array ( $this, 'woocommerce_email_enabled_new_order' ), 10, 2 );
51
add_filter ( 'woocommerce_email_enabled_customer_partially_refunded_order', array ( $this, 'woocommerce_email_enabled_new_order' ), 10, 2 );
52
add_filter ( 'woocommerce_email_enabled_customer_refunded_order', array ( $this, 'woocommerce_email_enabled_new_order' ), 10, 2 );
53
54
/* Order Refund */
55
add_action ( 'woocommerce_order_refunded', array ( $this, 'order_refunded' ), 10, 2 );
@@ -60,7 +61,7 @@ if ( ! class_exists ( 'YITH_Orders' ) ) {
60
add_filter ( 'woocommerce_attribute_label', array ( $this, 'commissions_attribute_label' ), 10, 3 );
61
62
/* Order Item Meta */
63
- add_action ( 'woocommerce_hidden_order_itemmeta', array ( $this, 'hidden_order_itemmeta' ) );
64
65
/* Order Table */
66
add_filter ( 'manage_shop_order_posts_columns', array ( $this, 'shop_order_columns' ) );
@@ -80,6 +81,9 @@ if ( ! class_exists ( 'YITH_Orders' ) ) {
80
81
/* YITH WooCommerce Stripe Support */
82
add_filter( 'yith_stripe_skip_capture_charge', array( $this, 'skip_stripe_charge_for_suborders' ), 10, 2 );
83
84
$sync_enabled = get_option ( 'yith_wpv_vendors_option_order_synchronization', 'yes' );
85
@@ -119,6 +123,12 @@ if ( ! class_exists ( 'YITH_Orders' ) ) {
119
$nopriv && add_action ( "wp_ajax_nopriv_woocommerce_{$ajax_event}", array ( __CLASS__, $ajax_event, 5 ) );
120
}
121
}
122
}
123
124
/**
@@ -409,7 +419,7 @@ if ( ! class_exists ( 'YITH_Orders' ) ) {
409
foreach ( $suborder_ids as $suborder_id ) {
410
/** @var $suborder WC_Order */
411
$suborder = wc_get_order ( $suborder_id );
412
- $suborder->update_status ( $new_status, _x ( 'Update by admin: ', 'Order note', 'yith_wc_product_vendors' ) );
413
}
414
add_action ( 'woocommerce_order_status_completed', 'wc_paying_customer' );
415
@@ -740,7 +750,7 @@ if ( ! class_exists ( 'YITH_Orders' ) ) {
740
if ( ! empty( $suborder_ids ) ) {
741
foreach ( $suborder_ids as $suborder_id ) {
742
$suborder = wc_get_order ( $suborder_id );
743
- $note_id = $suborder->add_order_note ( _x ( 'Update by admin: ', 'Order note', 'yith_wc_product_vendors' ) . $note, $is_customer_note, true );
744
add_comment_meta ( $note_id, 'parent_note_id', $parent_note_id );
745
}
746
}
@@ -1284,7 +1294,7 @@ if ( ! class_exists ( 'YITH_Orders' ) ) {
1284
}
1285
1286
/**
1287
- * Check for new order email
1288
*/
1289
public function woocommerce_email_enabled_new_order ( $enabled, $object ) {
1290
$is_editpost_action = ! empty( $_REQUEST['action'] ) && in_array( $_REQUEST['action'], array( 'editpost', 'edit') );
@@ -1473,8 +1483,8 @@ if ( ! class_exists ( 'YITH_Orders' ) ) {
1473
"<a href='%s' class='%s'>%s</a> <small>(%s: <strong>%s</strong>)</small>",
1474
$admin_url,
1475
'commission-id-label',
1476
- __ ( 'commission_id', 'yith_wc_product_vendors' ) ,
1477
- __ ( 'status', 'yith_wc_product_vendors' ) ,
1478
strtolower( $commission->get_status( 'display' ) )
1479
);
1480
$attribute_label = $item_meta_key == $meta_key ? $url_attribute_label : $attribute_label;
@@ -1537,11 +1547,11 @@ if ( ! class_exists ( 'YITH_Orders' ) ) {
1537
$vendor = yith_get_vendor ( 'current', 'user' );
1538
if ( $vendor->is_super_user () ) {
1539
if ( ( ! isset( $_GET[ 'post_status' ] ) || ( isset( $_GET[ 'post_status' ] ) && 'trash' != $_GET[ 'post_status' ] ) ) ) {
1540
- $suborder = array ( 'suborder' => _x ( 'Suborders', 'Admin: Order table column', 'yith_wc_product_vendors' ) );
1541
$ref_pos = array_search ( 'order_title', array_keys ( $order_columns ) );
1542
$order_columns = array_slice ( $order_columns, 0, $ref_pos + 1, true ) + $suborder + array_slice ( $order_columns, $ref_pos + 1, count ( $order_columns ) - 1, true );
1543
} else {
1544
- $vendor = array ( 'vendor' => _x ( 'Vendor', 'Admin: Order table column', 'yith_wc_product_vendors' ) );
1545
$ref_pos = array_search ( 'order_title', array_keys ( $order_columns ) );
1546
$order_columns = array_slice ( $order_columns, 0, $ref_pos + 1, true ) + $vendor + array_slice ( $order_columns, $ref_pos + 1, count ( $order_columns ) - 1, true );
1547
}
@@ -1580,7 +1590,7 @@ if ( ! class_exists ( 'YITH_Orders' ) ) {
1580
wc_get_order_status_name ( $suborder->get_status () ),
1581
$order_uri,
1582
$suborder_id,
1583
- _x ( 'in', 'Order table details', 'yith_wc_product_vendors' ),
1584
$vendor->name
1585
);
1586
@@ -1621,10 +1631,10 @@ if ( ! class_exists ( 'YITH_Orders' ) ) {
1621
1622
if ( $vendor->is_super_user () ) {
1623
if ( $has_suborder ) {
1624
- $metabox_suborder_description = _x ( 'Suborders', 'Admin: Single order page. Suborder details box', 'yith_wc_product_vendors' ) . ' <span class="tips" data-tip="' . esc_attr__ ( 'Note: from this box you can monitor the status of suborders associated to individual vendors.', 'woocommerce' ) . '">[?]</span>';
1625
add_meta_box ( 'woocommerce-suborders', $metabox_suborder_description, array ( $this, 'output' ), 'shop_order', 'side', 'core', array ( 'metabox' => 'suborders' ) );
1626
} else if ( $is_suborder ) {
1627
- $metabox_parent_order_description = _x ( 'Parent order', 'Admin: Single order page. Parent order details box', 'yith_wc_product_vendors' );
1628
add_meta_box ( 'woocommerce-parent-order', $metabox_parent_order_description, array ( $this, 'output' ), 'shop_order', 'side', 'high', array ( 'metabox' => 'parent-order' ) );
1629
}
1630
}
@@ -1655,7 +1665,7 @@ if ( ! class_exists ( 'YITH_Orders' ) ) {
1655
wc_get_order_status_name ( $suborder->get_status () ),
1656
$suborder_uri,
1657
$suborder_id,
1658
- _x ( 'in', 'Order table details', 'yith_wc_product_vendors' ),
1659
$vendor->name
1660
);
1661
echo '<li>';
@@ -1667,7 +1677,7 @@ if ( ! class_exists ( 'YITH_Orders' ) ) {
1667
case 'parent-order':
1668
$parent_order_id = wp_get_post_parent_id ( absint ( $post->ID ) );
1669
$parent_order_uri = esc_url ( 'post.php?post=' . absint ( $parent_order_id ) . '&action=edit' );
1670
- printf ( '<a href="%s">&#8592; %s</a>', $parent_order_uri, _x ( 'Return to main order', 'Admin: single order page. Link to parent order', 'yith_wc_product_vendors' ) );
1671
break;
1672
}
1673
}
@@ -1881,5 +1891,154 @@ if ( ! class_exists ( 'YITH_Orders' ) ) {
1881
return $skip;
1882
}
1883
1884
}
1885
}
50
add_filter ( 'woocommerce_email_enabled_customer_completed_order', array ( $this, 'woocommerce_email_enabled_new_order' ), 10, 2 );
51
add_filter ( 'woocommerce_email_enabled_customer_partially_refunded_order', array ( $this, 'woocommerce_email_enabled_new_order' ), 10, 2 );
52
add_filter ( 'woocommerce_email_enabled_customer_refunded_order', array ( $this, 'woocommerce_email_enabled_new_order' ), 10, 2 );
53
+ add_filter ( 'woocommerce_email_enabled_customer_on_hold_order', array ( $this, 'woocommerce_email_enabled_new_order' ), 10, 2 );
54
55
/* Order Refund */
56
add_action ( 'woocommerce_order_refunded', array ( $this, 'order_refunded' ), 10, 2 );
61
add_filter ( 'woocommerce_attribute_label', array ( $this, 'commissions_attribute_label' ), 10, 3 );
62
63
/* Order Item Meta */
64
+ add_filter ( 'woocommerce_hidden_order_itemmeta', array ( $this, 'hidden_order_itemmeta' ) );
65
66
/* Order Table */
67
add_filter ( 'manage_shop_order_posts_columns', array ( $this, 'shop_order_columns' ) );
81
82
/* YITH WooCommerce Stripe Support */
83
add_filter( 'yith_stripe_skip_capture_charge', array( $this, 'skip_stripe_charge_for_suborders' ), 10, 2 );
84
+
85
+ /* Add shipping addresses to vendor email */
86
+ add_filter( 'woocommerce_order_needs_shipping_address', array( $this, 'order_needs_shipping_address' ), 10, 3 );
87
88
$sync_enabled = get_option ( 'yith_wpv_vendors_option_order_synchronization', 'yes' );
89
123
$nopriv && add_action ( "wp_ajax_nopriv_woocommerce_{$ajax_event}", array ( __CLASS__, $ajax_event, 5 ) );
124
}
125
}
126
+
127
+ //the revoke download permission and the grant download permission would be always synchronized
128
+ add_action( 'woocommerce_ajax_revoke_access_to_product_download', array( $this, 'revoke_access_to_product_download' ), 10, 3 );
129
+ add_action( 'wp_ajax_woocommerce_grant_access_to_download', array( $this, 'grant_access_to_download' ), 5 );
130
+
131
+
132
}
133
134
/**
419
foreach ( $suborder_ids as $suborder_id ) {
420
/** @var $suborder WC_Order */
421
$suborder = wc_get_order ( $suborder_id );
422
+ $suborder->update_status ( $new_status, _x ( 'Update by admin: ', 'Order note', 'yith-woocommerce-product-vendors' ) );
423
}
424
add_action ( 'woocommerce_order_status_completed', 'wc_paying_customer' );
425
750
if ( ! empty( $suborder_ids ) ) {
751
foreach ( $suborder_ids as $suborder_id ) {
752
$suborder = wc_get_order ( $suborder_id );
753
+ $note_id = $suborder->add_order_note ( _x ( 'Update by admin: ', 'Order note', 'yith-woocommerce-product-vendors' ) . $note, $is_customer_note, true );
754
add_comment_meta ( $note_id, 'parent_note_id', $parent_note_id );
755
}
756
}
1294
}
1295
1296
/**
1297
+ * Prevent duplicated email for customer
1298
*/
1299
public function woocommerce_email_enabled_new_order ( $enabled, $object ) {
1300
$is_editpost_action = ! empty( $_REQUEST['action'] ) && in_array( $_REQUEST['action'], array( 'editpost', 'edit') );
1483
"<a href='%s' class='%s'>%s</a> <small>(%s: <strong>%s</strong>)</small>",
1484
$admin_url,
1485
'commission-id-label',
1486
+ __ ( 'commission_id', 'yith-woocommerce-product-vendors' ) ,
1487
+ __ ( 'status', 'yith-woocommerce-product-vendors' ) ,
1488
strtolower( $commission->get_status( 'display' ) )
1489
);
1490
$attribute_label = $item_meta_key == $meta_key ? $url_attribute_label : $attribute_label;
1547
$vendor = yith_get_vendor ( 'current', 'user' );
1548
if ( $vendor->is_super_user () ) {
1549
if ( ( ! isset( $_GET[ 'post_status' ] ) || ( isset( $_GET[ 'post_status' ] ) && 'trash' != $_GET[ 'post_status' ] ) ) ) {
1550
+ $suborder = array ( 'suborder' => _x ( 'Suborders', 'Admin: Order table column', 'yith-woocommerce-product-vendors' ) );
1551
$ref_pos = array_search ( 'order_title', array_keys ( $order_columns ) );
1552
$order_columns = array_slice ( $order_columns, 0, $ref_pos + 1, true ) + $suborder + array_slice ( $order_columns, $ref_pos + 1, count ( $order_columns ) - 1, true );
1553
} else {
1554
+ $vendor = array ( 'vendor' => _x ( 'Vendor', 'Admin: Order table column', 'yith-woocommerce-product-vendors' ) );
1555
$ref_pos = array_search ( 'order_title', array_keys ( $order_columns ) );
1556
$order_columns = array_slice ( $order_columns, 0, $ref_pos + 1, true ) + $vendor + array_slice ( $order_columns, $ref_pos + 1, count ( $order_columns ) - 1, true );
1557
}
1590
wc_get_order_status_name ( $suborder->get_status () ),
1591
$order_uri,
1592
$suborder_id,
1593
+ _x ( 'in', 'Order table details', 'yith-woocommerce-product-vendors' ),
1594
$vendor->name
1595
);
1596
1631
1632
if ( $vendor->is_super_user () ) {
1633
if ( $has_suborder ) {
1634
+ $metabox_suborder_description = _x ( 'Suborders', 'Admin: Single order page. Suborder details box', 'yith-woocommerce-product-vendors' ) . ' <span class="tips" data-tip="' . esc_attr__ ( 'Note: from this box you can monitor the status of suborders associated to individual vendors.', 'woocommerce' ) . '">[?]</span>';
1635
add_meta_box ( 'woocommerce-suborders', $metabox_suborder_description, array ( $this, 'output' ), 'shop_order', 'side', 'core', array ( 'metabox' => 'suborders' ) );
1636
} else if ( $is_suborder ) {
1637
+ $metabox_parent_order_description = _x ( 'Parent order', 'Admin: Single order page. Parent order details box', 'yith-woocommerce-product-vendors' );
1638
add_meta_box ( 'woocommerce-parent-order', $metabox_parent_order_description, array ( $this, 'output' ), 'shop_order', 'side', 'high', array ( 'metabox' => 'parent-order' ) );
1639
}
1640
}
1665
wc_get_order_status_name ( $suborder->get_status () ),
1666
$suborder_uri,
1667
$suborder_id,
1668
+ _x ( 'in', 'Order table details', 'yith-woocommerce-product-vendors' ),
1669
$vendor->name
1670
);
1671
echo '<li>';
1677
case 'parent-order':
1678
$parent_order_id = wp_get_post_parent_id ( absint ( $post->ID ) );
1679
$parent_order_uri = esc_url ( 'post.php?post=' . absint ( $parent_order_id ) . '&action=edit' );
1680
+ printf ( '<a href="%s">&#8592; %s</a>', $parent_order_uri, _x ( 'Return to main order', 'Admin: single order page. Link to parent order', 'yith-woocommerce-product-vendors' ) );
1681
break;
1682
}
1683
}
1891
return $skip;
1892
}
1893
1894
+ public function revoke_access_to_product_download( $download_id, $product_id, $order_id ){
1895
+
1896
+ check_ajax_referer( 'revoke-access', 'security' );
1897
+
1898
+
1899
+ if ( ! current_user_can( 'edit_shop_orders' ) ) {
1900
+ die(-1);
1901
+ }
1902
+
1903
+ $parent_order_id = 0;
1904
+ $current_order_id = 0;
1905
+ if ( wp_get_post_parent_id ( $order_id ) ) {
1906
+ $order = wc_get_order( $order_id );
1907
+ $parent_order_id = $order->post->post_parent;
1908
+ }
1909
+
1910
+ global $wpdb;
1911
+
1912
+ if( $parent_order_id == 0 ) {
1913
+ $suborders = self::get_suborder( $order_id );
1914
+ $vendor = yith_get_vendor( $product_id, 'product' );
1915
+ $vendor_orders = $vendor->get_orders();
1916
+ $suborder_id = array_intersect( $vendor_orders, $suborders );
1917
+
1918
+ if( count( $suborder_id ) == 1 ) {
1919
+
1920
+ $current_order_id = implode('', $suborder_id );
1921
+ }
1922
+
1923
+ }else{
1924
+ $current_order_id = $parent_order_id;
1925
+ }
1926
+
1927
+ $query = $wpdb->prepare( "DELETE FROM {$wpdb->prefix}woocommerce_downloadable_product_permissions WHERE order_id = %d AND product_id = %d AND download_id = %s;", $current_order_id, $product_id, $download_id );
1928
+ $wpdb->query( $query );
1929
+
1930
+ die();
1931
+ }
1932
+
1933
+ public static function grant_access_to_download() {
1934
+
1935
+
1936
+ check_ajax_referer( 'grant-access', 'security' );
1937
+
1938
+ if ( ! current_user_can( 'edit_shop_orders' ) ) {
1939
+ die(-1);
1940
+ }
1941
+
1942
+
1943
+ global $wpdb;
1944
+
1945
+ $wpdb->hide_errors();
1946
+
1947
+ $order_id = intval( $_POST['order_id'] );
1948
+ $product_ids = $_POST['product_ids'];
1949
+ $loop = intval( $_POST['loop'] );
1950
+ $file_counter = 0;
1951
+
1952
+
1953
+ $parent_order_id = 0;
1954
+ if( wp_get_post_parent_id( $order_id) ){
1955
+ $order = wc_get_order( $order_id );
1956
+ $parent_order_id = $order->post->post_parent;
1957
+ }
1958
+
1959
+ $suborders = self::get_suborder( $order_id );
1960
+
1961
+
1962
+ if ( ! is_array( $product_ids ) ) {
1963
+ $product_ids = array( $product_ids );
1964
+ }
1965
+
1966
+ foreach ( $product_ids as $product_id ) {
1967
+
1968
+ $product = wc_get_product( $product_id );
1969
+ $files = $product->get_files();
1970
+
1971
+ if( $parent_order_id == 0 ) {
1972
+ $vendor = yith_get_vendor( $product_id, 'product' );
1973
+ $vendor_orders = $vendor->get_orders();
1974
+ $suborder_id = array_intersect( $vendor_orders, $suborders );
1975
+
1976
+
1977
+ if( count( $suborder_id ) == 1 ) {
1978
+ $suborder_id = implode( '', $suborder_id );
1979
+ $order = wc_get_order( $suborder_id );
1980
+ }
1981
+ }else{
1982
+ $order = wc_get_order( $parent_order_id );
1983
+ }
1984
+
1985
+
1986
+ if ( ! $order->billing_email ) {
1987
+ die();
1988
+ }
1989
+
1990
+
1991
+ if ( ! empty( $files ) ) {
1992
+ foreach ( $files as $download_id => $file ) {
1993
+ if ( $inserted_id = wc_downloadable_file_permission( $download_id, $product_id, $order ) ) {
1994
+
1995
+ // insert complete - get inserted data
1996
+ $download = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$wpdb->prefix}woocommerce_downloadable_product_permissions WHERE permission_id = %d", $inserted_id ) );
1997
+
1998
+ $loop ++;
1999
+ $file_counter ++;
2000
+
2001
+ if ( isset( $file['name'] ) ) {
2002
+ $file_count = $file['name'];
2003
+ } else {
2004
+ $file_count = sprintf( __( 'File %d', 'woocommerce' ), $file_counter );
2005
+ }
2006
+ // include( WC()->plugin_path().'/includes/admin/meta-boxes/views/html-order-download-permission.php' );
2007
+ }
2008
+ }
2009
+ }
2010
+ }
2011
+ }
2012
+
2013
+ /**
2014
+ * Checks if an order needs display the shipping address, based on shipping method.
2015
+ *
2016
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
2017
+ * @return boolean
2018
+ */
2019
+ public function order_needs_shipping_address( $needs_address, $hide, $order ){
2020
+ $raq_order_meta = get_post_meta( $order->id, 'ywraq_raq' );
2021
+ $is_quote = ! empty( $raq_order_meta );
2022
+
2023
+ if( $order->post->post_parent && ! $is_quote ){
2024
+ $parent_order = wc_get_order( $order->post->post_parent );
2025
+
2026
+ if ( ! wc_shipping_enabled() ) {
2027
+ return false;
2028
+ }
2029
+
2030
+ $hide = apply_filters( 'woocommerce_order_hide_shipping_address', array( 'local_pickup' ), $this );
2031
+ $needs_address = false;
2032
+
2033
+ foreach ( $parent_order->get_shipping_methods() as $shipping_method ) {
2034
+ if ( ! in_array( $shipping_method['method_id'], $hide ) ) {
2035
+ $needs_address = true;
2036
+ break;
2037
+ }
2038
+ }
2039
+ }
2040
+
2041
+ return $needs_address;
2042
+ }
2043
}
2044
}
modules/yith-woocommerce-product-vendors/includes/class.yith-vendor.php CHANGED
@@ -22,6 +22,8 @@ if ( ! class_exists ( 'YITH_Vendor' ) ) {
22
* @author Your Inspiration Themes
23
*
24
* @property string $telephone
25
* @property string $paypal_email
26
* @property string $enable_selling
27
* @property string $payment_type
@@ -38,6 +40,7 @@ if ( ! class_exists ( 'YITH_Vendor' ) ) {
38
* @property int|string $commission
39
* @property string $vat
40
* @property string $featured_products
41
*
42
*/
43
class YITH_Vendor {
@@ -485,7 +488,7 @@ if ( ! class_exists ( 'YITH_Vendor' ) ) {
485
*
486
* @return array
487
*/
488
- public function get_products ( $extra = array () ) {
489
$args = wp_parse_args ( $extra, array (
490
'posts_per_page' => - 1,
491
'fields' => 'ids',
@@ -493,7 +496,8 @@ if ( ! class_exists ( 'YITH_Vendor' ) ) {
493
);
494
495
$args = $this->get_query_products_args ( $args );
496
-
497
return get_posts ( $args );
498
}
499
22
* @author Your Inspiration Themes
23
*
24
* @property string $telephone
25
+ * @property string $location
26
+ * @property string $store_email
27
* @property string $paypal_email
28
* @property string $enable_selling
29
* @property string $payment_type
40
* @property int|string $commission
41
* @property string $vat
42
* @property string $featured_products
43
+ * @property string $bank_account
44
*
45
*/
46
class YITH_Vendor {
488
*
489
* @return array
490
*/
491
+ public function get_products ( $extra = array () ) {
492
$args = wp_parse_args ( $extra, array (
493
'posts_per_page' => - 1,
494
'fields' => 'ids',
496
);
497
498
$args = $this->get_query_products_args ( $args );
499
+ $args = apply_filters( 'yith_wcmv_vendor_get_products_query_args', $args, $extra, $this );
500
+
501
return get_posts ( $args );
502
}
503
modules/yith-woocommerce-product-vendors/includes/class.yith-vendors-admin.php CHANGED
@@ -170,16 +170,16 @@ if ( !class_exists( 'YITH_Vendors_Admin' ) ) {
170
}
171
172
$admin_tabs = apply_filters( 'yith_vendors_admin_tabs', array(
173
- 'commissions' => __( 'Commissions', 'yith_wc_product_vendors' ),
174
- 'vendors' => __( 'Vendors', 'yith_wc_product_vendors' ),
175
- 'premium' => __( 'Premium Version', 'yith_wc_product_vendors' ),
176
) );
177
178
$args = array(
179
'create_menu_page' => true,
180
'parent_slug' => '',
181
- 'page_title' => __( 'Multi Vendor', 'yith_wc_product_vendors' ),
182
- 'menu_title' => __( 'Multi Vendor', 'yith_wc_product_vendors' ),
183
'capability' => apply_filters( 'yit_wcmv_plugin_options_capability', 'manage_options' ),
184
'parent' => '',
185
'parent_page' => 'yit_plugin_panel',
@@ -398,6 +398,8 @@ if ( !class_exists( 'YITH_Vendors_Admin' ) ) {
398
399
wp_set_object_terms( $object_id, $terms, $taxonomy, false );
400
}
401
}
402
}
403
@@ -410,19 +412,39 @@ if ( !class_exists( 'YITH_Vendors_Admin' ) ) {
410
* @use current_screen filter
411
*/
412
public function disabled_manage_other_vendors_posts() {
413
- if ( isset( $_POST[ 'post_ID' ] ) || !isset( $_GET[ 'post' ] ) ) {
414
return;
415
}
416
417
- $vendor = yith_get_vendor( 'current', 'user' );
418
/* WPML Support */
419
- $default_language = function_exists( 'wpml_get_default_language' ) ? wpml_get_default_language() : null;
420
- $post_id = yit_wpml_object_id( $_GET['post'], 'product', true, $default_language );
421
- $product_vendor = yith_get_vendor( $post_id, 'product' ); // If false, the product hasn't any vendor set
422
- $post = get_post( $_GET['post'] );
423
424
- if ( $vendor->has_limited_access() && false !== $product_vendor && $vendor->id != $product_vendor->id ) {
425
- wp_die( sprintf( __( 'You do not have permission to edit this product. %1$sClick here to view and edit your products%2$s.', 'yith_wc_product_vendors' ), '<a href="' . esc_url( 'edit.php?post_type=product' ) . '">', '</a>' ) );
426
}
427
}
428
@@ -468,8 +490,8 @@ if ( !class_exists( 'YITH_Vendors_Admin' ) ) {
468
469
$menus = apply_filters( 'yith_wc_product_vendors_details_menu_items', array(
470
'vendor_details' => array(
471
- 'page_title' => __( 'Vendor Profile', 'yith_wc_product_vendors' ),
472
- 'menu_title' => __( 'Vendor Profile', 'yith_wc_product_vendors' ),
473
'capability' => 'edit_products',
474
'menu_slug' => 'yith_vendor_details',
475
'function' => array( $this, 'admin_details_page' ),
@@ -600,8 +622,8 @@ if ( !class_exists( 'YITH_Vendors_Admin' ) ) {
600
$duplicate = false;
601
}
602
603
- $message = __( 'A vendor with this name already exists.', 'yith_wc_product_vendors' );
604
- $title = __( 'Vendor name already exists', 'yith_wc_product_vendors' );
605
$back_link = admin_url( 'edit-tag.php' );
606
607
$back_link = esc_url( add_query_arg( $back_link, array(
@@ -618,7 +640,7 @@ if ( !class_exists( 'YITH_Vendors_Admin' ) ) {
618
} else {
619
$duplicate = get_term_by( 'name', $term, $taxonomy );
620
621
- return !$duplicate ? $term : new WP_Error( 'term_exists', __( 'A vendor with this name already exists.', 'yith_wc_product_vendors' ), $duplicate );
622
}
623
}
624
@@ -1020,12 +1042,12 @@ if ( !class_exists( 'YITH_Vendors_Admin' ) ) {
1020
* @use plugin_action_links_{$plugin_file_name}
1021
*/
1022
public function action_links( $links ) {
1023
- $links[] = '<a href="' . admin_url( "admin.php?page={$this->_panel_page}" ) . '">' . __( 'Settings', 'yith_wc_product_vendors' ) . '</a>';
1024
- $premium_live_text = defined( 'YITH_WPV_FREE_INIT' ) ? __( 'Premium live demo', 'yith_wc_product_vendors' ) : __( 'Live demo', 'yith_wc_product_vendors' );
1025
$links[] = '<a href="' . $this->_premium_live . '" target="_blank">' . $premium_live_text . '</a>';
1026
1027
if ( defined( 'YITH_WPV_FREE_INIT' ) ) {
1028
- $links[] = '<a href="' . $this->get_premium_landing_uri() . '" target="_blank">' . __( 'Premium Version', 'yith_wc_product_vendors' ) . '</a>';
1029
}
1030
1031
return $links;
@@ -1049,7 +1071,7 @@ if ( !class_exists( 'YITH_Vendors_Admin' ) ) {
1049
public function plugin_row_meta( $plugin_meta, $plugin_file, $plugin_data, $status ) {
1050
1051
if ( ( defined( 'YITH_WPV_INIT' ) && YITH_WPV_INIT == $plugin_file ) || ( defined( 'YITH_WPV_FREE_INIT' ) && YITH_WPV_FREE_INIT == $plugin_file ) ) {
1052
- $plugin_meta[] = '<a href="' . $this->_official_documentation . '" target="_blank">' . __( 'Plugin Documentation', 'yith_wc_product_vendors' ) . '</a>';
1053
}
1054
1055
return $plugin_meta;
@@ -1173,7 +1195,7 @@ if ( !class_exists( 'YITH_Vendors_Admin' ) ) {
1173
global $post;
1174
$vendor = yith_get_vendor( 'current', 'user' );
1175
$is_ajax = defined( 'DOING_AJAX' ) && DOING_AJAX;
1176
- $is_order_details = is_admin() && !$is_ajax && 'shop_order' == get_current_screen()->id;
1177
$refund_management = 'yes' == get_option( 'yith_wpv_vendors_option_order_refund_synchronization', 'no' ) ? true : false;
1178
$quote_management = 'yes' == get_option( 'yith_wpv_vendors_enable_request_quote', 'no' ) ? true : false;
1179
@@ -1334,7 +1356,7 @@ if ( !class_exists( 'YITH_Vendors_Admin' ) ) {
1334
1335
$user = new WP_User( $user_id );
1336
$user_roles = array();
1337
- $output = esc_html__( 'None', 'yith_wc_product_vendors' );
1338
1339
if ( is_array( $user->roles ) ) {
1340
foreach ( $user->roles as $role ) {
@@ -1365,7 +1387,7 @@ if ( !class_exists( 'YITH_Vendors_Admin' ) ) {
1365
}
1366
1367
// Add our new roles column.
1368
- $columns[ 'roles' ] = esc_html__( 'Roles', 'yith_wc_product_vendors' );
1369
1370
return $columns;
1371
}
@@ -1545,56 +1567,56 @@ if ( !class_exists( 'YITH_Vendors_Admin' ) ) {
1545
public function get_sidebar_link(){
1546
$links = array(
1547
array(
1548
- 'title' => __( 'Plugin documentation', 'yith_wc_product_vendors' ),
1549
'url' => $this->_official_documentation,
1550
),
1551
);
1552
1553
if( defined( 'YITH_WPV_FREE_INIT' ) ){
1554
$links[] = array(
1555
- 'title' => __( 'Discover the premium version', 'yith_wc_product_vendors' ),
1556
'url' => $this->_premium_landing,
1557
);
1558
1559
$links[] = array(
1560
- 'title' => __( 'Free Vs Premium', 'yith_wc_product_vendors' ),
1561
'url' => 'https://yithemes.com/themes/plugins/yith-woocommerce-multi-vendor/#tab-free_vs_premium_tab',
1562
);
1563
1564
$links[] = array(
1565
- 'title' => __( 'Premium live demo', 'yith_wc_product_vendors' ),
1566
'url' => $this->_premium_live
1567
);
1568
1569
$links[] = array(
1570
- 'title' => __( 'WordPress support forum', 'yith_wc_product_vendors' ),
1571
'url' => 'https://wordpress.org/support/plugin/yith-woocommerce-product-vendors',
1572
);
1573
1574
$links[] = array(
1575
- 'title' => __( 'Changelog', 'yith_wc_product_vendors' ),
1576
'url' => 'http://yithemes.com/docs-plugins/yith-woocommerce-multi-vendor/14-changelog.html',
1577
);
1578
}
1579
1580
if( defined( 'YITH_WPV_PREMIUM' ) ){
1581
$links[] = array(
1582
- 'title' => __( 'Support platform', 'yith_wc_product_vendors' ),
1583
'url' => 'https://yithemes.com/my-account/support/dashboard/',
1584
);
1585
1586
$links[] = array(
1587
- 'title' => sprintf( '%s (%s %s)', __( 'Changelog', 'yith_wc_product_vendors' ), __( 'current version','yith_wc_product_vendors' ), YITH_WPV_VERSION ),
1588
'url' => 'http://yithemes.com/docs-plugins/yith-woocommerce-multi-vendor/15-changelog-premium.html',
1589
);
1590
1591
$links[] = array(
1592
- 'title' => __( 'PayPal sandbox test accounts', 'yith_wc_product_vendors' ),
1593
'url' => 'https://developer.paypal.com/developer/accounts/',
1594
);
1595
1596
$links[] = array(
1597
- 'title' => __( 'Enable PayPal MassPay', 'yith_wc_product_vendors' ),
1598
'url' => 'https://www.paypal.com/selfhelp/home',
1599
);
1600
}
170
}
171
172
$admin_tabs = apply_filters( 'yith_vendors_admin_tabs', array(
173
+ 'commissions' => __( 'Commissions', 'yith-woocommerce-product-vendors' ),
174
+ 'vendors' => __( 'Vendors', 'yith-woocommerce-product-vendors' ),
175
+ 'premium' => __( 'Premium Version', 'yith-woocommerce-product-vendors' ),
176
) );
177
178
$args = array(
179
'create_menu_page' => true,
180
'parent_slug' => '',
181
+ 'page_title' => __( 'Multi Vendor', 'yith-woocommerce-product-vendors' ),
182
+ 'menu_title' => __( 'Multi Vendor', 'yith-woocommerce-product-vendors' ),
183
'capability' => apply_filters( 'yit_wcmv_plugin_options_capability', 'manage_options' ),
184
'parent' => '',
185
'parent_page' => 'yit_plugin_panel',
398
399
wp_set_object_terms( $object_id, $terms, $taxonomy, false );
400
}
401
+
402
+ do_action( 'yith_wcmv_save_post_product', $post_id, $post, $current_vendor );
403
}
404
}
405
412
* @use current_screen filter
413
*/
414
public function disabled_manage_other_vendors_posts() {
415
+ if ( isset( $_POST[ 'post_ID' ] ) || ! isset( $_GET[ 'post' ] ) ) {
416
return;
417
}
418
419
+ $post_id = $product_vendor = 0;
420
+ $vendor = yith_get_vendor( 'current', 'user' );
421
+
422
/* WPML Support */
423
+ $default_language = function_exists( 'wpml_get_default_language' ) ? wpml_get_default_language() : null;
424
+ $post = get_post( $_GET['post'] );
425
+ $is_seller = $vendor->is_valid() && $vendor->has_limited_access();
426
+
427
+ if( $post && 'product' == $post->post_type ){
428
+ $post_id = yit_wpml_object_id( $_GET['post'], 'product', true, $default_language );
429
+ $product_vendor = yith_get_vendor( $post_id, 'product' ); // If false, the product hasn't any vendor set
430
+ if ( $is_seller && false !== $product_vendor && $vendor->id != $product_vendor->id ) {
431
+ wp_die( sprintf( __( 'You do not have permission to edit this product. %1$sClick here to view and edit your products%2$s.', 'yith-woocommerce-product-vendors' ), '<a href="' . esc_url( 'edit.php?post_type=product' ) . '">', '</a>' ) );
432
+ }
433
+ }
434
+
435
+ if( $post && 'shop_order' == $post->post_type ){
436
+ $vendor_orders = $vendor->get_orders( 'all' );
437
+ if( $is_seller && ! in_array( $post->ID, $vendor_orders ) ){
438
+ wp_die( sprintf( __( 'You do not have permission to edit this order. %1$sClick here to view and edit your orders%2$s.', 'yith-woocommerce-product-vendors' ), '<a href="' . esc_url( 'edit.php?post_type=shop_order' ) . '">', '</a>' ) );
439
+ }
440
+ }
441
+
442
+
443
+
444
+
445
+ if( $is_seller ){
446
+
447
448
}
449
}
450
490
491
$menus = apply_filters( 'yith_wc_product_vendors_details_menu_items', array(
492
'vendor_details' => array(
493
+ 'page_title' => __( 'Vendor Profile', 'yith-woocommerce-product-vendors' ),
494
+ 'menu_title' => __( 'Vendor Profile', 'yith-woocommerce-product-vendors' ),
495
'capability' => 'edit_products',
496
'menu_slug' => 'yith_vendor_details',
497
'function' => array( $this, 'admin_details_page' ),
622
$duplicate = false;
623
}
624
625
+ $message = __( 'A vendor with this name already exists.', 'yith-woocommerce-product-vendors' );
626
+ $title = __( 'Vendor name already exists', 'yith-woocommerce-product-vendors' );
627
$back_link = admin_url( 'edit-tag.php' );
628
629
$back_link = esc_url( add_query_arg( $back_link, array(
640
} else {
641
$duplicate = get_term_by( 'name', $term, $taxonomy );
642
643
+ return !$duplicate ? $term : new WP_Error( 'term_exists', __( 'A vendor with this name already exists.', 'yith-woocommerce-product-vendors' ), $duplicate );
644
}
645
}
646
1042
* @use plugin_action_links_{$plugin_file_name}
1043
*/
1044
public function action_links( $links ) {
1045
+ $links[] = '<a href="' . admin_url( "admin.php?page={$this->_panel_page}" ) . '">' . __( 'Settings', 'yith-woocommerce-product-vendors' ) . '</a>';
1046
+ $premium_live_text = defined( 'YITH_WPV_FREE_INIT' ) ? __( 'Premium live demo', 'yith-woocommerce-product-vendors' ) : __( 'Live demo', 'yith-woocommerce-product-vendors' );
1047
$links[] = '<a href="' . $this->_premium_live . '" target="_blank">' . $premium_live_text . '</a>';
1048
1049
if ( defined( 'YITH_WPV_FREE_INIT' ) ) {
1050
+ $links[] = '<a href="' . $this->get_premium_landing_uri() . '" target="_blank">' . __( 'Premium Version', 'yith-woocommerce-product-vendors' ) . '</a>';
1051
}
1052
1053
return $links;
1071
public function plugin_row_meta( $plugin_meta, $plugin_file, $plugin_data, $status ) {
1072
1073
if ( ( defined( 'YITH_WPV_INIT' ) && YITH_WPV_INIT == $plugin_file ) || ( defined( 'YITH_WPV_FREE_INIT' ) && YITH_WPV_FREE_INIT == $plugin_file ) ) {
1074
+ $plugin_meta[] = '<a href="' . $this->_official_documentation . '" target="_blank">' . __( 'Plugin Documentation', 'yith-woocommerce-product-vendors' ) . '</a>';
1075
}
1076
1077
return $plugin_meta;
1195
global $post;
1196
$vendor = yith_get_vendor( 'current', 'user' );
1197
$is_ajax = defined( 'DOING_AJAX' ) && DOING_AJAX;
1198
+ $is_order_details = is_admin() && ! $is_ajax && 'shop_order' == get_current_screen()->id;
1199
$refund_management = 'yes' == get_option( 'yith_wpv_vendors_option_order_refund_synchronization', 'no' ) ? true : false;
1200
$quote_management = 'yes' == get_option( 'yith_wpv_vendors_enable_request_quote', 'no' ) ? true : false;
1201
1356
1357
$user = new WP_User( $user_id );
1358
$user_roles = array();
1359
+ $output = esc_html__( 'None', 'yith-woocommerce-product-vendors' );
1360
1361
if ( is_array( $user->roles ) ) {
1362
foreach ( $user->roles as $role ) {
1387
}
1388
1389
// Add our new roles column.
1390
+ $columns[ 'roles' ] = esc_html__( 'Roles', 'yith-woocommerce-product-vendors' );
1391
1392
return $columns;
1393
}
1567
public function get_sidebar_link(){
1568
$links = array(
1569
array(
1570
+ 'title' => __( 'Plugin documentation', 'yith-woocommerce-product-vendors' ),
1571
'url' => $this->_official_documentation,
1572
),
1573
);
1574
1575
if( defined( 'YITH_WPV_FREE_INIT' ) ){
1576
$links[] = array(
1577
+ 'title' => __( 'Discover the premium version', 'yith-woocommerce-product-vendors' ),
1578
'url' => $this->_premium_landing,
1579
);
1580
1581
$links[] = array(
1582
+ 'title' => __( 'Free Vs Premium', 'yith-woocommerce-product-vendors' ),
1583
'url' => 'https://yithemes.com/themes/plugins/yith-woocommerce-multi-vendor/#tab-free_vs_premium_tab',
1584
);
1585
1586
$links[] = array(
1587
+ 'title' => __( 'Premium live demo', 'yith-woocommerce-product-vendors' ),
1588
'url' => $this->_premium_live
1589
);
1590
1591
$links[] = array(
1592
+ 'title' => __( 'WordPress support forum', 'yith-woocommerce-product-vendors' ),
1593
'url' => 'https://wordpress.org/support/plugin/yith-woocommerce-product-vendors',
1594
);
1595
1596
$links[] = array(
1597
+ 'title' => __( 'Changelog', 'yith-woocommerce-product-vendors' ),
1598
'url' => 'http://yithemes.com/docs-plugins/yith-woocommerce-multi-vendor/14-changelog.html',
1599
);
1600
}
1601
1602
if( defined( 'YITH_WPV_PREMIUM' ) ){
1603
$links[] = array(
1604
+ 'title' => __( 'Support platform', 'yith-woocommerce-product-vendors' ),
1605
'url' => 'https://yithemes.com/my-account/support/dashboard/',
1606
);
1607
1608
$links[] = array(
1609
+ 'title' => sprintf( '%s (%s %s)', __( 'Changelog', 'yith-woocommerce-product-vendors' ), __( 'current version','yith-woocommerce-product-vendors' ), YITH_WPV_VERSION ),
1610
'url' => 'http://yithemes.com/docs-plugins/yith-woocommerce-multi-vendor/15-changelog-premium.html',
1611
);
1612
1613
$links[] = array(
1614
+ 'title' => __( 'PayPal sandbox test accounts', 'yith-woocommerce-product-vendors' ),
1615
'url' => 'https://developer.paypal.com/developer/accounts/',
1616
);
1617
1618
$links[] = array(
1619
+ 'title' => __( 'Enable PayPal MassPay', 'yith-woocommerce-product-vendors' ),
1620
'url' => 'https://www.paypal.com/selfhelp/home',
1621
);
1622
}
modules/yith-woocommerce-product-vendors/includes/class.yith-vendors-frontend.php CHANGED
@@ -57,6 +57,11 @@ if ( ! class_exists( 'YITH_Vendors_Frontend' ) ) {
57
58
/* MyAccount -> My Order: Disable suborder view */
59
add_filter( 'woocommerce_my_account_my_orders_query', array( $this, 'my_account_my_orders_query' ) );
60
}
61
62
/**
@@ -269,6 +274,47 @@ if ( ! class_exists( 'YITH_Vendors_Frontend' ) ) {
269
$query_args['post_parent'] = 0;
270
return $query_args;
271
}
272
}
273
}
274
57
58
/* MyAccount -> My Order: Disable suborder view */
59
add_filter( 'woocommerce_my_account_my_orders_query', array( $this, 'my_account_my_orders_query' ) );
60
+
61
+ add_filter( 'woocommerce_customer_get_downloadable_products' , array( $this ,'get_downloadable_products' ) );
62
+
63
+ /* Support to Adventure Tours Product Type */
64
+ class_exists( 'WC_Tour_WP_Query' ) && add_filter( 'yith_wcmv_vendor_get_products_query_args', array( $this, 'add_wc_tour_query_type' ) );
65
}
66
67
/**
274
$query_args['post_parent'] = 0;
275
return $query_args;
276
}
277
+
278
+ /**
279
+ * Filter download permission (show only parent order)
280
+ *
281
+ * @author Salvatore Strano
282
+ * @param $downloads
283
+ * @return array
284
+ */
285
+ public function get_downloadable_products( $downloads ){
286
+
287
+ $new_downloads = array();
288
+
289
+ foreach ( $downloads as $download ){
290
+
291
+ $order_id = $download['order_id'];
292
+ $order = wc_get_order( $order_id );
293
+
294
+ //show only parent order download
295
+
296
+ if( $order->post->post_parent == 0 ){
297
+ $new_downloads[] = $download;
298
+ }
299
+
300
+ }
301
+
302
+ return $new_downloads;
303
+ }
304
+
305
+ /**
306
+ * Add Support to Adventure Tours Product Type
307
+ *
308
+ * Add the correct wc_query arg to get_posts array
309
+ *
310
+ * @author Andrea Grillo <andrea.grillo@yithemes.com>
311
+ * @since 1.9.13
312
+ * @return $args array WP_Query array
313
+ */
314
+ public function add_wc_tour_query_type( $args ){
315
+ $args['wc_query'] = 'tours';
316
+ return $args;
317
+ }
318
}
319
}
320
modules/yith-woocommerce-product-vendors/includes/class.yith-vendors.php CHANGED
@@ -331,23 +331,23 @@ if ( ! class_exists( 'YITH_Vendors' ) ) {
331
public function get_vendors_taxonomy_label( $arg = '' ) {
332
333
$label = apply_filters( 'yith_product_vendors_taxonomy_label', array(
334
- 'name' => __( 'Vendor', 'yith_wc_product_vendors' ),
335
- 'singular_name' => __( 'Vendor', 'yith_wc_product_vendors' ),
336
- 'menu_name' => __( 'Vendors', 'yith_wc_product_vendors' ),
337
- 'search_items' => __( 'Search Vendors', 'yith_wc_product_vendors' ),
338
- 'all_items' => __( 'All Vendors', 'yith_wc_product_vendors' ),
339
- 'parent_item' => __( 'Parent Vendor', 'yith_wc_product_vendors' ),
340
- 'parent_item_colon' => __( 'Parent Vendor:', 'yith_wc_product_vendors' ),
341
- 'view_item' => __( 'View Vendor', 'yith_wc_product_vendors' ),
342
- 'edit_item' => __( 'Edit Vendor', 'yith_wc_product_vendors' ),
343
- 'update_item' => __( 'Update Vendor', 'yith_wc_product_vendors' ),
344
- 'add_new_item' => __( 'Add New Vendor', 'yith_wc_product_vendors' ),
345
- 'new_item_name' => __( 'New Vendor\'s Name', 'yith_wc_product_vendors' ),
346
'popular_items' => null, //don't remove!
347
- 'separate_items_with_commas' => __( 'Separate vendors with commas', 'yith_wc_product_vendors' ),
348
- 'add_or_remove_items' => __( 'Add or remove vendors', 'yith_wc_product_vendors' ),
349
- 'choose_from_most_used' => __( 'Choose from most used vendors', 'yith_wc_product_vendors' ),
350
- 'not_found' => __( 'No vendors found', 'yith_wc_product_vendors' ),
351
)
352
);
353
331
public function get_vendors_taxonomy_label( $arg = '' ) {
332
333
$label = apply_filters( 'yith_product_vendors_taxonomy_label', array(
334
+ 'name' => __( 'Vendor', 'yith-woocommerce-product-vendors' ),
335
+ 'singular_name' => __( 'Vendor', 'yith-woocommerce-product-vendors' ),
336
+ 'menu_name' => __( 'Vendors', 'yith-woocommerce-product-vendors' ),
337
+ 'search_items' => __( 'Search Vendors', 'yith-woocommerce-product-vendors' ),
338
+ 'all_items' => __( 'All Vendors', 'yith-woocommerce-product-vendors' ),
339
+ 'parent_item' => __( 'Parent Vendor', 'yith-woocommerce-product-vendors' ),
340
+ 'parent_item_colon' => __( 'Parent Vendor:', 'yith-woocommerce-product-vendors' ),
341
+ 'view_item' => __( 'View Vendor', 'yith-woocommerce-product-vendors' ),
342
+ 'edit_item' => __( 'Edit Vendor', 'yith-woocommerce-product-vendors' ),
343
+ 'update_item' => __( 'Update Vendor', 'yith-woocommerce-product-vendors' ),
344
+ 'add_new_item' => __( 'Add New Vendor', 'yith-woocommerce-product-vendors' ),
345
+ 'new_item_name' => __( 'New Vendor\'s Name', 'yith-woocommerce-product-vendors' ),
346
'popular_items' => null, //don't remove!
347
+ 'separate_items_with_commas' => __( 'Separate vendors with commas', 'yith-woocommerce-product-vendors' ),
348
+ 'add_or_remove_items' => __( 'Add or remove vendors', 'yith-woocommerce-product-vendors' ),
349
+ 'choose_from_most_used' => __( 'Choose from most used vendors', 'yith-woocommerce-product-vendors' ),
350
+ 'not_found' => __( 'No vendors found', 'yith-woocommerce-product-vendors' ),
351
)
352
);
353
modules/yith-woocommerce-product-vendors/includes/lib/class.yith-commissions-list-table.php CHANGED
@@ -56,18 +56,18 @@ if ( ! class_exists( 'YITH_Commissions_List_Table' ) ) {
56
*/
57
public function get_columns() {
58
$columns = apply_filters( 'yith_commissions_list_table_column', array(
59
- 'commission_id' => __( 'ID', 'yith_wc_product_vendors' ),
60
- 'commission_status' => '<span class="status_head tips" data-tip="' . esc_attr__( 'Status', 'yith_wc_product_vendors' ) . '">' . esc_attr__( 'Status', 'yith_wc_product_vendors' ) . '</span>',
61
- 'order_id' => __( 'Order', 'yith_wc_product_vendors' ),
62
- 'line_item' => __( 'Product', 'yith_wc_product_vendors' ),
63
- 'rate' => __( 'Rate', 'yith_wc_product_vendors' ),
64
- 'user' => __( 'User', 'yith_wc_product_vendors' ),
65
'vendor' => YITH_Vendors()->get_vendors_taxonomy_label( 'singular_name' ),
66
- 'bank_account' => __( 'IBAN/BIC', 'yith_wc_product_vendors' ),
67
- 'amount' => __( 'Amount', 'yith_wc_product_vendors' ),
68
- 'date' => __( 'Date', 'yith_wc_product_vendors' ),
69
- 'date_edit' => __( 'Last update', 'yith_wc_product_vendors' ),
70
- 'user_actions' => __( 'Actions', 'yith_wc_product_vendors' ),
71
)
72
);
73
@@ -205,7 +205,7 @@ if ( ! class_exists( 'YITH_Commissions_List_Table' ) ) {
205
$order = wc_get_order( $rec->order_id );
206
207
if( ! $order ){
208
- echo '<small class="meta">' . __( 'Order Deleted', 'yith_wc_product_vendors' ) . '</small>';
209
return;
210
}
211
@@ -256,7 +256,7 @@ if ( ! class_exists( 'YITH_Commissions_List_Table' ) ) {
256
$order_info = $order_number;
257
}
258
259
- printf( _x( '%s by %s', 'Order number by user', 'yith_wc_product_vendors' ), $order_info, $username );
260
261
if ( $order->billing_email ) {
262
echo '<small class="meta email"><a href="' . esc_url( 'mailto:' . $order->billing_email ) . '">' . esc_html( $order->billing_email ) . '</a></small>';
@@ -284,7 +284,7 @@ if ( ! class_exists( 'YITH_Commissions_List_Table' ) ) {
284
$user = $rec->get_user();
285
286
if ( empty( $user ) ) {
287
- return "<em>" . __( 'User deleted', 'yith_wc_product_vendors' ) . "</em>";
288
}
289
290
$user_url = get_edit_user_link( $rec->user_id );
@@ -296,7 +296,7 @@ if ( ! class_exists( 'YITH_Commissions_List_Table' ) ) {
296
$vendor = $rec->get_vendor();
297
298
if ( ! $vendor->is_valid() ) {
299
- return "<em>" . __( 'Vendor deleted', 'yith_wc_product_vendors' ) . "</em>";
300
}
301
302
$vendor_url = get_edit_term_link( $vendor->id, $vendor->taxonomy );
@@ -309,22 +309,22 @@ if ( ! class_exists( 'YITH_Commissions_List_Table' ) ) {
309
break;
310
311
case 'user_actions':
312
- printf( '<a class="button tips view" href="%1$s" data-tip="%2$s">%2$s</a>', $rec->get_view_url( 'admin' ), __( 'View', 'yith_wc_product_vendors' ) );
313
break;
314
315
case 'date':
316
$date = $rec->get_date();
317
- $t_time = date_i18n( __( 'Y/m/d g:i:s A', 'yith_wc_product_vendors' ), mysql2date( 'U', $date ) );
318
$m_time = $date;
319
$time = mysql2date( 'G', $date );
320
321
$time_diff = time() - $time;
322
323
if ( $time_diff > 0 && $time_diff < DAY_IN_SECONDS ) {
324
- $h_time = sprintf( __( '%s ago', 'yith_wc_product_vendors' ), human_time_diff( $time ) );
325
}
326
else {
327
- $h_time = mysql2date( __( 'Y/m/d', 'yith_wc_product_vendors' ), $m_time );
328
}
329
330
echo $h_time ? '<abbr title="' . $t_time . '">' . $h_time . '</abbr>' : '<small class="meta">-</small>';
@@ -339,9 +339,9 @@ if ( ! class_exists( 'YITH_Commissions_List_Table' ) ) {
339
$time_diff = time() - $time;
340
341
if ( $time_diff > 0 && $time_diff < WEEK_IN_SECONDS )
342
- $h_time = sprintf( __( '%s ago', 'yith_wc_product_vendors' ), human_time_diff( $time ) );
343
else
344
- $h_time = mysql2date( __( 'Y/m/d', 'yith_wc_product_vendors' ), $m_time );
345
346
echo $h_time ? '<abbr title="' . $t_time . '">' . $h_time . '</abbr>' : '<small class="meta">-</small>';
347
break;
@@ -373,7 +373,7 @@ if ( ! class_exists( 'YITH_Commissions_List_Table' ) ) {
373
* @access public
374
*/
375
public function no_items() {
376
- _e( 'No commissions found.', 'yith_wc_product_vendors' );
377
}
378
379
56
*/
57
public function get_columns() {
58
$columns = apply_filters( 'yith_commissions_list_table_column', array(
59
+ 'commission_id' => __( 'ID', 'yith-woocommerce-product-vendors' ),
60
+ 'commission_status' => '<span class="status_head tips" data-tip="' . esc_attr__( 'Status', 'yith-woocommerce-product-vendors' ) . '">' . esc_attr__( 'Status', 'yith-woocommerce-product-vendors' ) . '</span>',
61
+ 'order_id' => __( 'Order', 'yith-woocommerce-product-vendors' ),
62
+ 'line_item' => __( 'Product', 'yith-woocommerce-product-vendors' ),
63
+ 'rate' => __( 'Rate', 'yith-woocommerce-product-vendors' ),
64
+ 'user' => __( 'User', 'yith-woocommerce-product-vendors' ),
65
'vendor' => YITH_Vendors()->get_vendors_taxonomy_label( 'singular_name' ),
66
+ 'bank_account' => __( 'IBAN/BIC', 'yith-woocommerce-product-vendors' ),
67
+ 'amount' => __( 'Amount', 'yith-woocommerce-product-vendors' ),
68
+ 'date' => __( 'Date', 'yith-woocommerce-product-vendors' ),
69
+ 'date_edit' => __( 'Last update', 'yith-woocommerce-product-vendors' ),
70
+ 'user_actions' => __( 'Actions', 'yith-woocommerce-product-vendors' ),
71
)
72
);
73
205
$order = wc_get_order( $rec->order_id );
206
207
if( ! $order ){
208
+ echo '<small class="meta">' . __( 'Order Deleted', 'yith-woocommerce-product-vendors' ) . '</small>';
209
return;
210
}
211
256
$order_info = $order_number;
257
}
258
259
+ printf( _x( '%s by %s', 'Order number by user', 'yith-woocommerce-product-vendors' ), $order_info, $username );
260
261
if ( $order->billing_email ) {
262
echo '<small class="meta email"><a href="' . esc_url( 'mailto:' . $order->billing_email ) . '">' . esc_html( $order->billing_email ) . '</a></small>';
284
$user = $rec->get_user();
285
286
if ( empty( $user ) ) {
287
+ return "<em>" . __( 'User deleted', 'yith-woocommerce-product-vendors' ) . "</em>";
288
}
289
290
$user_url = get_edit_user_link( $rec->user_id );
296
$vendor = $rec->get_vendor();
297
298
if ( ! $vendor->is_valid() ) {
299
+ return "<em>" . __( 'Vendor deleted', 'yith-woocommerce-product-vendors' ) . "</em>";
300
}
301
302
$vendor_url = get_edit_term_link( $vendor->id, $vendor->taxonomy );
309
break;
310
311
case 'user_actions':
312
+ printf( '<a class="button tips view" href="%1$s" data-tip="%2$s">%2$s</a>', $rec->get_view_url( 'admin' ), __( 'View', 'yith-woocommerce-product-vendors' ) );
313
break;
314
315
case 'date':
316
$date = $rec->get_date();
317
+ $t_time = date_i18n( __( 'Y/m/d g:i:s A', 'yith-woocommerce-product-vendors' ), mysql2date( 'U', $date ) );
318
$m_time = $date;
319
$time = mysql2date( 'G', $date );
320
321
$time_diff = time() - $time;
322
323
if ( $time_diff > 0 && $time_diff < DAY_IN_SECONDS ) {
324
+ $h_time = sprintf( __( '%s ago', 'yith-woocommerce-product-vendors' ), human_time_diff( $time ) );
325
}
326
else {
327
+ $h_time = mysql2date( __( 'Y/m/d', 'yith-woocommerce-product-vendors' ), $m_time );
328
}
329
330
echo $h_time ? '<abbr title="' . $t_time . '">' . $h_time . '</abbr>' : '<small class="meta">-</small>';
339
$time_diff = time() - $time;
340
341
if ( $time_diff > 0 && $time_diff < WEEK_IN_SECONDS )
342
+ $h_time = sprintf( __( '%s ago', 'yith-woocommerce-product-vendors' ), human_time_diff( $time ) );
343
else
344
+ $h_time = mysql2date( __( 'Y/m/d', 'yith-woocommerce-product-vendors' ), $m_time );
345
346
echo $h_time ? '<abbr title="' . $t_time . '">' . $h_time . '</abbr>' : '<small class="meta">-</small>';
347
break;
373
* @access public
374
*/
375
public function no_items() {
376
+ _e( 'No commissions found.', 'yith-woocommerce-product-vendors' );
377
}
378
379
modules/yith-woocommerce-product-vendors/includes/widgets/class.yith-woocommerce-vendors-widget.php CHANGED
@@ -26,9 +26,9 @@ if ( ! class_exists( 'YITH_Woocommerce_Vendors_Widget' ) ) {
26
*/
27
function __construct() {
28
$id_base = 'yith-vendors-list';
29
- $name = __( 'YITH Vendor List', 'yith_wc_product_vendors' );
30
$widget_options = array(
31
- 'description' => __( 'Display the list with enabled vendors.', 'yith_wc_product_vendors' )
32
);
33
34
parent::__construct( $id_base, $name, $widget_options );
@@ -64,7 +64,7 @@ if ( ! class_exists( 'YITH_Woocommerce_Vendors_Widget' ) ) {
64
65
public function form( $instance ) {
66
$defaults = array(
67
- 'title' => __( 'Vendor List', 'yith_wc_product_vendors' ),
68
'hide_on_vendor_page' => '',
69
'show_product_number' => '',
70
'hide_empty' => '',
@@ -73,22 +73,22 @@ if ( ! class_exists( 'YITH_Woocommerce_Vendors_Widget' ) ) {
73
$instance = wp_parse_args( (array) $instance, $defaults );
74
?>
75
<p>
76
- <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title', 'yith_wc_product_vendors' ) ?>:
77
<input type="text" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo $instance['title']; ?>" class="widefat" />
78
</label>
79
</p>
80
<p>
81
- <label for="<?php echo $this->get_field_id( 'hide_on_vendor_page' ); ?>"><?php _e( 'Hide this widget on vendor page', 'yith_wc_product_vendors' ) ?>:
82
<input type="checkbox" id="<?php echo $this->get_field_id( 'hide_on_vendor_page' ); ?>" name="<?php echo $this->get_field_name( 'hide_on_vendor_page' ); ?>" value="1" <?php checked( $instance['hide_on_vendor_page'], 1, true )?> class="widefat" />
83
</label>
84
</p>
85
<p>
86
- <label for="<?php echo $this->get_field_id( 'show_product_number' ); ?>"><?php _e( 'Vendor\'s products amount', 'yith_wc_product_vendors' ) ?>:
87
<input type="checkbox" id="<?php echo $this->get_field_id( 'show_product_number' ); ?>" name="<?php echo $this->get_field_name( 'show_product_number' ); ?>" value="1" <?php checked( $instance['show_product_number'], 1, true )?> class="widefat" />
88
</label>
89
</p>
90
<p>
91
- <label for="<?php echo $this->get_field_id( 'hide_empty' ); ?>"><?php _e( 'Hide vendors with no products', 'yith_wc_product_vendors' ) ?>:
92
<input type="checkbox" id="<?php echo $this->get_field_id( 'hide_empty' ); ?>" name="<?php echo $this->get_field_name( 'hide_empty' ); ?>" value="1" <?php checked( $instance['hide_empty'], 1, true )?> class="widefat" />
93
</label>
94
</p>
26
*/
27
function __construct() {
28
$id_base = 'yith-vendors-list';
29
+ $name = __( 'YITH Vendor List', 'yith-woocommerce-product-vendors' );
30
$widget_options = array(
31
+ 'description' => __( 'Display the list with enabled vendors.', 'yith-woocommerce-product-vendors' )
32
);
33
34
parent::__construct( $id_base, $name, $widget_options );
64
65
public function form( $instance ) {
66
$defaults = array(
67
+ 'title' => __( 'Vendor List', 'yith-woocommerce-product-vendors' ),
68
'hide_on_vendor_page' => '',
69
'show_product_number' => '',
70
'hide_empty' => '',
73
$instance = wp_parse_args( (array) $instance, $defaults );
74
?>
75
<p>
76
+ <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title', 'yith-woocommerce-product-vendors' ) ?>:
77
<input type="text" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo $instance['title']; ?>" class="widefat" />
78
</label>
79
</p>
80
<p>
81
+ <label for="<?php echo $this->get_field_id( 'hide_on_vendor_page' ); ?>"><?php _e( 'Hide this widget on vendor page', 'yith-woocommerce-product-vendors' ) ?>:
82
<input type="checkbox" id="<?php echo $this->get_field_id( 'hide_on_vendor_page' ); ?>" name="<?php echo $this->get_field_name( 'hide_on_vendor_page' ); ?>" value="1" <?php checked( $instance['hide_on_vendor_page'], 1, true )?> class="widefat" />
83
</label>
84
</p>
85
<p>
86
+ <label for="<?php echo $this->get_field_id( 'show_product_number' ); ?>"><?php _e( 'Vendor\'s products amount', 'yith-woocommerce-product-vendors' ) ?>:
87
<input type="checkbox" id="<?php echo $this->get_field_id( 'show_product_number' ); ?>" name="<?php echo $this->get_field_name( 'show_product_number' ); ?>" value="1" <?php checked( $instance['show_product_number'], 1, true )?> class="widefat" />
88
</label>
89
</p>
90
<p>
91
+ <label for="<?php echo $this->get_field_id( 'hide_empty' ); ?>"><?php _e( 'Hide vendors with no products', 'yith-woocommerce-product-vendors' ) ?>:
92
<input type="checkbox" id="<?php echo $this->get_field_id( 'hide_empty' ); ?>" name="<?php echo $this->get_field_name( 'hide_empty' ); ?>" value="1" <?php checked( $instance['hide_empty'], 1, true )?> class="widefat" />
93
</label>
94
</p>
modules/yith-woocommerce-product-vendors/init.php CHANGED
@@ -4,8 +4,8 @@ Plugin Name: YITH WooCommerce Multi Vendor
4
Plugin URI: http://yithemes.com/themes/plugins/yith-woocommerce-product-vendors/
5
Description: YITH WooCommerce Multi Vendor is a plugin explicitly developed to switch your website into a platform hosting more than one shop.