Booster for WooCommerce - Version 4.7.1

Version Description

  • 10/02/2020 =
  • Feature - EMAILS & MISC. - Template Editor - Add option to set custom /woocommerce/ folder among other paths from other possible plugins.
  • Fix - CART & CHECKOUT - EU VAT Number - Fix possible errors like "Call to Undefined WooCommerce functions".
  • Fix - PRICES & CURRENCIES - PHP Warning: Fix "A non-numeric value encountered".
  • Fix - PRICES & CURRENCIES - Multicurrency Product Base Price - Fix possible missing products with 'WooCommerce Price Filter Compatibility' option enabled by removing the 'wc_product_meta_lookup' table comparison.
  • Fix - PRODUCTS - Product by Condition - Improve performance by setting invisible products on transient.
  • Fix - PRODUCTS - Product Addons - Fix products getting "Required" with no reason.
  • Fix - SHIPPING & ORDERS - Custom Shipping - Fix possible Fatal error "Class 'WC_Shipping_WCJ_Custom_W_Zones' not found".
  • Dev - PAYMENT GATEWAYS - Custom Gateways - Add 'order_id' shortcode param automatically to a possible [wcj_order_meta] shortcode added to 'instructions'.
  • Dev - PAYMENT GATEWAYS - Gateways by User Role - Add 'Multiple Role Checking' option on pro version.
  • Dev - PDF Invoicing - Page Settings - Add option to enable/disable background image url parsing.
  • Dev - PRICES & CURRENCIES - Price by User Role - Add option to check for child categories.
  • Dev - PRICES & CURRENCIES - Wholesale Price - Add 'Default Max Qty Level' option to fix compatibility issues with decimal quantities when using plugins like 'Product Quantity' for instance.
  • Dev - Shortcodes - Add 'result_key' param to all shortcodes with the purpose of filtering a possible array result displaying only a key from it.
  • WC tested up to: 3.9
Download this release

Release Info

Developer algoritmika
Plugin Icon 128x128 Booster for WooCommerce
Version 4.7.1
Comparing to
See all releases

Code changes from version 4.7.0 to 4.7.1

includes/class-wcj-eu-vat-number.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce - Module - EU VAT Number
4
  *
5
- * @version 4.6.1
6
  * @since 2.3.9
7
  * @author Algoritmika Ltd.
8
  */
@@ -16,7 +16,7 @@ class WCJ_EU_VAT_Number extends WCJ_Module {
16
  /**
17
  * Constructor.
18
  *
19
- * @version 4.6.0
20
  * @todo [feature] add option to add "Verify" button to frontend
21
  */
22
  function __construct() {
@@ -41,7 +41,7 @@ class WCJ_EU_VAT_Number extends WCJ_Module {
41
  add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
42
  add_action( 'wp_ajax_wcj_validate_eu_vat_number', array( $this, 'wcj_validate_eu_vat_number' ) );
43
  add_action( 'wp_ajax_nopriv_wcj_validate_eu_vat_number', array( $this, 'wcj_validate_eu_vat_number' ) );
44
- add_filter( 'init', array( $this, 'maybe_exclude_vat' ), PHP_INT_MAX );
45
  add_filter( 'woocommerce_cart_tax_totals', array( $this, 'maybe_remove_tax_totals' ), 1 );
46
  add_filter( 'woocommerce_calculated_total', array( $this, 'maybe_recalculate_tax_totals' ), 1, 2 );
47
  add_action( 'woocommerce_after_checkout_validation', array( $this, 'checkout_validate_vat' ), PHP_INT_MAX );
@@ -431,14 +431,18 @@ class WCJ_EU_VAT_Number extends WCJ_Module {
431
  /**
432
  * need_to_exclude_vat.
433
  *
434
- * @version 4.6.0
435
  * @since 4.6.0
436
  *
437
  * @return bool
438
  */
439
  function need_to_exclude_vat() {
440
  if (
441
- ( is_checkout() || is_cart() || defined( 'WOOCOMMERCE_CHECKOUT' ) || defined( 'WOOCOMMERCE_CART' ) || ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) &&
 
 
 
 
442
  ! empty( WC()->customer ) &&
443
  'yes' === get_option( 'wcj_eu_vat_number_validate', 'yes' ) &&
444
  'yes' === get_option( 'wcj_eu_vat_number_disable_for_valid', 'yes' ) &&
@@ -465,7 +469,7 @@ class WCJ_EU_VAT_Number extends WCJ_Module {
465
  return false;
466
  }
467
  } else {
468
- if ( ! empty( WC()->customer ) ) {
469
  return false;
470
  }
471
  }
2
  /**
3
  * Booster for WooCommerce - Module - EU VAT Number
4
  *
5
+ * @version 4.7.1
6
  * @since 2.3.9
7
  * @author Algoritmika Ltd.
8
  */
16
  /**
17
  * Constructor.
18
  *
19
+ * @version 4.7.1
20
  * @todo [feature] add option to add "Verify" button to frontend
21
  */
22
  function __construct() {
41
  add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
42
  add_action( 'wp_ajax_wcj_validate_eu_vat_number', array( $this, 'wcj_validate_eu_vat_number' ) );
43
  add_action( 'wp_ajax_nopriv_wcj_validate_eu_vat_number', array( $this, 'wcj_validate_eu_vat_number' ) );
44
+ add_filter( 'wp', array( $this, 'maybe_exclude_vat' ), PHP_INT_MAX );
45
  add_filter( 'woocommerce_cart_tax_totals', array( $this, 'maybe_remove_tax_totals' ), 1 );
46
  add_filter( 'woocommerce_calculated_total', array( $this, 'maybe_recalculate_tax_totals' ), 1, 2 );
47
  add_action( 'woocommerce_after_checkout_validation', array( $this, 'checkout_validate_vat' ), PHP_INT_MAX );
431
  /**
432
  * need_to_exclude_vat.
433
  *
434
+ * @version 4.7.1
435
  * @since 4.6.0
436
  *
437
  * @return bool
438
  */
439
  function need_to_exclude_vat() {
440
  if (
441
+ (
442
+ ( function_exists( 'is_checkout' ) && is_checkout() ) ||
443
+ ( function_exists( 'is_cart' ) && is_cart() ) ||
444
+ defined( 'WOOCOMMERCE_CHECKOUT' ) || defined( 'WOOCOMMERCE_CART' ) || ( defined( 'DOING_AJAX' ) && DOING_AJAX )
445
+ ) &&
446
  ! empty( WC()->customer ) &&
447
  'yes' === get_option( 'wcj_eu_vat_number_validate', 'yes' ) &&
448
  'yes' === get_option( 'wcj_eu_vat_number_disable_for_valid', 'yes' ) &&
469
  return false;
470
  }
471
  } else {
472
+ if ( ! function_exists( 'WC' ) || ! empty( WC()->customer ) ) {
473
  return false;
474
  }
475
  }
includes/class-wcj-multicurrency-product-base-price.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce - Module - Multicurrency Product Base Price
4
  *
5
- * @version 4.4.0
6
  * @since 2.4.8
7
  * @author Algoritmika Ltd.
8
  */
@@ -198,7 +198,7 @@ if ( ! class_exists( 'WCJ_Multicurrency_Base_Price' ) ) :
198
  * Adds compatibility with price filter adding '_wcj_multicurrency_base_price' on product meta query.
199
  * It only compares products with '_wcj_multicurrency_base_price_comp_pf' meta
200
  *
201
- * @version 4.3.1
202
  * @since 4.3.1
203
  *
204
  * @param $query
@@ -212,6 +212,7 @@ if ( ! class_exists( 'WCJ_Multicurrency_Base_Price' ) ) :
212
  ) {
213
  return $query;
214
  }
 
215
  $price_filter = $price_filter_wcj = $query['price_filter'];
216
  $price_filter_wcj['key'] = '_wcj_multicurrency_base_price';
217
  $price_filter_wcj['wcj_mcpb_price_filter'] = 1;
2
  /**
3
  * Booster for WooCommerce - Module - Multicurrency Product Base Price
4
  *
5
+ * @version 4.7.1
6
  * @since 2.4.8
7
  * @author Algoritmika Ltd.
8
  */
198
  * Adds compatibility with price filter adding '_wcj_multicurrency_base_price' on product meta query.
199
  * It only compares products with '_wcj_multicurrency_base_price_comp_pf' meta
200
  *
201
+ * @version 4.7.1
202
  * @since 4.3.1
203
  *
204
  * @param $query
212
  ) {
213
  return $query;
214
  }
215
+ wcj_remove_class_filter( 'posts_clauses', 'WC_Query', 'price_filter_post_clauses' );
216
  $price_filter = $price_filter_wcj = $query['price_filter'];
217
  $price_filter_wcj['key'] = '_wcj_multicurrency_base_price';
218
  $price_filter_wcj['wcj_mcpb_price_filter'] = 1;
includes/class-wcj-payment-gateways-by-user-role.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce - Module - Gateways by User Role
4
  *
5
- * @version 3.2.2
6
  * @since 2.5.3
7
  * @author Algoritmika Ltd.
8
  */
@@ -20,7 +20,6 @@ class WCJ_Payment_Gateways_By_User_Role extends WCJ_Module {
20
  * @since 2.5.3
21
  */
22
  function __construct() {
23
-
24
  $this->id = 'payment_gateways_by_user_role';
25
  $this->short_desc = __( 'Gateways by User Role', 'woocommerce-jetpack' );
26
  $this->desc = __( 'Set user roles to include/exclude for payment gateways to show up.', 'woocommerce-jetpack' );
@@ -35,19 +34,19 @@ class WCJ_Payment_Gateways_By_User_Role extends WCJ_Module {
35
  /**
36
  * available_payment_gateways.
37
  *
38
- * @version 3.0.0
39
  * @since 2.5.3
40
  */
41
  function available_payment_gateways( $_available_gateways ) {
42
- $customer_role = wcj_get_current_user_first_role();
43
  foreach ( $_available_gateways as $key => $gateway ) {
44
  $include_roles = get_option( 'wcj_gateways_user_roles_include_' . $key, '' );
45
- if ( ! empty( $include_roles ) && ! in_array( $customer_role, $include_roles ) ) {
46
  unset( $_available_gateways[ $key ] );
47
  continue;
48
  }
49
  $exclude_roles = get_option( 'wcj_gateways_user_roles_exclude_' . $key, '' );
50
- if ( ! empty( $exclude_roles ) && in_array( $customer_role, $exclude_roles ) ) {
51
  unset( $_available_gateways[ $key ] );
52
  continue;
53
  }
2
  /**
3
  * Booster for WooCommerce - Module - Gateways by User Role
4
  *
5
+ * @version 4.7.1
6
  * @since 2.5.3
7
  * @author Algoritmika Ltd.
8
  */
20
  * @since 2.5.3
21
  */
22
  function __construct() {
 
23
  $this->id = 'payment_gateways_by_user_role';
24
  $this->short_desc = __( 'Gateways by User Role', 'woocommerce-jetpack' );
25
  $this->desc = __( 'Set user roles to include/exclude for payment gateways to show up.', 'woocommerce-jetpack' );
34
  /**
35
  * available_payment_gateways.
36
  *
37
+ * @version 4.7.1
38
  * @since 2.5.3
39
  */
40
  function available_payment_gateways( $_available_gateways ) {
41
+ $customer_roles = 'no' === ( $multi_role_check = get_option( 'wcj_payment_gateways_by_user_role_multi_role_check', 'no' ) ) ? array( wcj_get_current_user_first_role() ) : wcj_get_current_user_all_roles();
42
  foreach ( $_available_gateways as $key => $gateway ) {
43
  $include_roles = get_option( 'wcj_gateways_user_roles_include_' . $key, '' );
44
+ if ( ! empty( $include_roles ) && ! array_intersect( $customer_roles, $include_roles ) ) {
45
  unset( $_available_gateways[ $key ] );
46
  continue;
47
  }
48
  $exclude_roles = get_option( 'wcj_gateways_user_roles_exclude_' . $key, '' );
49
+ if ( ! empty( $exclude_roles ) && array_intersect( $customer_roles, $exclude_roles ) ) {
50
  unset( $_available_gateways[ $key ] );
51
  continue;
52
  }
includes/class-wcj-price-by-user-role.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce - Module - Price based on User Role
4
  *
5
- * @version 4.7.0
6
  * @since 2.5.0
7
  * @author Algoritmika Ltd.
8
  * @todo Fix "Make Empty Price" option for variable products
@@ -248,7 +248,7 @@ class WCJ_Price_By_User_Role extends WCJ_Module {
248
  /**
249
  * change_price.
250
  *
251
- * @version 3.6.0
252
  * @since 2.5.0
253
  * @todo (maybe) add "enable compound multipliers" option
254
  * @todo (maybe) check for `( '' === $price )` only once, at the beginning of the function (instead of comparing before each `return`)
@@ -348,12 +348,18 @@ class WCJ_Price_By_User_Role extends WCJ_Module {
348
  if ( ! empty( $product_categories ) ) {
349
  foreach ( $product_categories as $product_category ) {
350
  foreach ( $categories as $category ) {
351
- if ( $product_category->term_id == $category ) {
 
 
 
 
 
 
352
  if ( 'yes' === get_option( 'wcj_price_by_user_role_cat_empty_price_' . $category . '_' . $current_user_role, 'no' ) ) {
353
  return '';
354
  }
355
  if ( ( $koef_category = get_option( 'wcj_price_by_user_role_cat_' . $category . '_' . $current_user_role, -1 ) ) >= 0 ) {
356
- return ( '' === $price ) ? $price : $price * $koef_category;
357
  }
358
  }
359
  }
@@ -373,7 +379,7 @@ class WCJ_Price_By_User_Role extends WCJ_Module {
373
  return '';
374
  }
375
  if ( ( $koef_tag = get_option( 'wcj_price_by_user_role_tag_' . $tag . '_' . $current_user_role, -1 ) ) >= 0 ) {
376
- return ( '' === $price ) ? $price : $price * $koef_tag;
377
  }
378
  }
379
  }
@@ -386,7 +392,7 @@ class WCJ_Price_By_User_Role extends WCJ_Module {
386
  return '';
387
  }
388
  if ( 1 != ( $koef = get_option( 'wcj_price_by_user_role_' . $current_user_role, 1 ) ) ) {
389
- return ( '' === $price ) ? $price : $price * $koef;
390
  }
391
 
392
  // No changes
2
  /**
3
  * Booster for WooCommerce - Module - Price based on User Role
4
  *
5
+ * @version 4.7.1
6
  * @since 2.5.0
7
  * @author Algoritmika Ltd.
8
  * @todo Fix "Make Empty Price" option for variable products
248
  /**
249
  * change_price.
250
  *
251
+ * @version 4.7.1
252
  * @since 2.5.0
253
  * @todo (maybe) add "enable compound multipliers" option
254
  * @todo (maybe) check for `( '' === $price )` only once, at the beginning of the function (instead of comparing before each `return`)
348
  if ( ! empty( $product_categories ) ) {
349
  foreach ( $product_categories as $product_category ) {
350
  foreach ( $categories as $category ) {
351
+ if (
352
+ $product_category->term_id == $category ||
353
+ (
354
+ 'yes' === get_option( 'wcj_price_by_user_role_check_child_categories', 'no' ) &&
355
+ term_is_ancestor_of( $category, $product_category->term_id, 'product_cat' )
356
+ )
357
+ ) {
358
  if ( 'yes' === get_option( 'wcj_price_by_user_role_cat_empty_price_' . $category . '_' . $current_user_role, 'no' ) ) {
359
  return '';
360
  }
361
  if ( ( $koef_category = get_option( 'wcj_price_by_user_role_cat_' . $category . '_' . $current_user_role, -1 ) ) >= 0 ) {
362
+ return ( '' === $price ) ? $price : $price * (float) $koef_category;
363
  }
364
  }
365
  }
379
  return '';
380
  }
381
  if ( ( $koef_tag = get_option( 'wcj_price_by_user_role_tag_' . $tag . '_' . $current_user_role, -1 ) ) >= 0 ) {
382
+ return ( '' === $price ) ? $price : $price * (float) $koef_tag;
383
  }
384
  }
385
  }
392
  return '';
393
  }
394
  if ( 1 != ( $koef = get_option( 'wcj_price_by_user_role_' . $current_user_role, 1 ) ) ) {
395
+ return ( '' === $price ) ? $price : $price * (float) $koef;
396
  }
397
 
398
  // No changes
includes/class-wcj-shipping.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce - Module - Custom Shipping
4
  *
5
- * @version 4.7.0
6
  * @author Algoritmika Ltd.
7
  */
8
 
@@ -76,11 +76,14 @@ if ( ! class_exists( 'WCJ_Shipping' ) ) :
76
  /*
77
  * add_wc_shipping_wcj_custom_w_zones_class.
78
  *
79
- * @version 2.5.6
80
  * @since 2.5.6
81
  */
82
  function add_wc_shipping_wcj_custom_w_zones_class( $methods ) {
83
- $methods[ 'booster_custom_shipping_w_zones' ] = 'WC_Shipping_WCJ_Custom_W_Zones';
 
 
 
84
  return $methods;
85
  }
86
 
2
  /**
3
  * Booster for WooCommerce - Module - Custom Shipping
4
  *
5
+ * @version 4.7.1
6
  * @author Algoritmika Ltd.
7
  */
8
 
76
  /*
77
  * add_wc_shipping_wcj_custom_w_zones_class.
78
  *
79
+ * @version 4.7.1
80
  * @since 2.5.6
81
  */
82
  function add_wc_shipping_wcj_custom_w_zones_class( $methods ) {
83
+ if ( ! class_exists( 'WC_Shipping_WCJ_Custom_W_Zones' ) ) {
84
+ $this->init_shipping_zones_class();
85
+ }
86
+ $methods['booster_custom_shipping_w_zones'] = 'WC_Shipping_WCJ_Custom_W_Zones';
87
  return $methods;
88
  }
89
 
includes/class-wcj-template-editor.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce - Module - Template Editor
4
  *
5
- * @version 4.0.0
6
  * @since 3.9.0
7
  * @author Algoritmika Ltd.
8
  */
@@ -73,22 +73,57 @@ class WCJ_Template_Editor extends WCJ_Module {
73
  return $located;
74
  }
75
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
76
  /**
77
  * scan_templates.
78
  *
79
- * @version 3.9.0
80
  * @since 3.9.0
81
  * @todo [dev] (maybe) optimize
82
  */
83
- function scan_templates( $dir, &$results = array() ) {
84
  $files = scandir( $dir );
85
- foreach( $files as $key => $value ) {
86
  $path = realpath( $dir . DIRECTORY_SEPARATOR . $value );
87
- if( ! is_dir( $path ) ) {
88
- $template = str_replace( $this->templates_path, '', str_replace( '\\', '/', $path ) );
89
  $results[ $template ] = $template;
90
  } elseif ( '.' != $value && '..' != $value ) {
91
- $this->scan_templates( $path, $results );
92
  }
93
  }
94
  return $results;
2
  /**
3
  * Booster for WooCommerce - Module - Template Editor
4
  *
5
+ * @version 4.7.1
6
  * @since 3.9.0
7
  * @author Algoritmika Ltd.
8
  */
73
  return $located;
74
  }
75
 
76
+ /**
77
+ * Gets path by template.
78
+ *
79
+ * @version 4.7.1
80
+ * @since 4.7.1
81
+ *
82
+ * @param $template
83
+ *
84
+ * @return int|string
85
+ */
86
+ function get_path_by_template( $template ) {
87
+ $templates_by_path = get_option( 'wcj_template_editor_templates_by_path', array() );
88
+ foreach ( $templates_by_path as $path => $templates ) {
89
+ if ( in_array( $template, $templates ) ) {
90
+ return $path;
91
+ }
92
+ }
93
+ return '';
94
+ }
95
+
96
+ /**
97
+ * Gets paths from 'wcj_template_editor_paths' option
98
+ *
99
+ * @version 4.7.1
100
+ * @since 4.7.1
101
+ *
102
+ * @return array
103
+ */
104
+ function get_paths() {
105
+ $paths_arr = explode( "\n", str_replace( "\r", "", get_option( 'wcj_template_editor_paths', '/woocommerce/templates/' ) ) );
106
+ return array_map( function ( $path ) {
107
+ return trailingslashit( str_replace( '\\', '/', WP_PLUGIN_DIR . $path ) );
108
+ }, $paths_arr );
109
+ }
110
+
111
  /**
112
  * scan_templates.
113
  *
114
+ * @version 4.7.1
115
  * @since 3.9.0
116
  * @todo [dev] (maybe) optimize
117
  */
118
+ function scan_templates( $dir, $original_path, &$results = array() ) {
119
  $files = scandir( $dir );
120
+ foreach ( $files as $key => $value ) {
121
  $path = realpath( $dir . DIRECTORY_SEPARATOR . $value );
122
+ if ( ! is_dir( $path ) ) {
123
+ $template = str_replace( $original_path, '', str_replace( '\\', '/', $path ) );
124
  $results[ $template ] = $template;
125
  } elseif ( '.' != $value && '..' != $value ) {
126
+ $this->scan_templates( $path, $original_path, $results );
127
  }
128
  }
129
  return $results;
includes/class-wcj-wholesale-price.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce - Module - Wholesale Price
4
  *
5
- * @version 4.1.0
6
  * @since 2.2.0
7
  * @author Algoritmika Ltd.
8
  * @todo per variation
@@ -142,7 +142,7 @@ class WCJ_Wholesale_Price extends WCJ_Module {
142
  /**
143
  * get_discount_by_quantity.
144
  *
145
- * @version 2.5.5
146
  */
147
  private function get_discount_by_quantity( $quantity, $product_id ) {
148
 
@@ -160,7 +160,7 @@ class WCJ_Wholesale_Price extends WCJ_Module {
160
  }
161
 
162
  // Get discount
163
- $max_qty_level = 1;
164
  $discount = 0;
165
  if ( wcj_is_product_wholesale_enabled_per_product( $product_id ) ) {
166
  for ( $i = 1; $i <= apply_filters( 'booster_option', 1, get_post_meta( $product_id, '_' . 'wcj_wholesale_price_levels_number' . $role_option_name_addon, true ) ); $i++ ) {
2
  /**
3
  * Booster for WooCommerce - Module - Wholesale Price
4
  *
5
+ * @version 4.7.1
6
  * @since 2.2.0
7
  * @author Algoritmika Ltd.
8
  * @todo per variation
142
  /**
143
  * get_discount_by_quantity.
144
  *
145
+ * @version 4.7.1
146
  */
147
  private function get_discount_by_quantity( $quantity, $product_id ) {
148
 
160
  }
161
 
162
  // Get discount
163
+ $max_qty_level = get_option( 'wcj_wholesale_price_max_qty_level', 1 );
164
  $discount = 0;
165
  if ( wcj_is_product_wholesale_enabled_per_product( $product_id ) ) {
166
  for ( $i = 1; $i <= apply_filters( 'booster_option', 1, get_post_meta( $product_id, '_' . 'wcj_wholesale_price_levels_number' . $role_option_name_addon, true ) ); $i++ ) {
includes/classes/class-wcj-module-product-by-condition.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce - Module - Product by Condition
4
  *
5
- * @version 4.7.0
6
  * @since 3.6.0
7
  * @author Algoritmika Ltd.
8
  */
@@ -16,7 +16,7 @@ abstract class WCJ_Module_Product_By_Condition extends WCJ_Module {
16
  /**
17
  * Constructor.
18
  *
19
- * @version 4.7.0
20
  * @since 3.6.0
21
  */
22
  function __construct( $type = 'module' ) {
@@ -64,9 +64,132 @@ abstract class WCJ_Module_Product_By_Condition extends WCJ_Module {
64
 
65
  // Disable pre_get_posts query when exporting products
66
  add_filter( 'wcj_product_by_condition_pre_get_posts_validation', array( $this, 'disable_pre_get_posts_on_export' ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
67
  }
68
  }
69
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
70
  /**
71
  * Disables pre_get_posts query when exporting products.
72
  *
@@ -202,6 +325,7 @@ abstract class WCJ_Module_Product_By_Condition extends WCJ_Module {
202
  update_post_meta( $post_id, '_' . 'wcj_' . $this->id . '_invisible', $_REQUEST[ 'wcj_' . $this->id . '_invisible' ] );
203
  }
204
  }
 
205
  return $post_id;
206
  }
207
 
@@ -233,7 +357,7 @@ abstract class WCJ_Module_Product_By_Condition extends WCJ_Module {
233
  /**
234
  * pre_get_posts.
235
  *
236
- * @version 4.7.0
237
  * @since 3.6.0
238
  * @todo [dev] maybe move `if ( ! function_exists( 'is_user_logged_in' ) ) {`
239
  */
@@ -248,40 +372,10 @@ abstract class WCJ_Module_Product_By_Condition extends WCJ_Module {
248
  require_once( ABSPATH . 'wp-includes/pluggable.php' );
249
  }
250
  remove_action( 'pre_get_posts', array( $this, 'pre_get_posts' ) );
251
- $option_to_check = $this->get_check_option();
252
- $post__not_in = $query->get( 'post__not_in' );
253
- $meta_query = array();
254
- if ( 'invisible' != apply_filters( 'booster_option', 'visible', get_option( 'wcj_' . $this->id . '_visibility_method', 'visible' ) ) ) {
255
- $meta_query[] = array(
256
- 'key' => '_' . 'wcj_' . $this->id . '_visible',
257
- 'value' => '',
258
- 'compare' => '!=',
259
- );
260
- }
261
- if ( 'visible' != apply_filters( 'booster_option', 'visible', get_option( 'wcj_' . $this->id . '_visibility_method', 'visible' ) ) ) {
262
- $meta_query[] = array(
263
- 'key' => '_' . 'wcj_' . $this->id . '_invisible',
264
- 'value' => '',
265
- 'compare' => '!=',
266
- );
267
- }
268
- if ( count( $meta_query ) > 1 ) {
269
- $meta_query['relation'] = 'OR';
270
- }
271
- $args = array(
272
- 'post_type' => 'product',
273
- 'posts_per_page' => -1,
274
- 'fields' => 'ids',
275
- 'meta_query' => $meta_query,
276
- 'post__not_in' => $post__not_in,
277
- );
278
- $loop = new WP_Query( $args );
279
- foreach ( $loop->posts as $product_id ) {
280
- if ( ! $this->is_product_visible( $product_id, $option_to_check ) ) {
281
- $post__not_in[] = $product_id;
282
- }
283
- }
284
- $query->set( 'post__not_in', $post__not_in );
285
  add_action( 'pre_get_posts', array( $this, 'pre_get_posts' ) );
286
  }
287
 
2
  /**
3
  * Booster for WooCommerce - Module - Product by Condition
4
  *
5
+ * @version 4.7.1
6
  * @since 3.6.0
7
  * @author Algoritmika Ltd.
8
  */
16
  /**
17
  * Constructor.
18
  *
19
+ * @version 4.7.1
20
  * @since 3.6.0
21
  */
22
  function __construct( $type = 'module' ) {
64
 
65
  // Disable pre_get_posts query when exporting products
66
  add_filter( 'wcj_product_by_condition_pre_get_posts_validation', array( $this, 'disable_pre_get_posts_on_export' ) );
67
+
68
+ // Regenerate invisible products transient
69
+ add_action( 'save_meta_box_' . $this->id, array( $this, 'regenerate_invisible_products_transient' ) );
70
+ add_action( 'save_bulk_and_quick_edit_fields_' . $this->id, array( $this, 'regenerate_invisible_products_transient' ) );
71
+ }
72
+ }
73
+
74
+ /**
75
+ * get_invisible_products_ids.
76
+ *
77
+ * @version 4.7.1
78
+ * @since 4.7.1
79
+ *
80
+ * @param null $params
81
+ *
82
+ * @return array
83
+ */
84
+ function get_invisible_products_ids( $params = null ) {
85
+ $params = wp_parse_args( $params, array(
86
+ 'option_to_check' => $this->get_check_option(),
87
+ 'invisible_products_query_args' => $this->get_invisible_products_query_args()
88
+ ) );
89
+ $option_to_check = $params['option_to_check'];
90
+ $args = $params['invisible_products_query_args'];
91
+ $transient_name = 'wcj_' . $this->id . '_' . md5( serialize( $args ) . '_' . serialize( $option_to_check ) );
92
+ $invisible_products = get_transient( $transient_name );
93
+ if ( false === $invisible_products ) {
94
+ $invisible_products = array();
95
+ $loop = new WP_Query( $args );
96
+ foreach ( $loop->posts as $product_id ) {
97
+ if ( ! $this->is_product_visible( $product_id, $option_to_check ) ) {
98
+ $invisible_products[] = $product_id;
99
+ }
100
+ }
101
+ set_transient( $transient_name, $invisible_products, YEAR_IN_SECONDS );
102
+ }
103
+ return $invisible_products;
104
+ }
105
+
106
+ /**
107
+ * get_invisible_products_query_args.
108
+ *
109
+ * @version 4.7.1
110
+ * @since 4.7.1
111
+ *
112
+ * @return array
113
+ */
114
+ function get_invisible_products_query_args() {
115
+ $meta_query = array();
116
+ if ( 'invisible' != apply_filters( 'booster_option', 'visible', get_option( 'wcj_' . $this->id . '_visibility_method', 'visible' ) ) ) {
117
+ $meta_query[] = array(
118
+ 'key' => '_' . 'wcj_' . $this->id . '_visible',
119
+ 'value' => '',
120
+ 'compare' => '!=',
121
+ );
122
+ }
123
+ if ( 'visible' != apply_filters( 'booster_option', 'visible', get_option( 'wcj_' . $this->id . '_visibility_method', 'visible' ) ) ) {
124
+ $meta_query[] = array(
125
+ 'key' => '_' . 'wcj_' . $this->id . '_invisible',
126
+ 'value' => '',
127
+ 'compare' => '!=',
128
+ );
129
+ }
130
+ if ( count( $meta_query ) > 1 ) {
131
+ $meta_query['relation'] = 'OR';
132
+ }
133
+ $args = array(
134
+ 'post_type' => 'product',
135
+ 'posts_per_page' => - 1,
136
+ 'fields' => 'ids',
137
+ 'meta_query' => $meta_query,
138
+ );
139
+ return $args;
140
+ }
141
+
142
+ /**
143
+ * delete_invisible_products_transient.
144
+ *
145
+ * @version 4.7.1
146
+ * @since 4.7.1
147
+ *
148
+ * @param null $params
149
+ */
150
+ function delete_invisible_products_transient( $params = null ) {
151
+ $params = wp_parse_args( $params, array(
152
+ 'remove_method' => 'all_roles', // current_user_roles | all_roles
153
+ 'option_to_check' => $this->get_check_option(),
154
+ 'invisible_products_query_args' => $this->get_invisible_products_query_args()
155
+ ) );
156
+ if ( 'current_user_roles' === $params['remove_method'] ) {
157
+ $option_to_check = $params['option_to_check'];
158
+ $args = $params['invisible_products_query_args'];
159
+ $transient_name = 'wcj_' . $this->id . '_' . md5( serialize( $args ) . '_' . serialize( $option_to_check ) );
160
+ delete_transient( $transient_name );
161
+ } elseif ( 'all_roles' === $params['remove_method'] ) {
162
+ global $wpdb;
163
+ $sql = "delete from wp_options where option_name REGEXP %s";
164
+ $wpdb->query( $wpdb->prepare( $sql, '^_transient_' . 'wcj_' . $this->id ) );
165
  }
166
  }
167
 
168
+ /**
169
+ * regenerate_invisible_products_transient.
170
+ *
171
+ * @version 4.7.1
172
+ * @since 4.7.1
173
+ */
174
+ function regenerate_invisible_products_transient() {
175
+ $this->delete_invisible_products_transient();
176
+ $this->get_invisible_products_ids();
177
+ }
178
+
179
+ /**
180
+ * save_meta_box.
181
+ *
182
+ * @version 4.7.1
183
+ * @since 4.7.1
184
+ *
185
+ * @param $post_id
186
+ * @param $__post
187
+ */
188
+ function save_meta_box( $post_id, $__post ) {
189
+ parent::save_meta_box( $post_id, $__post );
190
+ do_action( 'save_meta_box_' . $this->id, $post_id, $__post );
191
+ }
192
+
193
  /**
194
  * Disables pre_get_posts query when exporting products.
195
  *
325
  update_post_meta( $post_id, '_' . 'wcj_' . $this->id . '_invisible', $_REQUEST[ 'wcj_' . $this->id . '_invisible' ] );
326
  }
327
  }
328
+ do_action( 'save_bulk_and_quick_edit_fields_' . $this->id, $post_id, $post );
329
  return $post_id;
330
  }
331
 
357
  /**
358
  * pre_get_posts.
359
  *
360
+ * @version 4.7.1
361
  * @since 3.6.0
362
  * @todo [dev] maybe move `if ( ! function_exists( 'is_user_logged_in' ) ) {`
363
  */
372
  require_once( ABSPATH . 'wp-includes/pluggable.php' );
373
  }
374
  remove_action( 'pre_get_posts', array( $this, 'pre_get_posts' ) );
375
+ $invisible_products = $this->get_invisible_products_ids();
376
+ $post__not_in = $query->get( 'post__not_in' );
377
+ $post__not_in = empty( $post__not_in ) ? array() : $post__not_in;
378
+ $query->set( 'post__not_in', array_unique( array_merge( $post__not_in, $invisible_products ) ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
379
  add_action( 'pre_get_posts', array( $this, 'pre_get_posts' ) );
380
  }
381
 
includes/classes/class-wcj-pdf-invoice.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce PDF Invoice
4
  *
5
- * @version 4.7.0
6
  * @author Algoritmika Ltd.
7
  */
8
 
@@ -24,7 +24,7 @@ class WCJ_PDF_Invoice extends WCJ_Invoice {
24
  /**
25
  * prepare_pdf.
26
  *
27
- * @version 4.2.0
28
  * @todo [dev] check `addTTFfont()`
29
  * @todo [dev] maybe `$pdf->SetAuthor( 'Booster for WooCommerce' )`
30
  * @todo [dev] maybe `$pdf->setLanguageArray( $l )`
@@ -144,8 +144,10 @@ class WCJ_PDF_Invoice extends WCJ_Invoice {
144
 
145
  // Background image
146
  if ( '' != ( $background_image = do_shortcode( get_option( 'wcj_invoicing_' . $invoice_type . '_background_image', '' ) ) ) ) {
147
- $background_image = parse_url( $background_image, PHP_URL_PATH );
148
- if ( file_exists( K_PATH_IMAGES . $background_image ) ) {
 
 
149
  $pdf->Image( $background_image, 0, 0, $pdf->getPageWidth(), $pdf->getPageHeight() );
150
  }
151
  }
2
  /**
3
  * Booster for WooCommerce PDF Invoice
4
  *
5
+ * @version 4.7.1
6
  * @author Algoritmika Ltd.
7
  */
8
 
24
  /**
25
  * prepare_pdf.
26
  *
27
+ * @version 4.7.1
28
  * @todo [dev] check `addTTFfont()`
29
  * @todo [dev] maybe `$pdf->SetAuthor( 'Booster for WooCommerce' )`
30
  * @todo [dev] maybe `$pdf->setLanguageArray( $l )`
144
 
145
  // Background image
146
  if ( '' != ( $background_image = do_shortcode( get_option( 'wcj_invoicing_' . $invoice_type . '_background_image', '' ) ) ) ) {
147
+ $background_image = 'yes' === ( $parse_bkg_image = get_option( 'wcj_invoicing_' . $invoice_type . '_background_image_parse', 'yes' ) ) ? parse_url( $background_image, PHP_URL_PATH ) : $background_image;
148
+ if ( 'yes' === $parse_bkg_image && file_exists( K_PATH_IMAGES . $background_image ) ) {
149
+ $pdf->Image( $background_image, 0, 0, $pdf->getPageWidth(), $pdf->getPageHeight() );
150
+ } elseif ( 'no' === $parse_bkg_image ) {
151
  $pdf->Image( $background_image, 0, 0, $pdf->getPageWidth(), $pdf->getPageHeight() );
152
  }
153
  }
includes/classes/class-wcj-shortcodes.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce - Shortcodes
4
  *
5
- * @version 4.4.0
6
  * @author Algoritmika Ltd.
7
  */
8
 
@@ -13,6 +13,8 @@ if ( ! class_exists( 'WCJ_Shortcodes' ) ) :
13
  class WCJ_Shortcodes {
14
 
15
  /**
 
 
16
  * Constructor.
17
  */
18
  function __construct() {
@@ -22,6 +24,22 @@ class WCJ_Shortcodes {
22
  }
23
 
24
  add_filter( 'wcj_shortcodes_list', array( $this, 'add_shortcodes_to_the_list' ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
  }
26
 
27
  /**
@@ -284,6 +302,8 @@ class WCJ_Shortcodes {
284
  return $atts['on_empty'];
285
  }
286
 
 
 
287
  /**
288
  * extra_check.
289
  *
2
  /**
3
  * Booster for WooCommerce - Shortcodes
4
  *
5
+ * @version 4.7.1
6
  * @author Algoritmika Ltd.
7
  */
8
 
13
  class WCJ_Shortcodes {
14
 
15
  /**
16
+ * @version 4.7.1
17
+ *
18
  * Constructor.
19
  */
20
  function __construct() {
24
  }
25
 
26
  add_filter( 'wcj_shortcodes_list', array( $this, 'add_shortcodes_to_the_list' ) );
27
+ add_filter( 'wcj_shortcode_result', array( $this, 'add_result_key_param_to_shortcode_result' ), 10, 4 );
28
+ }
29
+
30
+ /**
31
+ * add_result_key_param_to_shortcode_result.
32
+ *
33
+ * @version 4.7.1
34
+ * @since 4.7.1
35
+ *
36
+ * @return mixed
37
+ */
38
+ function add_result_key_param_to_shortcode_result( $result, $atts, $content, $shortcode ) {
39
+ if ( is_array( $result ) && isset( $atts['result_key'] ) && ! empty( $atts['result_key'] ) ) {
40
+ $result = $result[ $atts['result_key'] ];
41
+ }
42
+ return $result;
43
  }
44
 
45
  /**
302
  return $atts['on_empty'];
303
  }
304
 
305
+
306
+
307
  /**
308
  * extra_check.
309
  *
includes/gateways/class-wc-gateway-wcj-custom.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce - Custom Payment Gateway
4
  *
5
- * @version 4.7.0
6
  * @author Algoritmika Ltd.
7
  */
8
 
@@ -270,9 +270,13 @@ if ( ! function_exists( 'init_wc_gateway_wcj_custom_class' ) ) {
270
 
271
  /**
272
  * Output for the order received page.
 
 
 
273
  */
274
- function thankyou_page() {
275
  if ( $this->instructions ) {
 
276
  echo do_shortcode( wpautop( wptexturize( $this->instructions ) ) );
277
  }
278
  }
2
  /**
3
  * Booster for WooCommerce - Custom Payment Gateway
4
  *
5
+ * @version 4.7.1
6
  * @author Algoritmika Ltd.
7
  */
8
 
270
 
271
  /**
272
  * Output for the order received page.
273
+ *
274
+ * @version 4.7.1
275
+ *
276
  */
277
+ function thankyou_page( $order_id ) {
278
  if ( $this->instructions ) {
279
+ $this->instructions = str_replace( '[wcj_order_meta', '[wcj_order_meta order_id="' . $order_id . '" ', $this->instructions );
280
  echo do_shortcode( wpautop( wptexturize( $this->instructions ) ) );
281
  }
282
  }
includes/settings/meta-box/wcj-settings-meta-box-product-addons.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce - Settings Meta Box - Product Addons
4
  *
5
- * @version 4.6.1
6
  * @since 2.8.0
7
  * @author Algoritmika Ltd.
8
  */
@@ -151,8 +151,8 @@ for ( $i = 1; $i <= $total_number; $i++ ) {
151
  'default' => 'no',
152
  'type' => 'select',
153
  'options' => array(
154
- 'yes' => __( 'Yes', 'woocommerce-jetpack' ),
155
  'no' => __( 'No', 'woocommerce-jetpack' ),
 
156
  ),
157
  ),
158
  array(
2
  /**
3
  * Booster for WooCommerce - Settings Meta Box - Product Addons
4
  *
5
+ * @version 4.7.1
6
  * @since 2.8.0
7
  * @author Algoritmika Ltd.
8
  */
151
  'default' => 'no',
152
  'type' => 'select',
153
  'options' => array(
 
154
  'no' => __( 'No', 'woocommerce-jetpack' ),
155
+ 'yes' => __( 'Yes', 'woocommerce-jetpack' ),
156
  ),
157
  ),
158
  array(
includes/settings/wcj-settings-payment-gateways-by-user-role.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce - Settings - Gateways by User Role
4
  *
5
- * @version 2.8.0
6
  * @since 2.8.0
7
  * @author Algoritmika Ltd.
8
  */
@@ -10,6 +10,24 @@
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
11
 
12
  $settings = array(
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  array(
14
  'title' => __( 'Payment Gateways', 'woocommerce-jetpack' ),
15
  'type' => 'title',
2
  /**
3
  * Booster for WooCommerce - Settings - Gateways by User Role
4
  *
5
+ * @version 4.7.1
6
  * @since 2.8.0
7
  * @author Algoritmika Ltd.
8
  */
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
11
 
12
  $settings = array(
13
+ array(
14
+ 'title' => __( 'General Options', 'woocommerce-jetpack' ),
15
+ 'type' => 'title',
16
+ 'id' => 'wcj_payment_gateways_by_user_role_general_options',
17
+ ),
18
+ array(
19
+ 'title' => __( 'Multiple Role Checking', 'woocommerce-jetpack' ),
20
+ 'type' => 'checkbox',
21
+ 'default' => 'no',
22
+ 'desc_tip' => __( 'Enable if you have some plugin that allows users with multiple roles like "User Role Editor".', 'woocommerce-jetpack' ),
23
+ 'desc' => empty( $message = apply_filters( 'booster_message', '', 'desc' ) ) ? __( 'Enable', 'woocommerce-jetpack' ) : $message,
24
+ 'custom_attributes' => apply_filters( 'booster_message', '', 'disabled' ),
25
+ 'id' => 'wcj_payment_gateways_by_user_role_multi_role_check',
26
+ ),
27
+ array(
28
+ 'type' => 'sectionend',
29
+ 'id' => 'wcj_payment_gateways_by_user_role_general_options',
30
+ ),
31
  array(
32
  'title' => __( 'Payment Gateways', 'woocommerce-jetpack' ),
33
  'type' => 'title',
includes/settings/wcj-settings-pdf-invoicing-page.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce - Settings - PDF Invoicing - Page Settings
4
  *
5
- * @version 4.2.0
6
  * @since 2.8.0
7
  * @author Algoritmika Ltd.
8
  */
@@ -88,6 +88,14 @@ foreach ( $invoice_types as $invoice_type ) {
88
  'desc_tip' => __( 'Leave blank to disable', 'woocommerce-jetpack' ),
89
  'class' => 'widefat',
90
  ),
 
 
 
 
 
 
 
 
91
  array(
92
  'type' => 'sectionend',
93
  'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_page_options',
2
  /**
3
  * Booster for WooCommerce - Settings - PDF Invoicing - Page Settings
4
  *
5
+ * @version 4.7.1
6
  * @since 2.8.0
7
  * @author Algoritmika Ltd.
8
  */
88
  'desc_tip' => __( 'Leave blank to disable', 'woocommerce-jetpack' ),
89
  'class' => 'widefat',
90
  ),
91
+ array(
92
+ 'title' => __( 'Parse Background Image URL', 'woocommerce-jetpack' ),
93
+ 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_background_image_parse',
94
+ 'default' => 'yes',
95
+ 'type' => 'checkbox',
96
+ 'desc' => __( 'Enable', 'woocommerce-jetpack' ),
97
+ 'desc_tip' => __( 'Converts the Background Image URL to its local path.', 'woocommerce-jetpack' ) . '<br>' .__( 'If you are experiencing issues with displaying background image, please try to disable this option', 'woocommerce-jetpack' ),
98
+ ),
99
  array(
100
  'type' => 'sectionend',
101
  'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_page_options',
includes/settings/wcj-settings-price-by-user-role.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce - Settings - Price based on User Role
4
  *
5
- * @version 4.7.0
6
  * @since 2.8.0
7
  * @author Algoritmika Ltd.
8
  */
@@ -88,6 +88,15 @@ $settings = array(
88
  'default' => 'no',
89
  'type' => 'checkbox',
90
  ),
 
 
 
 
 
 
 
 
 
91
  array(
92
  'type' => 'sectionend',
93
  'id' => 'wcj_price_by_user_role_options',
2
  /**
3
  * Booster for WooCommerce - Settings - Price based on User Role
4
  *
5
+ * @version 4.7.1
6
  * @since 2.8.0
7
  * @author Algoritmika Ltd.
8
  */
88
  'default' => 'no',
89
  'type' => 'checkbox',
90
  ),
91
+ array(
92
+ 'title' => __( 'Check Child Categories', 'woocommerce-jetpack' ),
93
+ 'desc' => empty( $message = apply_filters( 'booster_message', '', 'desc' ) ) ? __( 'Enable', 'woocommerce-jetpack' ) : $message,
94
+ 'desc_tip' => __( 'Enable to also consider the child categories.', 'woocommerce-jetpack' ),
95
+ 'custom_attributes' => apply_filters( 'booster_message', '', 'disabled' ),
96
+ 'id' => 'wcj_price_by_user_role_check_child_categories',
97
+ 'default' => 'no',
98
+ 'type' => 'checkbox',
99
+ ),
100
  array(
101
  'type' => 'sectionend',
102
  'id' => 'wcj_price_by_user_role_options',
includes/settings/wcj-settings-template-editor.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce - Settings - Template Editor
4
  *
5
- * @version 4.0.0
6
  * @since 3.9.0
7
  * @author Algoritmika Ltd.
8
  * @todo [dev] (maybe) always use `DIRECTORY_SEPARATOR` (instead of '\\' and '/')
@@ -12,10 +12,34 @@
12
 
13
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
14
 
15
- $this->templates_path = str_replace( '\\', '/', WP_PLUGIN_DIR . '/woocommerce/templates/' );
16
- $templates = $this->scan_templates( $this->templates_path );
 
 
 
 
 
 
 
17
 
18
  $settings = array(
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  array(
20
  'title' => __( 'Templates', 'woocommerce-jetpack' ),
21
  'type' => 'title',
@@ -32,7 +56,7 @@ $settings = array(
32
  ),
33
  );
34
  foreach ( get_option( 'wcj_template_editor_templates_to_edit', array() ) as $template ) {
35
- $default_template_path = wc_locate_template( $template );
36
  $replaced_template_path = wcj_get_wcj_uploads_dir( 'templates', false ) . DIRECTORY_SEPARATOR . $template;
37
  $style = 'style="color:' . ( file_exists( $replaced_template_path ) ? 'green' : 'red' ) . ';"';
38
  $settings = array_merge( $settings, array(
2
  /**
3
  * Booster for WooCommerce - Settings - Template Editor
4
  *
5
+ * @version 4.7.1
6
  * @since 3.9.0
7
  * @author Algoritmika Ltd.
8
  * @todo [dev] (maybe) always use `DIRECTORY_SEPARATOR` (instead of '\\' and '/')
12
 
13
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
14
 
15
+ $new_paths = $this->get_paths();
16
+ $templates = array();
17
+ $templates_by_path = get_option( 'wcj_template_editor_templates_by_path', array() );
18
+ foreach ( $new_paths as $path ) {
19
+ $scanned_templates = $this->scan_templates( $path, $path );
20
+ $templates_by_path[ $path ] = $scanned_templates;
21
+ $templates = array_merge( $templates, $scanned_templates );
22
+ }
23
+ update_option( 'wcj_template_editor_templates_by_path', $templates_by_path );
24
 
25
  $settings = array(
26
+ array(
27
+ 'title' => __( 'General Options', 'woocommerce-jetpack' ),
28
+ 'type' => 'title',
29
+ 'id' => 'wcj_template_editor_options',
30
+ ),
31
+ array(
32
+ 'title' => __( 'Paths', 'woocommerce-jetpack' ),
33
+ 'type' => 'textarea',
34
+ 'default' => '/woocommerce/templates/',
35
+ 'css' => 'width:100%;',
36
+ 'id' => 'wcj_template_editor_paths',
37
+ 'desc_tip' => __( 'One path per line relative to: ' . WP_PLUGIN_DIR . '', 'woocommerce-jetpack' ),
38
+ ),
39
+ array(
40
+ 'type' => 'sectionend',
41
+ 'id' => 'wcj_template_editor_options',
42
+ ),
43
  array(
44
  'title' => __( 'Templates', 'woocommerce-jetpack' ),
45
  'type' => 'title',
56
  ),
57
  );
58
  foreach ( get_option( 'wcj_template_editor_templates_to_edit', array() ) as $template ) {
59
+ $default_template_path = wc_locate_template( $template, '', $this->get_path_by_template( $template ) );
60
  $replaced_template_path = wcj_get_wcj_uploads_dir( 'templates', false ) . DIRECTORY_SEPARATOR . $template;
61
  $style = 'style="color:' . ( file_exists( $replaced_template_path ) ? 'green' : 'red' ) . ';"';
62
  $settings = array_merge( $settings, array(
includes/settings/wcj-settings-wholesale-price.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce - Settings - Wholesale Price
4
  *
5
- * @version 4.7.0
6
  * @since 2.8.0
7
  * @author Algoritmika Ltd.
8
  */
@@ -148,6 +148,13 @@ $settings = array(
148
  array('step' => '1', 'min' => '1', ) ),
149
  'css' => 'width:100px;',
150
  ),
 
 
 
 
 
 
 
151
  );
152
  for ( $i = 1; $i <= apply_filters( 'booster_option', 1, get_option( 'wcj_wholesale_price_levels_number', 1 ) ); $i++ ) {
153
  $settings = array_merge( $settings, array(
2
  /**
3
  * Booster for WooCommerce - Settings - Wholesale Price
4
  *
5
+ * @version 4.7.1
6
  * @since 2.8.0
7
  * @author Algoritmika Ltd.
8
  */
148
  array('step' => '1', 'min' => '1', ) ),
149
  'css' => 'width:100px;',
150
  ),
151
+ array(
152
+ 'title' => __( 'Default Max Qty Level', 'woocommerce-jetpack' ),
153
+ 'id' => 'wcj_wholesale_price_max_qty_level',
154
+ 'default' => 1,
155
+ 'type' => 'number',
156
+ 'css' => 'width:100px;',
157
+ ),
158
  );
159
  for ( $i = 1; $i <= apply_filters( 'booster_option', 1, get_option( 'wcj_wholesale_price_levels_number', 1 ) ); $i++ ) {
160
  $settings = array_merge( $settings, array(
langs/woocommerce-jetpack.pot CHANGED
@@ -418,7 +418,7 @@ msgstr ""
418
  #: includes/settings/wcj-settings-payment-gateways-by-country.php:55
419
  #: includes/settings/wcj-settings-payment-gateways-by-currency.php:14
420
  #: includes/settings/wcj-settings-payment-gateways-by-shipping.php:37
421
- #: includes/settings/wcj-settings-payment-gateways-by-user-role.php:14
422
  #: includes/settings/wcj-settings-payment-gateways-currency.php:15
423
  #: includes/settings/wcj-settings-payment-gateways-min-max.php:81
424
  #: includes/settings/wcj-settings-reports.php:118
@@ -1709,7 +1709,7 @@ msgstr ""
1709
  msgid "Validation failed. Please try again."
1710
  msgstr ""
1711
 
1712
- #: includes/class-wcj-eu-vat-number.php:505
1713
  #: includes/settings/wcj-settings-eu-vat-number.php:83
1714
  msgid "<strong>EU VAT Number</strong> is not valid."
1715
  msgstr ""
@@ -2610,11 +2610,11 @@ msgstr ""
2610
  msgid "Set \"enable for shipping methods\" for payment gateways."
2611
  msgstr ""
2612
 
2613
- #: includes/class-wcj-payment-gateways-by-user-role.php:25
2614
  msgid "Gateways by User Role"
2615
  msgstr ""
2616
 
2617
- #: includes/class-wcj-payment-gateways-by-user-role.php:26
2618
  msgid "Set user roles to include/exclude for payment gateways to show up."
2619
  msgstr ""
2620
 
@@ -2956,6 +2956,7 @@ msgstr ""
2956
  #: includes/settings/wcj-settings-orders.php:80
2957
  #: includes/settings/wcj-settings-orders.php:105
2958
  #: includes/settings/wcj-settings-payment-gateways-by-shipping.php:23
 
2959
  #: includes/settings/wcj-settings-payment-gateways-currency.php:95
2960
  #: includes/settings/wcj-settings-payment-gateways-fees.php:67
2961
  #: includes/settings/wcj-settings-payment-gateways-fees.php:83
@@ -2965,6 +2966,7 @@ msgstr ""
2965
  #: includes/settings/wcj-settings-pdf-invoicing-footer.php:23
2966
  #: includes/settings/wcj-settings-pdf-invoicing-header.php:24
2967
  #: includes/settings/wcj-settings-pdf-invoicing-numbering.php:23
 
2968
  #: includes/settings/wcj-settings-pdf-invoicing-styling.php:73
2969
  #: includes/settings/wcj-settings-price-by-country.php:70
2970
  #: includes/settings/wcj-settings-price-by-country.php:90
@@ -2973,6 +2975,7 @@ msgstr ""
2973
  #: includes/settings/wcj-settings-price-by-country.php:142
2974
  #: includes/settings/wcj-settings-price-by-user-role.php:19
2975
  #: includes/settings/wcj-settings-price-by-user-role.php:46
 
2976
  #: includes/settings/wcj-settings-price-formats.php:21
2977
  #: includes/settings/wcj-settings-price-labels.php:23
2978
  #: includes/settings/wcj-settings-product-add-to-cart.php:25
@@ -4048,7 +4051,7 @@ msgstr ""
4048
  #: includes/settings/meta-box/wcj-settings-meta-box-product-add-to-cart.php:43
4049
  #: includes/settings/meta-box/wcj-settings-meta-box-product-addons.php:19
4050
  #: includes/settings/meta-box/wcj-settings-meta-box-product-addons.php:79
4051
- #: includes/settings/meta-box/wcj-settings-meta-box-product-addons.php:155
4052
  #: includes/settings/meta-box/wcj-settings-meta-box-product-bookings.php:20
4053
  #: includes/settings/meta-box/wcj-settings-meta-box-product-images.php:35
4054
  #: includes/settings/meta-box/wcj-settings-meta-box-product-images.php:45
@@ -4078,7 +4081,7 @@ msgstr ""
4078
  #: includes/settings/meta-box/wcj-settings-meta-box-product-add-to-cart.php:42
4079
  #: includes/settings/meta-box/wcj-settings-meta-box-product-addons.php:18
4080
  #: includes/settings/meta-box/wcj-settings-meta-box-product-addons.php:78
4081
- #: includes/settings/meta-box/wcj-settings-meta-box-product-addons.php:154
4082
  #: includes/settings/meta-box/wcj-settings-meta-box-product-bookings.php:19
4083
  #: includes/settings/meta-box/wcj-settings-meta-box-product-images.php:34
4084
  #: includes/settings/meta-box/wcj-settings-meta-box-product-images.php:44
@@ -4515,7 +4518,7 @@ msgstr ""
4515
  #: includes/class-wcj-shipping-by-user-role.php:33
4516
  #: includes/settings/wcj-settings-multicurrency.php:261
4517
  #: includes/settings/wcj-settings-order-min-amount.php:104
4518
- #: includes/settings/wcj-settings-price-by-user-role.php:124
4519
  #, php-format
4520
  msgid ""
4521
  "Custom roles can be added via \"Add/Manage Custom Roles\" tool in Booster's "
@@ -4843,16 +4846,16 @@ msgstr ""
4843
  msgid "File wpml-config.xml successfully regenerated!"
4844
  msgstr ""
4845
 
4846
- #: includes/classes/class-wcj-module-product-by-condition.php:137
4847
  msgid "— No change —"
4848
  msgstr ""
4849
 
4850
- #: includes/classes/class-wcj-module-product-by-condition.php:144
4851
  #: includes/settings/meta-box/wcj-settings-meta-box-product-by-condition.php:29
4852
  msgid "Visible"
4853
  msgstr ""
4854
 
4855
- #: includes/classes/class-wcj-module-product-by-condition.php:153
4856
  #: includes/settings/meta-box/wcj-settings-meta-box-product-by-condition.php:41
4857
  msgid "Invisible"
4858
  msgstr ""
@@ -4942,13 +4945,13 @@ msgstr ""
4942
  msgid "Company Name"
4943
  msgstr ""
4944
 
4945
- #: includes/classes/class-wcj-pdf-invoice.php:259
4946
  #: includes/functions/wcj-functions-general.php:145
4947
  #: includes/pdf-invoices/class-wcj-pdf-invoicing-report-tool.php:245
4948
  msgid "Unexpected error"
4949
  msgstr ""
4950
 
4951
- #: includes/classes/class-wcj-shortcodes.php:109
4952
  #: includes/shortcodes/class-wcj-shortcodes-general.php:517
4953
  #, php-format
4954
  msgid "\"%s\" module is not enabled!"
@@ -7127,12 +7130,12 @@ msgstr ""
7127
  msgid "Optional. Leave blank to use default URL."
7128
  msgstr ""
7129
 
7130
- #: includes/gateways/class-wc-gateway-wcj-custom.php:346
7131
  #: includes/settings/wcj-settings-payment-gateways.php:38
7132
  msgid "Custom Gateway"
7133
  msgstr ""
7134
 
7135
- #: includes/gateways/class-wc-gateway-wcj-custom.php:347
7136
  msgid "Booster for WooCommerce: Custom Payment Gateway"
7137
  msgstr ""
7138
 
@@ -7616,7 +7619,7 @@ msgstr ""
7616
  #: includes/settings/wcj-settings-multicurrency.php:162
7617
  #: includes/settings/wcj-settings-order-min-amount.php:69
7618
  #: includes/settings/wcj-settings-price-by-country.php:160
7619
- #: includes/settings/wcj-settings-price-by-user-role.php:97
7620
  #: includes/settings/wcj-settings-product-addons.php:230
7621
  msgid "Advanced"
7622
  msgstr ""
@@ -7749,7 +7752,7 @@ msgid "Styling"
7749
  msgstr ""
7750
 
7751
  #: includes/pdf-invoices/submodules/class-wcj-pdf-invoicing-templates.php:23
7752
- #: includes/settings/wcj-settings-template-editor.php:20
7753
  msgid "Templates"
7754
  msgstr ""
7755
 
@@ -8300,8 +8303,8 @@ msgstr ""
8300
 
8301
  #: includes/settings/meta-box/wcj-settings-meta-box-multicurrency.php:63
8302
  #: includes/settings/meta-box/wcj-settings-meta-box-price-by-user-role.php:136
8303
- #: includes/settings/wcj-settings-price-by-user-role.php:146
8304
- #: includes/settings/wcj-settings-price-by-user-role.php:215
8305
  msgid "Make Empty Price"
8306
  msgstr ""
8307
 
@@ -8447,7 +8450,7 @@ msgstr ""
8447
  #: includes/settings/wcj-settings-pdf-invoicing-advanced.php:84
8448
  #: includes/settings/wcj-settings-pdf-invoicing-advanced.php:123
8449
  #: includes/settings/wcj-settings-price-by-user-role.php:55
8450
- #: includes/settings/wcj-settings-price-by-user-role.php:130
8451
  #: includes/settings/wcj-settings-product-add-to-cart.php:131
8452
  #: includes/settings/wcj-settings-product-open-pricing.php:95
8453
  #: includes/settings/wcj-settings-sku.php:325
@@ -8753,10 +8756,10 @@ msgstr ""
8753
 
8754
  #: includes/settings/meta-box/wcj-settings-meta-box-wholesale-price.php:72
8755
  #: includes/settings/meta-box/wcj-settings-meta-box-wholesale-price.php:108
8756
- #: includes/settings/wcj-settings-wholesale-price.php:163
8757
- #: includes/settings/wcj-settings-wholesale-price.php:164
8758
- #: includes/settings/wcj-settings-wholesale-price.php:220
8759
- #: includes/settings/wcj-settings-wholesale-price.php:221
8760
  msgid "Discount"
8761
  msgstr ""
8762
 
@@ -9265,7 +9268,7 @@ msgid "Default columns order"
9265
  msgstr ""
9266
 
9267
  #: includes/settings/wcj-settings-admin-products-list.php:27
9268
- #: includes/settings/wcj-settings-price-by-user-role.php:191
9269
  #: includes/settings/wcj-settings-shipping.php:51
9270
  msgid ""
9271
  "Save module's settings after changing this option to see new settings fields."
@@ -9529,6 +9532,7 @@ msgstr ""
9529
  #: includes/settings/wcj-settings-order-quantities.php:17
9530
  #: includes/settings/wcj-settings-payment-gateways-by-country.php:15
9531
  #: includes/settings/wcj-settings-payment-gateways-by-shipping.php:17
 
9532
  #: includes/settings/wcj-settings-payment-gateways-min-max.php:15
9533
  #: includes/settings/wcj-settings-payment-gateways-per-category.php:19
9534
  #: includes/settings/wcj-settings-price-formats.php:15
@@ -9537,6 +9541,7 @@ msgstr ""
9537
  #: includes/settings/wcj-settings-shipping-by-order-amount.php:15
9538
  #: includes/settings/wcj-settings-shipping-by-order-qty.php:15
9539
  #: includes/settings/wcj-settings-shipping-time.php:25
 
9540
  #: includes/settings/wcj-settings-wpml.php:22
9541
  msgid "General Options"
9542
  msgstr ""
@@ -11272,7 +11277,7 @@ msgid "Add Product Info to Item Name"
11272
  msgstr ""
11273
 
11274
  #: includes/settings/wcj-settings-email-options.php:26
11275
- #: includes/settings/wcj-settings-template-editor.php:43
11276
  #: includes/settings/wcj-settings-track-users.php:26
11277
  msgid "Info"
11278
  msgstr ""
@@ -12133,7 +12138,7 @@ msgstr ""
12133
  #: includes/settings/wcj-settings-multicurrency-base-price.php:76
12134
  #: includes/settings/wcj-settings-multicurrency.php:176
12135
  #: includes/settings/wcj-settings-price-by-country.php:165
12136
- #: includes/settings/wcj-settings-price-by-user-role.php:102
12137
  #: includes/settings/wcj-settings-product-addons.php:258
12138
  #: includes/settings/wcj-settings-product-price-by-formula.php:100
12139
  msgid "Price Filters Priority"
@@ -12143,7 +12148,7 @@ msgstr ""
12143
  #: includes/settings/wcj-settings-multicurrency-base-price.php:77
12144
  #: includes/settings/wcj-settings-multicurrency.php:177
12145
  #: includes/settings/wcj-settings-price-by-country.php:166
12146
- #: includes/settings/wcj-settings-price-by-user-role.php:103
12147
  #: includes/settings/wcj-settings-product-addons.php:259
12148
  #: includes/settings/wcj-settings-product-price-by-formula.php:101
12149
  #: includes/settings/wcj-settings-wholesale-price.php:124
@@ -12591,7 +12596,7 @@ msgid "Roles"
12591
  msgstr ""
12592
 
12593
  #: includes/settings/wcj-settings-multicurrency.php:267
12594
- #: includes/settings/wcj-settings-wholesale-price.php:185
12595
  msgid "Save settings after you change this option. Leave blank to disable."
12596
  msgstr ""
12597
 
@@ -13722,7 +13727,7 @@ msgid "Exclude Postcodes (one per line)"
13722
  msgstr ""
13723
 
13724
  #: includes/settings/wcj-settings-payment-gateways-by-currency.php:16
13725
- #: includes/settings/wcj-settings-payment-gateways-by-user-role.php:16
13726
  #: includes/settings/wcj-settings-shipping-by-condition.php:43
13727
  msgid "Leave empty to disable."
13728
  msgstr ""
@@ -13768,7 +13773,17 @@ msgid ""
13768
  "Leave blank to enable for all methods."
13769
  msgstr ""
13770
 
13771
- #: includes/settings/wcj-settings-payment-gateways-by-user-role.php:17
 
 
 
 
 
 
 
 
 
 
13772
  #: includes/settings/wcj-settings-product-by-user.php:79
13773
  #, php-format
13774
  msgid ""
@@ -13776,11 +13791,11 @@ msgid ""
13776
  "<a href=\"%s\">General</a> module"
13777
  msgstr ""
13778
 
13779
- #: includes/settings/wcj-settings-payment-gateways-by-user-role.php:40
13780
  msgid "Include User Roles"
13781
  msgstr ""
13782
 
13783
- #: includes/settings/wcj-settings-payment-gateways-by-user-role.php:51
13784
  msgid "Exclude User Roles"
13785
  msgstr ""
13786
 
@@ -14514,6 +14529,20 @@ msgid ""
14514
  "option in %s."
14515
  msgstr ""
14516
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14517
  #: includes/settings/wcj-settings-pdf-invoicing-styling.php:19
14518
  #: includes/settings/wcj-settings-pdf-invoicing-styling.php:37
14519
  msgid "Font Family"
@@ -14871,15 +14900,23 @@ msgid ""
14871
  "\"woocommerce_single_variation\" hook on \"empty price\" variations."
14872
  msgstr ""
14873
 
14874
- #: includes/settings/wcj-settings-price-by-user-role.php:109
 
 
 
 
 
 
 
 
14875
  msgid "Price Changes"
14876
  msgstr ""
14877
 
14878
- #: includes/settings/wcj-settings-price-by-user-role.php:110
14879
  msgid "Disable price based on user role for products with \"Price Changes\""
14880
  msgstr ""
14881
 
14882
- #: includes/settings/wcj-settings-price-by-user-role.php:111
14883
  #: includes/settings/wcj-settings-product-open-pricing.php:149
14884
  #: includes/settings/wcj-settings-wholesale-price.php:117
14885
  msgid ""
@@ -14887,28 +14924,28 @@ msgid ""
14887
  "other plugins."
14888
  msgstr ""
14889
 
14890
- #: includes/settings/wcj-settings-price-by-user-role.php:122
14891
  msgid "Roles & Multipliers"
14892
  msgstr ""
14893
 
14894
- #: includes/settings/wcj-settings-price-by-user-role.php:129
14895
  msgid "Disable Price based on User Role for Products on Sale"
14896
  msgstr ""
14897
 
14898
- #: includes/settings/wcj-settings-price-by-user-role.php:161
14899
  msgid "Products Categories"
14900
  msgstr ""
14901
 
14902
- #: includes/settings/wcj-settings-price-by-user-role.php:167
14903
  msgid "Products Tags"
14904
  msgstr ""
14905
 
14906
- #: includes/settings/wcj-settings-price-by-user-role.php:185
14907
  #, php-format
14908
  msgid "Price based on User Role by %s"
14909
  msgstr ""
14910
 
14911
- #: includes/settings/wcj-settings-price-by-user-role.php:208
14912
  msgid ""
14913
  "Multiplier is ignored if set to negative number (e.g.: -1). Global "
14914
  "multiplier will be used instead."
@@ -18356,19 +18393,27 @@ msgstr ""
18356
  msgid "Setup how taxes will be applied during cart and checkout."
18357
  msgstr ""
18358
 
18359
- #: includes/settings/wcj-settings-template-editor.php:25
 
 
 
 
 
 
 
 
18360
  msgid "Templates to Edit"
18361
  msgstr ""
18362
 
18363
- #: includes/settings/wcj-settings-template-editor.php:26
18364
  msgid "Save changes after you set this option to see new options fields."
18365
  msgstr ""
18366
 
18367
- #: includes/settings/wcj-settings-template-editor.php:45
18368
  msgid "Default template path"
18369
  msgstr ""
18370
 
18371
- #: includes/settings/wcj-settings-template-editor.php:46
18372
  msgid "Replaced template path"
18373
  msgstr ""
18374
 
@@ -18596,32 +18641,36 @@ msgid "Wholesale Levels Options"
18596
  msgstr ""
18597
 
18598
  #: includes/settings/wcj-settings-wholesale-price.php:141
18599
- #: includes/settings/wcj-settings-wholesale-price.php:198
18600
  msgid "Number of Levels"
18601
  msgstr ""
18602
 
18603
- #: includes/settings/wcj-settings-wholesale-price.php:155
18604
- #: includes/settings/wcj-settings-wholesale-price.php:212
 
 
 
 
18605
  msgid "Min Quantity"
18606
  msgstr ""
18607
 
18608
- #: includes/settings/wcj-settings-wholesale-price.php:156
18609
- #: includes/settings/wcj-settings-wholesale-price.php:213
18610
  msgid "Minimum quantity to apply discount"
18611
  msgstr ""
18612
 
18613
- #: includes/settings/wcj-settings-wholesale-price.php:178
18614
  msgid "Additional User Roles Options"
18615
  msgstr ""
18616
 
18617
- #: includes/settings/wcj-settings-wholesale-price.php:180
18618
  msgid ""
18619
  "If you want to set different wholesale pricing options for different user "
18620
  "roles, fill this section. Please note that you can also use Booster's "
18621
  "\"Price based on User Role\" module without filling this section."
18622
  msgstr ""
18623
 
18624
- #: includes/settings/wcj-settings-wholesale-price.php:184
18625
  msgid "User Roles Settings"
18626
  msgstr ""
18627
 
418
  #: includes/settings/wcj-settings-payment-gateways-by-country.php:55
419
  #: includes/settings/wcj-settings-payment-gateways-by-currency.php:14
420
  #: includes/settings/wcj-settings-payment-gateways-by-shipping.php:37
421
+ #: includes/settings/wcj-settings-payment-gateways-by-user-role.php:32
422
  #: includes/settings/wcj-settings-payment-gateways-currency.php:15
423
  #: includes/settings/wcj-settings-payment-gateways-min-max.php:81
424
  #: includes/settings/wcj-settings-reports.php:118
1709
  msgid "Validation failed. Please try again."
1710
  msgstr ""
1711
 
1712
+ #: includes/class-wcj-eu-vat-number.php:509
1713
  #: includes/settings/wcj-settings-eu-vat-number.php:83
1714
  msgid "<strong>EU VAT Number</strong> is not valid."
1715
  msgstr ""
2610
  msgid "Set \"enable for shipping methods\" for payment gateways."
2611
  msgstr ""
2612
 
2613
+ #: includes/class-wcj-payment-gateways-by-user-role.php:24
2614
  msgid "Gateways by User Role"
2615
  msgstr ""
2616
 
2617
+ #: includes/class-wcj-payment-gateways-by-user-role.php:25
2618
  msgid "Set user roles to include/exclude for payment gateways to show up."
2619
  msgstr ""
2620
 
2956
  #: includes/settings/wcj-settings-orders.php:80
2957
  #: includes/settings/wcj-settings-orders.php:105
2958
  #: includes/settings/wcj-settings-payment-gateways-by-shipping.php:23
2959
+ #: includes/settings/wcj-settings-payment-gateways-by-user-role.php:23
2960
  #: includes/settings/wcj-settings-payment-gateways-currency.php:95
2961
  #: includes/settings/wcj-settings-payment-gateways-fees.php:67
2962
  #: includes/settings/wcj-settings-payment-gateways-fees.php:83
2966
  #: includes/settings/wcj-settings-pdf-invoicing-footer.php:23
2967
  #: includes/settings/wcj-settings-pdf-invoicing-header.php:24
2968
  #: includes/settings/wcj-settings-pdf-invoicing-numbering.php:23
2969
+ #: includes/settings/wcj-settings-pdf-invoicing-page.php:96
2970
  #: includes/settings/wcj-settings-pdf-invoicing-styling.php:73
2971
  #: includes/settings/wcj-settings-price-by-country.php:70
2972
  #: includes/settings/wcj-settings-price-by-country.php:90
2975
  #: includes/settings/wcj-settings-price-by-country.php:142
2976
  #: includes/settings/wcj-settings-price-by-user-role.php:19
2977
  #: includes/settings/wcj-settings-price-by-user-role.php:46
2978
+ #: includes/settings/wcj-settings-price-by-user-role.php:93
2979
  #: includes/settings/wcj-settings-price-formats.php:21
2980
  #: includes/settings/wcj-settings-price-labels.php:23
2981
  #: includes/settings/wcj-settings-product-add-to-cart.php:25
4051
  #: includes/settings/meta-box/wcj-settings-meta-box-product-add-to-cart.php:43
4052
  #: includes/settings/meta-box/wcj-settings-meta-box-product-addons.php:19
4053
  #: includes/settings/meta-box/wcj-settings-meta-box-product-addons.php:79
4054
+ #: includes/settings/meta-box/wcj-settings-meta-box-product-addons.php:154
4055
  #: includes/settings/meta-box/wcj-settings-meta-box-product-bookings.php:20
4056
  #: includes/settings/meta-box/wcj-settings-meta-box-product-images.php:35
4057
  #: includes/settings/meta-box/wcj-settings-meta-box-product-images.php:45
4081
  #: includes/settings/meta-box/wcj-settings-meta-box-product-add-to-cart.php:42
4082
  #: includes/settings/meta-box/wcj-settings-meta-box-product-addons.php:18
4083
  #: includes/settings/meta-box/wcj-settings-meta-box-product-addons.php:78
4084
+ #: includes/settings/meta-box/wcj-settings-meta-box-product-addons.php:155
4085
  #: includes/settings/meta-box/wcj-settings-meta-box-product-bookings.php:19
4086
  #: includes/settings/meta-box/wcj-settings-meta-box-product-images.php:34
4087
  #: includes/settings/meta-box/wcj-settings-meta-box-product-images.php:44
4518
  #: includes/class-wcj-shipping-by-user-role.php:33
4519
  #: includes/settings/wcj-settings-multicurrency.php:261
4520
  #: includes/settings/wcj-settings-order-min-amount.php:104
4521
+ #: includes/settings/wcj-settings-price-by-user-role.php:133
4522
  #, php-format
4523
  msgid ""
4524
  "Custom roles can be added via \"Add/Manage Custom Roles\" tool in Booster's "
4846
  msgid "File wpml-config.xml successfully regenerated!"
4847
  msgstr ""
4848
 
4849
+ #: includes/classes/class-wcj-module-product-by-condition.php:260
4850
  msgid "— No change —"
4851
  msgstr ""
4852
 
4853
+ #: includes/classes/class-wcj-module-product-by-condition.php:267
4854
  #: includes/settings/meta-box/wcj-settings-meta-box-product-by-condition.php:29
4855
  msgid "Visible"
4856
  msgstr ""
4857
 
4858
+ #: includes/classes/class-wcj-module-product-by-condition.php:276
4859
  #: includes/settings/meta-box/wcj-settings-meta-box-product-by-condition.php:41
4860
  msgid "Invisible"
4861
  msgstr ""
4945
  msgid "Company Name"
4946
  msgstr ""
4947
 
4948
+ #: includes/classes/class-wcj-pdf-invoice.php:261
4949
  #: includes/functions/wcj-functions-general.php:145
4950
  #: includes/pdf-invoices/class-wcj-pdf-invoicing-report-tool.php:245
4951
  msgid "Unexpected error"
4952
  msgstr ""
4953
 
4954
+ #: includes/classes/class-wcj-shortcodes.php:127
4955
  #: includes/shortcodes/class-wcj-shortcodes-general.php:517
4956
  #, php-format
4957
  msgid "\"%s\" module is not enabled!"
7130
  msgid "Optional. Leave blank to use default URL."
7131
  msgstr ""
7132
 
7133
+ #: includes/gateways/class-wc-gateway-wcj-custom.php:350
7134
  #: includes/settings/wcj-settings-payment-gateways.php:38
7135
  msgid "Custom Gateway"
7136
  msgstr ""
7137
 
7138
+ #: includes/gateways/class-wc-gateway-wcj-custom.php:351
7139
  msgid "Booster for WooCommerce: Custom Payment Gateway"
7140
  msgstr ""
7141
 
7619
  #: includes/settings/wcj-settings-multicurrency.php:162
7620
  #: includes/settings/wcj-settings-order-min-amount.php:69
7621
  #: includes/settings/wcj-settings-price-by-country.php:160
7622
+ #: includes/settings/wcj-settings-price-by-user-role.php:106
7623
  #: includes/settings/wcj-settings-product-addons.php:230
7624
  msgid "Advanced"
7625
  msgstr ""
7752
  msgstr ""
7753
 
7754
  #: includes/pdf-invoices/submodules/class-wcj-pdf-invoicing-templates.php:23
7755
+ #: includes/settings/wcj-settings-template-editor.php:44
7756
  msgid "Templates"
7757
  msgstr ""
7758
 
8303
 
8304
  #: includes/settings/meta-box/wcj-settings-meta-box-multicurrency.php:63
8305
  #: includes/settings/meta-box/wcj-settings-meta-box-price-by-user-role.php:136
8306
+ #: includes/settings/wcj-settings-price-by-user-role.php:155
8307
+ #: includes/settings/wcj-settings-price-by-user-role.php:224
8308
  msgid "Make Empty Price"
8309
  msgstr ""
8310
 
8450
  #: includes/settings/wcj-settings-pdf-invoicing-advanced.php:84
8451
  #: includes/settings/wcj-settings-pdf-invoicing-advanced.php:123
8452
  #: includes/settings/wcj-settings-price-by-user-role.php:55
8453
+ #: includes/settings/wcj-settings-price-by-user-role.php:139
8454
  #: includes/settings/wcj-settings-product-add-to-cart.php:131
8455
  #: includes/settings/wcj-settings-product-open-pricing.php:95
8456
  #: includes/settings/wcj-settings-sku.php:325
8756
 
8757
  #: includes/settings/meta-box/wcj-settings-meta-box-wholesale-price.php:72
8758
  #: includes/settings/meta-box/wcj-settings-meta-box-wholesale-price.php:108
8759
+ #: includes/settings/wcj-settings-wholesale-price.php:170
8760
+ #: includes/settings/wcj-settings-wholesale-price.php:171
8761
+ #: includes/settings/wcj-settings-wholesale-price.php:227
8762
+ #: includes/settings/wcj-settings-wholesale-price.php:228
8763
  msgid "Discount"
8764
  msgstr ""
8765
 
9268
  msgstr ""
9269
 
9270
  #: includes/settings/wcj-settings-admin-products-list.php:27
9271
+ #: includes/settings/wcj-settings-price-by-user-role.php:200
9272
  #: includes/settings/wcj-settings-shipping.php:51
9273
  msgid ""
9274
  "Save module's settings after changing this option to see new settings fields."
9532
  #: includes/settings/wcj-settings-order-quantities.php:17
9533
  #: includes/settings/wcj-settings-payment-gateways-by-country.php:15
9534
  #: includes/settings/wcj-settings-payment-gateways-by-shipping.php:17
9535
+ #: includes/settings/wcj-settings-payment-gateways-by-user-role.php:14
9536
  #: includes/settings/wcj-settings-payment-gateways-min-max.php:15
9537
  #: includes/settings/wcj-settings-payment-gateways-per-category.php:19
9538
  #: includes/settings/wcj-settings-price-formats.php:15
9541
  #: includes/settings/wcj-settings-shipping-by-order-amount.php:15
9542
  #: includes/settings/wcj-settings-shipping-by-order-qty.php:15
9543
  #: includes/settings/wcj-settings-shipping-time.php:25
9544
+ #: includes/settings/wcj-settings-template-editor.php:27
9545
  #: includes/settings/wcj-settings-wpml.php:22
9546
  msgid "General Options"
9547
  msgstr ""
11277
  msgstr ""
11278
 
11279
  #: includes/settings/wcj-settings-email-options.php:26
11280
+ #: includes/settings/wcj-settings-template-editor.php:67
11281
  #: includes/settings/wcj-settings-track-users.php:26
11282
  msgid "Info"
11283
  msgstr ""
12138
  #: includes/settings/wcj-settings-multicurrency-base-price.php:76
12139
  #: includes/settings/wcj-settings-multicurrency.php:176
12140
  #: includes/settings/wcj-settings-price-by-country.php:165
12141
+ #: includes/settings/wcj-settings-price-by-user-role.php:111
12142
  #: includes/settings/wcj-settings-product-addons.php:258
12143
  #: includes/settings/wcj-settings-product-price-by-formula.php:100
12144
  msgid "Price Filters Priority"
12148
  #: includes/settings/wcj-settings-multicurrency-base-price.php:77
12149
  #: includes/settings/wcj-settings-multicurrency.php:177
12150
  #: includes/settings/wcj-settings-price-by-country.php:166
12151
+ #: includes/settings/wcj-settings-price-by-user-role.php:112
12152
  #: includes/settings/wcj-settings-product-addons.php:259
12153
  #: includes/settings/wcj-settings-product-price-by-formula.php:101
12154
  #: includes/settings/wcj-settings-wholesale-price.php:124
12596
  msgstr ""
12597
 
12598
  #: includes/settings/wcj-settings-multicurrency.php:267
12599
+ #: includes/settings/wcj-settings-wholesale-price.php:192
12600
  msgid "Save settings after you change this option. Leave blank to disable."
12601
  msgstr ""
12602
 
13727
  msgstr ""
13728
 
13729
  #: includes/settings/wcj-settings-payment-gateways-by-currency.php:16
13730
+ #: includes/settings/wcj-settings-payment-gateways-by-user-role.php:34
13731
  #: includes/settings/wcj-settings-shipping-by-condition.php:43
13732
  msgid "Leave empty to disable."
13733
  msgstr ""
13773
  "Leave blank to enable for all methods."
13774
  msgstr ""
13775
 
13776
+ #: includes/settings/wcj-settings-payment-gateways-by-user-role.php:19
13777
+ msgid "Multiple Role Checking"
13778
+ msgstr ""
13779
+
13780
+ #: includes/settings/wcj-settings-payment-gateways-by-user-role.php:22
13781
+ msgid ""
13782
+ "Enable if you have some plugin that allows users with multiple roles like "
13783
+ "\"User Role Editor\"."
13784
+ msgstr ""
13785
+
13786
+ #: includes/settings/wcj-settings-payment-gateways-by-user-role.php:35
13787
  #: includes/settings/wcj-settings-product-by-user.php:79
13788
  #, php-format
13789
  msgid ""
13791
  "<a href=\"%s\">General</a> module"
13792
  msgstr ""
13793
 
13794
+ #: includes/settings/wcj-settings-payment-gateways-by-user-role.php:58
13795
  msgid "Include User Roles"
13796
  msgstr ""
13797
 
13798
+ #: includes/settings/wcj-settings-payment-gateways-by-user-role.php:69
13799
  msgid "Exclude User Roles"
13800
  msgstr ""
13801
 
14529
  "option in %s."
14530
  msgstr ""
14531
 
14532
+ #: includes/settings/wcj-settings-pdf-invoicing-page.php:92
14533
+ msgid "Parse Background Image URL"
14534
+ msgstr ""
14535
+
14536
+ #: includes/settings/wcj-settings-pdf-invoicing-page.php:97
14537
+ msgid "Converts the Background Image URL to its local path."
14538
+ msgstr ""
14539
+
14540
+ #: includes/settings/wcj-settings-pdf-invoicing-page.php:97
14541
+ msgid ""
14542
+ "If you are experiencing issues with displaying background image, please try "
14543
+ "to disable this option"
14544
+ msgstr ""
14545
+
14546
  #: includes/settings/wcj-settings-pdf-invoicing-styling.php:19
14547
  #: includes/settings/wcj-settings-pdf-invoicing-styling.php:37
14548
  msgid "Font Family"
14900
  "\"woocommerce_single_variation\" hook on \"empty price\" variations."
14901
  msgstr ""
14902
 
14903
+ #: includes/settings/wcj-settings-price-by-user-role.php:92
14904
+ msgid "Check Child Categories"
14905
+ msgstr ""
14906
+
14907
+ #: includes/settings/wcj-settings-price-by-user-role.php:94
14908
+ msgid "Enable to also consider the child categories."
14909
+ msgstr ""
14910
+
14911
+ #: includes/settings/wcj-settings-price-by-user-role.php:118
14912
  msgid "Price Changes"
14913
  msgstr ""
14914
 
14915
+ #: includes/settings/wcj-settings-price-by-user-role.php:119
14916
  msgid "Disable price based on user role for products with \"Price Changes\""
14917
  msgstr ""
14918
 
14919
+ #: includes/settings/wcj-settings-price-by-user-role.php:120
14920
  #: includes/settings/wcj-settings-product-open-pricing.php:149
14921
  #: includes/settings/wcj-settings-wholesale-price.php:117
14922
  msgid ""
14924
  "other plugins."
14925
  msgstr ""
14926
 
14927
+ #: includes/settings/wcj-settings-price-by-user-role.php:131
14928
  msgid "Roles & Multipliers"
14929
  msgstr ""
14930
 
14931
+ #: includes/settings/wcj-settings-price-by-user-role.php:138
14932
  msgid "Disable Price based on User Role for Products on Sale"
14933
  msgstr ""
14934
 
14935
+ #: includes/settings/wcj-settings-price-by-user-role.php:170
14936
  msgid "Products Categories"
14937
  msgstr ""
14938
 
14939
+ #: includes/settings/wcj-settings-price-by-user-role.php:176
14940
  msgid "Products Tags"
14941
  msgstr ""
14942
 
14943
+ #: includes/settings/wcj-settings-price-by-user-role.php:194
14944
  #, php-format
14945
  msgid "Price based on User Role by %s"
14946
  msgstr ""
14947
 
14948
+ #: includes/settings/wcj-settings-price-by-user-role.php:217
14949
  msgid ""
14950
  "Multiplier is ignored if set to negative number (e.g.: -1). Global "
14951
  "multiplier will be used instead."
18393
  msgid "Setup how taxes will be applied during cart and checkout."
18394
  msgstr ""
18395
 
18396
+ #: includes/settings/wcj-settings-template-editor.php:32
18397
+ msgid "Paths"
18398
+ msgstr ""
18399
+
18400
+ #: includes/settings/wcj-settings-template-editor.php:37
18401
+ msgid "One path per line relative to: "
18402
+ msgstr ""
18403
+
18404
+ #: includes/settings/wcj-settings-template-editor.php:49
18405
  msgid "Templates to Edit"
18406
  msgstr ""
18407
 
18408
+ #: includes/settings/wcj-settings-template-editor.php:50
18409
  msgid "Save changes after you set this option to see new options fields."
18410
  msgstr ""
18411
 
18412
+ #: includes/settings/wcj-settings-template-editor.php:69
18413
  msgid "Default template path"
18414
  msgstr ""
18415
 
18416
+ #: includes/settings/wcj-settings-template-editor.php:70
18417
  msgid "Replaced template path"
18418
  msgstr ""
18419
 
18641
  msgstr ""
18642
 
18643
  #: includes/settings/wcj-settings-wholesale-price.php:141
18644
+ #: includes/settings/wcj-settings-wholesale-price.php:205
18645
  msgid "Number of Levels"
18646
  msgstr ""
18647
 
18648
+ #: includes/settings/wcj-settings-wholesale-price.php:152
18649
+ msgid "Default Max Qty Level"
18650
+ msgstr ""
18651
+
18652
+ #: includes/settings/wcj-settings-wholesale-price.php:162
18653
+ #: includes/settings/wcj-settings-wholesale-price.php:219
18654
  msgid "Min Quantity"
18655
  msgstr ""
18656
 
18657
+ #: includes/settings/wcj-settings-wholesale-price.php:163
18658
+ #: includes/settings/wcj-settings-wholesale-price.php:220
18659
  msgid "Minimum quantity to apply discount"
18660
  msgstr ""
18661
 
18662
+ #: includes/settings/wcj-settings-wholesale-price.php:185
18663
  msgid "Additional User Roles Options"
18664
  msgstr ""
18665
 
18666
+ #: includes/settings/wcj-settings-wholesale-price.php:187
18667
  msgid ""
18668
  "If you want to set different wholesale pricing options for different user "
18669
  "roles, fill this section. Please note that you can also use Booster's "
18670
  "\"Price based on User Role\" module without filling this section."
18671
  msgstr ""
18672
 
18673
+ #: includes/settings/wcj-settings-wholesale-price.php:191
18674
  msgid "User Roles Settings"
18675
  msgstr ""
18676
 
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: algoritmika, anbinder, debugeris, karzin
3
  Tags: woocommerce, booster for woocommerce, woocommerce jetpack
4
  Requires at least: 4.4
5
  Tested up to: 5.3
6
- Stable tag: 4.7.0
7
  License: GNU General Public License v3.0
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
@@ -193,6 +193,22 @@ You can see the differences between versions in this [table](https://booster.io/
193
 
194
  == Changelog ==
195
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
196
  = 4.7.0 - 27/12/2019 =
197
  * Fix - CART & CHECKOUT - Checkout Custom Fields - Preserve select field value when editing the order from admin.
198
  * Fix - CART & CHECKOUT - EU VAT Number - Set the user agent explicitly, trying to avoid possible SoapClient errors.
3
  Tags: woocommerce, booster for woocommerce, woocommerce jetpack
4
  Requires at least: 4.4
5
  Tested up to: 5.3
6
+ Stable tag: 4.7.1
7
  License: GNU General Public License v3.0
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
193
 
194
  == Changelog ==
195
 
196
+ = 4.7.1 - 10/02/2020 =
197
+ * Feature - EMAILS & MISC. - Template Editor - Add option to set custom `/woocommerce/` folder among other paths from other possible plugins.
198
+ * Fix - CART & CHECKOUT - EU VAT Number - Fix possible errors like "Call to Undefined WooCommerce functions".
199
+ * Fix - PRICES & CURRENCIES - PHP Warning: Fix "A non-numeric value encountered".
200
+ * Fix - PRICES & CURRENCIES - Multicurrency Product Base Price - Fix possible missing products with 'WooCommerce Price Filter Compatibility' option enabled by removing the 'wc_product_meta_lookup' table comparison.
201
+ * Fix - PRODUCTS - Product by Condition - Improve performance by setting invisible products on transient.
202
+ * Fix - PRODUCTS - Product Addons - Fix products getting "Required" with no reason.
203
+ * Fix - SHIPPING & ORDERS - Custom Shipping - Fix possible Fatal error "Class 'WC_Shipping_WCJ_Custom_W_Zones' not found".
204
+ * Dev - PAYMENT GATEWAYS - Custom Gateways - Add 'order_id' shortcode param automatically to a possible `[wcj_order_meta]` shortcode added to 'instructions'.
205
+ * Dev - PAYMENT GATEWAYS - Gateways by User Role - Add 'Multiple Role Checking' option on pro version.
206
+ * Dev - PDF Invoicing - Page Settings - Add option to enable/disable background image url parsing.
207
+ * Dev - PRICES & CURRENCIES - Price by User Role - Add option to check for child categories.
208
+ * Dev - PRICES & CURRENCIES - Wholesale Price - Add 'Default Max Qty Level' option to fix compatibility issues with decimal quantities when using plugins like 'Product Quantity' for instance.
209
+ * Dev - Shortcodes - Add 'result_key' param to all shortcodes with the purpose of filtering a possible array result displaying only a key from it.
210
+ * WC tested up to: 3.9
211
+
212
  = 4.7.0 - 27/12/2019 =
213
  * Fix - CART & CHECKOUT - Checkout Custom Fields - Preserve select field value when editing the order from admin.
214
  * Fix - CART & CHECKOUT - EU VAT Number - Set the user agent explicitly, trying to avoid possible SoapClient errors.
woocommerce-jetpack.php CHANGED
@@ -3,13 +3,13 @@
3
  Plugin Name: Booster for WooCommerce
4
  Plugin URI: https://booster.io
5
  Description: Supercharge your WooCommerce site with these awesome powerful features. More than 100 modules. All in one WooCommerce plugin.
6
- Version: 4.7.0
7
  Author: Algoritmika Ltd
8
  Author URI: https://booster.io
9
  Text Domain: woocommerce-jetpack
10
  Domain Path: /langs
11
  Copyright: © 2019 Algoritmika Ltd.
12
- WC tested up to: 3.8
13
  License: GNU General Public License v3.0
14
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
15
  */
@@ -57,7 +57,7 @@ final class WC_Jetpack {
57
  * @var string
58
  * @since 2.4.7
59
  */
60
- public $version = '4.7.0';
61
 
62
  /**
63
  * @var WC_Jetpack The single instance of the class
3
  Plugin Name: Booster for WooCommerce
4
  Plugin URI: https://booster.io
5
  Description: Supercharge your WooCommerce site with these awesome powerful features. More than 100 modules. All in one WooCommerce plugin.
6
+ Version: 4.7.1
7
  Author: Algoritmika Ltd
8
  Author URI: https://booster.io
9
  Text Domain: woocommerce-jetpack
10
  Domain Path: /langs
11
  Copyright: © 2019 Algoritmika Ltd.
12
+ WC tested up to: 3.9
13
  License: GNU General Public License v3.0
14
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
15
  */
57
  * @var string
58
  * @since 2.4.7
59
  */
60
+ public $version = '4.7.1';
61
 
62
  /**
63
  * @var WC_Jetpack The single instance of the class