Booster for WooCommerce - Version 2.5.9

Version Description

  • 19/12/2016 =
  • Dev - WCJ_Module - "Reset settings" button now uses JS confirmation; wp_safe_redirect added.
  • Dev - Shortcodes - Orders - [wcj_order_items_table] - columns - item_meta column added.
  • Dev - Shortcodes - Orders - [wcj_order_items_table] - quantity_prefix attribute added.
  • Dev - Shortcodes - Orders - [wcj_order_total_in_words] - LT - Lithuanian language function added.
  • Fix - Shortcodes - Orders - [wcj_order_total_in_words] - BG - not including national currency; Upper-case for first letter.
  • Fix - PRICES & CURRENCIES - Prices and Currencies by Country - Add Countries Flags Images to Select Drop-Down Box - Flag image missing bug fixed.
  • Dev - BUTTON & PRICE LABELS - Free Price Labels - Initial module release.
  • Fix - PRODUCTS - Product Cost Price - Checking if order prices included taxes, when calculating "Profit" column.
  • Dev - PDF INVOICING & PACKING SLIPS - General - "Do not create if order total equals zero" option added.
  • Dev - EMAILS & MISC. - Export - "Export Orders Items" tool added.
  • Dev - EMAILS & MISC. - Export - "Filter by All Fields" added.
  • Dev - EMAILS & MISC. - Export - "Download XML" button added.
  • Dev - EMAILS & MISC. - Export - Code refactoring.
  • Dev - EMAILS & MISC. - Export - Customers - New customer fields added: "Login", "Nicename", "URL", "Registered", "Display Name".
  • Dev - EMAILS & MISC. - Export - Customers - "Export Customers Fields" option added.
  • Dev - EMAILS & MISC. - Export - Customers from Orders - WP_Query optimized to return ids only.
  • Dev - EMAILS & MISC. - Export - Customers from Orders - "Export Customers from Orders Fields" option added.
  • Dev - EMAILS & MISC. - Export - Customers from Orders - New fields added: "Billing Company", "Billing Address 1", "Billing Address 2", "Billing City", "Billing State", "Billing Postcode", "Billing Country", "Billing Phone".
  • Dev - EMAILS & MISC. - Export - Orders - "Additional Export Orders Fields" options added.
  • Dev - EMAILS & MISC. - Export - Orders - Corresponding data is gathered only if "Order Items" or "Order Items Product Input Fields" columns are enabled.
  • Dev - EMAILS & MISC. - Export - Orders - Item meta info added to "Order Items" column.
  • Dev - EMAILS & MISC. - Export - Products - New product fields added: "Price Including Tax", "Price Excluding Tax", "Display Price", "Average Rating", "Rating Count", "Review Count", "Categories", "Tags", "Dimensions", "Formatted Name", "Availability", "Availability Class".
  • Tweak - Shortcodes - Orders - [wcj_order_items_table] - get_meta_info - replaced with wcj_get_order_item_meta_info().
  • Tweak - SHIPPING & ORDERS - Left to Free Shipping - Description updated.
  • Tweak - EMAILS & MISC. - Export - Divided settings into separate sections.
  • Tweak - Filters renamed.
Download this release

Release Info

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

Code changes from version 2.5.8 to 2.5.9

Files changed (89) hide show
  1. includes/add-to-cart/class-wcj-add-to-cart-per-category.php +1 -1
  2. includes/admin/class-wc-settings-jetpack.php +2 -2
  3. includes/admin/wcj-modules-cats.php +2 -1
  4. includes/class-wcj-add-to-cart.php +3 -3
  5. includes/class-wcj-call-for-price.php +12 -12
  6. includes/class-wcj-cart.php +5 -5
  7. includes/class-wcj-checkout-custom-fields.php +10 -10
  8. includes/class-wcj-checkout-custom-info.php +5 -5
  9. includes/class-wcj-checkout-files-upload.php +10 -10
  10. includes/class-wcj-currencies.php +8 -8
  11. includes/class-wcj-currency-exchange-rates.php +4 -4
  12. includes/class-wcj-currency-per-product.php +8 -8
  13. includes/class-wcj-emails.php +5 -5
  14. includes/class-wcj-empty-cart-button.php +8 -8
  15. includes/class-wcj-eu-vat-number.php +6 -6
  16. includes/class-wcj-export-import.php +315 -655
  17. includes/class-wcj-free-price.php +191 -0
  18. includes/class-wcj-global-discount.php +6 -6
  19. includes/class-wcj-left-to-free-shipping.php +9 -9
  20. includes/class-wcj-mini-cart.php +5 -5
  21. includes/class-wcj-multicurrency-product-base-price.php +9 -9
  22. includes/class-wcj-multicurrency.php +8 -8
  23. includes/class-wcj-order-min-amount.php +8 -8
  24. includes/class-wcj-order-numbers.php +9 -9
  25. includes/class-wcj-orders.php +5 -5
  26. includes/class-wcj-payment-gateways-by-country.php +2 -2
  27. includes/class-wcj-payment-gateways-by-user-role.php +2 -2
  28. includes/class-wcj-payment-gateways-currency.php +3 -3
  29. includes/class-wcj-payment-gateways-fees.php +1 -1
  30. includes/class-wcj-payment-gateways-icons.php +3 -3
  31. includes/class-wcj-payment-gateways-min-max.php +2 -2
  32. includes/class-wcj-payment-gateways-per-category.php +6 -6
  33. includes/class-wcj-payment-gateways.php +4 -4
  34. includes/class-wcj-pdf-invoicing.php +11 -4
  35. includes/class-wcj-price-by-country.php +7 -7
  36. includes/class-wcj-price-by-user-role.php +1 -1
  37. includes/class-wcj-price-formats.php +4 -4
  38. includes/class-wcj-price-labels.php +23 -23
  39. includes/class-wcj-product-add-to-cart.php +3 -3
  40. includes/class-wcj-product-addons.php +4 -4
  41. includes/class-wcj-product-bookings.php +1 -1
  42. includes/class-wcj-product-bulk-price-converter.php +7 -7
  43. includes/class-wcj-product-by-user.php +4 -4
  44. includes/class-wcj-product-custom-info.php +5 -5
  45. includes/class-wcj-product-info.php +4 -4
  46. includes/class-wcj-product-input-fields.php +5 -5
  47. includes/class-wcj-product-listings.php +8 -8
  48. includes/class-wcj-product-open-pricing.php +1 -1
  49. includes/class-wcj-product-price-by-formula.php +3 -3
  50. includes/class-wcj-product-tabs.php +21 -21
  51. includes/class-wcj-products-xml.php +9 -9
  52. includes/class-wcj-purchase-data.php +9 -7
  53. includes/class-wcj-shipping-calculator.php +7 -7
  54. includes/class-wcj-shipping.php +4 -4
  55. includes/class-wcj-sku.php +23 -23
  56. includes/class-wcj-sorting.php +9 -9
  57. includes/class-wcj-wholesale-price.php +14 -14
  58. includes/classes/class-wcj-invoice.php +10 -3
  59. includes/classes/class-wcj-module.php +11 -24
  60. includes/classes/class-wcj-pdf-invoice.php +3 -3
  61. includes/classes/class-wcj-product.php +1 -1
  62. includes/classes/class-wcj-tcpdf.php +1 -1
  63. includes/exchange-rates/class-wcj-exchange-rates-crons.php +9 -9
  64. includes/export/class-wcj-exporter-customers.php +191 -0
  65. includes/export/class-wcj-exporter-orders.php +395 -0
  66. includes/export/class-wcj-exporter-products.php +277 -0
  67. includes/export/class-wcj-fields-helper.php +354 -0
  68. includes/functions/wcj-functions-number-to-words-bg.php +182 -174
  69. includes/functions/wcj-functions-number-to-words-lt.php +160 -0
  70. includes/functions/wcj-functions.php +70 -8
  71. includes/functions/wcj-invoicing-functions.php +1 -1
  72. includes/gateways/class-wc-gateway-wcj-custom.php +6 -6
  73. includes/input-fields/class-wcj-product-input-fields-abstract.php +9 -9
  74. includes/input-fields/class-wcj-product-input-fields-per-product.php +5 -5
  75. includes/pdf-invoices/settings/class-wcj-pdf-invoicing-emails.php +1 -1
  76. includes/pdf-invoices/settings/class-wcj-pdf-invoicing-footer.php +2 -2
  77. includes/pdf-invoices/settings/class-wcj-pdf-invoicing-styling.php +2 -2
  78. includes/price-by-country/class-wcj-price-by-country-core.php +1 -1
  79. includes/price-by-country/class-wcj-price-by-country-group-generator.php +1 -1
  80. includes/price-by-country/class-wcj-price-by-country-local.php +1 -1
  81. includes/reports/class-wcj-currency-reports.php +3 -3
  82. includes/shipping/class-wc-shipping-wcj-custom.php +1 -1
  83. includes/shortcodes/class-wcj-general-shortcodes.php +6 -6
  84. includes/shortcodes/class-wcj-order-items-shortcodes.php +16 -12
  85. includes/shortcodes/class-wcj-orders-shortcodes.php +23 -3
  86. includes/shortcodes/class-wcj-products-add-form-shortcodes.php +2 -2
  87. includes/shortcodes/class-wcj-products-shortcodes.php +2 -2
  88. readme.txt +31 -2
  89. woocommerce-jetpack.php +44 -45
includes/add-to-cart/class-wcj-add-to-cart-per-category.php CHANGED
@@ -46,7 +46,7 @@ class WCJ_Add_To_Cart_Per_Category {
46
  public function change_add_to_cart_button_text( $add_to_cart_text, $single_or_archive ) {
47
  $product_categories = get_the_terms( get_the_ID(), 'product_cat' );
48
  if ( empty( $product_categories ) ) return $add_to_cart_text;
49
- for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_add_to_cart_per_category_total_groups_number', 1 ) ); $i++ ) {
50
  if ( 'yes' !== get_option( 'wcj_add_to_cart_per_category_enabled_group_' . $i ) ) continue;
51
  $categories = get_option( 'wcj_add_to_cart_per_category_ids_group_' . $i );
52
  if ( empty( $categories ) ) continue;
46
  public function change_add_to_cart_button_text( $add_to_cart_text, $single_or_archive ) {
47
  $product_categories = get_the_terms( get_the_ID(), 'product_cat' );
48
  if ( empty( $product_categories ) ) return $add_to_cart_text;
49
+ for ( $i = 1; $i <= apply_filters( 'booster_get_option', 1, get_option( 'wcj_add_to_cart_per_category_total_groups_number', 1 ) ); $i++ ) {
50
  if ( 'yes' !== get_option( 'wcj_add_to_cart_per_category_enabled_group_' . $i ) ) continue;
51
  $categories = get_option( 'wcj_add_to_cart_per_category_ids_group_' . $i );
52
  if ( empty( $categories ) ) continue;
includes/admin/class-wc-settings-jetpack.php CHANGED
@@ -147,7 +147,7 @@ class WC_Settings_Jetpack extends WC_Settings_Page {
147
  $tooltip_html = ( isset( $value['desc_tip'] ) && '' != $value['desc_tip'] ) ? '<span class="woocommerce-help-tip" data-tip="' . $value['desc_tip'] . '"></span>' : '';
148
  // $custom_attributes = ( is_array( $value['custom_attributes'] ) ) ? $value['custom_attributes'] : array();
149
  $description = ' <span class="description">' . $value['desc'] . '</span>';
150
- $save_button = apply_filters( 'wcj_get_option_filter', '', ' <input name="save" class="button-primary" type="submit" value="' . __( 'Save changes', 'woocommerce' ) . '">' );
151
 
152
  // Custom attribute handling
153
  $custom_attributes = array();
@@ -525,7 +525,7 @@ class WC_Settings_Jetpack extends WC_Settings_Page {
525
  global $current_section;
526
  $settings = $this->get_settings( $current_section );
527
  WC_Admin_Settings::save_fields( $settings );
528
- echo apply_filters('get_wc_jetpack_plus_message', '', 'global' );
529
  do_action( 'woojetpack_after_settings_save', $this->get_sections(), $current_section );
530
  }
531
 
147
  $tooltip_html = ( isset( $value['desc_tip'] ) && '' != $value['desc_tip'] ) ? '<span class="woocommerce-help-tip" data-tip="' . $value['desc_tip'] . '"></span>' : '';
148
  // $custom_attributes = ( is_array( $value['custom_attributes'] ) ) ? $value['custom_attributes'] : array();
149
  $description = ' <span class="description">' . $value['desc'] . '</span>';
150
+ $save_button = apply_filters( 'booster_get_option', '', ' <input name="save" class="button-primary" type="submit" value="' . __( 'Save changes', 'woocommerce' ) . '">' );
151
 
152
  // Custom attribute handling
153
  $custom_attributes = array();
525
  global $current_section;
526
  $settings = $this->get_settings( $current_section );
527
  WC_Admin_Settings::save_fields( $settings );
528
+ echo apply_filters('booster_get_message', '', 'global' );
529
  do_action( 'woojetpack_after_settings_save', $this->get_sections(), $current_section );
530
  }
531
 
includes/admin/wcj-modules-cats.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * The WooCommerce Modules Array.
6
  *
7
- * @version 2.5.8
8
  * @since 2.2.0
9
  * @author Algoritmika Ltd.
10
  */
@@ -49,6 +49,7 @@ return array(
49
  'all_cat_ids' => array(
50
  'price_labels',
51
  'call_for_price',
 
52
  'add_to_cart',
53
  'more_button_labels',
54
  ),
4
  *
5
  * The WooCommerce Modules Array.
6
  *
7
+ * @version 2.5.9
8
  * @since 2.2.0
9
  * @author Algoritmika Ltd.
10
  */
49
  'all_cat_ids' => array(
50
  'price_labels',
51
  'call_for_price',
52
+ 'free_price',
53
  'add_to_cart',
54
  'more_button_labels',
55
  ),
includes/class-wcj-add-to-cart.php CHANGED
@@ -222,9 +222,9 @@ class WCJ_Add_To_Cart extends WCJ_Module {
222
  'id' => 'wcj_add_to_cart_per_category_total_groups_number',
223
  'default' => 1,
224
  'type' => 'custom_number',
225
- 'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
226
  'custom_attributes' => array_merge(
227
- is_array( apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ) ) ? apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ) : array(),
228
  array(
229
  'step' => '1',
230
  'min' => '1',
@@ -242,7 +242,7 @@ class WCJ_Add_To_Cart extends WCJ_Module {
242
  }
243
  }
244
 
245
- for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_add_to_cart_per_category_total_groups_number', 1 ) ); $i++ ) {
246
 
247
  /* $deprecated = get_option( 'wcj_add_to_cart_per_category_group_' . $i );
248
  if ( false !== $deprecated ) {
222
  'id' => 'wcj_add_to_cart_per_category_total_groups_number',
223
  'default' => 1,
224
  'type' => 'custom_number',
225
+ 'desc' => apply_filters( 'booster_get_message', '', 'desc' ),
226
  'custom_attributes' => array_merge(
227
+ is_array( apply_filters( 'booster_get_message', '', 'readonly' ) ) ? apply_filters( 'booster_get_message', '', 'readonly' ) : array(),
228
  array(
229
  'step' => '1',
230
  'min' => '1',
242
  }
243
  }
244
 
245
+ for ( $i = 1; $i <= apply_filters( 'booster_get_option', 1, get_option( 'wcj_add_to_cart_per_category_total_groups_number', 1 ) ); $i++ ) {
246
 
247
  /* $deprecated = get_option( 'wcj_add_to_cart_per_category_group_' . $i );
248
  if ( false !== $deprecated ) {
includes/class-wcj-call-for-price.php CHANGED
@@ -74,16 +74,16 @@ class WCJ_Call_For_Price extends WCJ_module {
74
  */
75
  public function on_empty_price( $price ) {
76
  if ( ( get_option('wcj_call_for_price_text') !== '' ) && is_single( get_the_ID() ) ) {
77
- return do_shortcode( apply_filters( 'wcj_get_option_filter', $this->default_empty_price_text, get_option('wcj_call_for_price_text') ) );
78
  }
79
  if ( ( get_option('wcj_call_for_price_text_on_related') !== '' ) && ( is_single() ) && ( ! is_single( get_the_ID() ) ) ) {
80
- return do_shortcode( apply_filters( 'wcj_get_option_filter', $this->default_empty_price_text, get_option('wcj_call_for_price_text_on_related') ) );
81
  }
82
  if ( ( get_option('wcj_call_for_price_text_on_archive') !== '' ) && is_archive() ) {
83
- return do_shortcode( apply_filters( 'wcj_get_option_filter', $this->default_empty_price_text, get_option('wcj_call_for_price_text_on_archive') ) );
84
  }
85
  if ( ( get_option('wcj_call_for_price_text_on_home') !== '' ) && is_front_page() ) {
86
- return do_shortcode( apply_filters( 'wcj_get_option_filter', $this->default_empty_price_text, get_option('wcj_call_for_price_text_on_home') ) );
87
  }
88
 
89
  // No changes
@@ -106,46 +106,46 @@ class WCJ_Call_For_Price extends WCJ_module {
106
  array(
107
  'title' => __( 'Label to Show on Single', 'woocommerce-jetpack' ),
108
  'desc_tip' => __( 'This sets the html to output on empty price. Leave blank to disable.', 'woocommerce-jetpack' ),
109
- 'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
110
  'id' => 'wcj_call_for_price_text',
111
  'default' => $this->default_empty_price_text,
112
  'type' => 'textarea',
113
  'css' => 'width:50%;min-width:300px;',
114
  'custom_attributes'
115
- => apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ),
116
  ),
117
  array(
118
  'title' => __( 'Label to Show on Archives', 'woocommerce-jetpack' ),
119
  'desc_tip' => __( 'This sets the html to output on empty price. Leave blank to disable.', 'woocommerce-jetpack' ),
120
- 'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
121
  'id' => 'wcj_call_for_price_text_on_archive',
122
  'default' => $this->default_empty_price_text,
123
  'type' => 'textarea',
124
  'css' => 'width:50%;min-width:300px;',
125
  'custom_attributes'
126
- => apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ),
127
  ),
128
  array(
129
  'title' => __( 'Label to Show on Homepage', 'woocommerce-jetpack' ),
130
  'desc_tip' => __( 'This sets the html to output on empty price. Leave blank to disable.', 'woocommerce-jetpack' ),
131
- 'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
132
  'id' => 'wcj_call_for_price_text_on_home',
133
  'default' => $this->default_empty_price_text,
134
  'type' => 'textarea',
135
  'css' => 'width:50%;min-width:300px;',
136
  'custom_attributes'
137
- => apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ),
138
  ),
139
  array(
140
  'title' => __( 'Label to Show on Related', 'woocommerce-jetpack' ),
141
  'desc_tip' => __( 'This sets the html to output on empty price. Leave blank to disable.', 'woocommerce-jetpack' ),
142
- 'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
143
  'id' => 'wcj_call_for_price_text_on_related',
144
  'default' => $this->default_empty_price_text,
145
  'type' => 'textarea',
146
  'css' => 'width:50%;min-width:300px;',
147
  'custom_attributes'
148
- => apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ),
149
  ),
150
  array(
151
  'title' => __( 'Hide Sale! Tag', 'woocommerce-jetpack' ),
74
  */
75
  public function on_empty_price( $price ) {
76
  if ( ( get_option('wcj_call_for_price_text') !== '' ) && is_single( get_the_ID() ) ) {
77
+ return do_shortcode( apply_filters( 'booster_get_option', $this->default_empty_price_text, get_option('wcj_call_for_price_text') ) );
78
  }
79
  if ( ( get_option('wcj_call_for_price_text_on_related') !== '' ) && ( is_single() ) && ( ! is_single( get_the_ID() ) ) ) {
80
+ return do_shortcode( apply_filters( 'booster_get_option', $this->default_empty_price_text, get_option('wcj_call_for_price_text_on_related') ) );
81
  }
82
  if ( ( get_option('wcj_call_for_price_text_on_archive') !== '' ) && is_archive() ) {
83
+ return do_shortcode( apply_filters( 'booster_get_option', $this->default_empty_price_text, get_option('wcj_call_for_price_text_on_archive') ) );
84
  }
85
  if ( ( get_option('wcj_call_for_price_text_on_home') !== '' ) && is_front_page() ) {
86
+ return do_shortcode( apply_filters( 'booster_get_option', $this->default_empty_price_text, get_option('wcj_call_for_price_text_on_home') ) );
87
  }
88
 
89
  // No changes
106
  array(
107
  'title' => __( 'Label to Show on Single', 'woocommerce-jetpack' ),
108
  'desc_tip' => __( 'This sets the html to output on empty price. Leave blank to disable.', 'woocommerce-jetpack' ),
109
+ 'desc' => apply_filters( 'booster_get_message', '', 'desc' ),
110
  'id' => 'wcj_call_for_price_text',
111
  'default' => $this->default_empty_price_text,
112
  'type' => 'textarea',
113
  'css' => 'width:50%;min-width:300px;',
114
  'custom_attributes'
115
+ => apply_filters( 'booster_get_message', '', 'readonly' ),
116
  ),
117
  array(
118
  'title' => __( 'Label to Show on Archives', 'woocommerce-jetpack' ),
119
  'desc_tip' => __( 'This sets the html to output on empty price. Leave blank to disable.', 'woocommerce-jetpack' ),
120
+ 'desc' => apply_filters( 'booster_get_message', '', 'desc' ),
121
  'id' => 'wcj_call_for_price_text_on_archive',
122
  'default' => $this->default_empty_price_text,
123
  'type' => 'textarea',
124
  'css' => 'width:50%;min-width:300px;',
125
  'custom_attributes'
126
+ => apply_filters( 'booster_get_message', '', 'readonly' ),
127
  ),
128
  array(
129
  'title' => __( 'Label to Show on Homepage', 'woocommerce-jetpack' ),
130
  'desc_tip' => __( 'This sets the html to output on empty price. Leave blank to disable.', 'woocommerce-jetpack' ),
131
+ 'desc' => apply_filters( 'booster_get_message', '', 'desc' ),
132
  'id' => 'wcj_call_for_price_text_on_home',
133
  'default' => $this->default_empty_price_text,
134
  'type' => 'textarea',
135
  'css' => 'width:50%;min-width:300px;',
136
  'custom_attributes'
137
+ => apply_filters( 'booster_get_message', '', 'readonly' ),
138
  ),
139
  array(
140
  'title' => __( 'Label to Show on Related', 'woocommerce-jetpack' ),
141
  'desc_tip' => __( 'This sets the html to output on empty price. Leave blank to disable.', 'woocommerce-jetpack' ),
142
+ 'desc' => apply_filters( 'booster_get_message', '', 'desc' ),
143
  'id' => 'wcj_call_for_price_text_on_related',
144
  'default' => $this->default_empty_price_text,
145
  'type' => 'textarea',
146
  'css' => 'width:50%;min-width:300px;',
147
  'custom_attributes'
148
+ => apply_filters( 'booster_get_message', '', 'readonly' ),
149
  ),
150
  array(
151
  'title' => __( 'Hide Sale! Tag', 'woocommerce-jetpack' ),
includes/class-wcj-cart.php CHANGED
@@ -40,7 +40,7 @@ class WCJ_Cart extends WCJ_Module {
40
  add_filter( 'gettext', array( $this, 'hide_shipping_and_taxes_estimated_message' ), 20, 3 ); */
41
 
42
  // add_action( get_option( 'wcj_cart_custom_info_hook', 'woocommerce_after_cart_totals' ), array( $this, 'add_cart_custom_info' ) );
43
- $total_number = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_cart_custom_info_total_number', 1 ) );
44
  for ( $i = 1; $i <= $total_number; $i++) {
45
  add_action(
46
  get_option( 'wcj_cart_custom_info_hook_' . $i, 'woocommerce_after_cart_totals' ),
@@ -77,7 +77,7 @@ class WCJ_Cart extends WCJ_Module {
77
  function add_cart_custom_info() {
78
  $current_filter = current_filter();
79
  $current_filter_priority = wcj_current_filter_priority();
80
- $total_number = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_cart_custom_info_total_number', 1 ) );
81
  for ( $i = 1; $i <= $total_number; $i++) {
82
  if (
83
  '' != get_option( 'wcj_cart_custom_info_content_' . $i ) &&
@@ -133,9 +133,9 @@ class WCJ_Cart extends WCJ_Module {
133
  'id' => 'wcj_cart_custom_info_total_number',
134
  'default' => 1,
135
  'type' => 'custom_number',
136
- 'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
137
  'custom_attributes'
138
- => apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ),
139
  );
140
 
141
  $settings[] = array(
@@ -143,7 +143,7 @@ class WCJ_Cart extends WCJ_Module {
143
  'id' => 'wcj_cart_custom_info_options',
144
  );
145
 
146
- $total_number = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_cart_custom_info_total_number', 1 ) );
147
 
148
  for ( $i = 1; $i <= $total_number; $i++) {
149
 
40
  add_filter( 'gettext', array( $this, 'hide_shipping_and_taxes_estimated_message' ), 20, 3 ); */
41
 
42
  // add_action( get_option( 'wcj_cart_custom_info_hook', 'woocommerce_after_cart_totals' ), array( $this, 'add_cart_custom_info' ) );
43
+ $total_number = apply_filters( 'booster_get_option', 1, get_option( 'wcj_cart_custom_info_total_number', 1 ) );
44
  for ( $i = 1; $i <= $total_number; $i++) {
45
  add_action(
46
  get_option( 'wcj_cart_custom_info_hook_' . $i, 'woocommerce_after_cart_totals' ),
77
  function add_cart_custom_info() {
78
  $current_filter = current_filter();
79
  $current_filter_priority = wcj_current_filter_priority();
80
+ $total_number = apply_filters( 'booster_get_option', 1, get_option( 'wcj_cart_custom_info_total_number', 1 ) );
81
  for ( $i = 1; $i <= $total_number; $i++) {
82
  if (
83
  '' != get_option( 'wcj_cart_custom_info_content_' . $i ) &&
133
  'id' => 'wcj_cart_custom_info_total_number',
134
  'default' => 1,
135
  'type' => 'custom_number',
136
+ 'desc' => apply_filters( 'booster_get_message', '', 'desc' ),
137
  'custom_attributes'
138
+ => apply_filters( 'booster_get_message', '', 'readonly' ),
139
  );
140
 
141
  $settings[] = array(
143
  'id' => 'wcj_cart_custom_info_options',
144
  );
145
 
146
+ $total_number = apply_filters( 'booster_get_option', 1, get_option( 'wcj_cart_custom_info_total_number', 1 ) );
147
 
148
  for ( $i = 1; $i <= $total_number; $i++) {
149
 
includes/class-wcj-checkout-custom-fields.php CHANGED
@@ -55,7 +55,7 @@ class WCJ_Checkout_Custom_Fields extends WCJ_Module {
55
  add_filter( 'woocommerce_form_field_' . 'text', array( $this, 'woocommerce_form_field_type_number' ), PHP_INT_MAX, 4 );
56
 
57
  add_filter( 'woocommerce_customer_meta_fields', array( $this, 'add_checkout_custom_fields_customer_meta_fields' ) );
58
- for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_checkout_custom_fields_total_number', 1 ) ); $i++ ) {
59
  if ( 'yes' === get_option( 'wcj_checkout_custom_field_enabled_' . $i ) ) {
60
  $the_section = get_option( 'wcj_checkout_custom_field_section_' . $i );
61
  $the_key = 'wcj_checkout_field_' . $i;
@@ -73,7 +73,7 @@ class WCJ_Checkout_Custom_Fields extends WCJ_Module {
73
  * @since 2.4.5
74
  */
75
  function add_checkout_custom_fields_customer_meta_fields( $fields ) {
76
- for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_checkout_custom_fields_total_number', 1 ) ); $i++ ) {
77
  if ( 'yes' === get_option( 'wcj_checkout_custom_field_enabled_' . $i ) ) {
78
  $the_section = get_option( 'wcj_checkout_custom_field_section_' . $i );
79
  $the_key = 'wcj_checkout_field_' . $i;
@@ -159,7 +159,7 @@ class WCJ_Checkout_Custom_Fields extends WCJ_Module {
159
  * add_custom_fields_to_store_exporter.
160
  */
161
  public function add_custom_fields_to_store_exporter( $fields ) {
162
- for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_checkout_custom_fields_total_number', 1 ) ); $i++ ) {
163
  if ( 'yes' === get_option( 'wcj_checkout_custom_field_enabled_' . $i ) ) {
164
  $the_section = get_option( 'wcj_checkout_custom_field_section_' . $i );
165
  $the_key = 'wcj_checkout_field_' . $i;
@@ -244,7 +244,7 @@ class WCJ_Checkout_Custom_Fields extends WCJ_Module {
244
  * add_custom_shipping_fields_to_formatted_address.
245
  *
246
  public function add_custom_shipping_fields_to_formatted_address( $fields, $order ) {
247
- for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_checkout_custom_fields_total_number', 1 ) ); $i++ ) {
248
  //if ( 'yes' === get_option( 'wcj_checkout_custom_field_enabled_' . $i ) ) {
249
  $the_section = get_option( 'wcj_checkout_custom_field_section_' . $i );
250
  if ( 'shipping' === $the_section ) {
@@ -262,7 +262,7 @@ class WCJ_Checkout_Custom_Fields extends WCJ_Module {
262
  * @version 2.4.7
263
  */
264
  public function update_custom_checkout_fields_order_meta( $order_id ) {
265
- for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_checkout_custom_fields_total_number', 1 ) ); $i++ ) {
266
  if ( 'yes' === get_option( 'wcj_checkout_custom_field_enabled_' . $i ) ) {
267
  $the_section = get_option( 'wcj_checkout_custom_field_section_' . $i );
268
  $the_type = get_option( 'wcj_checkout_custom_field_type_' . $i );
@@ -387,7 +387,7 @@ class WCJ_Checkout_Custom_Fields extends WCJ_Module {
387
  * @version 2.4.7
388
  */
389
  public function add_woocommerce_admin_fields( $fields, $section ) {
390
- for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_checkout_custom_fields_total_number', 1 ) ); $i++ ) {
391
  if ( 'yes' === get_option( 'wcj_checkout_custom_field_enabled_' . $i ) ) {
392
  $the_section = get_option( 'wcj_checkout_custom_field_section_' . $i );
393
  if ( $section != $the_section ) {
@@ -490,7 +490,7 @@ class WCJ_Checkout_Custom_Fields extends WCJ_Module {
490
  */
491
  public function add_custom_checkout_fields( $fields ) {
492
 
493
- for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_checkout_custom_fields_total_number', 1 ) ); $i++ ) {
494
 
495
  if ( 'yes' === get_option( 'wcj_checkout_custom_field_enabled_' . $i ) ) {
496
 
@@ -638,9 +638,9 @@ class WCJ_Checkout_Custom_Fields extends WCJ_Module {
638
  'id' => 'wcj_checkout_custom_fields_total_number',
639
  'default' => 1,
640
  'type' => 'custom_number',
641
- 'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
642
  'custom_attributes' => array_merge(
643
- is_array( apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ) ) ? apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ) : array(),
644
  array(
645
  'step' => '1',
646
  'min' => '1',
@@ -660,7 +660,7 @@ class WCJ_Checkout_Custom_Fields extends WCJ_Module {
660
 
661
  $products_options = apply_filters( 'wcj_get_products_filter', array() );
662
 
663
- for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_checkout_custom_fields_total_number', 1 ) ); $i++ ) {
664
  $settings = array_merge( $settings,
665
  array(
666
  array(
55
  add_filter( 'woocommerce_form_field_' . 'text', array( $this, 'woocommerce_form_field_type_number' ), PHP_INT_MAX, 4 );
56
 
57
  add_filter( 'woocommerce_customer_meta_fields', array( $this, 'add_checkout_custom_fields_customer_meta_fields' ) );
58
+ for ( $i = 1; $i <= apply_filters( 'booster_get_option', 1, get_option( 'wcj_checkout_custom_fields_total_number', 1 ) ); $i++ ) {
59
  if ( 'yes' === get_option( 'wcj_checkout_custom_field_enabled_' . $i ) ) {
60
  $the_section = get_option( 'wcj_checkout_custom_field_section_' . $i );
61
  $the_key = 'wcj_checkout_field_' . $i;
73
  * @since 2.4.5
74
  */
75
  function add_checkout_custom_fields_customer_meta_fields( $fields ) {
76
+ for ( $i = 1; $i <= apply_filters( 'booster_get_option', 1, get_option( 'wcj_checkout_custom_fields_total_number', 1 ) ); $i++ ) {
77
  if ( 'yes' === get_option( 'wcj_checkout_custom_field_enabled_' . $i ) ) {
78
  $the_section = get_option( 'wcj_checkout_custom_field_section_' . $i );
79
  $the_key = 'wcj_checkout_field_' . $i;
159
  * add_custom_fields_to_store_exporter.
160
  */
161
  public function add_custom_fields_to_store_exporter( $fields ) {
162
+ for ( $i = 1; $i <= apply_filters( 'booster_get_option', 1, get_option( 'wcj_checkout_custom_fields_total_number', 1 ) ); $i++ ) {
163
  if ( 'yes' === get_option( 'wcj_checkout_custom_field_enabled_' . $i ) ) {
164
  $the_section = get_option( 'wcj_checkout_custom_field_section_' . $i );
165
  $the_key = 'wcj_checkout_field_' . $i;
244
  * add_custom_shipping_fields_to_formatted_address.
245
  *
246
  public function add_custom_shipping_fields_to_formatted_address( $fields, $order ) {
247
+ for ( $i = 1; $i <= apply_filters( 'booster_get_option', 1, get_option( 'wcj_checkout_custom_fields_total_number', 1 ) ); $i++ ) {
248
  //if ( 'yes' === get_option( 'wcj_checkout_custom_field_enabled_' . $i ) ) {
249
  $the_section = get_option( 'wcj_checkout_custom_field_section_' . $i );
250
  if ( 'shipping' === $the_section ) {
262
  * @version 2.4.7
263
  */
264
  public function update_custom_checkout_fields_order_meta( $order_id ) {
265
+ for ( $i = 1; $i <= apply_filters( 'booster_get_option', 1, get_option( 'wcj_checkout_custom_fields_total_number', 1 ) ); $i++ ) {
266
  if ( 'yes' === get_option( 'wcj_checkout_custom_field_enabled_' . $i ) ) {
267
  $the_section = get_option( 'wcj_checkout_custom_field_section_' . $i );
268
  $the_type = get_option( 'wcj_checkout_custom_field_type_' . $i );
387
  * @version 2.4.7
388
  */
389
  public function add_woocommerce_admin_fields( $fields, $section ) {
390
+ for ( $i = 1; $i <= apply_filters( 'booster_get_option', 1, get_option( 'wcj_checkout_custom_fields_total_number', 1 ) ); $i++ ) {
391
  if ( 'yes' === get_option( 'wcj_checkout_custom_field_enabled_' . $i ) ) {
392
  $the_section = get_option( 'wcj_checkout_custom_field_section_' . $i );
393
  if ( $section != $the_section ) {
490
  */
491
  public function add_custom_checkout_fields( $fields ) {
492
 
493
+ for ( $i = 1; $i <= apply_filters( 'booster_get_option', 1, get_option( 'wcj_checkout_custom_fields_total_number', 1 ) ); $i++ ) {
494
 
495
  if ( 'yes' === get_option( 'wcj_checkout_custom_field_enabled_' . $i ) ) {
496
 
638
  'id' => 'wcj_checkout_custom_fields_total_number',
639
  'default' => 1,
640
  'type' => 'custom_number',
641
+ 'desc' => apply_filters( 'booster_get_message', '', 'desc' ),
642
  'custom_attributes' => array_merge(
643
+ is_array( apply_filters( 'booster_get_message', '', 'readonly' ) ) ? apply_filters( 'booster_get_message', '', 'readonly' ) : array(),
644
  array(
645
  'step' => '1',
646
  'min' => '1',
660
 
661
  $products_options = apply_filters( 'wcj_get_products_filter', array() );
662
 
663
+ for ( $i = 1; $i <= apply_filters( 'booster_get_option', 1, get_option( 'wcj_checkout_custom_fields_total_number', 1 ) ); $i++ ) {
664
  $settings = array_merge( $settings,
665
  array(
666
  array(
includes/class-wcj-checkout-custom-info.php CHANGED
@@ -29,7 +29,7 @@ class WCJ_Checkout_Custom_Info extends WCJ_Module {
29
  parent::__construct();
30
 
31
  if ( $this->is_enabled() ) {
32
- for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_checkout_custom_info_total_number', 1 ) ); $i++) {
33
  add_action(
34
  get_option( 'wcj_checkout_custom_info_hook_' . $i, 'woocommerce_checkout_after_order_review' ),
35
  array( $this, 'add_checkout_custom_info' ),
@@ -47,7 +47,7 @@ class WCJ_Checkout_Custom_Info extends WCJ_Module {
47
  function add_checkout_custom_info() {
48
  $current_filter = current_filter();
49
  $current_filter_priority = wcj_current_filter_priority();
50
- $total_number = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_checkout_custom_info_total_number', 1 ) );
51
  for ( $i = 1; $i <= $total_number; $i++) {
52
  if (
53
  '' != get_option( 'wcj_checkout_custom_info_content_' . $i ) &&
@@ -76,14 +76,14 @@ class WCJ_Checkout_Custom_Info extends WCJ_Module {
76
  'id' => 'wcj_checkout_custom_info_total_number',
77
  'default' => 1,
78
  'type' => 'custom_number',
79
- 'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
80
- 'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ),
81
  );
82
  $settings[] = array(
83
  'type' => 'sectionend',
84
  'id' => 'wcj_checkout_custom_info_blocks_options',
85
  );
86
- $total_number = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_checkout_custom_info_total_number', 1 ) );
87
  for ( $i = 1; $i <= $total_number; $i++) {
88
  $settings = array_merge( $settings, array(
89
  array(
29
  parent::__construct();
30
 
31
  if ( $this->is_enabled() ) {
32
+ for ( $i = 1; $i <= apply_filters( 'booster_get_option', 1, get_option( 'wcj_checkout_custom_info_total_number', 1 ) ); $i++) {
33
  add_action(
34
  get_option( 'wcj_checkout_custom_info_hook_' . $i, 'woocommerce_checkout_after_order_review' ),
35
  array( $this, 'add_checkout_custom_info' ),
47
  function add_checkout_custom_info() {
48
  $current_filter = current_filter();
49
  $current_filter_priority = wcj_current_filter_priority();
50
+ $total_number = apply_filters( 'booster_get_option', 1, get_option( 'wcj_checkout_custom_info_total_number', 1 ) );
51
  for ( $i = 1; $i <= $total_number; $i++) {
52
  if (
53
  '' != get_option( 'wcj_checkout_custom_info_content_' . $i ) &&
76
  'id' => 'wcj_checkout_custom_info_total_number',
77
  'default' => 1,
78
  'type' => 'custom_number',
79
+ 'desc' => apply_filters( 'booster_get_message', '', 'desc' ),
80
+ 'custom_attributes' => apply_filters( 'booster_get_message', '', 'readonly' ),
81
  );
82
  $settings[] = array(
83
  'type' => 'sectionend',
84
  'id' => 'wcj_checkout_custom_info_blocks_options',
85
  );
86
+ $total_number = apply_filters( 'booster_get_option', 1, get_option( 'wcj_checkout_custom_info_total_number', 1 ) );
87
  for ( $i = 1; $i <= $total_number; $i++) {
88
  $settings = array_merge( $settings, array(
89
  array(
includes/class-wcj-checkout-files-upload.php CHANGED
@@ -33,7 +33,7 @@ class WCJ_Checkout_Files_Upload extends WCJ_Module {
33
  if ( $this->is_enabled() ) {
34
  add_action( 'add_meta_boxes', array( $this, 'add_file_admin_order_meta_box' ) );
35
  add_action( 'init', array( $this, 'process_checkout_files_upload' ) );
36
- $total_number = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_checkout_files_upload_total_number', 1 ) );
37
  for ( $i = 1; $i <= $total_number; $i++ ) {
38
  if ( 'disable' != ( $the_hook = get_option( 'wcj_checkout_files_upload_hook_' . $i, 'woocommerce_before_checkout_form' ) ) ) {
39
  add_action( $the_hook, array( $this, 'add_files_upload_form_to_checkout_frontend' ), get_option( 'wcj_checkout_files_upload_hook_priority_' . $i, 10 ) );
@@ -98,7 +98,7 @@ class WCJ_Checkout_Files_Upload extends WCJ_Module {
98
  * @since 2.4.5
99
  */
100
  function validate_on_checkout( $posted ) {
101
- $total_number = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_checkout_files_upload_total_number', 1 ) );
102
  for ( $i = 1; $i <= $total_number; $i++ ) {
103
  if (
104
  'yes' === get_option( 'wcj_checkout_files_upload_enabled_' . $i, 'yes' ) &&
@@ -185,7 +185,7 @@ class WCJ_Checkout_Files_Upload extends WCJ_Module {
185
  if ( ! file_exists( $upload_dir ) ) {
186
  mkdir( $upload_dir, 0755, true );
187
  }
188
- $total_number = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_checkout_files_upload_total_number', 1 ) );
189
  for ( $i = 1; $i <= $total_number; $i++ ) {
190
  if ( isset( $_SESSION[ 'wcj_checkout_files_upload_' . $i ] ) ) {
191
  $file_name = $_SESSION[ 'wcj_checkout_files_upload_' . $i ]['name'];
@@ -215,7 +215,7 @@ class WCJ_Checkout_Files_Upload extends WCJ_Module {
215
  session_start();
216
  }
217
  // Remove file
218
- $total_number = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_checkout_files_upload_total_number', 1 ) );
219
  for ( $i = 1; $i <= $total_number; $i++ ) {
220
  if ( isset( $_POST[ 'wcj_remove_checkout_file_' . $i ] ) ) {
221
  if ( isset( $_POST[ 'wcj_checkout_files_upload_order_id_' . $i ] ) ) {
@@ -523,7 +523,7 @@ class WCJ_Checkout_Files_Upload extends WCJ_Module {
523
  */
524
  function add_files_upload_form_to_thankyou_and_myaccount_page( $order_id ) {
525
  $html = '';
526
- $total_number = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_checkout_files_upload_total_number', 1 ) );
527
  $current_filter = current_filter();
528
  for ( $i = 1; $i <= $total_number; $i++ ) {
529
  if ( 'yes' === get_option( 'wcj_checkout_files_upload_enabled_' . $i, 'yes' ) && $this->is_visible( $i, $order_id ) ) {
@@ -557,7 +557,7 @@ class WCJ_Checkout_Files_Upload extends WCJ_Module {
557
  */
558
  function add_files_upload_form_to_checkout_frontend_all( $is_direct_call = false ) {
559
  $html = '';
560
- $total_number = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_checkout_files_upload_total_number', 1 ) );
561
  if ( ! $is_direct_call ) {
562
  $current_filter = current_filter();
563
  $current_filter_priority = wcj_current_filter_priority();
@@ -612,15 +612,15 @@ class WCJ_Checkout_Files_Upload extends WCJ_Module {
612
  'id' => 'wcj_checkout_files_upload_total_number',
613
  'default' => 1,
614
  'type' => 'custom_number',
615
- 'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
616
  'custom_attributes' => array_merge(
617
- is_array( apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ) ) ?
618
- apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ) : array(),
619
  array( 'step' => '1', 'min' => '1', )
620
  ),
621
  ),
622
  );
623
- $total_number = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_checkout_files_upload_total_number', 1 ) );
624
  for ( $i = 1; $i <= $total_number; $i++ ) {
625
  $settings = array_merge( $settings, array(
626
  array(
33
  if ( $this->is_enabled() ) {
34
  add_action( 'add_meta_boxes', array( $this, 'add_file_admin_order_meta_box' ) );
35
  add_action( 'init', array( $this, 'process_checkout_files_upload' ) );
36
+ $total_number = apply_filters( 'booster_get_option', 1, get_option( 'wcj_checkout_files_upload_total_number', 1 ) );
37
  for ( $i = 1; $i <= $total_number; $i++ ) {
38
  if ( 'disable' != ( $the_hook = get_option( 'wcj_checkout_files_upload_hook_' . $i, 'woocommerce_before_checkout_form' ) ) ) {
39
  add_action( $the_hook, array( $this, 'add_files_upload_form_to_checkout_frontend' ), get_option( 'wcj_checkout_files_upload_hook_priority_' . $i, 10 ) );
98
  * @since 2.4.5
99
  */
100
  function validate_on_checkout( $posted ) {
101
+ $total_number = apply_filters( 'booster_get_option', 1, get_option( 'wcj_checkout_files_upload_total_number', 1 ) );
102
  for ( $i = 1; $i <= $total_number; $i++ ) {
103
  if (
104
  'yes' === get_option( 'wcj_checkout_files_upload_enabled_' . $i, 'yes' ) &&
185
  if ( ! file_exists( $upload_dir ) ) {
186
  mkdir( $upload_dir, 0755, true );
187
  }
188
+ $total_number = apply_filters( 'booster_get_option', 1, get_option( 'wcj_checkout_files_upload_total_number', 1 ) );
189
  for ( $i = 1; $i <= $total_number; $i++ ) {
190
  if ( isset( $_SESSION[ 'wcj_checkout_files_upload_' . $i ] ) ) {
191
  $file_name = $_SESSION[ 'wcj_checkout_files_upload_' . $i ]['name'];
215
  session_start();
216
  }
217
  // Remove file
218
+ $total_number = apply_filters( 'booster_get_option', 1, get_option( 'wcj_checkout_files_upload_total_number', 1 ) );
219
  for ( $i = 1; $i <= $total_number; $i++ ) {
220
  if ( isset( $_POST[ 'wcj_remove_checkout_file_' . $i ] ) ) {
221
  if ( isset( $_POST[ 'wcj_checkout_files_upload_order_id_' . $i ] ) ) {
523
  */
524
  function add_files_upload_form_to_thankyou_and_myaccount_page( $order_id ) {
525
  $html = '';
526
+ $total_number = apply_filters( 'booster_get_option', 1, get_option( 'wcj_checkout_files_upload_total_number', 1 ) );
527
  $current_filter = current_filter();
528
  for ( $i = 1; $i <= $total_number; $i++ ) {
529
  if ( 'yes' === get_option( 'wcj_checkout_files_upload_enabled_' . $i, 'yes' ) && $this->is_visible( $i, $order_id ) ) {
557
  */
558
  function add_files_upload_form_to_checkout_frontend_all( $is_direct_call = false ) {
559
  $html = '';
560
+ $total_number = apply_filters( 'booster_get_option', 1, get_option( 'wcj_checkout_files_upload_total_number', 1 ) );
561
  if ( ! $is_direct_call ) {
562
  $current_filter = current_filter();
563
  $current_filter_priority = wcj_current_filter_priority();
612
  'id' => 'wcj_checkout_files_upload_total_number',
613
  'default' => 1,
614
  'type' => 'custom_number',
615
+ 'desc' => apply_filters( 'booster_get_message', '', 'desc' ),
616
  'custom_attributes' => array_merge(
617
+ is_array( apply_filters( 'booster_get_message', '', 'readonly' ) ) ?
618
+ apply_filters( 'booster_get_message', '', 'readonly' ) : array(),
619
  array( 'step' => '1', 'min' => '1', )
620
  ),
621
  ),
622
  );
623
+ $total_number = apply_filters( 'booster_get_option', 1, get_option( 'wcj_checkout_files_upload_total_number', 1 ) );
624
  for ( $i = 1; $i <= $total_number; $i++ ) {
625
  $settings = array_merge( $settings, array(
626
  array(
includes/class-wcj-currencies.php CHANGED
@@ -57,7 +57,7 @@ class WCJ_Currencies extends WCJ_Module {
57
  if ( 'yes' === get_option( 'wcj_currency_hide_symbol' ) ) {
58
  return '';
59
  }
60
- // return apply_filters( 'wcj_get_option_filter', wcj_get_currency_symbol( $currency ), get_option( 'wcj_currency_' . $currency, $currency_symbol ) ); // TODO: custom currency
61
  return wcj_get_currency_symbol( $currency );
62
  }
63
 
@@ -76,9 +76,9 @@ class WCJ_Currencies extends WCJ_Module {
76
  'id' => 'wcj_currency_' . get_woocommerce_currency(),
77
  'type' => 'text',
78
  'default' => get_woocommerce_currency_symbol(),
79
- 'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
80
  'css' => 'width: 50px;',
81
- 'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ),
82
  );
83
  }
84
  $updated_settings[] = $section;
@@ -116,11 +116,11 @@ class WCJ_Currencies extends WCJ_Module {
116
  foreach ( $currency_names as $currency_code => $currency_name ) {
117
  $settings[] = array(
118
  'title' => $currency_name,
119
- 'desc_tip' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc_no_link' ),
120
  'id' => 'wcj_currency_' . $currency_code,
121
  'default' => $currency_symbols[ $currency_code ],
122
  'type' => 'text',
123
- 'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ),
124
  );
125
  }
126
 
@@ -140,11 +140,11 @@ class WCJ_Currencies extends WCJ_Module {
140
  'id' => 'wcj_currency_custom_currency_total_number',
141
  'default' => 1,
142
  'type' => 'custom_number',
143
- 'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
144
- 'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ),
145
  );
146
 
147
- $custom_currency_total_number = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_currency_custom_currency_total_number', 1 ) );
148
  for ( $i = 1; $i <= $custom_currency_total_number; $i++) {
149
 
150
  $settings[] = array(
57
  if ( 'yes' === get_option( 'wcj_currency_hide_symbol' ) ) {
58
  return '';
59
  }
60
+ // return apply_filters( 'booster_get_option', wcj_get_currency_symbol( $currency ), get_option( 'wcj_currency_' . $currency, $currency_symbol ) ); // TODO: custom currency
61
  return wcj_get_currency_symbol( $currency );
62
  }
63
 
76
  'id' => 'wcj_currency_' . get_woocommerce_currency(),
77
  'type' => 'text',
78
  'default' => get_woocommerce_currency_symbol(),
79
+ 'desc' => apply_filters( 'booster_get_message', '', 'desc' ),
80
  'css' => 'width: 50px;',
81
+ 'custom_attributes' => apply_filters( 'booster_get_message', '', 'readonly' ),
82
  );
83
  }
84
  $updated_settings[] = $section;
116
  foreach ( $currency_names as $currency_code => $currency_name ) {
117
  $settings[] = array(
118
  'title' => $currency_name,
119
+ 'desc_tip' => apply_filters( 'booster_get_message', '', 'desc_no_link' ),
120
  'id' => 'wcj_currency_' . $currency_code,
121
  'default' => $currency_symbols[ $currency_code ],
122
  'type' => 'text',
123
+ 'custom_attributes' => apply_filters( 'booster_get_message', '', 'readonly' ),
124
  );
125
  }
126
 
140
  'id' => 'wcj_currency_custom_currency_total_number',
141
  'default' => 1,
142
  'type' => 'custom_number',
143
+ 'desc' => apply_filters( 'booster_get_message', '', 'desc' ),
144
+ 'custom_attributes' => apply_filters( 'booster_get_message', '', 'readonly' ),
145
  );
146
 
147
+ $custom_currency_total_number = apply_filters( 'booster_get_option', 1, get_option( 'wcj_currency_custom_currency_total_number', 1 ) );
148
  for ( $i = 1; $i <= $custom_currency_total_number; $i++) {
149
 
150
  $settings[] = array(
includes/class-wcj-currency-exchange-rates.php CHANGED
@@ -128,7 +128,7 @@ class WCJ_Currency_Exchange_Rates extends WCJ_Module {
128
 
129
  if ( wcj_is_module_enabled( 'price_by_country' ) ) {
130
  // Currency Pairs - Price by Country
131
- for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_price_by_country_total_groups_number', 1 ) ); $i++ ) {
132
  $currency_to = get_option( 'wcj_price_by_country_exchange_rate_currency_group_' . $i );
133
  $settings = $this->add_currency_pair_setting( $currency_from, $currency_to, $settings );
134
  }
@@ -136,7 +136,7 @@ class WCJ_Currency_Exchange_Rates extends WCJ_Module {
136
 
137
  if ( wcj_is_module_enabled( 'multicurrency' ) ) {
138
  // Currency Pairs - Multicurrency
139
- for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 2, get_option( 'wcj_multicurrency_total_number', 2 ) ); $i++ ) {
140
  $currency_to = get_option( 'wcj_multicurrency_currency_' . $i );
141
  $settings = $this->add_currency_pair_setting( $currency_from, $currency_to, $settings );
142
  }
@@ -144,7 +144,7 @@ class WCJ_Currency_Exchange_Rates extends WCJ_Module {
144
 
145
  if ( wcj_is_module_enabled( 'multicurrency_base_price' ) ) {
146
  // Currency Pairs - Multicurrency Product Base Price
147
- for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_multicurrency_base_price_total_number', 1 ) ); $i++ ) {
148
  $currency_to = get_option( 'wcj_multicurrency_base_price_currency_' . $i );
149
  $settings = $this->add_currency_pair_setting( $currency_from, $currency_to, $settings );
150
  }
@@ -152,7 +152,7 @@ class WCJ_Currency_Exchange_Rates extends WCJ_Module {
152
 
153
  if ( wcj_is_module_enabled( 'currency_per_product' ) ) {
154
  // Currency Pairs - Currency per Product
155
- for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_currency_per_product_total_number', 1 ) ); $i++ ) {
156
  $currency_to = get_option( 'wcj_currency_per_product_currency_' . $i );
157
  $settings = $this->add_currency_pair_setting( $currency_from, $currency_to, $settings );
158
  }
128
 
129
  if ( wcj_is_module_enabled( 'price_by_country' ) ) {
130
  // Currency Pairs - Price by Country
131
+ for ( $i = 1; $i <= apply_filters( 'booster_get_option', 1, get_option( 'wcj_price_by_country_total_groups_number', 1 ) ); $i++ ) {
132
  $currency_to = get_option( 'wcj_price_by_country_exchange_rate_currency_group_' . $i );
133
  $settings = $this->add_currency_pair_setting( $currency_from, $currency_to, $settings );
134
  }
136
 
137
  if ( wcj_is_module_enabled( 'multicurrency' ) ) {
138
  // Currency Pairs - Multicurrency
139
+ for ( $i = 1; $i <= apply_filters( 'booster_get_option', 2, get_option( 'wcj_multicurrency_total_number', 2 ) ); $i++ ) {
140
  $currency_to = get_option( 'wcj_multicurrency_currency_' . $i );
141
  $settings = $this->add_currency_pair_setting( $currency_from, $currency_to, $settings );
142
  }
144
 
145
  if ( wcj_is_module_enabled( 'multicurrency_base_price' ) ) {
146
  // Currency Pairs - Multicurrency Product Base Price
147
+ for ( $i = 1; $i <= apply_filters( 'booster_get_option', 1, get_option( 'wcj_multicurrency_base_price_total_number', 1 ) ); $i++ ) {
148
  $currency_to = get_option( 'wcj_multicurrency_base_price_currency_' . $i );
149
  $settings = $this->add_currency_pair_setting( $currency_from, $currency_to, $settings );
150
  }
152
 
153
  if ( wcj_is_module_enabled( 'currency_per_product' ) ) {
154
  // Currency Pairs - Currency per Product
155
+ for ( $i = 1; $i <= apply_filters( 'booster_get_option', 1, get_option( 'wcj_currency_per_product_total_number', 1 ) ); $i++ ) {
156
  $currency_to = get_option( 'wcj_currency_per_product_currency_' . $i );
157
  $settings = $this->add_currency_pair_setting( $currency_from, $currency_to, $settings );
158
  }
includes/class-wcj-currency-per-product.php CHANGED
@@ -116,7 +116,7 @@ class WCJ_Currency_Per_Product extends WCJ_Module {
116
  */
117
  function get_currency_exchange_rate( $currency_code ) {
118
  $currency_exchange_rate = 1;
119
- $total_number = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_currency_per_product_total_number', 1 ) );
120
  for ( $i = 1; $i <= $total_number; $i++ ) {
121
  if ( $currency_code === get_option( 'wcj_currency_per_product_currency_' . $i ) ) {
122
  $currency_exchange_rate = 1 / get_option( 'wcj_currency_per_product_exchange_rate_' . $i );
@@ -224,7 +224,7 @@ class WCJ_Currency_Per_Product extends WCJ_Module {
224
  $currency_codes = array();
225
  $currency_codes[ get_option('woocommerce_currency') ] = get_option('woocommerce_currency');
226
  $currency_codes[ get_woocommerce_currency() ] = get_woocommerce_currency();
227
- $total_number = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_currency_per_product_total_number', 1 ) );
228
  for ( $i = 1; $i <= $total_number; $i++ ) {
229
  $currency_codes[ get_option( 'wcj_currency_per_product_currency_' . $i ) ] = get_option( 'wcj_currency_per_product_currency_' . $i );
230
  }
@@ -291,11 +291,11 @@ class WCJ_Currency_Per_Product extends WCJ_Module {
291
  'manual' => __( 'Enter Rates Manually', 'woocommerce-jetpack' ),
292
  'auto' => __( 'Automatically via Currency Exchange Rates module', 'woocommerce-jetpack' ),
293
  ),
294
- 'desc' => ( '' == apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ) ) ?
295
  __( 'Visit', 'woocommerce-jetpack' ) . ' <a href="' . admin_url( 'admin.php?page=wc-settings&tab=jetpack&wcj-cat=prices_and_currencies&section=currency_exchange_rates' ) . '">' . __( 'Currency Exchange Rates module', 'woocommerce-jetpack' ) . '</a>'
296
  :
297
- apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
298
- 'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'disabled' ),
299
  ),
300
  array(
301
  'type' => 'sectionend',
@@ -311,14 +311,14 @@ class WCJ_Currency_Per_Product extends WCJ_Module {
311
  'id' => 'wcj_currency_per_product_total_number',
312
  'default' => 1,
313
  'type' => 'custom_number',
314
- 'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
315
  'custom_attributes' => array_merge(
316
- is_array( apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ) ) ? apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ) : array(),
317
  array( 'step' => '1', 'min' => '1', )
318
  ),
319
  ),
320
  );
321
- $total_number = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_currency_per_product_total_number', 1 ) );
322
  for ( $i = 1; $i <= $total_number; $i++ ) {
323
  $currency_to = get_option( 'wcj_currency_per_product_currency_' . $i, $currency_from );
324
  $custom_attributes = array(
116
  */
117
  function get_currency_exchange_rate( $currency_code ) {
118
  $currency_exchange_rate = 1;
119
+ $total_number = apply_filters( 'booster_get_option', 1, get_option( 'wcj_currency_per_product_total_number', 1 ) );
120
  for ( $i = 1; $i <= $total_number; $i++ ) {
121
  if ( $currency_code === get_option( 'wcj_currency_per_product_currency_' . $i ) ) {
122
  $currency_exchange_rate = 1 / get_option( 'wcj_currency_per_product_exchange_rate_' . $i );
224
  $currency_codes = array();
225
  $currency_codes[ get_option('woocommerce_currency') ] = get_option('woocommerce_currency');
226
  $currency_codes[ get_woocommerce_currency() ] = get_woocommerce_currency();
227
+ $total_number = apply_filters( 'booster_get_option', 1, get_option( 'wcj_currency_per_product_total_number', 1 ) );
228
  for ( $i = 1; $i <= $total_number; $i++ ) {
229
  $currency_codes[ get_option( 'wcj_currency_per_product_currency_' . $i ) ] = get_option( 'wcj_currency_per_product_currency_' . $i );
230
  }
291
  'manual' => __( 'Enter Rates Manually', 'woocommerce-jetpack' ),
292
  'auto' => __( 'Automatically via Currency Exchange Rates module', 'woocommerce-jetpack' ),
293
  ),
294
+ 'desc' => ( '' == apply_filters( 'booster_get_message', '', 'desc' ) ) ?
295
  __( 'Visit', 'woocommerce-jetpack' ) . ' <a href="' . admin_url( 'admin.php?page=wc-settings&tab=jetpack&wcj-cat=prices_and_currencies&section=currency_exchange_rates' ) . '">' . __( 'Currency Exchange Rates module', 'woocommerce-jetpack' ) . '</a>'
296
  :
297
+ apply_filters( 'booster_get_message', '', 'desc' ),
298
+ 'custom_attributes' => apply_filters( 'booster_get_message', '', 'disabled' ),
299
  ),
300
  array(
301
  'type' => 'sectionend',
311
  'id' => 'wcj_currency_per_product_total_number',
312
  'default' => 1,
313
  'type' => 'custom_number',
314
+ 'desc' => apply_filters( 'booster_get_message', '', 'desc' ),
315
  'custom_attributes' => array_merge(
316
+ is_array( apply_filters( 'booster_get_message', '', 'readonly' ) ) ? apply_filters( 'booster_get_message', '', 'readonly' ) : array(),
317
  array( 'step' => '1', 'min' => '1', )
318
  ),
319
  ),
320
  );
321
+ $total_number = apply_filters( 'booster_get_option', 1, get_option( 'wcj_currency_per_product_total_number', 1 ) );
322
  for ( $i = 1; $i <= $total_number; $i++ ) {
323
  $currency_to = get_option( 'wcj_currency_per_product_currency_' . $i, $currency_from );
324
  $custom_attributes = array(
includes/class-wcj-emails.php CHANGED
@@ -88,7 +88,7 @@ class WCJ_Emails extends WCJ_Module {
88
  * @since 2.3.9
89
  */
90
  function add_custom_emails_to_wc_resend_order_emails( $emails ) {
91
- for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_emails_custom_emails_total_number', 1 ) ); $i++ ) {
92
  $emails[] = 'wcj_custom' . '_' . $i;
93
  }
94
  return $emails;
@@ -104,7 +104,7 @@ class WCJ_Emails extends WCJ_Module {
104
  if ( ! class_exists( 'WC_Email_WCJ_Custom' ) ) {
105
  require_once( 'emails/class-wc-email-wcj-custom.php' );
106
  }
107
- for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_emails_custom_emails_total_number', 1 ) ); $i++ ) {
108
  $emails[ 'WC_Email_WCJ_Custom_' . $i ] = new WC_Email_WCJ_Custom( $i );
109
  }
110
  return $emails;
@@ -195,11 +195,11 @@ class WCJ_Emails extends WCJ_Module {
195
  'id' => 'wcj_emails_custom_emails_total_number',
196
  'default' => 1,
197
  'type' => 'custom_number',
198
- 'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
199
- 'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ),
200
  ),
201
  );
202
- $total_number = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_emails_custom_emails_total_number', 1 ) );
203
  for ( $i = 1; $i <= $total_number; $i++ ) {
204
  $settings [] = array(
205
  'title' => __( 'Admin Title Custom Email', 'woocommerce-jetpack' ) . ' #' . $i,
88
  * @since 2.3.9
89
  */
90
  function add_custom_emails_to_wc_resend_order_emails( $emails ) {
91
+ for ( $i = 1; $i <= apply_filters( 'booster_get_option', 1, get_option( 'wcj_emails_custom_emails_total_number', 1 ) ); $i++ ) {
92
  $emails[] = 'wcj_custom' . '_' . $i;
93
  }
94
  return $emails;
104
  if ( ! class_exists( 'WC_Email_WCJ_Custom' ) ) {
105
  require_once( 'emails/class-wc-email-wcj-custom.php' );
106
  }
107
+ for ( $i = 1; $i <= apply_filters( 'booster_get_option', 1, get_option( 'wcj_emails_custom_emails_total_number', 1 ) ); $i++ ) {
108
  $emails[ 'WC_Email_WCJ_Custom_' . $i ] = new WC_Email_WCJ_Custom( $i );
109
  }
110
  return $emails;
195
  'id' => 'wcj_emails_custom_emails_total_number',
196
  'default' => 1,
197
  'type' => 'custom_number',
198
+ 'desc' => apply_filters( 'booster_get_message', '', 'desc' ),
199
+ 'custom_attributes' => apply_filters( 'booster_get_message', '', 'readonly' ),
200
  ),
201
  );
202
+ $total_number = apply_filters( 'booster_get_option', 1, get_option( 'wcj_emails_custom_emails_total_number', 1 ) );
203
  for ( $i = 1; $i <= $total_number; $i++ ) {
204
  $settings [] = array(
205
  'title' => __( 'Admin Title Custom Email', 'woocommerce-jetpack' ) . ' #' . $i,
includes/class-wcj-empty-cart-button.php CHANGED
@@ -31,7 +31,7 @@ class WCJ_Empty_Cart_Button extends WCJ_Module {
31
  if ( $this->is_enabled() ) {
32
  add_action( 'init', array( $this, 'empty_cart' ) );
33
  add_action(
34
- apply_filters( 'wcj_get_option_filter', 'woocommerce_after_cart', get_option( 'wcj_empty_cart_position', 'woocommerce_after_cart' ) ),
35
  array( $this, 'add_empty_cart_link' )
36
  );
37
  if ( 'disable' != ( $empty_cart_checkout_position = get_option( 'wcj_empty_cart_checkout_position', 'disable' ) ) ) {
@@ -50,7 +50,7 @@ class WCJ_Empty_Cart_Button extends WCJ_Module {
50
  */
51
  public function add_empty_cart_link() {
52
  $confirmation_html = ( 'confirm_with_pop_up_box' == get_option( 'wcj_empty_cart_confirmation', 'no_confirmation' ) ) ? ' onclick="return confirm(\'' . get_option( 'wcj_empty_cart_confirmation_text' ) . '\')"' : '';
53
- echo '<div style="' . get_option( 'wcj_empty_cart_div_style', 'float: right;' ) . '"><form action="" method="post"><input type="submit" class="button" name="empty_cart" value="' . apply_filters( 'wcj_get_option_filter', 'Empty Cart', get_option( 'wcj_empty_cart_text' ) ) . '"' . $confirmation_html . '></form></div>';
54
  }
55
 
56
  /**
@@ -81,8 +81,8 @@ class WCJ_Empty_Cart_Button extends WCJ_Module {
81
  'id' => 'wcj_empty_cart_text',
82
  'default' => 'Empty Cart',
83
  'type' => 'text',
84
- 'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
85
- 'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ),
86
  ),
87
  array(
88
  'title' => __( 'Wrapping DIV style', 'woocommerce-jetpack' ),
@@ -102,8 +102,8 @@ class WCJ_Empty_Cart_Button extends WCJ_Module {
102
  'woocommerce_proceed_to_checkout' => __( 'After Proceed to Checkout button', 'woocommerce-jetpack' ),
103
  'woocommerce_after_cart_totals' => __( 'After Cart Totals', 'woocommerce-jetpack' ),
104
  ),
105
- 'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
106
- 'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'disabled' ),
107
  ),
108
  array(
109
  'title' => __( 'Button position on the Checkout page', 'woocommerce-jetpack' ),
@@ -122,8 +122,8 @@ class WCJ_Empty_Cart_Button extends WCJ_Module {
122
  'woocommerce_checkout_after_order_review' => __( 'After order review', 'woocommerce-jetpack' ),
123
  'woocommerce_after_checkout_form' => __( 'After checkout form', 'woocommerce-jetpack' ),
124
  ),
125
- /* 'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
126
- 'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'disabled' ), */
127
  ),
128
  array(
129
  'title' => __( 'Confirmation', 'woocommerce-jetpack' ),
31
  if ( $this->is_enabled() ) {
32
  add_action( 'init', array( $this, 'empty_cart' ) );
33
  add_action(
34
+ apply_filters( 'booster_get_option', 'woocommerce_after_cart', get_option( 'wcj_empty_cart_position', 'woocommerce_after_cart' ) ),
35
  array( $this, 'add_empty_cart_link' )
36
  );
37
  if ( 'disable' != ( $empty_cart_checkout_position = get_option( 'wcj_empty_cart_checkout_position', 'disable' ) ) ) {
50
  */
51
  public function add_empty_cart_link() {
52
  $confirmation_html = ( 'confirm_with_pop_up_box' == get_option( 'wcj_empty_cart_confirmation', 'no_confirmation' ) ) ? ' onclick="return confirm(\'' . get_option( 'wcj_empty_cart_confirmation_text' ) . '\')"' : '';
53
+ echo '<div style="' . get_option( 'wcj_empty_cart_div_style', 'float: right;' ) . '"><form action="" method="post"><input type="submit" class="button" name="empty_cart" value="' . apply_filters( 'booster_get_option', 'Empty Cart', get_option( 'wcj_empty_cart_text' ) ) . '"' . $confirmation_html . '></form></div>';
54
  }
55
 
56
  /**
81
  'id' => 'wcj_empty_cart_text',
82
  'default' => 'Empty Cart',
83
  'type' => 'text',
84
+ 'desc' => apply_filters( 'booster_get_message', '', 'desc' ),
85
+ 'custom_attributes' => apply_filters( 'booster_get_message', '', 'readonly' ),
86
  ),
87
  array(
88
  'title' => __( 'Wrapping DIV style', 'woocommerce-jetpack' ),
102
  'woocommerce_proceed_to_checkout' => __( 'After Proceed to Checkout button', 'woocommerce-jetpack' ),
103
  'woocommerce_after_cart_totals' => __( 'After Cart Totals', 'woocommerce-jetpack' ),
104
  ),
105
+ 'desc' => apply_filters( 'booster_get_message', '', 'desc' ),
106
+ 'custom_attributes' => apply_filters( 'booster_get_message', '', 'disabled' ),
107
  ),
108
  array(
109
  'title' => __( 'Button position on the Checkout page', 'woocommerce-jetpack' ),
122
  'woocommerce_checkout_after_order_review' => __( 'After order review', 'woocommerce-jetpack' ),
123
  'woocommerce_after_checkout_form' => __( 'After checkout form', 'woocommerce-jetpack' ),
124
  ),
125
+ /* 'desc' => apply_filters( 'booster_get_message', '', 'desc' ),
126
+ 'custom_attributes' => apply_filters( 'booster_get_message', '', 'disabled' ), */
127
  ),
128
  array(
129
  'title' => __( 'Confirmation', 'woocommerce-jetpack' ),
includes/class-wcj-eu-vat-number.php CHANGED
@@ -217,7 +217,7 @@ class WCJ_EU_VAT_Number extends WCJ_Module {
217
  if ( isset( $_POST['wcj_eu_vat_number_to_check'] ) && '' != $_POST['wcj_eu_vat_number_to_check'] ) {
218
  $eu_vat_number_to_check = substr( $_POST['wcj_eu_vat_number_to_check'], 2 );
219
  $eu_vat_number_country_to_check = substr( $_POST['wcj_eu_vat_number_to_check'], 0, 2 );
220
- if ( 'yes' === apply_filters( 'wcj_get_option_filter', 'no', get_option( 'wcj_eu_vat_number_check_ip_location_country', 'no' ) ) ) {
221
  $location = WC_Geolocation::geolocate_ip();
222
  if ( empty( $location['country'] ) ) {
223
  $location = wc_format_country_state_string( apply_filters( 'woocommerce_customer_default_location', get_option( 'woocommerce_default_country' ) ) );
@@ -252,7 +252,7 @@ class WCJ_EU_VAT_Number extends WCJ_Module {
252
  isset( $_SESSION['wcj_is_eu_vat_number_valid'] ) && true === $_SESSION['wcj_is_eu_vat_number_valid'] && isset( $_SESSION['wcj_eu_vat_number_to_check'] )
253
  ) {
254
  $preserve_base_country_check_passed = true;
255
- if ( 'yes' === apply_filters( 'wcj_get_option_filter', 'no', get_option( 'wcj_eu_vat_number_preserve_in_base_country', 'no' ) ) ) {
256
  $location = wc_get_base_location();
257
  if ( empty( $location['country'] ) ) {
258
  $location = wc_format_country_state_string( apply_filters( 'woocommerce_customer_default_location', get_option( 'woocommerce_default_country' ) ) );
@@ -439,9 +439,9 @@ class WCJ_EU_VAT_Number extends WCJ_Module {
439
  'id' => 'wcj_eu_vat_number_preserve_in_base_country',
440
  'default' => 'no',
441
  'type' => 'checkbox',
442
- 'desc_tip' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
443
  'custom_attributes'
444
- => apply_filters( 'get_wc_jetpack_plus_message', '', 'disabled' ),
445
  ),
446
  /* array(
447
  'title' => '',
@@ -457,9 +457,9 @@ class WCJ_EU_VAT_Number extends WCJ_Module {
457
  'id' => 'wcj_eu_vat_number_check_ip_location_country',
458
  'default' => 'no',
459
  'type' => 'checkbox',
460
- 'desc_tip' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
461
  'custom_attributes'
462
- => apply_filters( 'get_wc_jetpack_plus_message', '', 'disabled' ),
463
  ),
464
  /* array(
465
  'title' => '',
217
  if ( isset( $_POST['wcj_eu_vat_number_to_check'] ) && '' != $_POST['wcj_eu_vat_number_to_check'] ) {
218
  $eu_vat_number_to_check = substr( $_POST['wcj_eu_vat_number_to_check'], 2 );
219
  $eu_vat_number_country_to_check = substr( $_POST['wcj_eu_vat_number_to_check'], 0, 2 );
220
+ if ( 'yes' === apply_filters( 'booster_get_option', 'no', get_option( 'wcj_eu_vat_number_check_ip_location_country', 'no' ) ) ) {
221
  $location = WC_Geolocation::geolocate_ip();
222
  if ( empty( $location['country'] ) ) {
223
  $location = wc_format_country_state_string( apply_filters( 'woocommerce_customer_default_location', get_option( 'woocommerce_default_country' ) ) );
252
  isset( $_SESSION['wcj_is_eu_vat_number_valid'] ) && true === $_SESSION['wcj_is_eu_vat_number_valid'] && isset( $_SESSION['wcj_eu_vat_number_to_check'] )
253
  ) {
254
  $preserve_base_country_check_passed = true;
255
+ if ( 'yes' === apply_filters( 'booster_get_option', 'no', get_option( 'wcj_eu_vat_number_preserve_in_base_country', 'no' ) ) ) {
256
  $location = wc_get_base_location();
257
  if ( empty( $location['country'] ) ) {
258
  $location = wc_format_country_state_string( apply_filters( 'woocommerce_customer_default_location', get_option( 'woocommerce_default_country' ) ) );
439
  'id' => 'wcj_eu_vat_number_preserve_in_base_country',
440
  'default' => 'no',
441
  'type' => 'checkbox',
442
+ 'desc_tip' => apply_filters( 'booster_get_message', '', 'desc' ),
443
  'custom_attributes'
444
+ => apply_filters( 'booster_get_message', '', 'disabled' ),
445
  ),
446
  /* array(
447
  'title' => '',
457
  'id' => 'wcj_eu_vat_number_check_ip_location_country',
458
  'default' => 'no',
459
  'type' => 'checkbox',
460
+ 'desc_tip' => apply_filters( 'booster_get_message', '', 'desc' ),
461
  'custom_attributes'
462
+ => apply_filters( 'booster_get_message', '', 'disabled' ),
463
  ),
464
  /* array(
465
  'title' => '',
includes/class-wcj-export-import.php CHANGED
@@ -4,10 +4,10 @@
4
  *
5
  * The WooCommerce Jetpack Export Import class.
6
  *
7
- * @version 2.5.7
8
  * @since 2.5.4
9
  * @author Algoritmika Ltd.
10
- * @todo import products (maybe orders, customers) tool(s);
11
  */
12
 
13
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -19,7 +19,7 @@ class WCJ_Export_Import extends WCJ_Module {
19
  /**
20
  * Constructor.
21
  *
22
- * @version 2.5.4
23
  * @since 2.5.4
24
  */
25
  public function __construct() {
@@ -37,78 +37,154 @@ class WCJ_Export_Import extends WCJ_Module {
37
  ),
38
  'export_customers_from_orders' => array(
39
  'title' => __( 'Export Customers from Orders', 'woocommerce-jetpack' ),
40
- 'desc' => __( 'Export Customers (extracted from orders).', 'woocommerce-jetpack' ),
41
  ),
42
  'export_orders' => array(
43
  'title' => __( 'Export Orders', 'woocommerce-jetpack' ),
44
  'desc' => __( 'Export Orders.', 'woocommerce-jetpack' ),
45
  ),
 
 
 
 
46
  'export_products' => array(
47
  'title' => __( 'Export Products', 'woocommerce-jetpack' ),
48
  'desc' => __( 'Export Products.', 'woocommerce-jetpack' ),
49
  ),
50
  ) );
51
 
 
 
52
  if ( $this->is_enabled() ) {
53
  add_action( 'init', array( $this, 'export_csv' ) );
 
54
  }
55
  }
56
 
57
  /**
58
  * export.
59
  *
60
- * @version 2.5.3
61
  * @since 2.4.8
 
62
  */
63
  function export( $tool_id ) {
64
  $data = array();
65
  switch ( $tool_id ) {
66
  case 'customers':
67
- $data = $this->export_customers();
 
68
  break;
69
  case 'customers_from_orders':
70
- $data = $this->export_customers_from_orders();
 
71
  break;
72
  case 'orders':
73
- $data = $this->export_orders();
 
 
 
 
 
74
  break;
75
  case 'products':
76
- $data = $this->export_products();
 
77
  break;
78
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
79
  return $data;
80
  }
81
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
82
  /**
83
  * export_csv.
84
  *
85
- * @version 2.5.7
86
  * @since 2.4.8
87
  */
88
  function export_csv() {
89
  if ( isset( $_POST['wcj_export'] ) ) {
90
  $data = $this->export( $_POST['wcj_export'] );
91
- $csv = '';
92
- foreach ( $data as $row ) {
93
- $csv .= implode( get_option( 'wcj_export_csv_separator', ',' ), $row ) . PHP_EOL;
94
- }
95
- if ( 'yes' === get_option( 'wcj_export_csv_add_utf_8_bom', 'yes' ) ) {
96
- $csv = "\xEF\xBB\xBF" . $csv; // UTF-8 BOM
 
 
 
 
 
 
 
 
97
  }
98
- header( "Content-Disposition: attachment; filename=" . $_POST['wcj_export'] . ".csv" );
99
- header( "Content-Type: Content-Type: text/html; charset=utf-8" );
100
- header( "Content-Description: File Transfer" );
101
- header( "Content-Length: " . strlen( $csv ) );
102
- echo $csv;
103
- die();
104
  }
105
  }
106
 
107
  /**
108
  * export_filter_fields.
109
  *
110
- * @version 2.5.6
111
  * @since 2.5.5
 
112
  */
113
  function export_filter_fields( $tool_id ) {
114
  $fields = array();
@@ -119,6 +195,11 @@ class WCJ_Export_Import extends WCJ_Module {
119
  'wcj_filter_by_product_title' => __( 'Filter by Product Title', 'woocommerce-jetpack' ),
120
  );
121
  break;
 
 
 
 
 
122
  }
123
  if ( ! empty( $fields ) ) {
124
  $data = array();
@@ -137,162 +218,10 @@ class WCJ_Export_Import extends WCJ_Module {
137
  }
138
  }
139
 
140
- /**
141
- * get_order_export_fields.
142
- *
143
- * @version 2.5.7
144
- * @since 2.5.6
145
- */
146
- function get_order_export_fields() {
147
- return array(
148
- 'order-id' => __( 'Order ID', 'woocommerce-jetpack' ),
149
- 'order-number' => __( 'Order Number', 'woocommerce-jetpack' ),
150
- 'order-status' => __( 'Order Status', 'woocommerce-jetpack' ),
151
- 'order-date' => __( 'Order Date', 'woocommerce-jetpack' ),
152
- 'order-time' => __( 'Order Time', 'woocommerce-jetpack' ),
153
- 'order-item-count' => __( 'Order Item Count', 'woocommerce-jetpack' ),
154
- 'order-items' => __( 'Order Items', 'woocommerce-jetpack' ),
155
- 'order-items-product-input-fields' => __( 'Order Items Product Input Fields', 'woocommerce-jetpack' ),
156
- 'order-currency' => __( 'Order Currency', 'woocommerce-jetpack' ),
157
- 'order-total' => __( 'Order Total', 'woocommerce-jetpack' ),
158
- 'order-total-tax' => __( 'Order Total Tax', 'woocommerce-jetpack' ),
159
- 'order-payment-method' => __( 'Order Payment Method', 'woocommerce-jetpack' ),
160
- 'order-notes' => __( 'Order Notes', 'woocommerce-jetpack' ),
161
- 'billing-first-name' => __( 'Billing First Name', 'woocommerce-jetpack' ),
162
- 'billing-last-name' => __( 'Billing Last Name', 'woocommerce-jetpack' ),
163
- 'billing-company' => __( 'Billing Company', 'woocommerce-jetpack' ),
164
- 'billing-address-1' => __( 'Billing Address 1', 'woocommerce-jetpack' ),
165
- 'billing-address-2' => __( 'Billing Address 2', 'woocommerce-jetpack' ),
166
- 'billing-city' => __( 'Billing City', 'woocommerce-jetpack' ),
167
- 'billing-state' => __( 'Billing State', 'woocommerce-jetpack' ),
168
- 'billing-postcode' => __( 'Billing Postcode', 'woocommerce-jetpack' ),
169
- 'billing-country' => __( 'Billing Country', 'woocommerce-jetpack' ),
170
- 'billing-phone' => __( 'Billing Phone', 'woocommerce-jetpack' ),
171
- 'billing-email' => __( 'Billing Email', 'woocommerce-jetpack' ),
172
- 'shipping-first-name' => __( 'Shipping First Name', 'woocommerce-jetpack' ),
173
- 'shipping-last-name' => __( 'Shipping Last Name', 'woocommerce-jetpack' ),
174
- 'shipping-company' => __( 'Shipping Company', 'woocommerce-jetpack' ),
175
- 'shipping-address-1' => __( 'Shipping Address 1', 'woocommerce-jetpack' ),
176
- 'shipping-address-2' => __( 'Shipping Address 2', 'woocommerce-jetpack' ),
177
- 'shipping-city' => __( 'Shipping City', 'woocommerce-jetpack' ),
178
- 'shipping-state' => __( 'Shipping State', 'woocommerce-jetpack' ),
179
- 'shipping-postcode' => __( 'Shipping Postcode', 'woocommerce-jetpack' ),
180
- 'shipping-country' => __( 'Shipping Country', 'woocommerce-jetpack' ),
181
- );
182
- }
183
-
184
- /**
185
- * get_order_export_default_fields_ids.
186
- *
187
- * @version 2.5.7
188
- * @since 2.5.6
189
- */
190
- function get_order_export_default_fields_ids() {
191
- return array(
192
- 'order-id',
193
- 'order-number',
194
- 'order-status',
195
- 'order-date',
196
- 'order-time',
197
- 'order-item-count',
198
- 'order-items',
199
- 'order-currency',
200
- 'order-total',
201
- 'order-total-tax',
202
- 'order-payment-method',
203
- 'order-notes',
204
- 'billing-first-name',
205
- 'billing-last-name',
206
- 'billing-company',
207
- 'billing-address-1',
208
- 'billing-address-2',
209
- 'billing-city',
210
- 'billing-state',
211
- 'billing-postcode',
212
- 'billing-country',
213
- 'billing-phone',
214
- 'billing-email',
215
- 'shipping-first-name',
216
- 'shipping-last-name',
217
- 'shipping-company',
218
- 'shipping-address-1',
219
- 'shipping-address-2',
220
- 'shipping-city',
221
- 'shipping-state',
222
- 'shipping-postcode',
223
- 'shipping-country',
224
- );
225
- }
226
-
227
- /**
228
- * get_product_export_fields.
229
- *
230
- * @version 2.5.7
231
- * @since 2.5.7
232
- */
233
- function get_product_export_fields() {
234
- return array(
235
- 'product-id' => __( 'Product ID', 'woocommerce-jetpack' ),
236
- 'product-name' => __( 'Name', 'woocommerce-jetpack' ),
237
- 'product-sku' => __( 'SKU', 'woocommerce-jetpack' ),
238
- 'product-stock' => __( 'Total Stock', 'woocommerce-jetpack' ),
239
- 'product-stock-quantity' => __( 'Stock Quantity', 'woocommerce-jetpack' ),
240
- 'product-regular-price' => __( 'Regular Price', 'woocommerce-jetpack' ),
241
- 'product-sale-price' => __( 'Sale Price', 'woocommerce-jetpack' ),
242
- 'product-price' => __( 'Price', 'woocommerce-jetpack' ),
243
- 'product-type' => __( 'Type', 'woocommerce-jetpack' ),
244
- // 'product-attributes' => __( 'Attributes', 'woocommerce-jetpack' ),
245
- 'product-image-url' => __( 'Image URL', 'woocommerce-jetpack' ),
246
- 'product-short-description' => __( 'Short Description', 'woocommerce-jetpack' ),
247
- 'product-description' => __( 'Description', 'woocommerce-jetpack' ),
248
- 'product-status' => __( 'Status', 'woocommerce-jetpack' ),
249
- 'product-url' => __( 'URL', 'woocommerce-jetpack' ),
250
- 'product-shipping-class' => __( 'Shipping Class', 'woocommerce-jetpack' ),
251
- 'product-shipping-class-id' => __( 'Shipping Class ID', 'woocommerce-jetpack' ),
252
- 'product-width' => __( 'Width', 'woocommerce-jetpack' ),
253
- 'product-length' => __( 'Length', 'woocommerce-jetpack' ),
254
- 'product-height' => __( 'Height', 'woocommerce-jetpack' ),
255
- 'product-weight' => __( 'Weight', 'woocommerce-jetpack' ),
256
- 'product-downloadable' => __( 'Downloadable', 'woocommerce-jetpack' ),
257
- 'product-virtual' => __( 'Virtual', 'woocommerce-jetpack' ),
258
- 'product-sold-individually' => __( 'Sold Individually', 'woocommerce-jetpack' ),
259
- 'product-tax-status' => __( 'Tax Status', 'woocommerce-jetpack' ),
260
- 'product-tax-class' => __( 'Tax Class', 'woocommerce-jetpack' ),
261
- 'product-manage-stock' => __( 'Manage Stock', 'woocommerce-jetpack' ),
262
- 'product-stock-status' => __( 'Stock Status', 'woocommerce-jetpack' ),
263
- 'product-backorders' => __( 'Backorders', 'woocommerce-jetpack' ),
264
- 'product-featured' => __( 'Featured', 'woocommerce-jetpack' ),
265
- 'product-visibility' => __( 'Visibility', 'woocommerce-jetpack' ),
266
- );
267
- }
268
-
269
- /**
270
- * get_product_export_default_fields_ids.
271
- *
272
- * @version 2.5.7
273
- * @since 2.5.7
274
- */
275
- function get_product_export_default_fields_ids() {
276
- return array(
277
- 'product-id',
278
- 'product-name',
279
- 'product-sku',
280
- 'product-stock',
281
- 'product-regular-price',
282
- 'product-sale-price',
283
- 'product-price',
284
- 'product-type',
285
- 'product-image-url',
286
- 'product-short-description',
287
- 'product-status',
288
- 'product-url',
289
- );
290
- }
291
-
292
  /**
293
  * create_export_tool.
294
  *
295
- * @version 2.5.7
296
  * @since 2.4.8
297
  */
298
  function create_export_tool( $tool_id ) {
@@ -300,9 +229,15 @@ class WCJ_Export_Import extends WCJ_Module {
300
  echo $this->get_tool_header_html( 'export_' . $tool_id );
301
  echo '<form method="post" action="">';
302
  echo '<p>' . $this->export_filter_fields( $tool_id ) . '</p>';
303
- echo '<p><button class="button-primary" type="submit" name="wcj_export" value="' . $tool_id . '">' . __( 'Download CSV', 'woocommerce-jetpack' ) . '</button></p>';
 
 
 
 
 
 
304
  echo '</form>';
305
- echo wcj_get_table_html( $data, array( 'table_class' => 'widefat striped' ) );
306
  }
307
 
308
  /**
@@ -325,6 +260,16 @@ class WCJ_Export_Import extends WCJ_Module {
325
  $this->create_export_tool( 'orders' );
326
  }
327
 
 
 
 
 
 
 
 
 
 
 
328
  /**
329
  * create_export_products_tool.
330
  *
@@ -345,474 +290,12 @@ class WCJ_Export_Import extends WCJ_Module {
345
  $this->create_export_tool( 'customers_from_orders' );
346
  }
347
 
348
- /**
349
- * export_customers.
350
- *
351
- * @version 2.4.8
352
- * @since 2.4.8
353
- */
354
- function export_customers() {
355
- $data = array();
356
- $data[] = array(
357
- __( 'Customer ID', 'woocommerce-jetpack' ),
358
- __( 'Customer Email', 'woocommerce-jetpack' ),
359
- __( 'Customer First Name', 'woocommerce-jetpack' ),
360
- __( 'Customer Last Name', 'woocommerce-jetpack' ),
361
- );
362
- $customers = get_users( 'role=customer' );
363
- foreach ( $customers as $customer ) {
364
- $data[] = array( $customer->ID, $customer->user_email, $customer->first_name, $customer->last_name, );
365
- }
366
- return $data;
367
- }
368
-
369
- /**
370
- * export_orders.
371
- *
372
- * @version 2.5.7
373
- * @since 2.4.8
374
- */
375
- function export_orders() {
376
- $all_fields = $this->get_order_export_fields();
377
- $fields_ids = get_option( 'wcj_export_orders_fields', $this->get_order_export_default_fields_ids() );
378
- $titles = array();
379
- foreach( $fields_ids as $field_id ) {
380
- $titles[] = $all_fields[ $field_id ];
381
- }
382
- $data = array();
383
- $data[] = $titles;
384
- $offset = 0;
385
- $block_size = 1024;
386
- while( true ) {
387
- $args_orders = array(
388
- 'post_type' => 'shop_order',
389
- 'post_status' => 'any',
390
- 'posts_per_page' => $block_size,
391
- 'orderby' => 'date',
392
- 'order' => 'DESC',
393
- 'offset' => $offset,
394
- 'fields' => 'ids',
395
- );
396
- $loop_orders = new WP_Query( $args_orders );
397
- if ( ! $loop_orders->have_posts() ) break;
398
- foreach ( $loop_orders->posts as $order_id ) {
399
- $order = wc_get_order( $order_id );
400
-
401
- if ( isset( $_POST['wcj_filter_by_order_billing_country'] ) && '' != $_POST['wcj_filter_by_order_billing_country'] ) {
402
- if ( $order->billing_country != $_POST['wcj_filter_by_order_billing_country'] ) {
403
- continue;
404
- }
405
- }
406
-
407
- $filter_by_product_title = true;
408
- if ( isset( $_POST['wcj_filter_by_product_title'] ) && '' != $_POST['wcj_filter_by_product_title'] ) {
409
- $filter_by_product_title = false;
410
- }
411
- $items = array();
412
- $items_product_input_fields = array();
413
- foreach ( $order->get_items() as $item ) {
414
- $items[] = $item['name'];
415
- $item_product_input_fields = wcj_get_product_input_fields( $item );
416
- if ( '' != $item_product_input_fields ) {
417
- $items_product_input_fields[] = $item_product_input_fields;
418
- }
419
- if ( ! $filter_by_product_title ) {
420
- // if ( $item['name'] === $_POST['wcj_filter_by_product_title'] ) {
421
- if ( false !== strpos( $item['name'], $_POST['wcj_filter_by_product_title'] ) ) {
422
- $filter_by_product_title = true;
423
- }
424
- }
425
- }
426
- $items = implode( ' / ', $items );
427
- $items_product_input_fields = implode( ' / ', $items_product_input_fields );
428
- if ( ! $filter_by_product_title ) {
429
- continue;
430
- }
431
-
432
- $row = array();
433
- foreach( $fields_ids as $field_id ) {
434
- switch ( $field_id ) {
435
- case 'order-id':
436
- $row[] = $order_id;
437
- break;
438
- case 'order-number':
439
- $row[] = $order->get_order_number();
440
- break;
441
- case 'order-status':
442
- $row[] = $order->get_status();
443
- break;
444
- case 'order-date':
445
- $row[] = get_the_date( get_option( 'date_format' ), $order_id );
446
- break;
447
- case 'order-time':
448
- $row[] = get_the_time( get_option( 'time_format' ), $order_id );
449
- break;
450
- case 'order-item-count':
451
- $row[] = $order->get_item_count();
452
- break;
453
- case 'order-items':
454
- $row[] = $items;
455
- break;
456
- case 'order-items-product-input-fields':
457
- $row[] = $items_product_input_fields;
458
- break;
459
- case 'order-currency':
460
- $row[] = $order->get_order_currency();
461
- break;
462
- case 'order-total':
463
- $row[] = $order->get_total();
464
- break;
465
- case 'order-total-tax':
466
- $row[] = $order->get_total_tax();
467
- break;
468
- case 'order-payment-method':
469
- $row[] = $order->payment_method_title;
470
- break;
471
- case 'order-notes':
472
- $row[] = $order->customer_note;
473
- break;
474
- case 'billing-first-name':
475
- $row[] = $order->billing_first_name;
476
- break;
477
- case 'billing-last-name':
478
- $row[] = $order->billing_last_name;
479
- break;
480
- case 'billing-company':
481
- $row[] = $order->billing_company;
482
- break;
483
- case 'billing-address-1':
484
- $row[] = $order->billing_address_1;
485
- break;
486
- case 'billing-address-2':
487
- $row[] = $order->billing_address_2;
488
- break;
489
- case 'billing-city':
490
- $row[] = $order->billing_city;
491
- break;
492
- case 'billing-state':
493
- $row[] = $order->billing_state;
494
- break;
495
- case 'billing-postcode':
496
- $row[] = $order->billing_postcode;
497
- break;
498
- case 'billing-country':
499
- $row[] = $order->billing_country;
500
- break;
501
- case 'billing-phone':
502
- $row[] = $order->billing_phone;
503
- break;
504
- case 'billing-email':
505
- $row[] = $order->billing_email;
506
- break;
507
- case 'shipping-first-name':
508
- $row[] = $order->shipping_first_name;
509
- break;
510
- case 'shipping-last-name':
511
- $row[] = $order->shipping_last_name;
512
- break;
513
- case 'shipping-company':
514
- $row[] = $order->shipping_company;
515
- break;
516
- case 'shipping-address-1':
517
- $row[] = $order->shipping_address_1;
518
- break;
519
- case 'shipping-address-2':
520
- $row[] = $order->shipping_address_2;
521
- break;
522
- case 'shipping-city':
523
- $row[] = $order->shipping_city;
524
- break;
525
- case 'shipping-state':
526
- $row[] = $order->shipping_state;
527
- break;
528
- case 'shipping-postcode':
529
- $row[] = $order->shipping_postcode;
530
- break;
531
- case 'shipping-country':
532
- $row[] = $order->shipping_country;
533
- break;
534
- }
535
- }
536
- $data[] = $row;
537
- }
538
- $offset += $block_size;
539
- }
540
- return $data;
541
- }
542
-
543
- /**
544
- * get_variable_or_grouped_product_info.
545
- *
546
- * @version 2.5.7
547
- * @since 2.5.7
548
- */
549
- function get_variable_or_grouped_product_info( $_product, $which_info ) {
550
- $all_variations_data = array();
551
- foreach ( $_product->get_children() as $child_id ) {
552
- $variation = $_product->get_child( $child_id );
553
- switch ( $which_info ) {
554
- case 'price':
555
- $all_variations_data[] = ( '' === $variation->get_price() ) ? '-' : $variation->get_price();
556
- break;
557
- case 'regular_price':
558
- $all_variations_data[] = ( '' === $variation->get_regular_price() ) ? '-' : $variation->get_regular_price();
559
- break;
560
- case 'sale_price':
561
- $all_variations_data[] = ( '' === $variation->get_sale_price() ) ? '-' : $variation->get_sale_price();
562
- break;
563
- case 'total_stock':
564
- $all_variations_data[] = ( null === $variation->get_total_stock() ) ? '-' : $variation->get_total_stock();
565
- break;
566
- case 'stock_quantity':
567
- $all_variations_data[] = ( null === $variation->get_stock_quantity() ) ? '-' : $variation->get_stock_quantity();
568
- break;
569
- }
570
- }
571
- return implode( '/', $all_variations_data );
572
- }
573
-
574
- /**
575
- * export_products.
576
- *
577
- * @version 2.5.7
578
- * @since 2.5.3
579
- * @todo export variations; product attributes; get_price_including_tax, get_price_excluding_tax, get_display_price, get_average_rating, get_rating_count, get_review_count, get_categories, get_tags, get_dimensions, get_formatted_name, get_availability;
580
- */
581
- function export_products() {
582
-
583
- // Standard Fields
584
- $all_fields = $this->get_product_export_fields();
585
- $fields_ids = get_option( 'wcj_export_products_fields', $this->get_product_export_default_fields_ids() );
586
- $titles = array();
587
- foreach( $fields_ids as $field_id ) {
588
- $titles[] = $all_fields[ $field_id ];
589
- }
590
-
591
- // Additional Fields
592
- $total_number = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_export_products_fields_additional_total_number', 1 ) );
593
- for ( $i = 1; $i <= $total_number; $i++ ) {
594
- if ( 'yes' === get_option( 'wcj_export_products_fields_additional_enabled_' . $i, 'no' ) ) {
595
- $titles[] = get_option( 'wcj_export_products_fields_additional_title_' . $i, '' );
596
- }
597
- }
598
-
599
- $data = array();
600
- $data[] = $titles;
601
- $offset = 0;
602
- $block_size = 1024;
603
- while( true ) {
604
- $args = array(
605
- 'post_type' => 'product',
606
- 'post_status' => 'any',
607
- 'posts_per_page' => $block_size,
608
- 'orderby' => 'date',
609
- 'order' => 'DESC',
610
- 'offset' => $offset,
611
- 'fields' => 'ids',
612
- );
613
- $loop = new WP_Query( $args );
614
- if ( ! $loop->have_posts() ) {
615
- break;
616
- }
617
- foreach ( $loop->posts as $product_id ) {
618
- $_product = wc_get_product( $product_id );
619
- $row = array();
620
- foreach( $fields_ids as $field_id ) {
621
- switch ( $field_id ) {
622
- case 'product-id':
623
- $row[] = $product_id;
624
- break;
625
- case 'product-name':
626
- $row[] = $_product->get_title();
627
- break;
628
- case 'product-sku':
629
- $row[] = $_product->get_sku();
630
- break;
631
- case 'product-stock-quantity':
632
- $row[] = ( $_product->is_type( 'variable' ) || $_product->is_type( 'grouped' ) ?
633
- $this->get_variable_or_grouped_product_info( $_product, 'stock_quantity' ) : $_product->get_stock_quantity() );
634
- break;
635
- case 'product-stock':
636
- $row[] = ( $_product->is_type( 'variable' ) || $_product->is_type( 'grouped' ) ?
637
- $this->get_variable_or_grouped_product_info( $_product, 'total_stock' ) : $_product->get_total_stock() );
638
- break;
639
- case 'product-regular-price':
640
- $row[] = ( $_product->is_type( 'variable' ) || $_product->is_type( 'grouped' ) ?
641
- $this->get_variable_or_grouped_product_info( $_product, 'regular_price' ) : $_product->get_regular_price() );
642
- break;
643
- case 'product-sale-price':
644
- $row[] = ( $_product->is_type( 'variable' ) || $_product->is_type( 'grouped' ) ?
645
- $this->get_variable_or_grouped_product_info( $_product, 'sale_price' ) : $_product->get_sale_price() );
646
- break;
647
- case 'product-price':
648
- $row[] = ( $_product->is_type( 'variable' ) || $_product->is_type( 'grouped' ) ?
649
- $this->get_variable_or_grouped_product_info( $_product, 'price' ) : $_product->get_price() );
650
- break;
651
- case 'product-type':
652
- $row[] = $_product->get_type();
653
- break;
654
- /* todo
655
- case 'product-attributes':
656
- $row[] = ( ! empty( $_product->get_attributes() ) ? serialize( $_product->get_attributes() ) : '' );
657
- break;
658
- */
659
- case 'product-image-url':
660
- $row[] = wcj_get_product_image_url( $product_id, 'full' );
661
- break;
662
- case 'product-short-description':
663
- $row[] = $_product->post->post_excerpt;
664
- break;
665
- case 'product-description':
666
- $row[] = $_product->post->post_content;
667
- break;
668
- case 'product-status':
669
- $row[] = $_product->post->post_status;
670
- break;
671
- case 'product-url':
672
- $row[] = $_product->get_permalink();
673
- break;
674
- case 'product-shipping-class':
675
- $row[] = $_product->get_shipping_class();
676
- break;
677
- case 'product-shipping-class-id':
678
- $row[] = $_product->get_shipping_class_id();
679
- break;
680
- case 'product-width':
681
- $row[] = $_product->get_width();
682
- break;
683
- case 'product-length':
684
- $row[] = $_product->get_length();
685
- break;
686
- case 'product-height':
687
- $row[] = $_product->get_height();
688
- break;
689
- case 'product-weight':
690
- $row[] = $_product->get_weight();
691
- break;
692
- case 'product-downloadable':
693
- $row[] = $_product->downloadable;
694
- break;
695
- case 'product-virtual':
696
- $row[] = $_product->virtual;
697
- break;
698
- case 'product-sold-individually':
699
- $row[] = $_product->sold_individually;
700
- break;
701
- case 'product-tax-status':
702
- $row[] = $_product->get_tax_status();
703
- break;
704
- case 'product-tax-class':
705
- $row[] = $_product->get_tax_class();
706
- break;
707
- case 'product-manage-stock':
708
- $row[] = $_product->manage_stock;
709
- break;
710
- case 'product-stock-status':
711
- $row[] = $_product->stock_status;
712
- break;
713
- case 'product-backorders':
714
- $row[] = $_product->backorders;
715
- break;
716
- case 'product-featured':
717
- $row[] = $_product->featured;
718
- break;
719
- case 'product-visibility':
720
- $row[] = $_product->visibility;
721
- break;
722
- // todo
723
- // get_price_including_tax
724
- // get_price_excluding_tax
725
- // get_display_price
726
- // get_average_rating
727
- // get_rating_count
728
- // get_review_count
729
- // get_categories
730
- // get_tags
731
- // get_dimensions
732
- // get_formatted_name
733
- // get_availability
734
- }
735
- }
736
-
737
- // Additional Fields
738
- $total_number = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_export_products_fields_additional_total_number', 1 ) );
739
- for ( $i = 1; $i <= $total_number; $i++ ) {
740
- if ( 'yes' === get_option( 'wcj_export_products_fields_additional_enabled_' . $i, 'no' ) ) {
741
- if ( '' != $additional_field_value = get_option( 'wcj_export_products_fields_additional_value_' . $i, '' ) ) {
742
- if ( 'meta' === get_option( 'wcj_export_products_fields_additional_type_' . $i, 'meta' ) ) {
743
- $row[] = get_post_meta( $product_id, $additional_field_value, true );
744
- } else {
745
- global $post;
746
- $post = get_post( $product_id );
747
- setup_postdata( $post );
748
- $row[] = do_shortcode( $additional_field_value );
749
- wp_reset_postdata();
750
- }
751
- } else {
752
- $row[] = '';
753
- }
754
- }
755
- }
756
-
757
- $data[] = $row;
758
- }
759
- $offset += $block_size;
760
- }
761
- return $data;
762
- }
763
-
764
- /**
765
- * export_customers_from_orders.
766
- *
767
- * @version 2.4.8
768
- * @since 2.4.8
769
- */
770
- function export_customers_from_orders() {
771
- $data = array();
772
- $data[] = array(
773
- __( 'Nr.', 'woocommerce-jetpack' ),
774
- __( 'Email', 'woocommerce-jetpack' ),
775
- __( 'First Name', 'woocommerce-jetpack' ),
776
- __( 'Last Name', 'woocommerce-jetpack' ),
777
- __( 'Last Order Date', 'woocommerce-jetpack' ),
778
- );
779
- $total_customers = 0;
780
- $orders = array();
781
- $offset = 0;
782
- $block_size = 96;
783
- while( true ) {
784
- $args_orders = array(
785
- 'post_type' => 'shop_order',
786
- 'post_status' => 'any',
787
- 'posts_per_page' => $block_size,
788
- 'orderby' => 'date',
789
- 'order' => 'DESC',
790
- 'offset' => $offset,
791
- );
792
- $loop_orders = new WP_Query( $args_orders );
793
- if ( ! $loop_orders->have_posts() ) break;
794
- while ( $loop_orders->have_posts() ) : $loop_orders->the_post();
795
- $order_id = $loop_orders->post->ID;
796
- $order = wc_get_order( $order_id );
797
- if ( isset( $order->billing_email ) && '' != $order->billing_email && ! in_array( $order->billing_email, $orders ) ) {
798
- $emails_to_skip = array();
799
- if ( ! in_array( $order->billing_email, $emails_to_skip ) ) {
800
- $total_customers++;
801
- $data[] = array( $total_customers, $order->billing_email, $order->billing_first_name, $order->billing_last_name, get_the_date( 'Y/m/d' ), );
802
- $orders[] = $order->billing_email;
803
- }
804
- }
805
- endwhile;
806
- $offset += $block_size;
807
- }
808
- return $data;
809
- }
810
-
811
  /**
812
  * get_settings.
813
  *
814
- * @version 2.5.7
815
  * @since 2.5.4
 
816
  */
817
  function get_settings() {
818
  $settings = array(
@@ -835,20 +318,160 @@ class WCJ_Export_Import extends WCJ_Module {
835
  'default' => 'yes',
836
  'type' => 'checkbox',
837
  ),
 
 
 
 
 
 
 
 
 
838
  array(
839
  'title' => __( 'Export Orders Fields', 'woocommerce-jetpack' ),
 
840
  'id' => 'wcj_export_orders_fields',
841
- 'default' => $this->get_order_export_default_fields_ids(),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
842
  'type' => 'multiselect',
843
- 'options' => $this->get_order_export_fields(),
844
  'css' => 'height:300px;',
845
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
846
  array(
847
  'title' => __( 'Export Products Fields', 'woocommerce-jetpack' ),
 
848
  'id' => 'wcj_export_products_fields',
849
- 'default' => $this->get_product_export_default_fields_ids(),
850
  'type' => 'multiselect',
851
- 'options' => $this->get_product_export_fields(),
852
  'css' => 'height:300px;',
853
  ),
854
  array(
@@ -856,15 +479,15 @@ class WCJ_Export_Import extends WCJ_Module {
856
  'id' => 'wcj_export_products_fields_additional_total_number',
857
  'default' => 1,
858
  'type' => 'custom_number',
859
- 'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
860
  'custom_attributes' => array_merge(
861
- is_array( apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ) ) ?
862
- apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ) : array(),
863
  array( 'step' => '1', 'min' => '0', )
864
  ),
865
  ),
866
- );
867
- $total_number = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_export_products_fields_additional_total_number', 1 ) );
868
  for ( $i = 1; $i <= $total_number; $i++ ) {
869
  $settings = array_merge( $settings, array(
870
  array(
@@ -886,13 +509,14 @@ class WCJ_Export_Import extends WCJ_Module {
886
  'type' => 'select',
887
  'default' => 'meta',
888
  'options' => array(
889
- 'meta' => __( 'Meta', 'woocommerce-jetpack' ),
890
- 'shortcode' => __( 'Shortcode', 'woocommerce-jetpack' ),
891
  ),
892
  ),
893
  array(
894
  'desc' => __( 'Value', 'woocommerce-jetpack' ),
895
- 'desc_tip' => __( 'If field\'s "Type" is set to "Meta", enter product meta key to retrieve (can be custom field name).', 'woocommerce-jetpack' ),
 
896
  'id' => 'wcj_export_products_fields_additional_value_' . $i,
897
  'type' => 'text',
898
  'default' => '',
@@ -902,7 +526,43 @@ class WCJ_Export_Import extends WCJ_Module {
902
  $settings = array_merge( $settings, array(
903
  array(
904
  'type' => 'sectionend',
905
- 'id' => 'wcj_export_options',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
906
  ),
907
  ) );
908
  return $this->add_standard_settings( $settings );
4
  *
5
  * The WooCommerce Jetpack Export Import class.
6
  *
7
+ * @version 2.5.9
8
  * @since 2.5.4
9
  * @author Algoritmika Ltd.
10
+ * @todo import products, (maybe) orders, customers tools;
11
  */
12
 
13
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
19
  /**
20
  * Constructor.
21
  *
22
+ * @version 2.5.9
23
  * @since 2.5.4
24
  */
25
  public function __construct() {
37
  ),
38
  'export_customers_from_orders' => array(
39
  'title' => __( 'Export Customers from Orders', 'woocommerce-jetpack' ),
40
+ 'desc' => __( 'Export Customers (extracted from orders).', 'woocommerce-jetpack' ) . ' ' . __( 'Customers are identified by billing email.', 'woocommerce-jetpack' ),
41
  ),
42
  'export_orders' => array(
43
  'title' => __( 'Export Orders', 'woocommerce-jetpack' ),
44
  'desc' => __( 'Export Orders.', 'woocommerce-jetpack' ),
45
  ),
46
+ 'export_orders_items' => array(
47
+ 'title' => __( 'Export Orders Items', 'woocommerce-jetpack' ),
48
+ 'desc' => __( 'Export Orders Items.', 'woocommerce-jetpack' ),
49
+ ),
50
  'export_products' => array(
51
  'title' => __( 'Export Products', 'woocommerce-jetpack' ),
52
  'desc' => __( 'Export Products.', 'woocommerce-jetpack' ),
53
  ),
54
  ) );
55
 
56
+ $this->fields_helper = require_once( 'export/class-wcj-fields-helper.php' );
57
+
58
  if ( $this->is_enabled() ) {
59
  add_action( 'init', array( $this, 'export_csv' ) );
60
+ add_action( 'init', array( $this, 'export_xml' ) );
61
  }
62
  }
63
 
64
  /**
65
  * export.
66
  *
67
+ * @version 2.5.9
68
  * @since 2.4.8
69
+ * @todo when filtering now using strpos, but other options would be stripos (case-insensitive) or strict equality
70
  */
71
  function export( $tool_id ) {
72
  $data = array();
73
  switch ( $tool_id ) {
74
  case 'customers':
75
+ $exporter = require_once( 'export/class-wcj-exporter-customers.php' );
76
+ $data = $exporter->export_customers( $this->fields_helper );
77
  break;
78
  case 'customers_from_orders':
79
+ $exporter = require_once( 'export/class-wcj-exporter-customers.php' );
80
+ $data = $exporter->export_customers_from_orders( $this->fields_helper );
81
  break;
82
  case 'orders':
83
+ $exporter = require_once( 'export/class-wcj-exporter-orders.php' );
84
+ $data = $exporter->export_orders( $this->fields_helper );
85
+ break;
86
+ case 'orders_items':
87
+ $exporter = require_once( 'export/class-wcj-exporter-orders.php' );
88
+ $data = $exporter->export_orders_items( $this->fields_helper );
89
  break;
90
  case 'products':
91
+ $exporter = require_once( 'export/class-wcj-exporter-products.php' );
92
+ $data = $exporter->export_products( $this->fields_helper );
93
  break;
94
  }
95
+ if ( isset( $_POST['wcj_export_filter_all_columns'] ) && '' != $_POST['wcj_export_filter_all_columns'] ) {
96
+ foreach ( $data as $row_id => $row ) {
97
+ if ( 0 == $row_id ) {
98
+ continue;
99
+ }
100
+ $is_filtered = false;
101
+ foreach ( $row as $cell ) {
102
+ if ( false !== strpos( $cell, $_POST['wcj_export_filter_all_columns'] ) ) {
103
+ $is_filtered = true;
104
+ break;
105
+ }
106
+ }
107
+ if ( ! $is_filtered ) {
108
+ unset( $data[ $row_id ] );
109
+ }
110
+ }
111
+ }
112
+ /* if ( 1 == count( $data ) ) {
113
+ return '<em>' . __( 'No results found.', 'woocommerce-jetpack' ) . '</em>';
114
+ } */
115
  return $data;
116
  }
117
 
118
+ /**
119
+ * export_xml.
120
+ *
121
+ * @version 2.5.9
122
+ * @since 2.5.9
123
+ * @todo templates for xml_start, xml_end, xml_item.
124
+ */
125
+ function export_xml() {
126
+ if ( isset( $_POST['wcj_export_xml'] ) ) {
127
+ $data = $this->export( $_POST['wcj_export_xml'] );
128
+ if ( is_array( $data ) ) {
129
+ $xml = '';
130
+ $xml .= '<?xml version = "1.0" encoding = "utf-8" ?>' . PHP_EOL . '<root>' . PHP_EOL;
131
+ foreach ( $data as $row_num => $row ) {
132
+ if ( 0 == $row_num ) {
133
+ foreach ( $row as $cell_id => $cell_value ) {
134
+ $cell_ids[ $cell_id ] = sanitize_title_with_dashes( $cell_value );
135
+ }
136
+ continue;
137
+ }
138
+ $xml .= '<item>' . PHP_EOL;
139
+ foreach ( $row as $cell_id => $cell_value ) {
140
+ $xml .= "\t" . '<' . $cell_ids[ $cell_id ] . '>' . $cell_value . '</' . $cell_ids[ $cell_id ] . '>' . PHP_EOL;
141
+ }
142
+ $xml .= '</item>' . PHP_EOL;
143
+ }
144
+ $xml .= '</root>';
145
+ header( "Content-Disposition: attachment; filename=" . $_POST['wcj_export_xml'] . ".xml" );
146
+ header( "Content-Type: Content-Type: text/html; charset=utf-8" );
147
+ header( "Content-Description: File Transfer" );
148
+ header( "Content-Length: " . strlen( $xml ) );
149
+ echo $xml;
150
+ die();
151
+ }
152
+ }
153
+ }
154
+
155
  /**
156
  * export_csv.
157
  *
158
+ * @version 2.5.9
159
  * @since 2.4.8
160
  */
161
  function export_csv() {
162
  if ( isset( $_POST['wcj_export'] ) ) {
163
  $data = $this->export( $_POST['wcj_export'] );
164
+ if ( is_array( $data ) ) {
165
+ $csv = '';
166
+ foreach ( $data as $row ) {
167
+ $csv .= implode( get_option( 'wcj_export_csv_separator', ',' ), $row ) . PHP_EOL;
168
+ }
169
+ if ( 'yes' === get_option( 'wcj_export_csv_add_utf_8_bom', 'yes' ) ) {
170
+ $csv = "\xEF\xBB\xBF" . $csv; // UTF-8 BOM
171
+ }
172
+ header( "Content-Disposition: attachment; filename=" . $_POST['wcj_export'] . ".csv" );
173
+ header( "Content-Type: Content-Type: text/html; charset=utf-8" );
174
+ header( "Content-Description: File Transfer" );
175
+ header( "Content-Length: " . strlen( $csv ) );
176
+ echo $csv;
177
+ die();
178
  }
 
 
 
 
 
 
179
  }
180
  }
181
 
182
  /**
183
  * export_filter_fields.
184
  *
185
+ * @version 2.5.9
186
  * @since 2.5.5
187
+ * @todo filter each field.
188
  */
189
  function export_filter_fields( $tool_id ) {
190
  $fields = array();
195
  'wcj_filter_by_product_title' => __( 'Filter by Product Title', 'woocommerce-jetpack' ),
196
  );
197
  break;
198
+ case 'orders_items':
199
+ $fields = array(
200
+ 'wcj_filter_by_order_billing_country' => __( 'Filter by Billing Country', 'woocommerce-jetpack' ),
201
+ );
202
+ break;
203
  }
204
  if ( ! empty( $fields ) ) {
205
  $data = array();
218
  }
219
  }
220
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
221
  /**
222
  * create_export_tool.
223
  *
224
+ * @version 2.5.9
225
  * @since 2.4.8
226
  */
227
  function create_export_tool( $tool_id ) {
229
  echo $this->get_tool_header_html( 'export_' . $tool_id );
230
  echo '<form method="post" action="">';
231
  echo '<p>' . $this->export_filter_fields( $tool_id ) . '</p>';
232
+ echo '<p>';
233
+ echo '<button class="button-primary" type="submit" name="wcj_export" value="' . $tool_id . '">' . __( 'Download CSV', 'woocommerce-jetpack' ) . '</button>';
234
+ echo ' ';
235
+ echo '<button class="button-primary" type="submit" name="wcj_export_xml" value="' . $tool_id . '">' . __( 'Download XML', 'woocommerce-jetpack' ) . '</button>';
236
+ echo '<button style="float:right;margin-right:10px;" class="button-primary" type="submit" name="wcj_export_filter" value="' . $tool_id . '">' . __( 'Filter by All Fields', 'woocommerce-jetpack' ) . '</button>';
237
+ echo '<input style="float:right;margin-right:10px;" type="text" name="wcj_export_filter_all_columns" value="' . ( isset( $_POST['wcj_export_filter_all_columns'] ) ? $_POST['wcj_export_filter_all_columns'] : '' ) . '">';
238
+ echo '</p>';
239
  echo '</form>';
240
+ echo ( is_array( $data ) ) ? wcj_get_table_html( $data, array( 'table_class' => 'widefat striped' ) ) : $data;
241
  }
242
 
243
  /**
260
  $this->create_export_tool( 'orders' );
261
  }
262
 
263
+ /**
264
+ * create_export_orders_items_tool.
265
+ *
266
+ * @version 2.5.9
267
+ * @since 2.5.9
268
+ */
269
+ function create_export_orders_items_tool() {
270
+ $this->create_export_tool( 'orders_items' );
271
+ }
272
+
273
  /**
274
  * create_export_products_tool.
275
  *
290
  $this->create_export_tool( 'customers_from_orders' );
291
  }
292
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
293
  /**
294
  * get_settings.
295
  *
296
+ * @version 2.5.9
297
  * @since 2.5.4
298
+ * @todo add "Additional Export Fields" for "Customers from Orders" and (maybe) "Customers"
299
  */
300
  function get_settings() {
301
  $settings = array(
318
  'default' => 'yes',
319
  'type' => 'checkbox',
320
  ),
321
+ array(
322
+ 'type' => 'sectionend',
323
+ 'id' => 'wcj_export_options',
324
+ ),
325
+ array(
326
+ 'title' => __( 'Export Orders Options', 'woocommerce-jetpack' ),
327
+ 'type' => 'title',
328
+ 'id' => 'wcj_export_orders_options',
329
+ ),
330
  array(
331
  'title' => __( 'Export Orders Fields', 'woocommerce-jetpack' ),
332
+ 'desc_tip' => __( 'Hold "Control" key to select multiple fields.', 'woocommerce-jetpack' ),
333
  'id' => 'wcj_export_orders_fields',
334
+ 'default' => $this->fields_helper->get_order_export_default_fields_ids(),
335
+ 'type' => 'multiselect',
336
+ 'options' => $this->fields_helper->get_order_export_fields(),
337
+ 'css' => 'height:300px;',
338
+ ),
339
+ array(
340
+ 'title' => __( 'Additional Export Orders Fields', 'woocommerce-jetpack' ),
341
+ 'id' => 'wcj_export_orders_fields_additional_total_number',
342
+ 'default' => 1,
343
+ 'type' => 'custom_number',
344
+ 'desc' => apply_filters( 'booster_get_message', '', 'desc' ),
345
+ 'custom_attributes' => array_merge(
346
+ is_array( apply_filters( 'booster_get_message', '', 'readonly' ) ) ?
347
+ apply_filters( 'booster_get_message', '', 'readonly' ) : array(),
348
+ array( 'step' => '1', 'min' => '0', )
349
+ ),
350
+ ),
351
+ );
352
+ $total_number = apply_filters( 'booster_get_option', 1, get_option( 'wcj_export_orders_fields_additional_total_number', 1 ) );
353
+ for ( $i = 1; $i <= $total_number; $i++ ) {
354
+ $settings = array_merge( $settings, array(
355
+ array(
356
+ 'title' => __( 'Field', 'woocommerce-jetpack' ) . ' #' . $i,
357
+ 'id' => 'wcj_export_orders_fields_additional_enabled_' . $i,
358
+ 'desc' => __( 'Enabled', 'woocommerce-jetpack' ),
359
+ 'type' => 'checkbox',
360
+ 'default' => 'no',
361
+ ),
362
+ array(
363
+ 'desc' => __( 'Title', 'woocommerce-jetpack' ),
364
+ 'id' => 'wcj_export_orders_fields_additional_title_' . $i,
365
+ 'type' => 'text',
366
+ 'default' => '',
367
+ ),
368
+ array(
369
+ 'desc' => __( 'Type', 'woocommerce-jetpack' ),
370
+ 'id' => 'wcj_export_orders_fields_additional_type_' . $i,
371
+ 'type' => 'select',
372
+ 'default' => 'meta',
373
+ 'options' => array(
374
+ 'meta' => __( 'Order Meta', 'woocommerce-jetpack' ),
375
+ 'shortcode' => __( 'Order Shortcode', 'woocommerce-jetpack' ),
376
+ ),
377
+ ),
378
+ array(
379
+ 'desc' => __( 'Value', 'woocommerce-jetpack' ),
380
+ 'desc_tip' => __( 'If field\'s "Type" is set to "Meta", enter order meta key to retrieve (can be custom field name).', 'woocommerce-jetpack' ) .
381
+ ' ' . __( 'If it\'s set to "Shortcode", use Booster\'s Orders shortcodes here.', 'woocommerce-jetpack' ),
382
+ 'id' => 'wcj_export_orders_fields_additional_value_' . $i,
383
+ 'type' => 'text',
384
+ 'default' => '',
385
+ ),
386
+ ) );
387
+ }
388
+ $settings = array_merge( $settings, array(
389
+ array(
390
+ 'type' => 'sectionend',
391
+ 'id' => 'wcj_export_orders_options',
392
+ ),
393
+ array(
394
+ 'title' => __( 'Export Orders Items Options', 'woocommerce-jetpack' ),
395
+ 'type' => 'title',
396
+ 'id' => 'wcj_export_orders_items_options',
397
+ ),
398
+ array(
399
+ 'title' => __( 'Export Orders Items Fields', 'woocommerce-jetpack' ),
400
+ 'desc_tip' => __( 'Hold "Control" key to select multiple fields.', 'woocommerce-jetpack' ),
401
+ 'id' => 'wcj_export_orders_items_fields',
402
+ 'default' => $this->fields_helper->get_order_items_export_default_fields_ids(),
403
  'type' => 'multiselect',
404
+ 'options' => $this->fields_helper->get_order_items_export_fields(),
405
  'css' => 'height:300px;',
406
  ),
407
+ array(
408
+ 'title' => __( 'Additional Export Orders Items Fields', 'woocommerce-jetpack' ),
409
+ 'id' => 'wcj_export_orders_items_fields_additional_total_number',
410
+ 'default' => 1,
411
+ 'type' => 'custom_number',
412
+ 'desc' => apply_filters( 'booster_get_message', '', 'desc' ),
413
+ 'custom_attributes' => array_merge(
414
+ is_array( apply_filters( 'booster_get_message', '', 'readonly' ) ) ?
415
+ apply_filters( 'booster_get_message', '', 'readonly' ) : array(),
416
+ array( 'step' => '1', 'min' => '0', )
417
+ ),
418
+ ),
419
+ ) );
420
+ $total_number = apply_filters( 'booster_get_option', 1, get_option( 'wcj_export_orders_items_fields_additional_total_number', 1 ) );
421
+ for ( $i = 1; $i <= $total_number; $i++ ) {
422
+ $settings = array_merge( $settings, array(
423
+ array(
424
+ 'title' => __( 'Field', 'woocommerce-jetpack' ) . ' #' . $i,
425
+ 'id' => 'wcj_export_orders_items_fields_additional_enabled_' . $i,
426
+ 'desc' => __( 'Enabled', 'woocommerce-jetpack' ),
427
+ 'type' => 'checkbox',
428
+ 'default' => 'no',
429
+ ),
430
+ array(
431
+ 'desc' => __( 'Title', 'woocommerce-jetpack' ),
432
+ 'id' => 'wcj_export_orders_items_fields_additional_title_' . $i,
433
+ 'type' => 'text',
434
+ 'default' => '',
435
+ ),
436
+ array(
437
+ 'desc' => __( 'Type', 'woocommerce-jetpack' ),
438
+ 'id' => 'wcj_export_orders_items_fields_additional_type_' . $i,
439
+ 'type' => 'select',
440
+ 'default' => 'meta',
441
+ 'options' => array(
442
+ 'meta' => __( 'Order Meta', 'woocommerce-jetpack' ),
443
+ 'shortcode' => __( 'Order Shortcode', 'woocommerce-jetpack' ),
444
+ 'meta_product' => __( 'Product Meta', 'woocommerce-jetpack' ),
445
+ 'shortcode_product' => __( 'Product Shortcode', 'woocommerce-jetpack' ),
446
+ ),
447
+ ),
448
+ array(
449
+ 'desc' => __( 'Value', 'woocommerce-jetpack' ),
450
+ 'desc_tip' => __( 'If field\'s "Type" is set to "Meta", enter order/product meta key to retrieve (can be custom field name).', 'woocommerce-jetpack' ) .
451
+ ' ' . __( 'If it\'s set to "Shortcode", use Booster\'s Orders/Products shortcodes here.', 'woocommerce-jetpack' ),
452
+ 'id' => 'wcj_export_orders_items_fields_additional_value_' . $i,
453
+ 'type' => 'text',
454
+ 'default' => '',
455
+ ),
456
+ ) );
457
+ }
458
+ $settings = array_merge( $settings, array(
459
+ array(
460
+ 'type' => 'sectionend',
461
+ 'id' => 'wcj_export_orders_items_options',
462
+ ),
463
+ array(
464
+ 'title' => __( 'Export Products Options', 'woocommerce-jetpack' ),
465
+ 'type' => 'title',
466
+ 'id' => 'wcj_export_products_options',
467
+ ),
468
  array(
469
  'title' => __( 'Export Products Fields', 'woocommerce-jetpack' ),
470
+ 'desc_tip' => __( 'Hold "Control" key to select multiple fields.', 'woocommerce-jetpack' ),
471
  'id' => 'wcj_export_products_fields',
472
+ 'default' => $this->fields_helper->get_product_export_default_fields_ids(),
473
  'type' => 'multiselect',
474
+ 'options' => $this->fields_helper->get_product_export_fields(),
475
  'css' => 'height:300px;',
476
  ),
477
  array(
479
  'id' => 'wcj_export_products_fields_additional_total_number',
480
  'default' => 1,
481
  'type' => 'custom_number',
482
+ 'desc' => apply_filters( 'booster_get_message', '', 'desc' ),
483
  'custom_attributes' => array_merge(
484
+ is_array( apply_filters( 'booster_get_message', '', 'readonly' ) ) ?
485
+ apply_filters( 'booster_get_message', '', 'readonly' ) : array(),
486
  array( 'step' => '1', 'min' => '0', )
487
  ),
488
  ),
489
+ ) );
490
+ $total_number = apply_filters( 'booster_get_option', 1, get_option( 'wcj_export_products_fields_additional_total_number', 1 ) );
491
  for ( $i = 1; $i <= $total_number; $i++ ) {
492
  $settings = array_merge( $settings, array(
493
  array(
509
  'type' => 'select',
510
  'default' => 'meta',
511
  'options' => array(
512
+ 'meta' => __( 'Product Meta', 'woocommerce-jetpack' ),
513
+ 'shortcode' => __( 'Product Shortcode', 'woocommerce-jetpack' ),
514
  ),
515
  ),
516
  array(
517
  'desc' => __( 'Value', 'woocommerce-jetpack' ),
518
+ 'desc_tip' => __( 'If field\'s "Type" is set to "Meta", enter product meta key to retrieve (can be custom field name).', 'woocommerce-jetpack' ) .
519
+ ' ' . __( 'If it\'s set to "Shortcode", use Booster\'s Products shortcodes here.', 'woocommerce-jetpack' ),
520
  'id' => 'wcj_export_products_fields_additional_value_' . $i,
521
  'type' => 'text',
522
  'default' => '',
526
  $settings = array_merge( $settings, array(
527
  array(
528
  'type' => 'sectionend',
529
+ 'id' => 'wcj_export_products_options',
530
+ ),
531
+ array(
532
+ 'title' => __( 'Export Customers Options', 'woocommerce-jetpack' ),
533
+ 'type' => 'title',
534
+ 'id' => 'wcj_export_customers_options',
535
+ ),
536
+ array(
537
+ 'title' => __( 'Export Customers Fields', 'woocommerce-jetpack' ),
538
+ 'desc_tip' => __( 'Hold "Control" key to select multiple fields.', 'woocommerce-jetpack' ),
539
+ 'id' => 'wcj_export_customers_fields',
540
+ 'default' => $this->fields_helper->get_customer_export_default_fields_ids(),
541
+ 'type' => 'multiselect',
542
+ 'options' => $this->fields_helper->get_customer_export_fields(),
543
+ 'css' => 'height:150px;',
544
+ ),
545
+ array(
546
+ 'type' => 'sectionend',
547
+ 'id' => 'wcj_export_customers_options',
548
+ ),
549
+ array(
550
+ 'title' => __( 'Export Customers from Orders Options', 'woocommerce-jetpack' ),
551
+ 'type' => 'title',
552
+ 'id' => 'wcj_export_customers_from_orders_options',
553
+ ),
554
+ array(
555
+ 'title' => __( 'Export Customers from Orders Fields', 'woocommerce-jetpack' ),
556
+ 'desc_tip' => __( 'Hold "Control" key to select multiple fields.', 'woocommerce-jetpack' ),
557
+ 'id' => 'wcj_export_customers_from_orders_fields',
558
+ 'default' => $this->fields_helper->get_customer_from_order_export_default_fields_ids(),
559
+ 'type' => 'multiselect',
560
+ 'options' => $this->fields_helper->get_customer_from_order_export_fields(),
561
+ 'css' => 'height:150px;',
562
+ ),
563
+ array(
564
+ 'type' => 'sectionend',
565
+ 'id' => 'wcj_export_customers_from_orders_options',
566
  ),
567
  ) );
568
  return $this->add_standard_settings( $settings );
includes/class-wcj-free-price.php ADDED
@@ -0,0 +1,191 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * WooCommerce Jetpack Free Price
4
+ *
5
+ * The WooCommerce Jetpack Free Price class.
6
+ *
7
+ * @version 2.5.9
8
+ * @since 2.5.9
9
+ * @author Algoritmika Ltd.
10
+ */
11
+
12
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
13
+
14
+ if ( ! class_exists( 'WCJ_Free_Price' ) ) :
15
+
16
+ class WCJ_Free_Price extends WCJ_Module {
17
+
18
+ /**
19
+ * Constructor.
20
+ *
21
+ * @version 2.5.9
22
+ * @since 2.5.9
23
+ * @todo single in grouped is treated as "related"
24
+ */
25
+ function __construct() {
26
+
27
+ $this->id = 'free_price';
28
+ $this->short_desc = __( 'Free Price Labels', 'woocommerce-jetpack' );
29
+ $this->desc = __( 'WooCommerce free price labels.', 'woocommerce-jetpack' );
30
+ $this->link = 'http://booster.io/features/woocommerce-free-price/';
31
+ parent::__construct();
32
+
33
+ add_action( 'init', array( $this, 'add_settings_hook' ) );
34
+
35
+ if ( $this->is_enabled() ) {
36
+ add_filter( 'woocommerce_free_price_html', array( $this, 'modify_free_price_simple_external_custom' ), PHP_INT_MAX, 2 );
37
+ add_filter( 'woocommerce_grouped_free_price_html', array( $this, 'modify_free_price_grouped' ), PHP_INT_MAX, 2 );
38
+ add_filter( 'woocommerce_variable_free_price_html', array( $this, 'modify_free_price_variable' ), PHP_INT_MAX, 2 );
39
+ add_filter( 'woocommerce_variation_free_price_html', array( $this, 'modify_free_price_variation' ), PHP_INT_MAX, 2 );
40
+ }
41
+ }
42
+
43
+ /**
44
+ * get_view_id
45
+ *
46
+ * @version 2.5.9
47
+ * @since 2.5.9
48
+ */
49
+ function get_view_id( $product_id ) {
50
+ $view = 'single'; // default
51
+ if ( is_single( $product_id ) ) {
52
+ $view = 'single';
53
+ } elseif ( is_single() ) {
54
+ $view = 'related';
55
+ } elseif ( is_front_page() ) {
56
+ $view = 'home';
57
+ } elseif ( is_page() ) {
58
+ $view = 'page';
59
+ } elseif ( is_archive() ) {
60
+ $view = 'archive';
61
+ }
62
+ return $view;
63
+ }
64
+
65
+ /**
66
+ * modify_free_price_simple_external_custom.
67
+ *
68
+ * @version 2.5.9
69
+ * @since 2.5.9
70
+ */
71
+ function modify_free_price_simple_external_custom( $price, $_product ) {
72
+ $default = '<span class="amount">' . __( 'Free!', 'woocommerce' ) . '</span>';
73
+ return ( $_product->is_type( 'external' ) ) ?
74
+ do_shortcode( get_option( 'wcj_free_price_external_' . $this->get_view_id( $_product->id ), $default ) ) :
75
+ do_shortcode( get_option( 'wcj_free_price_simple_' . $this->get_view_id( $_product->id ), $default ) );
76
+ }
77
+
78
+ /**
79
+ * modify_free_price_grouped.
80
+ *
81
+ * @version 2.5.9
82
+ * @since 2.5.9
83
+ */
84
+ function modify_free_price_grouped( $price, $_product ) {
85
+ return do_shortcode( get_option( 'wcj_free_price_grouped_' . $this->get_view_id( $_product->id ), __( 'Free!', 'woocommerce' ) ) );
86
+ }
87
+
88
+ /**
89
+ * modify_free_price_variable.
90
+ *
91
+ * @version 2.5.9
92
+ * @since 2.5.9
93
+ */
94
+ function modify_free_price_variable( $price, $_product ) {
95
+ return do_shortcode( apply_filters( 'booster_get_option', __( 'Free!', 'woocommerce' ), get_option( 'wcj_free_price_variable_' . $this->get_view_id( $_product->id ), __( 'Free!', 'woocommerce' ) ) ) );
96
+ }
97
+
98
+ /**
99
+ * modify_free_price_variation.
100
+ *
101
+ * @version 2.5.9
102
+ * @since 2.5.9
103
+ */
104
+ function modify_free_price_variation( $price, $_product ) {
105
+ return do_shortcode( apply_filters( 'booster_get_option', __( 'Free!', 'woocommerce' ), get_option( 'wcj_free_price_variable_variation', __( 'Free!', 'woocommerce' ) ) ) );
106
+ }
107
+
108
+ /**
109
+ * add_settings_hook.
110
+ *
111
+ * @version 2.5.9
112
+ * @since 2.5.9
113
+ */
114
+ function add_settings_hook() {
115
+ add_filter( 'wcj_' . $this->id . '_settings', array( $this, 'add_settings' ) );
116
+ }
117
+
118
+ /**
119
+ * get_settings.
120
+ *
121
+ * @version 2.5.9
122
+ * @since 2.5.9
123
+ */
124
+ function get_settings() {
125
+ $settings = array();
126
+ $settings = apply_filters( 'wcj_' . $this->id . '_settings', $settings );
127
+ return $this->add_standard_settings( $settings, __( 'Labels can contain shortcodes.', 'woocommerce-jetpack' ) );
128
+ }
129
+
130
+ /**
131
+ * add_settings.
132
+ *
133
+ * @version 2.5.9
134
+ * @since 2.5.9
135
+ */
136
+ function add_settings( $settings ) {
137
+ $product_types = array(
138
+ 'simple' => __( 'Simple and Custom Products', 'woocommerce-jetpack' ),
139
+ 'variable' => __( 'Variable Products', 'woocommerce-jetpack' ),
140
+ 'grouped' => __( 'Grouped Products', 'woocommerce-jetpack' ),
141
+ 'external' => __( 'External Products', 'woocommerce-jetpack' ),
142
+ );
143
+ $views = array(
144
+ 'single' => __( 'Single Product Page', 'woocommerce-jetpack' ),
145
+ 'related' => __( 'Related Products', 'woocommerce-jetpack' ),
146
+ 'home' => __( 'Homepage', 'woocommerce-jetpack' ),
147
+ 'page' => __( 'Pages (e.g. Shortcodes)', 'woocommerce-jetpack' ),
148
+ 'archive' => __( 'Archives (Product Categories)', 'woocommerce-jetpack' ),
149
+ );
150
+ $settings = array();
151
+ foreach ( $product_types as $product_type => $product_type_desc ) {
152
+ $default_value = ( 'simple' === $product_type || 'external' === $product_type ) ? '<span class="amount">' . __( 'Free!', 'woocommerce' ) . '</span>' : __( 'Free!', 'woocommerce' );
153
+ $settings = array_merge( $settings, array(
154
+ array(
155
+ 'title' => $product_type_desc,
156
+ 'type' => 'title',
157
+ 'id' => 'wcj_free_price_' . $product_type . 'options',
158
+ ),
159
+ ) );
160
+ $current_views = $views;
161
+ if ( 'variable' === $product_type ) {
162
+ $current_views['variation'] = __( 'Variations', 'woocommerce-jetpack' );
163
+ }
164
+ foreach ( $current_views as $view => $view_desc ) {
165
+ $settings = array_merge( $settings, array(
166
+ array(
167
+ 'title' => $view_desc,
168
+ 'id' => 'wcj_free_price_' . $product_type . '_' . $view,
169
+ 'default' => $default_value,
170
+ 'type' => 'textarea',
171
+ 'css' => 'width:30%;min-width:300px;min-height:50px;',
172
+ 'desc' => ( 'variable' === $product_type ) ? apply_filters( 'booster_get_message', '', 'desc' ) : '',
173
+ 'custom_attributes' => ( 'variable' === $product_type ) ? apply_filters( 'booster_get_message', '', 'readonly' ) : '',
174
+
175
+ ),
176
+ ) );
177
+ }
178
+ $settings = array_merge( $settings, array(
179
+ array(
180
+ 'type' => 'sectionend',
181
+ 'id' => 'wcj_free_price_' . $product_type . 'options',
182
+ ),
183
+ ) );
184
+ }
185
+ return $settings;
186
+ }
187
+ }
188
+
189
+ endif;
190
+
191
+ return new WCJ_Free_Price();
includes/class-wcj-global-discount.php CHANGED
@@ -125,7 +125,7 @@ class WCJ_Global_Discount extends WCJ_Module {
125
  * @since 2.5.7
126
  */
127
  function add_global_discount_any_price( $price_type, $price, $_product ) {
128
- $total_number = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_global_discount_groups_total_number', 1 ) );
129
  for ( $i = 1; $i <= $total_number; $i++ ) {
130
  if ( ! $this->check_if_applicable( $_product, $i ) ) {
131
  continue; // no changes by current discount group
@@ -183,7 +183,7 @@ class WCJ_Global_Discount extends WCJ_Module {
183
  */
184
  function get_variation_prices_hash( $price_hash, $_product, $display ) {
185
  $wcj_global_discount_price_hash = array();
186
- $total_number = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_global_discount_groups_total_number', 1 ) );
187
  $wcj_global_discount_price_hash['total_number'] = $total_number;
188
  for ( $i = 1; $i <= $total_number; $i++ ) {
189
  $wcj_global_discount_price_hash[ 'enabled_' . $i ] = get_option( 'wcj_global_discount_sale_enabled_' . $i, 'yes' );
@@ -222,16 +222,16 @@ class WCJ_Global_Discount extends WCJ_Module {
222
  'default' => 1,
223
  'type' => 'custom_number',
224
  'desc_tip' => __( 'Press Save changes after you change this number.', 'woocommerce-jetpack' ),
225
- 'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
226
- 'custom_attributes' => is_array( apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ) ) ?
227
- apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ) : array( 'step' => '1', 'min' => '1', ),
228
  ),
229
  array(
230
  'type' => 'sectionend',
231
  'id' => 'wcj_global_discount_options',
232
  ),
233
  );
234
- $total_number = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_global_discount_groups_total_number', 1 ) );
235
  for ( $i = 1; $i <= $total_number; $i++ ) {
236
  $settings = array_merge( $settings, array(
237
  array(
125
  * @since 2.5.7
126
  */
127
  function add_global_discount_any_price( $price_type, $price, $_product ) {
128
+ $total_number = apply_filters( 'booster_get_option', 1, get_option( 'wcj_global_discount_groups_total_number', 1 ) );
129
  for ( $i = 1; $i <= $total_number; $i++ ) {
130
  if ( ! $this->check_if_applicable( $_product, $i ) ) {
131
  continue; // no changes by current discount group
183
  */
184
  function get_variation_prices_hash( $price_hash, $_product, $display ) {
185
  $wcj_global_discount_price_hash = array();
186
+ $total_number = apply_filters( 'booster_get_option', 1, get_option( 'wcj_global_discount_groups_total_number', 1 ) );
187
  $wcj_global_discount_price_hash['total_number'] = $total_number;
188
  for ( $i = 1; $i <= $total_number; $i++ ) {
189
  $wcj_global_discount_price_hash[ 'enabled_' . $i ] = get_option( 'wcj_global_discount_sale_enabled_' . $i, 'yes' );
222
  'default' => 1,
223
  'type' => 'custom_number',
224
  'desc_tip' => __( 'Press Save changes after you change this number.', 'woocommerce-jetpack' ),
225
+ 'desc' => apply_filters( 'booster_get_message', '', 'desc' ),
226
+ 'custom_attributes' => is_array( apply_filters( 'booster_get_message', '', 'readonly' ) ) ?
227
+ apply_filters( 'booster_get_message', '', 'readonly' ) : array( 'step' => '1', 'min' => '1', ),
228
  ),
229
  array(
230
  'type' => 'sectionend',
231
  'id' => 'wcj_global_discount_options',
232
  ),
233
  );
234
+ $total_number = apply_filters( 'booster_get_option', 1, get_option( 'wcj_global_discount_groups_total_number', 1 ) );
235
  for ( $i = 1; $i <= $total_number; $i++ ) {
236
  $settings = array_merge( $settings, array(
237
  array(
includes/class-wcj-left-to-free-shipping.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * The WooCommerce Jetpack Left to Free Shipping class.
6
  *
7
- * @version 2.5.8
8
  * @since 2.5.8
9
  * @author Algoritmika Ltd.
10
  */
@@ -18,14 +18,14 @@ class WCJ_Left_To_Free_Shipping extends WCJ_Module {
18
  /**
19
  * Constructor.
20
  *
21
- * @version 2.5.8
22
  * @since 2.5.8
23
  */
24
  function __construct() {
25
 
26
  $this->id = 'left_to_free_shipping';
27
  $this->short_desc = __( 'Left to Free Shipping', 'woocommerce-jetpack' );
28
- $this->desc = __( 'Display "left to free shipping" info.', 'woocommerce-jetpack' );
29
  $this->link = 'http://booster.io/features/woocommerce-left-to-free-shipping/';
30
  parent::__construct();
31
 
@@ -39,14 +39,14 @@ class WCJ_Left_To_Free_Shipping extends WCJ_Module {
39
  get_option( 'wcj_shipping_left_to_free_info_priority_cart', 10 )
40
  );
41
  }
42
- if ( 'yes' === apply_filters( 'wcj_get_option_filter', 'no', get_option( 'wcj_shipping_left_to_free_info_enabled_mini_cart', 'no' ) ) ) {
43
  add_action(
44
  get_option( 'wcj_shipping_left_to_free_info_position_mini_cart', 'woocommerce_after_mini_cart' ),
45
  array( $this, 'show_left_to_free_shipping_info_mini_cart' ),
46
  get_option( 'wcj_shipping_left_to_free_info_priority_mini_cart', 10 )
47
  );
48
  }
49
- if ( 'yes' === apply_filters( 'wcj_get_option_filter', 'no', get_option( 'wcj_shipping_left_to_free_info_enabled_checkout', 'no' ) ) ) {
50
  add_action(
51
  get_option( 'wcj_shipping_left_to_free_info_position_checkout', 'woocommerce_checkout_after_order_review' ),
52
  array( $this, 'show_left_to_free_shipping_info_checkout' ),
@@ -172,8 +172,8 @@ class WCJ_Left_To_Free_Shipping extends WCJ_Module {
172
  'id' => 'wcj_shipping_left_to_free_info_enabled_mini_cart',
173
  'default' => 'no',
174
  'type' => 'checkbox',
175
- 'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'disabled' ),
176
- 'desc_tip' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
177
  ),
178
  array(
179
  'title' => '',
@@ -210,8 +210,8 @@ class WCJ_Left_To_Free_Shipping extends WCJ_Module {
210
  'id' => 'wcj_shipping_left_to_free_info_enabled_checkout',
211
  'default' => 'no',
212
  'type' => 'checkbox',
213
- 'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'disabled' ),
214
- 'desc_tip' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
215
  ),
216
  array(
217
  'title' => '',
4
  *
5
  * The WooCommerce Jetpack Left to Free Shipping class.
6
  *
7
+ * @version 2.5.9
8
  * @since 2.5.8
9
  * @author Algoritmika Ltd.
10
  */
18
  /**
19
  * Constructor.
20
  *
21
+ * @version 2.5.9
22
  * @since 2.5.8
23
  */
24
  function __construct() {
25
 
26
  $this->id = 'left_to_free_shipping';
27
  $this->short_desc = __( 'Left to Free Shipping', 'woocommerce-jetpack' );
28
+ $this->desc = __( 'Display "left to free shipping" info in WooCommerce.', 'woocommerce-jetpack' );
29
  $this->link = 'http://booster.io/features/woocommerce-left-to-free-shipping/';
30
  parent::__construct();
31
 
39
  get_option( 'wcj_shipping_left_to_free_info_priority_cart', 10 )
40
  );
41
  }
42
+ if ( 'yes' === apply_filters( 'booster_get_option', 'no', get_option( 'wcj_shipping_left_to_free_info_enabled_mini_cart', 'no' ) ) ) {
43
  add_action(
44
  get_option( 'wcj_shipping_left_to_free_info_position_mini_cart', 'woocommerce_after_mini_cart' ),
45
  array( $this, 'show_left_to_free_shipping_info_mini_cart' ),
46
  get_option( 'wcj_shipping_left_to_free_info_priority_mini_cart', 10 )
47
  );
48
  }
49
+ if ( 'yes' === apply_filters( 'booster_get_option', 'no', get_option( 'wcj_shipping_left_to_free_info_enabled_checkout', 'no' ) ) ) {
50
  add_action(
51
  get_option( 'wcj_shipping_left_to_free_info_position_checkout', 'woocommerce_checkout_after_order_review' ),
52
  array( $this, 'show_left_to_free_shipping_info_checkout' ),
172
  'id' => 'wcj_shipping_left_to_free_info_enabled_mini_cart',
173
  'default' => 'no',
174
  'type' => 'checkbox',
175
+ 'custom_attributes' => apply_filters( 'booster_get_message', '', 'disabled' ),
176
+ 'desc_tip' => apply_filters( 'booster_get_message', '', 'desc' ),
177
  ),
178
  array(
179
  'title' => '',
210
  'id' => 'wcj_shipping_left_to_free_info_enabled_checkout',
211
  'default' => 'no',
212
  'type' => 'checkbox',
213
+ 'custom_attributes' => apply_filters( 'booster_get_message', '', 'disabled' ),
214
+ 'desc_tip' => apply_filters( 'booster_get_message', '', 'desc' ),
215
  ),
216
  array(
217
  'title' => '',
includes/class-wcj-mini-cart.php CHANGED
@@ -29,7 +29,7 @@ class WCJ_Mini_Cart extends WCJ_Module {
29
  parent::__construct();
30
 
31
  if ( $this->is_enabled() ) {
32
- $total_number = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_mini_cart_custom_info_total_number', 1 ) );
33
  for ( $i = 1; $i <= $total_number; $i++ ) {
34
  add_action(
35
  get_option( 'wcj_mini_cart_custom_info_hook_' . $i, 'woocommerce_after_mini_cart' ),
@@ -48,7 +48,7 @@ class WCJ_Mini_Cart extends WCJ_Module {
48
  function add_mini_cart_custom_info() {
49
  $current_filter = current_filter();
50
  $current_filter_priority = wcj_current_filter_priority();
51
- $total_number = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_mini_cart_custom_info_total_number', 1 ) );
52
  for ( $i = 1; $i <= $total_number; $i++ ) {
53
  if (
54
  '' != get_option( 'wcj_mini_cart_custom_info_content_' . $i ) &&
@@ -81,8 +81,8 @@ class WCJ_Mini_Cart extends WCJ_Module {
81
  'id' => 'wcj_mini_cart_custom_info_total_number',
82
  'default' => 1,
83
  'type' => 'custom_number',
84
- 'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
85
- 'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ),
86
  );
87
 
88
  $settings[] = array(
@@ -90,7 +90,7 @@ class WCJ_Mini_Cart extends WCJ_Module {
90
  'id' => 'wcj_mini_cart_custom_info_options',
91
  );
92
 
93
- $total_number = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_mini_cart_custom_info_total_number', 1 ) );
94
 
95
  for ( $i = 1; $i <= $total_number; $i++ ) {
96
 
29
  parent::__construct();
30
 
31
  if ( $this->is_enabled() ) {
32
+ $total_number = apply_filters( 'booster_get_option', 1, get_option( 'wcj_mini_cart_custom_info_total_number', 1 ) );
33
  for ( $i = 1; $i <= $total_number; $i++ ) {
34
  add_action(
35
  get_option( 'wcj_mini_cart_custom_info_hook_' . $i, 'woocommerce_after_mini_cart' ),
48
  function add_mini_cart_custom_info() {
49
  $current_filter = current_filter();
50
  $current_filter_priority = wcj_current_filter_priority();
51
+ $total_number = apply_filters( 'booster_get_option', 1, get_option( 'wcj_mini_cart_custom_info_total_number', 1 ) );
52
  for ( $i = 1; $i <= $total_number; $i++ ) {
53
  if (
54
  '' != get_option( 'wcj_mini_cart_custom_info_content_' . $i ) &&
81
  'id' => 'wcj_mini_cart_custom_info_total_number',
82
  'default' => 1,
83
  'type' => 'custom_number',
84
+ 'desc' => apply_filters( 'booster_get_message', '', 'desc' ),
85
+ 'custom_attributes' => apply_filters( 'booster_get_message', '', 'readonly' ),
86
  );
87
 
88
  $settings[] = array(
90
  'id' => 'wcj_mini_cart_custom_info_options',
91
  );
92
 
93
+ $total_number = apply_filters( 'booster_get_option', 1, get_option( 'wcj_mini_cart_custom_info_total_number', 1 ) );
94
 
95
  for ( $i = 1; $i <= $total_number; $i++ ) {
96
 
includes/class-wcj-multicurrency-product-base-price.php CHANGED
@@ -67,7 +67,7 @@ class WCJ_Multicurrency_Base_Price extends WCJ_Module {
67
  function get_currency_exchange_rate( $currency_code ) {
68
  /*
69
  $currency_exchange_rate = 1;
70
- $total_number = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_multicurrency_base_price_total_number', 1 ) );
71
  for ( $i = 1; $i <= $total_number; $i++ ) {
72
  if ( $currency_code === get_option( 'wcj_multicurrency_base_price_currency_' . $i ) ) {
73
  $currency_exchange_rate = get_option( 'wcj_multicurrency_base_price_exchange_rate_' . $i );
@@ -151,7 +151,7 @@ class WCJ_Multicurrency_Base_Price extends WCJ_Module {
151
  $products[ $main_product_id ] = '';
152
  }
153
  $options = array();
154
- $total_number = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_multicurrency_base_price_total_number', 1 ) );
155
  foreach ( $products as $product_id => $desc ) {
156
  $currency_codes = array();
157
  $currency_codes[ get_woocommerce_currency() ] = get_woocommerce_currency();
@@ -173,7 +173,7 @@ class WCJ_Multicurrency_Base_Price extends WCJ_Module {
173
 
174
  $currency_codes = array();
175
  $currency_codes[ get_woocommerce_currency() ] = get_woocommerce_currency();
176
- $total_number = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_multicurrency_base_price_total_number', 1 ) );
177
  for ( $i = 1; $i <= $total_number; $i++ ) {
178
  $currency_codes[ get_option( 'wcj_multicurrency_base_price_currency_' . $i ) ] = get_option( 'wcj_multicurrency_base_price_currency_' . $i );
179
  }
@@ -246,11 +246,11 @@ class WCJ_Multicurrency_Base_Price extends WCJ_Module {
246
  'manual' => __( 'Enter Rates Manually', 'woocommerce-jetpack' ),
247
  'auto' => __( 'Automatically via Currency Exchange Rates module', 'woocommerce-jetpack' ),
248
  ),
249
- 'desc' => ( '' == apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ) ) ?
250
  __( 'Visit', 'woocommerce-jetpack' ) . ' <a href="' . admin_url( 'admin.php?page=wc-settings&tab=jetpack&wcj-cat=prices_and_currencies&section=currency_exchange_rates' ) . '">' . __( 'Currency Exchange Rates module', 'woocommerce-jetpack' ) . '</a>'
251
  :
252
- apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
253
- 'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'disabled' ),
254
  ),
255
  array(
256
  'type' => 'sectionend',
@@ -266,14 +266,14 @@ class WCJ_Multicurrency_Base_Price extends WCJ_Module {
266
  'id' => 'wcj_multicurrency_base_price_total_number',
267
  'default' => 1,
268
  'type' => 'custom_number',
269
- 'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
270
  'custom_attributes' => array_merge(
271
- is_array( apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ) ) ? apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ) : array(),
272
  array( 'step' => '1', 'min' => '1', )
273
  ),
274
  ),
275
  );
276
- $total_number = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_multicurrency_base_price_total_number', 1 ) );
277
  for ( $i = 1; $i <= $total_number; $i++ ) {
278
  $currency_to = get_option( 'wcj_multicurrency_base_price_currency_' . $i, $currency_from );
279
  $custom_attributes = array(
67
  function get_currency_exchange_rate( $currency_code ) {
68
  /*
69
  $currency_exchange_rate = 1;
70
+ $total_number = apply_filters( 'booster_get_option', 1, get_option( 'wcj_multicurrency_base_price_total_number', 1 ) );
71
  for ( $i = 1; $i <= $total_number; $i++ ) {
72
  if ( $currency_code === get_option( 'wcj_multicurrency_base_price_currency_' . $i ) ) {
73
  $currency_exchange_rate = get_option( 'wcj_multicurrency_base_price_exchange_rate_' . $i );
151
  $products[ $main_product_id ] = '';
152
  }
153
  $options = array();
154
+ $total_number = apply_filters( 'booster_get_option', 1, get_option( 'wcj_multicurrency_base_price_total_number', 1 ) );
155
  foreach ( $products as $product_id => $desc ) {
156
  $currency_codes = array();
157
  $currency_codes[ get_woocommerce_currency() ] = get_woocommerce_currency();
173
 
174
  $currency_codes = array();
175
  $currency_codes[ get_woocommerce_currency() ] = get_woocommerce_currency();
176
+ $total_number = apply_filters( 'booster_get_option', 1, get_option( 'wcj_multicurrency_base_price_total_number', 1 ) );
177
  for ( $i = 1; $i <= $total_number; $i++ ) {
178
  $currency_codes[ get_option( 'wcj_multicurrency_base_price_currency_' . $i ) ] = get_option( 'wcj_multicurrency_base_price_currency_' . $i );
179
  }
246
  'manual' => __( 'Enter Rates Manually', 'woocommerce-jetpack' ),
247
  'auto' => __( 'Automatically via Currency Exchange Rates module', 'woocommerce-jetpack' ),
248
  ),
249
+ 'desc' => ( '' == apply_filters( 'booster_get_message', '', 'desc' ) ) ?
250
  __( 'Visit', 'woocommerce-jetpack' ) . ' <a href="' . admin_url( 'admin.php?page=wc-settings&tab=jetpack&wcj-cat=prices_and_currencies&section=currency_exchange_rates' ) . '">' . __( 'Currency Exchange Rates module', 'woocommerce-jetpack' ) . '</a>'
251
  :
252
+ apply_filters( 'booster_get_message', '', 'desc' ),
253
+ 'custom_attributes' => apply_filters( 'booster_get_message', '', 'disabled' ),
254
  ),
255
  array(
256
  'type' => 'sectionend',
266
  'id' => 'wcj_multicurrency_base_price_total_number',
267
  'default' => 1,
268
  'type' => 'custom_number',
269
+ 'desc' => apply_filters( 'booster_get_message', '', 'desc' ),
270
  'custom_attributes' => array_merge(
271
+ is_array( apply_filters( 'booster_get_message', '', 'readonly' ) ) ? apply_filters( 'booster_get_message', '', 'readonly' ) : array(),
272
  array( 'step' => '1', 'min' => '1', )
273
  ),
274
  ),
275
  );
276
+ $total_number = apply_filters( 'booster_get_option', 1, get_option( 'wcj_multicurrency_base_price_total_number', 1 ) );
277
  for ( $i = 1; $i <= $total_number; $i++ ) {
278
  $currency_to = get_option( 'wcj_multicurrency_base_price_currency_' . $i, $currency_from );
279
  $custom_attributes = array(
includes/class-wcj-multicurrency.php CHANGED
@@ -64,7 +64,7 @@ class WCJ_Multicurrency extends WCJ_Module {
64
  $products[ $main_product_id ] = '';
65
  }
66
  $currencies = array();
67
- $total_number = apply_filters( 'wcj_get_option_filter', 2, get_option( 'wcj_multicurrency_total_number', 2 ) );
68
  foreach ( $products as $product_id => $desc ) {
69
  for ( $i = 1; $i <= $total_number; $i++ ) {
70
  $currency_code = get_option( 'wcj_multicurrency_currency_' . $i );
@@ -201,7 +201,7 @@ class WCJ_Multicurrency extends WCJ_Module {
201
  */
202
  function get_currency_exchange_rate( $currency_code ) {
203
  $currency_exchange_rate = 1;
204
- $total_number = apply_filters( 'wcj_get_option_filter', 2, get_option( 'wcj_multicurrency_total_number', 2 ) );
205
  for ( $i = 1; $i <= $total_number; $i++ ) {
206
  if ( $currency_code === get_option( 'wcj_multicurrency_currency_' . $i ) ) {
207
  $currency_exchange_rate = get_option( 'wcj_multicurrency_exchange_rate_' . $i );
@@ -395,11 +395,11 @@ class WCJ_Multicurrency extends WCJ_Module {
395
  'manual' => __( 'Enter Rates Manually', 'woocommerce-jetpack' ),
396
  'auto' => __( 'Automatically via Currency Exchange Rates module', 'woocommerce-jetpack' ),
397
  ),
398
- 'desc' => ( '' == apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ) ) ?
399
  __( 'Visit', 'woocommerce-jetpack' ) . ' <a href="' . admin_url( 'admin.php?page=wc-settings&tab=jetpack&wcj-cat=prices_and_currencies&section=currency_exchange_rates' ) . '">' . __( 'Currency Exchange Rates module', 'woocommerce-jetpack' ) . '</a>'
400
  :
401
- apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
402
- 'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'disabled' ),
403
  ),
404
  array(
405
  'title' => __( 'Multicurrency on per Product Basis', 'woocommerce-jetpack' ),
@@ -452,14 +452,14 @@ class WCJ_Multicurrency extends WCJ_Module {
452
  'id' => 'wcj_multicurrency_total_number',
453
  'default' => 2,
454
  'type' => 'custom_number',
455
- 'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
456
  'custom_attributes' => array_merge(
457
- is_array( apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ) ) ? apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ) : array(),
458
  array( 'step' => '1', 'min' => '2', )
459
  ),
460
  ),
461
  );
462
- $total_number = apply_filters( 'wcj_get_option_filter', 2, get_option( 'wcj_multicurrency_total_number', 2 ) );
463
  for ( $i = 1; $i <= $total_number; $i++ ) {
464
  $currency_to = get_option( 'wcj_multicurrency_currency_' . $i, $currency_from );
465
  $custom_attributes = array(
64
  $products[ $main_product_id ] = '';
65
  }
66
  $currencies = array();
67
+ $total_number = apply_filters( 'booster_get_option', 2, get_option( 'wcj_multicurrency_total_number', 2 ) );
68
  foreach ( $products as $product_id => $desc ) {
69
  for ( $i = 1; $i <= $total_number; $i++ ) {
70
  $currency_code = get_option( 'wcj_multicurrency_currency_' . $i );
201
  */
202
  function get_currency_exchange_rate( $currency_code ) {
203
  $currency_exchange_rate = 1;
204
+ $total_number = apply_filters( 'booster_get_option', 2, get_option( 'wcj_multicurrency_total_number', 2 ) );
205
  for ( $i = 1; $i <= $total_number; $i++ ) {
206
  if ( $currency_code === get_option( 'wcj_multicurrency_currency_' . $i ) ) {
207
  $currency_exchange_rate = get_option( 'wcj_multicurrency_exchange_rate_' . $i );
395
  'manual' => __( 'Enter Rates Manually', 'woocommerce-jetpack' ),
396
  'auto' => __( 'Automatically via Currency Exchange Rates module', 'woocommerce-jetpack' ),
397
  ),
398
+ 'desc' => ( '' == apply_filters( 'booster_get_message', '', 'desc' ) ) ?
399
  __( 'Visit', 'woocommerce-jetpack' ) . ' <a href="' . admin_url( 'admin.php?page=wc-settings&tab=jetpack&wcj-cat=prices_and_currencies&section=currency_exchange_rates' ) . '">' . __( 'Currency Exchange Rates module', 'woocommerce-jetpack' ) . '</a>'
400
  :
401
+ apply_filters( 'booster_get_message', '', 'desc' ),
402
+ 'custom_attributes' => apply_filters( 'booster_get_message', '', 'disabled' ),
403
  ),
404
  array(
405
  'title' => __( 'Multicurrency on per Product Basis', 'woocommerce-jetpack' ),
452
  'id' => 'wcj_multicurrency_total_number',
453
  'default' => 2,
454
  'type' => 'custom_number',
455
+ 'desc' => apply_filters( 'booster_get_message', '', 'desc' ),
456
  'custom_attributes' => array_merge(
457
+ is_array( apply_filters( 'booster_get_message', '', 'readonly' ) ) ? apply_filters( 'booster_get_message', '', 'readonly' ) : array(),
458
  array( 'step' => '1', 'min' => '2', )
459
  ),
460
  ),
461
  );
462
+ $total_number = apply_filters( 'booster_get_option', 2, get_option( 'wcj_multicurrency_total_number', 2 ) );
463
  for ( $i = 1; $i <= $total_number; $i++ ) {
464
  $currency_to = get_option( 'wcj_multicurrency_currency_' . $i, $currency_from );
465
  $custom_attributes = array(
includes/class-wcj-order-min-amount.php CHANGED
@@ -116,7 +116,7 @@ class WCJ_Order_Min_Amount extends WCJ_Module {
116
  if( is_cart() ) {
117
  if ( 'yes' === get_option( 'wcj_order_minimum_amount_cart_notice_enabled' ) ) {
118
  wc_print_notice(
119
- sprintf( apply_filters( 'wcj_get_option_filter', 'You must have an order with a minimum of %s to place your order, your current order total is %s.', get_option( 'wcj_order_minimum_amount_cart_notice_message' ) ),
120
  woocommerce_price( $minimum ),
121
  woocommerce_price( $cart_total )
122
  ),
@@ -125,7 +125,7 @@ class WCJ_Order_Min_Amount extends WCJ_Module {
125
  }
126
  } else {
127
  wc_add_notice(
128
- sprintf( apply_filters( 'wcj_get_option_filter', 'You must have an order with a minimum of %s to place your order, your current order total is %s.', get_option( 'wcj_order_minimum_amount_error_message' ) ),
129
  woocommerce_price( $minimum ),
130
  woocommerce_price( $cart_total )
131
  ),
@@ -220,12 +220,12 @@ class WCJ_Order_Min_Amount extends WCJ_Module {
220
  ),
221
  array(
222
  'title' => __( 'Error message', 'woocommerce-jetpack' ),
223
- 'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
224
  'desc_tip' => __( 'Message to customer if order is below minimum amount. Default: You must have an order with a minimum of %s to place your order, your current order total is %s.', 'woocommerce-jetpack' ),
225
  'id' => 'wcj_order_minimum_amount_error_message',
226
  'default' => 'You must have an order with a minimum of %s to place your order, your current order total is %s.',
227
  'type' => 'textarea',
228
- 'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ),
229
  'css' => 'width:50%;min-width:300px;',
230
  ),
231
  array(
@@ -237,12 +237,12 @@ class WCJ_Order_Min_Amount extends WCJ_Module {
237
  ),
238
  array(
239
  'title' => __( 'Message on cart page', 'woocommerce-jetpack' ),
240
- 'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
241
  'desc_tip' => __( 'Message to customer if order is below minimum amount. Default: You must have an order with a minimum of %s to place your order, your current order total is %s.', 'woocommerce-jetpack' ),
242
  'id' => 'wcj_order_minimum_amount_cart_notice_message',
243
  'default' => 'You must have an order with a minimum of %s to place your order, your current order total is %s.',
244
  'type' => 'textarea',
245
- 'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ),
246
  'css' => 'width:50%;min-width:300px;',
247
  ),
248
  array(
@@ -265,7 +265,7 @@ class WCJ_Order_Min_Amount extends WCJ_Module {
265
  ),
266
  );
267
  $c = array( 'guest', 'administrator', 'customer' );
268
- $is_r = apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' );
269
  if ( '' == $is_r ) {
270
  $is_r = array();
271
  }
@@ -277,7 +277,7 @@ class WCJ_Order_Min_Amount extends WCJ_Module {
277
  'default' => 0,
278
  'type' => 'number',
279
  'custom_attributes' => ( ! in_array( $role_key, $c ) ? array_merge( array( 'step' => '0.0001', 'min' => '0', ), $is_r ) : array( 'step' => '0.0001', 'min' => '0', ) ),
280
- 'desc_tip' => ( ! in_array( $role_key, $c ) ? apply_filters( 'get_wc_jetpack_plus_message', '', 'desc_no_link' ) : '' ),
281
  ),
282
  ) );
283
  }
116
  if( is_cart() ) {
117
  if ( 'yes' === get_option( 'wcj_order_minimum_amount_cart_notice_enabled' ) ) {
118
  wc_print_notice(
119
+ sprintf( apply_filters( 'booster_get_option', 'You must have an order with a minimum of %s to place your order, your current order total is %s.', get_option( 'wcj_order_minimum_amount_cart_notice_message' ) ),
120
  woocommerce_price( $minimum ),
121
  woocommerce_price( $cart_total )
122
  ),
125
  }
126
  } else {
127
  wc_add_notice(
128
+ sprintf( apply_filters( 'booster_get_option', 'You must have an order with a minimum of %s to place your order, your current order total is %s.', get_option( 'wcj_order_minimum_amount_error_message' ) ),
129
  woocommerce_price( $minimum ),
130
  woocommerce_price( $cart_total )
131
  ),
220
  ),
221
  array(
222
  'title' => __( 'Error message', 'woocommerce-jetpack' ),
223
+ 'desc' => apply_filters( 'booster_get_message', '', 'desc' ),
224
  'desc_tip' => __( 'Message to customer if order is below minimum amount. Default: You must have an order with a minimum of %s to place your order, your current order total is %s.', 'woocommerce-jetpack' ),
225
  'id' => 'wcj_order_minimum_amount_error_message',
226
  'default' => 'You must have an order with a minimum of %s to place your order, your current order total is %s.',
227
  'type' => 'textarea',
228
+ 'custom_attributes' => apply_filters( 'booster_get_message', '', 'readonly' ),
229
  'css' => 'width:50%;min-width:300px;',
230
  ),
231
  array(
237
  ),
238
  array(
239
  'title' => __( 'Message on cart page', 'woocommerce-jetpack' ),
240
+ 'desc' => apply_filters( 'booster_get_message', '', 'desc' ),
241
  'desc_tip' => __( 'Message to customer if order is below minimum amount. Default: You must have an order with a minimum of %s to place your order, your current order total is %s.', 'woocommerce-jetpack' ),
242
  'id' => 'wcj_order_minimum_amount_cart_notice_message',
243
  'default' => 'You must have an order with a minimum of %s to place your order, your current order total is %s.',
244
  'type' => 'textarea',
245
+ 'custom_attributes' => apply_filters( 'booster_get_message', '', 'readonly' ),
246
  'css' => 'width:50%;min-width:300px;',
247
  ),
248
  array(
265
  ),
266
  );
267
  $c = array( 'guest', 'administrator', 'customer' );
268
+ $is_r = apply_filters( 'booster_get_message', '', 'readonly' );
269
  if ( '' == $is_r ) {
270
  $is_r = array();
271
  }
277
  'default' => 0,
278
  'type' => 'number',
279
  'custom_attributes' => ( ! in_array( $role_key, $c ) ? array_merge( array( 'step' => '0.0001', 'min' => '0', ), $is_r ) : array( 'step' => '0.0001', 'min' => '0', ) ),
280
+ 'desc_tip' => ( ! in_array( $role_key, $c ) ? apply_filters( 'booster_get_message', '', 'desc_no_link' ) : '' ),
281
  ),
282
  ) );
283
  }
includes/class-wcj-order-numbers.php CHANGED
@@ -89,7 +89,7 @@ class WCJ_Order_Numbers extends WCJ_Module {
89
  $order_number_meta = $order->id;
90
  }
91
  $order_timestamp = strtotime( $order->post->post_date );
92
- $order_number = apply_filters( 'wcj_get_option_filter',
93
  sprintf( '%s%d', do_shortcode( get_option( 'wcj_order_number_prefix', '' ) ), $order_number_meta ),
94
  sprintf( '%s%s%0' . get_option( 'wcj_order_number_min_width', 0 ) . 'd%s%s',
95
  do_shortcode( get_option( 'wcj_order_number_prefix', '' ) ),
@@ -230,42 +230,42 @@ class WCJ_Order_Numbers extends WCJ_Module {
230
  ),
231
  array(
232
  'title' => __( 'Order Number Date Prefix', 'woocommerce-jetpack' ),
233
- 'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
234
  'desc_tip' => __( 'Date prefix before order number (optional). This will change the prefixes for all existing orders. Value is passed directly to PHP `date` function, so most of PHP date formats can be used. The only exception is using `\` symbol in date format, as this symbol will be excluded from date. Try: Y-m-d- or mdy.', 'woocommerce-jetpack' ),
235
  'id' => 'wcj_order_number_date_prefix',
236
  'default' => '',
237
  'type' => 'text',
238
- 'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ),
239
  'css' => 'width:300px;',
240
  ),
241
  array(
242
  'title' => __( 'Order Number Width', 'woocommerce-jetpack' ),
243
- 'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
244
  'desc_tip' => __( 'Minimum width of number without prefix (zeros will be added to the left side). This will change the minimum width of order number for all existing orders. E.g. set to 5 to have order number displayed as 00001 instead of 1. Leave zero to disable.', 'woocommerce-jetpack' ),
245
  'id' => 'wcj_order_number_min_width',
246
  'default' => 0,
247
  'type' => 'number',
248
- 'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ),
249
  'css' => 'width:300px;',
250
  ),
251
  array(
252
  'title' => __( 'Order Number Custom Suffix', 'woocommerce-jetpack' ),
253
- 'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
254
  'desc_tip' => __( 'Suffix after order number (optional). This will change the suffixes for all existing orders.', 'woocommerce-jetpack' ),
255
  'id' => 'wcj_order_number_suffix',
256
  'default' => '',
257
  'type' => 'text',
258
- 'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ),
259
  'css' => 'width:300px;',
260
  ),
261
  array(
262
  'title' => __( 'Order Number Date Suffix', 'woocommerce-jetpack' ),
263
- 'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
264
  'desc_tip' => __( 'Date suffix after order number (optional). This will change the suffixes for all existing orders. Value is passed directly to PHP `date` function, so most of PHP date formats can be used. The only exception is using `\` symbol in date format, as this symbol will be excluded from date. Try: Y-m-d- or mdy.', 'woocommerce-jetpack' ),
265
  'id' => 'wcj_order_number_date_suffix',
266
  'default' => '',
267
  'type' => 'text',
268
- 'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ),
269
  'css' => 'width:300px;',
270
  ),
271
  array(
89
  $order_number_meta = $order->id;
90
  }
91
  $order_timestamp = strtotime( $order->post->post_date );
92
+ $order_number = apply_filters( 'booster_get_option',
93
  sprintf( '%s%d', do_shortcode( get_option( 'wcj_order_number_prefix', '' ) ), $order_number_meta ),
94
  sprintf( '%s%s%0' . get_option( 'wcj_order_number_min_width', 0 ) . 'd%s%s',
95
  do_shortcode( get_option( 'wcj_order_number_prefix', '' ) ),
230
  ),
231
  array(
232
  'title' => __( 'Order Number Date Prefix', 'woocommerce-jetpack' ),
233
+ 'desc' => apply_filters( 'booster_get_message', '', 'desc' ),
234
  'desc_tip' => __( 'Date prefix before order number (optional). This will change the prefixes for all existing orders. Value is passed directly to PHP `date` function, so most of PHP date formats can be used. The only exception is using `\` symbol in date format, as this symbol will be excluded from date. Try: Y-m-d- or mdy.', 'woocommerce-jetpack' ),
235
  'id' => 'wcj_order_number_date_prefix',
236
  'default' => '',
237
  'type' => 'text',
238
+ 'custom_attributes' => apply_filters( 'booster_get_message', '', 'readonly' ),
239
  'css' => 'width:300px;',
240
  ),
241
  array(
242
  'title' => __( 'Order Number Width', 'woocommerce-jetpack' ),
243
+ 'desc' => apply_filters( 'booster_get_message', '', 'desc' ),
244
  'desc_tip' => __( 'Minimum width of number without prefix (zeros will be added to the left side). This will change the minimum width of order number for all existing orders. E.g. set to 5 to have order number displayed as 00001 instead of 1. Leave zero to disable.', 'woocommerce-jetpack' ),
245
  'id' => 'wcj_order_number_min_width',
246
  'default' => 0,
247
  'type' => 'number',
248
+ 'custom_attributes' => apply_filters( 'booster_get_message', '', 'readonly' ),
249
  'css' => 'width:300px;',
250
  ),
251
  array(
252
  'title' => __( 'Order Number Custom Suffix', 'woocommerce-jetpack' ),
253
+ 'desc' => apply_filters( 'booster_get_message', '', 'desc' ),
254
  'desc_tip' => __( 'Suffix after order number (optional). This will change the suffixes for all existing orders.', 'woocommerce-jetpack' ),
255
  'id' => 'wcj_order_number_suffix',
256
  'default' => '',
257
  'type' => 'text',
258
+ 'custom_attributes' => apply_filters( 'booster_get_message', '', 'readonly' ),
259
  'css' => 'width:300px;',
260
  ),
261
  array(
262
  'title' => __( 'Order Number Date Suffix', 'woocommerce-jetpack' ),
263
+ 'desc' => apply_filters( 'booster_get_message', '', 'desc' ),
264
  'desc_tip' => __( 'Date suffix after order number (optional). This will change the suffixes for all existing orders. Value is passed directly to PHP `date` function, so most of PHP date formats can be used. The only exception is using `\` symbol in date format, as this symbol will be excluded from date. Try: Y-m-d- or mdy.', 'woocommerce-jetpack' ),
265
  'id' => 'wcj_order_number_date_suffix',
266
  'default' => '',
267
  'type' => 'text',
268
+ 'custom_attributes' => apply_filters( 'booster_get_message', '', 'readonly' ),
269
  'css' => 'width:300px;',
270
  ),
271
  array(
includes/class-wcj-orders.php CHANGED
@@ -302,7 +302,7 @@ class WCJ_Orders extends WCJ_Module {
302
  if ( 'yes' === get_option( 'wcj_orders_list_custom_columns_country', 'no' ) ) {
303
  $columns['country'] = __( 'Country', 'woocommerce-jetpack' );
304
  }
305
- $total_number = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_orders_list_custom_columns_total_number', 1 ) );
306
  for ( $i = 1; $i <= $total_number; $i++ ) {
307
  if ( 'yes' === get_option( 'wcj_orders_list_custom_columns_enabled_' . $i, 'no' ) ) {
308
  $columns[ 'wcj_orders_custom_column_' . $i ] = get_option( 'wcj_orders_list_custom_columns_label_' . $i, '' );
@@ -334,7 +334,7 @@ class WCJ_Orders extends WCJ_Module {
334
  ? $this->wcj_get_country_flag_by_code( $country_code ) . ' ' . wcj_get_country_name_by_code( $country_code )
335
  : wcj_get_country_name_by_code( $country_code );
336
  }
337
- $total_number = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_orders_list_custom_columns_total_number', 1 ) );
338
  for ( $i = 1; $i <= $total_number; $i++ ) {
339
  if ( 'yes' === get_option( 'wcj_orders_list_custom_columns_enabled_' . $i, 'no' ) ) {
340
  if ( 'wcj_orders_custom_column_' . $i === $column ) {
@@ -448,14 +448,14 @@ class WCJ_Orders extends WCJ_Module {
448
  'id' => 'wcj_orders_list_custom_columns_total_number',
449
  'default' => 1,
450
  'type' => 'custom_number',
451
- 'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
452
  'custom_attributes' => array_merge(
453
- is_array( apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ) ) ? apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ) : array(),
454
  array( 'step' => '1', 'min' => '0', )
455
  ),
456
  ),
457
  );
458
- $total_number = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_orders_list_custom_columns_total_number', 1 ) );
459
  for ( $i = 1; $i <= $total_number; $i++ ) {
460
  $settings = array_merge( $settings, array(
461
  array(
302
  if ( 'yes' === get_option( 'wcj_orders_list_custom_columns_country', 'no' ) ) {
303
  $columns['country'] = __( 'Country', 'woocommerce-jetpack' );
304
  }
305
+ $total_number = apply_filters( 'booster_get_option', 1, get_option( 'wcj_orders_list_custom_columns_total_number', 1 ) );
306
  for ( $i = 1; $i <= $total_number; $i++ ) {
307
  if ( 'yes' === get_option( 'wcj_orders_list_custom_columns_enabled_' . $i, 'no' ) ) {
308
  $columns[ 'wcj_orders_custom_column_' . $i ] = get_option( 'wcj_orders_list_custom_columns_label_' . $i, '' );
334
  ? $this->wcj_get_country_flag_by_code( $country_code ) . ' ' . wcj_get_country_name_by_code( $country_code )
335
  : wcj_get_country_name_by_code( $country_code );
336
  }
337
+ $total_number = apply_filters( 'booster_get_option', 1, get_option( 'wcj_orders_list_custom_columns_total_number', 1 ) );
338
  for ( $i = 1; $i <= $total_number; $i++ ) {
339
  if ( 'yes' === get_option( 'wcj_orders_list_custom_columns_enabled_' . $i, 'no' ) ) {
340
  if ( 'wcj_orders_custom_column_' . $i === $column ) {
448
  'id' => 'wcj_orders_list_custom_columns_total_number',
449
  'default' => 1,
450
  'type' => 'custom_number',
451
+ 'desc' => apply_filters( 'booster_get_message', '', 'desc' ),
452
  'custom_attributes' => array_merge(
453
+ is_array( apply_filters( 'booster_get_message', '', 'readonly' ) ) ? apply_filters( 'booster_get_message', '', 'readonly' ) : array(),
454
  array( 'step' => '1', 'min' => '0', )
455
  ),
456
  ),
457
  );
458
+ $total_number = apply_filters( 'booster_get_option', 1, get_option( 'wcj_orders_list_custom_columns_total_number', 1 ) );
459
  for ( $i = 1; $i <= $total_number; $i++ ) {
460
  $settings = array_merge( $settings, array(
461
  array(
includes/class-wcj-payment-gateways-by-country.php CHANGED
@@ -96,11 +96,11 @@ class WCJ_Payment_Gateways_By_Country extends WCJ_Module {
96
  foreach ( $gateways as $key => $gateway ) {
97
  $default_gateways = array( 'bacs' );
98
  if ( ! empty( $default_gateways ) && ! in_array( $key, $default_gateways ) ) {
99
- $custom_attributes = apply_filters( 'get_wc_jetpack_plus_message', '', 'disabled' );
100
  if ( '' == $custom_attributes ) {
101
  $custom_attributes = array();
102
  }
103
- $desc_tip = apply_filters( 'get_wc_jetpack_plus_message', '', 'desc_no_link' );
104
  } else {
105
  $custom_attributes = array();
106
  $desc_tip = '';
96
  foreach ( $gateways as $key => $gateway ) {
97
  $default_gateways = array( 'bacs' );
98
  if ( ! empty( $default_gateways ) && ! in_array( $key, $default_gateways ) ) {
99
+ $custom_attributes = apply_filters( 'booster_get_message', '', 'disabled' );
100
  if ( '' == $custom_attributes ) {
101
  $custom_attributes = array();
102
  }
103
+ $desc_tip = apply_filters( 'booster_get_message', '', 'desc_no_link' );
104
  } else {
105
  $custom_attributes = array();
106
  $desc_tip = '';
includes/class-wcj-payment-gateways-by-user-role.php CHANGED
@@ -90,11 +90,11 @@ class WCJ_Payment_Gateways_By_User_Role extends WCJ_Module {
90
  foreach ( $gateways as $key => $gateway ) {
91
  $default_gateways = array( 'bacs' );
92
  if ( ! empty( $default_gateways ) && ! in_array( $key, $default_gateways ) ) {
93
- $custom_attributes = apply_filters( 'get_wc_jetpack_plus_message', '', 'disabled' );
94
  if ( '' == $custom_attributes ) {
95
  $custom_attributes = array();
96
  }
97
- $desc_tip = apply_filters( 'get_wc_jetpack_plus_message', '', 'desc_no_link' );
98
  } else {
99
  $custom_attributes = array();
100
  $desc_tip = '';
90
  foreach ( $gateways as $key => $gateway ) {
91
  $default_gateways = array( 'bacs' );
92
  if ( ! empty( $default_gateways ) && ! in_array( $key, $default_gateways ) ) {
93
+ $custom_attributes = apply_filters( 'booster_get_message', '', 'disabled' );
94
  if ( '' == $custom_attributes ) {
95
  $custom_attributes = array();
96
  }
97
+ $desc_tip = apply_filters( 'booster_get_message', '', 'desc_no_link' );
98
  } else {
99
  $custom_attributes = array();
100
  $desc_tip = '';
includes/class-wcj-payment-gateways-currency.php CHANGED
@@ -287,12 +287,12 @@ class WCJ_Payment_Gateways_Currency extends WCJ_Module {
287
  'manual' => __( 'Enter Rates Manually', 'woocommerce-jetpack' ),
288
  'auto' => __( 'Automatically via Currency Exchange Rates module', 'woocommerce-jetpack' ),
289
  ),
290
- 'desc' => ( '' == apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ) ) ?
291
  __( 'Visit', 'woocommerce-jetpack' ) . ' <a href="' . admin_url( 'admin.php?page=wc-settings&tab=jetpack&wcj-cat=prices_and_currencies&section=currency_exchange_rates' ) . '">' . __( 'Currency Exchange Rates module', 'woocommerce-jetpack' ) . '</a>'
292
  :
293
- apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
294
  'custom_attributes'
295
- => apply_filters( 'get_wc_jetpack_plus_message', '', 'disabled' ),
296
  );
297
 
298
  $settings[] = array(
287
  'manual' => __( 'Enter Rates Manually', 'woocommerce-jetpack' ),
288
  'auto' => __( 'Automatically via Currency Exchange Rates module', 'woocommerce-jetpack' ),
289
  ),
290
+ 'desc' => ( '' == apply_filters( 'booster_get_message', '', 'desc' ) ) ?
291
  __( 'Visit', 'woocommerce-jetpack' ) . ' <a href="' . admin_url( 'admin.php?page=wc-settings&tab=jetpack&wcj-cat=prices_and_currencies&section=currency_exchange_rates' ) . '">' . __( 'Currency Exchange Rates module', 'woocommerce-jetpack' ) . '</a>'
292
  :
293
+ apply_filters( 'booster_get_message', '', 'desc' ),
294
  'custom_attributes'
295
+ => apply_filters( 'booster_get_message', '', 'disabled' ),
296
  );
297
 
298
  $settings[] = array(
includes/class-wcj-payment-gateways-fees.php CHANGED
@@ -156,7 +156,7 @@ class WCJ_Payment_Gateways_Fees extends WCJ_Module {
156
  array(
157
  'title' => '',
158
  'desc' => __( 'Fee (or discount) type.', 'woocommerce-jetpack' ),
159
- 'desc_tip' => __( 'Percent or fixed value.', 'woocommerce-jetpack' )/* . ' ' . apply_filters( 'get_wc_jetpack_plus_message', '', 'desc_no_link' ) */,
160
  'id' => 'wcj_gateways_fees_type_' . $key,
161
  'default' => 'fixed',
162
  'type' => 'select',
156
  array(
157
  'title' => '',
158
  'desc' => __( 'Fee (or discount) type.', 'woocommerce-jetpack' ),
159
+ 'desc_tip' => __( 'Percent or fixed value.', 'woocommerce-jetpack' )/* . ' ' . apply_filters( 'booster_get_message', '', 'desc_no_link' ) */,
160
  'id' => 'wcj_gateways_fees_type_' . $key,
161
  'default' => 'fixed',
162
  'type' => 'select',
includes/class-wcj-payment-gateways-icons.php CHANGED
@@ -72,7 +72,7 @@ class WCJ_Payment_Gateways_Icons extends WCJ_Module {
72
  * @version 2.3.1
73
  */
74
  function set_icon( $icon, $key ) {
75
- $default_gateways = apply_filters( 'wcj_get_option_filter', array( 'cod', 'cheque', 'bacs', 'mijireh_checkout', 'paypal' ), array() );
76
  if ( ! empty( $default_gateways ) && ! in_array( $key, $default_gateways ) ) {
77
  return $icon;
78
  }
@@ -101,8 +101,8 @@ class WCJ_Payment_Gateways_Icons extends WCJ_Module {
101
  foreach ( $available_gateways as $key => $gateway ) {
102
  $default_gateways = array( 'cod', 'cheque', 'bacs', 'mijireh_checkout', 'paypal' );
103
  if ( ! empty( $default_gateways ) && ! in_array( $key, $default_gateways ) ) {
104
- $custom_attributes = apply_filters( 'get_wc_jetpack_plus_message', '', 'disabled' );
105
- $desc_tip = apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' );
106
  } else {
107
  $custom_attributes = array();
108
  $desc_tip = '';
72
  * @version 2.3.1
73
  */
74
  function set_icon( $icon, $key ) {
75
+ $default_gateways = apply_filters( 'booster_get_option', array( 'cod', 'cheque', 'bacs', 'mijireh_checkout', 'paypal' ), array() );
76
  if ( ! empty( $default_gateways ) && ! in_array( $key, $default_gateways ) ) {
77
  return $icon;
78
  }
101
  foreach ( $available_gateways as $key => $gateway ) {
102
  $default_gateways = array( 'cod', 'cheque', 'bacs', 'mijireh_checkout', 'paypal' );
103
  if ( ! empty( $default_gateways ) && ! in_array( $key, $default_gateways ) ) {
104
+ $custom_attributes = apply_filters( 'booster_get_message', '', 'disabled' );
105
+ $desc_tip = apply_filters( 'booster_get_message', '', 'desc' );
106
  } else {
107
  $custom_attributes = array();
108
  $desc_tip = '';
includes/class-wcj-payment-gateways-min-max.php CHANGED
@@ -96,11 +96,11 @@ class WCJ_Payment_Gateways_Min_Max extends WCJ_Module {
96
  foreach ( $gateways as $key => $gateway ) {
97
  $default_gateways = array( 'bacs' );
98
  if ( ! empty( $default_gateways ) && ! in_array( $key, $default_gateways ) ) {
99
- $custom_attributes = apply_filters( 'get_wc_jetpack_plus_message', '', 'disabled' );
100
  if ( '' == $custom_attributes ) {
101
  $custom_attributes = array();
102
  }
103
- $desc_tip = apply_filters( 'get_wc_jetpack_plus_message', '', 'desc_no_link' );
104
  } else {
105
  $custom_attributes = array();
106
  $desc_tip = '';
96
  foreach ( $gateways as $key => $gateway ) {
97
  $default_gateways = array( 'bacs' );
98
  if ( ! empty( $default_gateways ) && ! in_array( $key, $default_gateways ) ) {
99
+ $custom_attributes = apply_filters( 'booster_get_message', '', 'disabled' );
100
  if ( '' == $custom_attributes ) {
101
  $custom_attributes = array();
102
  }
103
+ $desc_tip = apply_filters( 'booster_get_message', '', 'desc_no_link' );
104
  } else {
105
  $custom_attributes = array();
106
  $desc_tip = '';
includes/class-wcj-payment-gateways-per-category.php CHANGED
@@ -116,7 +116,7 @@ class WCJ_Payment_Gateways_Per_Category extends WCJ_Module {
116
  }
117
 
118
  // Including by products
119
- $products_in = apply_filters( 'wcj_get_option_filter', array(), get_option( 'wcj_gateways_per_products_' . $gateway_id ) );
120
  if ( ! empty( $products_in ) ) {
121
  $do_skip = true;
122
  foreach ( WC()->cart->get_cart() as $cart_item_key => $values ) {
@@ -134,7 +134,7 @@ class WCJ_Payment_Gateways_Per_Category extends WCJ_Module {
134
  }
135
 
136
  // Excluding by products
137
- $products_excl = apply_filters( 'wcj_get_option_filter', array(), get_option( 'wcj_gateways_per_products_excl_' . $gateway_id ) );
138
  if ( ! empty( $products_excl ) ) {
139
  $do_skip = false;
140
  foreach ( WC()->cart->get_cart() as $cart_item_key => $values ) {
@@ -203,7 +203,7 @@ class WCJ_Payment_Gateways_Per_Category extends WCJ_Module {
203
  );
204
  $settings[] = array(
205
  'title' => '',
206
- 'desc' => __( 'Products - Include', 'woocommerce-jetpack' ) . '. ' . apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
207
  'desc_tip' => __( 'Show gateway only if there is selected products in cart. Leave blank to disable the option.', 'woocommerce-jetpack' ),
208
  'id' => 'wcj_gateways_per_products_' . $gateway_id,
209
  'default' => '',
@@ -211,11 +211,11 @@ class WCJ_Payment_Gateways_Per_Category extends WCJ_Module {
211
  'class' => 'chosen_select',
212
  'css' => 'width: 450px;',
213
  'options' => $products,
214
- 'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'disabled' ),
215
  );
216
  $settings[] = array(
217
  'title' => '',
218
- 'desc' => __( 'Products - Exclude', 'woocommerce-jetpack' ) . '. ' . apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
219
  'desc_tip' => __( 'Hide gateway if there is selected products in cart. Leave blank to disable the option.', 'woocommerce-jetpack' ),
220
  'id' => 'wcj_gateways_per_products_excl_' . $gateway_id,
221
  'default' => '',
@@ -223,7 +223,7 @@ class WCJ_Payment_Gateways_Per_Category extends WCJ_Module {
223
  'class' => 'chosen_select',
224
  'css' => 'width: 450px;',
225
  'options' => $products,
226
- 'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'disabled' ),
227
  );
228
  }
229
 
116
  }
117
 
118
  // Including by products
119
+ $products_in = apply_filters( 'booster_get_option', array(), get_option( 'wcj_gateways_per_products_' . $gateway_id ) );
120
  if ( ! empty( $products_in ) ) {
121
  $do_skip = true;
122
  foreach ( WC()->cart->get_cart() as $cart_item_key => $values ) {
134
  }
135
 
136
  // Excluding by products
137
+ $products_excl = apply_filters( 'booster_get_option', array(), get_option( 'wcj_gateways_per_products_excl_' . $gateway_id ) );
138
  if ( ! empty( $products_excl ) ) {
139
  $do_skip = false;
140
  foreach ( WC()->cart->get_cart() as $cart_item_key => $values ) {
203
  );
204
  $settings[] = array(
205
  'title' => '',
206
+ 'desc' => __( 'Products - Include', 'woocommerce-jetpack' ) . '. ' . apply_filters( 'booster_get_message', '', 'desc' ),
207
  'desc_tip' => __( 'Show gateway only if there is selected products in cart. Leave blank to disable the option.', 'woocommerce-jetpack' ),
208
  'id' => 'wcj_gateways_per_products_' . $gateway_id,
209
  'default' => '',
211
  'class' => 'chosen_select',
212
  'css' => 'width: 450px;',
213
  'options' => $products,
214
+ 'custom_attributes' => apply_filters( 'booster_get_message', '', 'disabled' ),
215
  );
216
  $settings[] = array(
217
  'title' => '',
218
+ 'desc' => __( 'Products - Exclude', 'woocommerce-jetpack' ) . '. ' . apply_filters( 'booster_get_message', '', 'desc' ),
219
  'desc_tip' => __( 'Hide gateway if there is selected products in cart. Leave blank to disable the option.', 'woocommerce-jetpack' ),
220
  'id' => 'wcj_gateways_per_products_excl_' . $gateway_id,
221
  'default' => '',
223
  'class' => 'chosen_select',
224
  'css' => 'width: 450px;',
225
  'options' => $products,
226
+ 'custom_attributes' => apply_filters( 'booster_get_message', '', 'disabled' ),
227
  );
228
  }
229
 
includes/class-wcj-payment-gateways.php CHANGED
@@ -124,16 +124,16 @@ class WCJ_Payment_Gateways extends WCJ_Module {
124
  ),
125
  array(
126
  'title' => __( 'Number of Gateways', 'woocommerce-jetpack' ),
127
- 'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
128
  'desc_tip' => __( 'Number of custom payments gateways to be added. All settings for each new gateway are in WooCommerce > Settings > Checkout.', 'woocommerce-jetpack' ),
129
  'id' => 'wcj_custom_payment_gateways_number',
130
  'default' => 1,
131
  'type' => 'number',
132
- 'custom_attributes' => is_array( apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ) ) ?
133
- apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ) : array( 'step' => '1', 'min' => '1' ),
134
  ),
135
  );
136
- $total_number = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_custom_payment_gateways_number', 1 ) );
137
  for ( $i = 1; $i <= $total_number; $i++ ) {
138
  $settings [] = array(
139
  'title' => __( 'Admin Title Custom Gateway', 'woocommerce-jetpack' ) . ' #' . $i,
124
  ),
125
  array(
126
  'title' => __( 'Number of Gateways', 'woocommerce-jetpack' ),
127
+ 'desc' => apply_filters( 'booster_get_message', '', 'desc' ),
128
  'desc_tip' => __( 'Number of custom payments gateways to be added. All settings for each new gateway are in WooCommerce > Settings > Checkout.', 'woocommerce-jetpack' ),
129
  'id' => 'wcj_custom_payment_gateways_number',
130
  'default' => 1,
131
  'type' => 'number',
132
+ 'custom_attributes' => is_array( apply_filters( 'booster_get_message', '', 'readonly' ) ) ?
133
+ apply_filters( 'booster_get_message', '', 'readonly' ) : array( 'step' => '1', 'min' => '1' ),
134
  ),
135
  );
136
+ $total_number = apply_filters( 'booster_get_option', 1, get_option( 'wcj_custom_payment_gateways_number', 1 ) );
137
  for ( $i = 1; $i <= $total_number; $i++ ) {
138
  $settings [] = array(
139
  'title' => __( 'Admin Title Custom Gateway', 'woocommerce-jetpack' ) . ' #' . $i,
includes/class-wcj-pdf-invoicing.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * The WooCommerce Jetpack PDF Invoicing class.
6
  *
7
- * @version 2.5.7
8
  * @author Algoritmika Ltd.
9
  */
10
 
@@ -351,7 +351,7 @@ class WCJ_PDF_Invoicing extends WCJ_Module {
351
  /**
352
  * get_settings.
353
  *
354
- * @version 2.4.0
355
  */
356
  function get_settings() {
357
 
@@ -383,8 +383,15 @@ class WCJ_PDF_Invoicing extends WCJ_Module {
383
  'type' => 'select',
384
  'class' => 'chosen_select',
385
  'options' => $create_on_array,
386
- 'desc' => ( 0 === $k ) ? '' : apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
387
- 'custom_attributes' => ( 0 === $k ) ? '' : apply_filters( 'get_wc_jetpack_plus_message', '', 'disabled' ),
 
 
 
 
 
 
 
388
  );
389
  }
390
 
4
  *
5
  * The WooCommerce Jetpack PDF Invoicing class.
6
  *
7
+ * @version 2.5.9
8
  * @author Algoritmika Ltd.
9
  */
10
 
351
  /**
352
  * get_settings.
353
  *
354
+ * @version 2.5.9
355
  */
356
  function get_settings() {
357
 
383
  'type' => 'select',
384
  'class' => 'chosen_select',
385
  'options' => $create_on_array,
386
+ 'desc' => ( 0 === $k ) ? '' : apply_filters( 'booster_get_message', '', 'desc' ),
387
+ 'custom_attributes' => ( 0 === $k ) ? '' : apply_filters( 'booster_get_message', '', 'disabled' ),
388
+ );
389
+ $settings[] = array(
390
+ 'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_skip_zero_total',
391
+ 'default' => 'no',
392
+ 'type' => 'checkbox',
393
+ 'desc' => __( 'Do not create if order total equals zero', 'woocommerce-jetpack' ),// . ( ( 0 === $k ) ? '' : ' ' . apply_filters( 'booster_get_message', '', 'desc' ) ),
394
+ 'custom_attributes' => ( 0 === $k ) ? '' : apply_filters( 'booster_get_message', '', 'disabled' ),
395
  );
396
  }
397
 
includes/class-wcj-price-by-country.php CHANGED
@@ -286,15 +286,15 @@ class WCJ_Price_By_Country extends WCJ_Module {
286
  'id' => 'wcj_price_by_country_total_groups_number',
287
  'default' => 1,
288
  'type' => 'custom_number',
289
- 'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
290
  'custom_attributes' => array_merge(
291
- is_array( apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ) ) ? apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ) : array(),
292
  array('step' => '1', 'min' => '1', ) ),
293
  'css' => 'width:100px;',
294
  ),
295
  );
296
 
297
- for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_price_by_country_total_groups_number', 1 ) ); $i++ ) {
298
 
299
  switch ( get_option( 'wcj_price_by_country_selection', 'comma_list' ) ) {
300
 
@@ -356,14 +356,14 @@ class WCJ_Price_By_Country extends WCJ_Module {
356
  'manual' => __( 'Enter Rates Manually', 'woocommerce-jetpack' ),
357
  'auto' => __( 'Automatically via Currency Exchange Rates module', 'woocommerce-jetpack' ),
358
  ),
359
- 'desc' => ( '' == apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ) )
360
  ? __( 'Visit', 'woocommerce-jetpack' ) . ' <a href="' . admin_url( 'admin.php?page=wc-settings&tab=jetpack&wcj-cat=prices_and_currencies&section=currency_exchange_rates' ) . '">' . __( 'Currency Exchange Rates module', 'woocommerce-jetpack' ) . '</a>'
361
- : apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
362
- 'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'disabled' ),
363
  );
364
 
365
  $currency_from = apply_filters( 'woocommerce_currency', get_option('woocommerce_currency') );
366
- for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_price_by_country_total_groups_number', 1 ) ); $i++ ) {
367
 
368
  $currency_to = get_option( 'wcj_price_by_country_exchange_rate_currency_group_' . $i );
369
 
286
  'id' => 'wcj_price_by_country_total_groups_number',
287
  'default' => 1,
288
  'type' => 'custom_number',
289
+ 'desc' => apply_filters( 'booster_get_message', '', 'desc' ),
290
  'custom_attributes' => array_merge(
291
+ is_array( apply_filters( 'booster_get_message', '', 'readonly' ) ) ? apply_filters( 'booster_get_message', '', 'readonly' ) : array(),
292
  array('step' => '1', 'min' => '1', ) ),
293
  'css' => 'width:100px;',
294
  ),
295
  );
296
 
297
+ for ( $i = 1; $i <= apply_filters( 'booster_get_option', 1, get_option( 'wcj_price_by_country_total_groups_number', 1 ) ); $i++ ) {
298
 
299
  switch ( get_option( 'wcj_price_by_country_selection', 'comma_list' ) ) {
300
 
356
  'manual' => __( 'Enter Rates Manually', 'woocommerce-jetpack' ),
357
  'auto' => __( 'Automatically via Currency Exchange Rates module', 'woocommerce-jetpack' ),
358
  ),
359
+ 'desc' => ( '' == apply_filters( 'booster_get_message', '', 'desc' ) )
360
  ? __( 'Visit', 'woocommerce-jetpack' ) . ' <a href="' . admin_url( 'admin.php?page=wc-settings&tab=jetpack&wcj-cat=prices_and_currencies&section=currency_exchange_rates' ) . '">' . __( 'Currency Exchange Rates module', 'woocommerce-jetpack' ) . '</a>'
361
+ : apply_filters( 'booster_get_message', '', 'desc' ),
362
+ 'custom_attributes' => apply_filters( 'booster_get_message', '', 'disabled' ),
363
  );
364
 
365
  $currency_from = apply_filters( 'woocommerce_currency', get_option('woocommerce_currency') );
366
+ for ( $i = 1; $i <= apply_filters( 'booster_get_option', 1, get_option( 'wcj_price_by_country_total_groups_number', 1 ) ); $i++ ) {
367
 
368
  $currency_to = get_option( 'wcj_price_by_country_exchange_rate_currency_group_' . $i );
369
 
includes/class-wcj-price-by-user-role.php CHANGED
@@ -54,7 +54,7 @@ class WCJ_Price_By_User_Role extends WCJ_Module {
54
  * @since 2.5.0
55
  */
56
  function save_meta_box_value( $option_value, $option_name, $module_id ) {
57
- if ( true === apply_filters( 'wcj_get_option_filter', false, true ) ) {
58
  return $option_value;
59
  }
60
  if ( 'no' === $option_value ) {
54
  * @since 2.5.0
55
  */
56
  function save_meta_box_value( $option_value, $option_name, $module_id ) {
57
+ if ( true === apply_filters( 'booster_get_option', false, true ) ) {
58
  return $option_value;
59
  }
60
  if ( 'no' === $option_value ) {
includes/class-wcj-price-formats.php CHANGED
@@ -43,7 +43,7 @@ class WCJ_Price_Formats extends WCJ_Module {
43
  * @since 2.5.2
44
  */
45
  function price_format( $args ) {
46
- for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_price_formats_total_number', 1 ) ); $i++ ) {
47
  if ( get_woocommerce_currency() === get_option( 'wcj_price_formats_currency_' . $i ) ) {
48
  if ( defined( 'ICL_LANGUAGE_CODE' ) && '' != ( $wpml_language = get_option( 'wcj_price_formats_wpml_language_' . $i, '' ) ) ) {
49
  $wpml_language = explode( ',', trim( str_replace( ' ', '', $wpml_language ), ',' ) );
@@ -127,14 +127,14 @@ class WCJ_Price_Formats extends WCJ_Module {
127
  'id' => 'wcj_price_formats_total_number',
128
  'default' => 1,
129
  'type' => 'custom_number',
130
- 'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
131
  'custom_attributes' => array_merge(
132
- is_array( apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ) ) ? apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ) : array(),
133
  array( 'step' => '1', 'min' => '0', )
134
  ),
135
  ),
136
  );
137
- for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_price_formats_total_number', 1 ) ); $i++ ) {
138
  $currency_symbol = wcj_get_currency_symbol( get_option( 'wcj_price_formats_currency_' . $i, get_woocommerce_currency() ) );
139
  $settings = array_merge( $settings, array(
140
  array(
43
  * @since 2.5.2
44
  */
45
  function price_format( $args ) {
46
+ for ( $i = 1; $i <= apply_filters( 'booster_get_option', 1, get_option( 'wcj_price_formats_total_number', 1 ) ); $i++ ) {
47
  if ( get_woocommerce_currency() === get_option( 'wcj_price_formats_currency_' . $i ) ) {
48
  if ( defined( 'ICL_LANGUAGE_CODE' ) && '' != ( $wpml_language = get_option( 'wcj_price_formats_wpml_language_' . $i, '' ) ) ) {
49
  $wpml_language = explode( ',', trim( str_replace( ' ', '', $wpml_language ), ',' ) );
127
  'id' => 'wcj_price_formats_total_number',
128
  'default' => 1,
129
  'type' => 'custom_number',
130
+ 'desc' => apply_filters( 'booster_get_message', '', 'desc' ),
131
  'custom_attributes' => array_merge(
132
+ is_array( apply_filters( 'booster_get_message', '', 'readonly' ) ) ? apply_filters( 'booster_get_message', '', 'readonly' ) : array(),
133
  array( 'step' => '1', 'min' => '0', )
134
  ),
135
  ),
136
  );
137
+ for ( $i = 1; $i <= apply_filters( 'booster_get_option', 1, get_option( 'wcj_price_formats_total_number', 1 ) ); $i++ ) {
138
  $currency_symbol = wcj_get_currency_symbol( get_option( 'wcj_price_formats_currency_' . $i, get_woocommerce_currency() ) );
139
  $settings = array_merge( $settings, array(
140
  array(
includes/class-wcj-price-labels.php CHANGED
@@ -296,7 +296,7 @@ class WCJ_Price_Labels extends WCJ_Module {
296
  echo '<tr>';
297
  foreach ( $this->custom_tab_sections as $custom_tab_section ) {
298
  if ( '_instead' != $custom_tab_section )
299
- $disabled_if_no_plus = apply_filters( 'get_wc_jetpack_plus_message', '', 'desc_below' );
300
  else
301
  $disabled_if_no_plus = '';
302
  echo '<td style="width:25%;">' . $disabled_if_no_plus . '</td>';
@@ -309,7 +309,7 @@ class WCJ_Price_Labels extends WCJ_Module {
309
 
310
  echo '<td style="width:25%;">';
311
 
312
- /*if ( $custom_tab_section == '_before' ) $disabled_if_no_plus = apply_filters( 'get_wc_jetpack_plus_message', '', 'desc_below' );
313
  else $disabled_if_no_plus = '';
314
  echo '<p>' . $disabled_if_no_plus . '<ul><h4>' . $this->custom_tab_sections_titles[ $custom_tab_section ] . '</h4>';*/
315
 
@@ -324,7 +324,7 @@ class WCJ_Price_Labels extends WCJ_Module {
324
 
325
  //$option_name .= $custom_tab_section_variation . $custom_tab_section;
326
 
327
- if ( $custom_tab_section != '_instead' ) $disabled_if_no_plus = apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly_string' );
328
  else $disabled_if_no_plus = '';
329
  //if ( $disabled_if_no_plus != '' ) $disabled_if_no_plus = 'readonly';
330
 
@@ -345,7 +345,7 @@ class WCJ_Price_Labels extends WCJ_Module {
345
 
346
  //$option_name .= $custom_tab_section . $custom_tab_section_variation;
347
 
348
- if ( '_instead' != $custom_tab_section ) $disabled_if_no_plus = apply_filters( 'get_wc_jetpack_plus_message', '', 'disabled_string' );
349
  else $disabled_if_no_plus = '';
350
  //if ( $disabled_if_no_plus != '' ) $disabled_if_no_plus = 'disabled';
351
 
@@ -363,7 +363,7 @@ class WCJ_Price_Labels extends WCJ_Module {
363
  echo '<tr>';
364
  foreach ( $this->custom_tab_sections as $custom_tab_section ) {
365
  if ( '_instead' != $custom_tab_section )
366
- $disabled_if_no_plus = apply_filters( 'get_wc_jetpack_plus_message', '', 'desc_above' );
367
  else
368
  $disabled_if_no_plus = '';
369
  echo '<td style="width:25%;">' . $disabled_if_no_plus . '</td>';
@@ -385,15 +385,15 @@ class WCJ_Price_Labels extends WCJ_Module {
385
  break;
386
 
387
  case '_before':
388
- $price = apply_filters( 'wcj_get_option_filter', $price, $custom_label . $price );
389
  break;
390
 
391
  case '_between':
392
- $price = apply_filters( 'wcj_get_option_filter', $price, str_replace( '</del> <ins>', '</del>' . $custom_label . '<ins>', $price ) );
393
  break;
394
 
395
  case '_after':
396
- $price = apply_filters( 'wcj_get_option_filter', $price, $price . $custom_label );
397
  break;
398
  }
399
 
@@ -479,7 +479,7 @@ class WCJ_Price_Labels extends WCJ_Module {
479
  }
480
  if ( $do_apply_global ) {
481
  // Global price labels - Add text before price
482
- $text_to_add_before = apply_filters( 'wcj_get_option_filter', '', get_option( 'wcj_global_price_labels_add_before_text' ) );
483
  if ( '' != $text_to_add_before ) {
484
  if ( apply_filters( 'wcj_price_labels_check_on_applying_label', true, $price, $text_to_add_before ) ) {
485
  $price = $text_to_add_before . $price;
@@ -496,15 +496,15 @@ class WCJ_Price_Labels extends WCJ_Module {
496
  // Global price labels - Between regular and sale prices
497
  $text_to_add_between_regular_and_sale = get_option( 'wcj_global_price_labels_between_regular_and_sale_text' );
498
  if ( '' != $text_to_add_between_regular_and_sale )
499
- $price = apply_filters( 'wcj_get_option_filter', $price, str_replace( '</del> <ins>', '</del>' . $text_to_add_between_regular_and_sale . '<ins>', $price ) );
500
 
501
  // Global price labels - Remove text from price
502
- $text_to_remove = apply_filters( 'wcj_get_option_filter', '', get_option( 'wcj_global_price_labels_remove_text' ) );
503
  if ( '' != $text_to_remove )
504
  $price = str_replace( $text_to_remove, '', $price );
505
  // Global price labels - Replace in price
506
- $text_to_replace = apply_filters( 'wcj_get_option_filter', '', get_option( 'wcj_global_price_labels_replace_text' ) );
507
- $text_to_replace_with = apply_filters( 'wcj_get_option_filter', '', get_option( 'wcj_global_price_labels_replace_with_text' ) );
508
  if ( '' != $text_to_replace && '' != $text_to_replace_with )
509
  $price = str_replace( $text_to_replace, $text_to_replace_with, $price );
510
  }
@@ -638,8 +638,8 @@ class WCJ_Price_Labels extends WCJ_Module {
638
  'id' => 'wcj_global_price_labels_add_before_text',
639
  'default' => '',
640
  'type' => 'textarea',
641
- 'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
642
- 'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ),
643
  'css' => 'width:30%;min-width:300px;',
644
  ),
645
  array(
@@ -656,8 +656,8 @@ class WCJ_Price_Labels extends WCJ_Module {
656
  'id' => 'wcj_global_price_labels_between_regular_and_sale_text',
657
  'default' => '',
658
  'type' => 'textarea',
659
- 'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
660
- 'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ),
661
  'css' => 'width:30%;min-width:300px;',
662
  ),
663
  array(
@@ -667,8 +667,8 @@ class WCJ_Price_Labels extends WCJ_Module {
667
  'id' => 'wcj_global_price_labels_remove_text',
668
  'default' => '',
669
  'type' => 'textarea',
670
- 'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
671
- 'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ),
672
  'css' => 'width:30%;min-width:300px;',
673
  ),
674
  array(
@@ -677,9 +677,9 @@ class WCJ_Price_Labels extends WCJ_Module {
677
  'id' => 'wcj_global_price_labels_replace_text',
678
  'default' => '',
679
  'type' => 'textarea',
680
- 'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
681
  'custom_attributes'
682
- => apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ),
683
  'css' => 'width:30%;min-width:300px;',
684
  ),
685
  array(
@@ -688,8 +688,8 @@ class WCJ_Price_Labels extends WCJ_Module {
688
  'id' => 'wcj_global_price_labels_replace_with_text',
689
  'default' => '',
690
  'type' => 'textarea',
691
- 'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
692
- 'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ),
693
  'css' => 'width:30%;min-width:300px;',
694
  ),
695
  array(
296
  echo '<tr>';
297
  foreach ( $this->custom_tab_sections as $custom_tab_section ) {
298
  if ( '_instead' != $custom_tab_section )
299
+ $disabled_if_no_plus = apply_filters( 'booster_get_message', '', 'desc_below' );
300
  else
301
  $disabled_if_no_plus = '';
302
  echo '<td style="width:25%;">' . $disabled_if_no_plus . '</td>';
309
 
310
  echo '<td style="width:25%;">';
311
 
312
+ /*if ( $custom_tab_section == '_before' ) $disabled_if_no_plus = apply_filters( 'booster_get_message', '', 'desc_below' );
313
  else $disabled_if_no_plus = '';
314
  echo '<p>' . $disabled_if_no_plus . '<ul><h4>' . $this->custom_tab_sections_titles[ $custom_tab_section ] . '</h4>';*/
315
 
324
 
325
  //$option_name .= $custom_tab_section_variation . $custom_tab_section;
326
 
327
+ if ( $custom_tab_section != '_instead' ) $disabled_if_no_plus = apply_filters( 'booster_get_message', '', 'readonly_string' );
328
  else $disabled_if_no_plus = '';
329
  //if ( $disabled_if_no_plus != '' ) $disabled_if_no_plus = 'readonly';
330
 
345
 
346
  //$option_name .= $custom_tab_section . $custom_tab_section_variation;
347
 
348
+ if ( '_instead' != $custom_tab_section ) $disabled_if_no_plus = apply_filters( 'booster_get_message', '', 'disabled_string' );
349
  else $disabled_if_no_plus = '';
350
  //if ( $disabled_if_no_plus != '' ) $disabled_if_no_plus = 'disabled';
351
 
363
  echo '<tr>';
364
  foreach ( $this->custom_tab_sections as $custom_tab_section ) {
365
  if ( '_instead' != $custom_tab_section )
366
+ $disabled_if_no_plus = apply_filters( 'booster_get_message', '', 'desc_above' );
367
  else
368
  $disabled_if_no_plus = '';
369
  echo '<td style="width:25%;">' . $disabled_if_no_plus . '</td>';
385
  break;
386
 
387
  case '_before':
388
+ $price = apply_filters( 'booster_get_option', $price, $custom_label . $price );
389
  break;
390
 
391
  case '_between':
392
+ $price = apply_filters( 'booster_get_option', $price, str_replace( '</del> <ins>', '</del>' . $custom_label . '<ins>', $price ) );
393
  break;
394
 
395
  case '_after':
396
+ $price = apply_filters( 'booster_get_option', $price, $price . $custom_label );
397
  break;
398
  }
399
 
479
  }
480
  if ( $do_apply_global ) {
481
  // Global price labels - Add text before price
482
+ $text_to_add_before = apply_filters( 'booster_get_option', '', get_option( 'wcj_global_price_labels_add_before_text' ) );
483
  if ( '' != $text_to_add_before ) {
484
  if ( apply_filters( 'wcj_price_labels_check_on_applying_label', true, $price, $text_to_add_before ) ) {
485
  $price = $text_to_add_before . $price;
496
  // Global price labels - Between regular and sale prices
497
  $text_to_add_between_regular_and_sale = get_option( 'wcj_global_price_labels_between_regular_and_sale_text' );
498
  if ( '' != $text_to_add_between_regular_and_sale )
499
+ $price = apply_filters( 'booster_get_option', $price, str_replace( '</del> <ins>', '</del>' . $text_to_add_between_regular_and_sale . '<ins>', $price ) );
500
 
501
  // Global price labels - Remove text from price
502
+ $text_to_remove = apply_filters( 'booster_get_option', '', get_option( 'wcj_global_price_labels_remove_text' ) );
503
  if ( '' != $text_to_remove )
504
  $price = str_replace( $text_to_remove, '', $price );
505
  // Global price labels - Replace in price
506
+ $text_to_replace = apply_filters( 'booster_get_option', '', get_option( 'wcj_global_price_labels_replace_text' ) );
507
+ $text_to_replace_with = apply_filters( 'booster_get_option', '', get_option( 'wcj_global_price_labels_replace_with_text' ) );
508
  if ( '' != $text_to_replace && '' != $text_to_replace_with )
509
  $price = str_replace( $text_to_replace, $text_to_replace_with, $price );
510
  }
638
  'id' => 'wcj_global_price_labels_add_before_text',
639
  'default' => '',
640
  'type' => 'textarea',
641
+ 'desc' => apply_filters( 'booster_get_message', '', 'desc' ),
642
+ 'custom_attributes' => apply_filters( 'booster_get_message', '', 'readonly' ),
643
  'css' => 'width:30%;min-width:300px;',
644
  ),
645
  array(
656
  'id' => 'wcj_global_price_labels_between_regular_and_sale_text',
657
  'default' => '',
658
  'type' => 'textarea',
659
+ 'desc' => apply_filters( 'booster_get_message', '', 'desc' ),
660
+ 'custom_attributes' => apply_filters( 'booster_get_message', '', 'readonly' ),
661
  'css' => 'width:30%;min-width:300px;',
662
  ),
663
  array(
667
  'id' => 'wcj_global_price_labels_remove_text',
668
  'default' => '',
669
  'type' => 'textarea',
670
+ 'desc' => apply_filters( 'booster_get_message', '', 'desc' ),
671
+ 'custom_attributes' => apply_filters( 'booster_get_message', '', 'readonly' ),
672
  'css' => 'width:30%;min-width:300px;',
673
  ),
674
  array(
677
  'id' => 'wcj_global_price_labels_replace_text',
678
  'default' => '',
679
  'type' => 'textarea',
680
+ 'desc' => apply_filters( 'booster_get_message', '', 'desc' ),
681
  'custom_attributes'
682
+ => apply_filters( 'booster_get_message', '', 'readonly' ),
683
  'css' => 'width:30%;min-width:300px;',
684
  ),
685
  array(
688
  'id' => 'wcj_global_price_labels_replace_with_text',
689
  'default' => '',
690
  'type' => 'textarea',
691
+ 'desc' => apply_filters( 'booster_get_message', '', 'desc' ),
692
+ 'custom_attributes' => apply_filters( 'booster_get_message', '', 'readonly' ),
693
  'css' => 'width:30%;min-width:300px;',
694
  ),
695
  array(
includes/class-wcj-product-add-to-cart.php CHANGED
@@ -44,7 +44,7 @@ class WCJ_Product_Add_To_Cart extends WCJ_Module {
44
  }
45
 
46
  // Variable Add to Cart Template
47
- if ( 'yes' === apply_filters( 'wcj_get_option_filter', 'wcj', get_option( 'wcj_add_to_cart_variable_as_radio_enabled', 'no' ) ) ) {
48
  add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_variable_add_to_cart_scripts' ) );
49
  add_filter( 'wc_get_template', array( $this, 'change_variable_add_to_cart_template' ), PHP_INT_MAX, 5 );
50
  }
@@ -391,8 +391,8 @@ class WCJ_Product_Add_To_Cart extends WCJ_Module {
391
  'id' => 'wcj_add_to_cart_variable_as_radio_enabled',
392
  'default' => 'no',
393
  'type' => 'checkbox',
394
- 'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'disabled' ),
395
- 'desc_tip' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
396
  ),
397
  array(
398
  'type' => 'sectionend',
44
  }
45
 
46
  // Variable Add to Cart Template
47
+ if ( 'yes' === apply_filters( 'booster_get_option', 'wcj', get_option( 'wcj_add_to_cart_variable_as_radio_enabled', 'no' ) ) ) {
48
  add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_variable_add_to_cart_scripts' ) );
49
  add_filter( 'wc_get_template', array( $this, 'change_variable_add_to_cart_template' ), PHP_INT_MAX, 5 );
50
  }
391
  'id' => 'wcj_add_to_cart_variable_as_radio_enabled',
392
  'default' => 'no',
393
  'type' => 'checkbox',
394
+ 'custom_attributes' => apply_filters( 'booster_get_message', '', 'disabled' ),
395
+ 'desc_tip' => apply_filters( 'booster_get_message', '', 'desc' ),
396
  ),
397
  array(
398
  'type' => 'sectionend',
includes/class-wcj-product-addons.php CHANGED
@@ -183,7 +183,7 @@ class WCJ_Product_Addons extends WCJ_Module {
183
  $addons = array();
184
  // All Products
185
  if ( 'yes' === get_option( 'wcj_product_addons_all_products_enabled', 'no' ) ) {
186
- $total_number = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_product_addons_all_products_total_number', 1 ) );
187
  for ( $i = 1; $i <= $total_number; $i++ ) {
188
  if ( 'yes' === get_option( 'wcj_product_addons_all_products_enabled_' . $i, 'yes' ) ) {
189
  $addons[] = array(
@@ -562,14 +562,14 @@ class WCJ_Product_Addons extends WCJ_Module {
562
  'id' => 'wcj_product_addons_all_products_total_number',
563
  'default' => 1,
564
  'type' => 'custom_number',
565
- 'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
566
  'custom_attributes' => array_merge(
567
- is_array( apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ) ) ? apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ) : array(),
568
  array( 'step' => '1', 'min' => '0', )
569
  ),
570
  ),
571
  ) );
572
- $total_number = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_product_addons_all_products_total_number', 1 ) );
573
  for ( $i = 1; $i <= $total_number; $i++ ) {
574
  $settings = array_merge( $settings, array(
575
  array(
183
  $addons = array();
184
  // All Products
185
  if ( 'yes' === get_option( 'wcj_product_addons_all_products_enabled', 'no' ) ) {
186
+ $total_number = apply_filters( 'booster_get_option', 1, get_option( 'wcj_product_addons_all_products_total_number', 1 ) );
187
  for ( $i = 1; $i <= $total_number; $i++ ) {
188
  if ( 'yes' === get_option( 'wcj_product_addons_all_products_enabled_' . $i, 'yes' ) ) {
189
  $addons[] = array(
562
  'id' => 'wcj_product_addons_all_products_total_number',
563
  'default' => 1,
564
  'type' => 'custom_number',
565
+ 'desc' => apply_filters( 'booster_get_message', '', 'desc' ),
566
  'custom_attributes' => array_merge(
567
+ is_array( apply_filters( 'booster_get_message', '', 'readonly' ) ) ? apply_filters( 'booster_get_message', '', 'readonly' ) : array(),
568
  array( 'step' => '1', 'min' => '0', )
569
  ),
570
  ),
571
  ) );
572
+ $total_number = apply_filters( 'booster_get_option', 1, get_option( 'wcj_product_addons_all_products_total_number', 1 ) );
573
  for ( $i = 1; $i <= $total_number; $i++ ) {
574
  $settings = array_merge( $settings, array(
575
  array(
includes/class-wcj-product-bookings.php CHANGED
@@ -335,7 +335,7 @@ class WCJ_Product_Bookings extends WCJ_Module {
335
  * @since 2.5.0
336
  */
337
  function save_meta_box_value( $option_value, $option_name, $module_id ) {
338
- if ( true === apply_filters( 'wcj_get_option_filter', false, true ) ) {
339
  return $option_value;
340
  }
341
  if ( 'no' === $option_value ) {
335
  * @since 2.5.0
336
  */
337
  function save_meta_box_value( $option_value, $option_name, $module_id ) {
338
+ if ( true === apply_filters( 'booster_get_option', false, true ) ) {
339
  return $option_value;
340
  }
341
  if ( 'no' === $option_value ) {
includes/class-wcj-product-bulk-price-converter.php CHANGED
@@ -46,7 +46,7 @@ class WCJ_Bulk_Price_Converter extends WCJ_Module {
46
  if ( '' != $the_price && 0 != $the_price ) {
47
  $precision = get_option( 'woocommerce_price_num_decimals', 2 );
48
  $the_modified_price = round( $the_price * $multiply_price_by, $precision );
49
- if ( isset( $_POST['make_pretty_prices_threshold'] ) && apply_filters( 'wcj_get_option_filter', 0, $_POST['make_pretty_prices_threshold'] ) > 0 ) {
50
  $the_modified_price = $this->make_pretty_price( $the_modified_price );
51
  }
52
  if ( $the_modified_price < 0 ) {
@@ -164,7 +164,7 @@ class WCJ_Bulk_Price_Converter extends WCJ_Module {
164
  // 'orderby' => 'date',
165
  // 'order' => 'ASC',
166
  );
167
- if ( isset( $_POST['wcj_product_cat'] ) && 'wcj_any' != $_POST['wcj_product_cat'] && 'any' != apply_filters( 'wcj_get_option_filter', 'any', '' ) ) {
168
  $args['tax_query'] = array(
169
  array(
170
  'taxonomy' => 'product_cat',
@@ -257,22 +257,22 @@ class WCJ_Bulk_Price_Converter extends WCJ_Module {
257
  if ( '' != $select_options_html ) {
258
  $data_table[] = array(
259
  __( 'Products category', 'woocommerce-jetpack' ),
260
- '<select name="wcj_product_cat" ' . apply_filters( 'wcj_get_option_filter', 'disabled', '' ) . '>' .
261
  '<option value="wcj_any">' . __( 'Any', 'woocommerce-jetpack' ) . '</option>' .
262
  $select_options_html .
263
  '<option value="wcj_none"' . selected( 'wcj_none', $selected_option, false ) . '>' . __( 'None', 'woocommerce-jetpack' ) . '</option>' .
264
  '</select>',
265
- apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
266
  );
267
  }
268
  $make_pretty_prices_threshold = isset( $_POST['make_pretty_prices_threshold'] ) ? $_POST['make_pretty_prices_threshold'] : 0;
269
  $data_table[] = array(
270
  __( '"Pretty prices" threshold', 'woocommerce-jetpack' ),
271
  '<input class="" type="number" step="0.000001" min="0" name="make_pretty_prices_threshold" id="make_pretty_prices_threshold" value="' .
272
- $make_pretty_prices_threshold . '"' . apply_filters( 'wcj_get_option_filter', 'disabled', '' ) . '>',
273
- ( '' == apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ) ) ?
274
  '<em>' . __( 'Leave zero to disable', 'woocommerce-jetpack' ) . '</em>' :
275
- apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
276
  );
277
  $data_table[] = array(
278
  '<input class="button-primary" type="submit" name="bulk_change_prices_preview" id="bulk_change_prices_preview" value="' .
46
  if ( '' != $the_price && 0 != $the_price ) {
47
  $precision = get_option( 'woocommerce_price_num_decimals', 2 );
48
  $the_modified_price = round( $the_price * $multiply_price_by, $precision );
49
+ if ( isset( $_POST['make_pretty_prices_threshold'] ) && apply_filters( 'booster_get_option', 0, $_POST['make_pretty_prices_threshold'] ) > 0 ) {
50
  $the_modified_price = $this->make_pretty_price( $the_modified_price );
51
  }
52
  if ( $the_modified_price < 0 ) {
164
  // 'orderby' => 'date',
165
  // 'order' => 'ASC',
166
  );
167
+ if ( isset( $_POST['wcj_product_cat'] ) && 'wcj_any' != $_POST['wcj_product_cat'] && 'any' != apply_filters( 'booster_get_option', 'any', '' ) ) {
168
  $args['tax_query'] = array(
169
  array(
170
  'taxonomy' => 'product_cat',
257
  if ( '' != $select_options_html ) {
258
  $data_table[] = array(
259
  __( 'Products category', 'woocommerce-jetpack' ),
260
+ '<select name="wcj_product_cat" ' . apply_filters( 'booster_get_option', 'disabled', '' ) . '>' .
261
  '<option value="wcj_any">' . __( 'Any', 'woocommerce-jetpack' ) . '</option>' .
262
  $select_options_html .
263
  '<option value="wcj_none"' . selected( 'wcj_none', $selected_option, false ) . '>' . __( 'None', 'woocommerce-jetpack' ) . '</option>' .
264
  '</select>',
265
+ apply_filters( 'booster_get_message', '', 'desc' ),
266
  );
267
  }
268
  $make_pretty_prices_threshold = isset( $_POST['make_pretty_prices_threshold'] ) ? $_POST['make_pretty_prices_threshold'] : 0;
269
  $data_table[] = array(
270
  __( '"Pretty prices" threshold', 'woocommerce-jetpack' ),
271
  '<input class="" type="number" step="0.000001" min="0" name="make_pretty_prices_threshold" id="make_pretty_prices_threshold" value="' .
272
+ $make_pretty_prices_threshold . '"' . apply_filters( 'booster_get_option', 'disabled', '' ) . '>',
273
+ ( '' == apply_filters( 'booster_get_message', '', 'desc' ) ) ?
274
  '<em>' . __( 'Leave zero to disable', 'woocommerce-jetpack' ) . '</em>' :
275
+ apply_filters( 'booster_get_message', '', 'desc' ),
276
  );
277
  $data_table[] = array(
278
  '<input class="button-primary" type="submit" name="bulk_change_prices_preview" id="bulk_change_prices_preview" value="' .
includes/class-wcj-product-by-user.php CHANGED
@@ -226,8 +226,8 @@ class WCJ_Product_By_User extends WCJ_Module {
226
  'default' => 'no',
227
  'type' => 'checkbox',
228
  'checkboxgroup' => $checkboxgroup,
229
- 'custom_attributes' => ( ( 'image' === $field_id ) ? apply_filters( 'get_wc_jetpack_plus_message', '', 'disabled' ) : '' ),
230
- 'desc_tip' => ( ( 'image' === $field_id ) ? apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ) : '' ),
231
  );
232
  $fields_required_options[] = array(
233
  'title' => ( ( 1 === $i ) ? __( 'Is Required', 'woocommerce-jetpack' ) : '' ),
@@ -236,8 +236,8 @@ class WCJ_Product_By_User extends WCJ_Module {
236
  'default' => 'no',
237
  'type' => 'checkbox',
238
  'checkboxgroup' => $checkboxgroup,
239
- 'custom_attributes' => ( ( 'image' === $field_id ) ? apply_filters( 'get_wc_jetpack_plus_message', '', 'disabled' ) : '' ),
240
- 'desc_tip' => ( ( 'image' === $field_id ) ? apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ) : '' ),
241
  );
242
  }
243
 
226
  'default' => 'no',
227
  'type' => 'checkbox',
228
  'checkboxgroup' => $checkboxgroup,
229
+ 'custom_attributes' => ( ( 'image' === $field_id ) ? apply_filters( 'booster_get_message', '', 'disabled' ) : '' ),
230
+ 'desc_tip' => ( ( 'image' === $field_id ) ? apply_filters( 'booster_get_message', '', 'desc' ) : '' ),
231
  );
232
  $fields_required_options[] = array(
233
  'title' => ( ( 1 === $i ) ? __( 'Is Required', 'woocommerce-jetpack' ) : '' ),
236
  'default' => 'no',
237
  'type' => 'checkbox',
238
  'checkboxgroup' => $checkboxgroup,
239
+ 'custom_attributes' => ( ( 'image' === $field_id ) ? apply_filters( 'booster_get_message', '', 'disabled' ) : '' ),
240
+ 'desc_tip' => ( ( 'image' === $field_id ) ? apply_filters( 'booster_get_message', '', 'desc' ) : '' ),
241
  );
242
  }
243
 
includes/class-wcj-product-custom-info.php CHANGED
@@ -34,7 +34,7 @@ class WCJ_Product_Custom_info extends WCJ_Module {
34
  $single_or_archive_array = array( 'single', 'archive' );
35
  foreach ( $single_or_archive_array as $single_or_archive ) {
36
  $default_hook = ( 'single' === $single_or_archive ) ? 'woocommerce_after_single_product_summary' : 'woocommerce_after_shop_loop_item_title';
37
- for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_product_custom_info_total_number_' . $single_or_archive, 1 ) ); $i++ ) {
38
  add_action(
39
  get_option( 'wcj_product_custom_info_hook_' . $single_or_archive . '_' . $i, $default_hook ),
40
  array( $this, 'add_product_custom_info' ),
@@ -56,7 +56,7 @@ class WCJ_Product_Custom_info extends WCJ_Module {
56
  $single_or_archive_array = array( 'single', 'archive' );
57
  foreach ( $single_or_archive_array as $single_or_archive ) {
58
  $default_hook = ( 'single' === $single_or_archive ) ? 'woocommerce_after_single_product_summary' : 'woocommerce_after_shop_loop_item_title';
59
- for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_product_custom_info_total_number_' . $single_or_archive, 1 ) ); $i++ ) {
60
  if (
61
  '' != get_option( 'wcj_product_custom_info_content_' . $single_or_archive . '_' . $i ) &&
62
  $current_filter === get_option( 'wcj_product_custom_info_hook_' . $single_or_archive . '_' . $i, $default_hook ) &&
@@ -116,15 +116,15 @@ class WCJ_Product_Custom_info extends WCJ_Module {
116
  'id' => 'wcj_product_custom_info_total_number_' . $single_or_archive,
117
  'default' => 1,
118
  'type' => 'custom_number',
119
- 'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
120
- 'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ),
121
  ),
122
  array(
123
  'type' => 'sectionend',
124
  'id' => 'wcj_product_custom_info_options_' . $single_or_archive,
125
  ),
126
  ) );
127
- for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_product_custom_info_total_number_' . $single_or_archive, 1 ) ); $i++ ) {
128
  $settings = array_merge( $settings, array(
129
  array(
130
  'title' => __( 'Info Block', 'woocommerce-jetpack' ) . ' #' . $i . ' - ' . $single_or_archive_desc,
34
  $single_or_archive_array = array( 'single', 'archive' );
35
  foreach ( $single_or_archive_array as $single_or_archive ) {
36
  $default_hook = ( 'single' === $single_or_archive ) ? 'woocommerce_after_single_product_summary' : 'woocommerce_after_shop_loop_item_title';
37
+ for ( $i = 1; $i <= apply_filters( 'booster_get_option', 1, get_option( 'wcj_product_custom_info_total_number_' . $single_or_archive, 1 ) ); $i++ ) {
38
  add_action(
39
  get_option( 'wcj_product_custom_info_hook_' . $single_or_archive . '_' . $i, $default_hook ),
40
  array( $this, 'add_product_custom_info' ),
56
  $single_or_archive_array = array( 'single', 'archive' );
57
  foreach ( $single_or_archive_array as $single_or_archive ) {
58
  $default_hook = ( 'single' === $single_or_archive ) ? 'woocommerce_after_single_product_summary' : 'woocommerce_after_shop_loop_item_title';
59
+ for ( $i = 1; $i <= apply_filters( 'booster_get_option', 1, get_option( 'wcj_product_custom_info_total_number_' . $single_or_archive, 1 ) ); $i++ ) {
60
  if (
61
  '' != get_option( 'wcj_product_custom_info_content_' . $single_or_archive . '_' . $i ) &&
62
  $current_filter === get_option( 'wcj_product_custom_info_hook_' . $single_or_archive . '_' . $i, $default_hook ) &&
116
  'id' => 'wcj_product_custom_info_total_number_' . $single_or_archive,
117
  'default' => 1,
118
  'type' => 'custom_number',
119
+ 'desc' => apply_filters( 'booster_get_message', '', 'desc' ),
120
+ 'custom_attributes' => apply_filters( 'booster_get_message', '', 'readonly' ),
121
  ),
122
  array(
123
  'type' => 'sectionend',
124
  'id' => 'wcj_product_custom_info_options_' . $single_or_archive,
125
  ),
126
  ) );
127
+ for ( $i = 1; $i <= apply_filters( 'booster_get_option', 1, get_option( 'wcj_product_custom_info_total_number_' . $single_or_archive, 1 ) ); $i++ ) {
128
  $settings = array_merge( $settings, array(
129
  array(
130
  'title' => __( 'Info Block', 'woocommerce-jetpack' ) . ' #' . $i . ' - ' . $single_or_archive_desc,
includes/class-wcj-product-info.php CHANGED
@@ -196,7 +196,7 @@ class WCJ_Product_Info extends WCJ_Module {
196
  */
197
  public function add_more_product_info( $single_or_archive ) {
198
  //$single_or_archive = 'archive';
199
- for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 4, get_option( 'wcj_more_product_info_on_' . $single_or_archive . '_fields_total', 4 ) ); $i++ ) {
200
  $field_id = 'wcj_more_product_info_on_' . $single_or_archive . '_' . $i ;
201
  $the_product_info = get_option( $field_id );
202
  $the_product_info = $this->search_and_replace_deprecated_shortcodes( $the_product_info );
@@ -282,8 +282,8 @@ class WCJ_Product_Info extends WCJ_Module {
282
  'id' => 'wcj_more_product_info_on_' . $single_or_archive . '_fields_total',
283
  'default' => 4,
284
  'type' => 'number',
285
- 'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
286
- 'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ),
287
  ),
288
  ) );
289
  $this->admin_add_product_info_fields( $settings, $single_or_archive );
@@ -295,7 +295,7 @@ class WCJ_Product_Info extends WCJ_Module {
295
  * @version 2.4.0
296
  */
297
  function admin_add_product_info_fields( &$settings, $single_or_archive ) {
298
- for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 4, get_option( 'wcj_more_product_info_on_' . $single_or_archive . '_fields_total', 4 ) ); $i++ ) {
299
  $field_id = 'wcj_more_product_info_on_' . $single_or_archive . '_' . $i ;
300
  $default_value = '';
301
  switch ( $i ) {
196
  */
197
  public function add_more_product_info( $single_or_archive ) {
198
  //$single_or_archive = 'archive';
199
+ for ( $i = 1; $i <= apply_filters( 'booster_get_option', 4, get_option( 'wcj_more_product_info_on_' . $single_or_archive . '_fields_total', 4 ) ); $i++ ) {
200
  $field_id = 'wcj_more_product_info_on_' . $single_or_archive . '_' . $i ;
201
  $the_product_info = get_option( $field_id );
202
  $the_product_info = $this->search_and_replace_deprecated_shortcodes( $the_product_info );
282
  'id' => 'wcj_more_product_info_on_' . $single_or_archive . '_fields_total',
283
  'default' => 4,
284
  'type' => 'number',
285
+ 'desc' => apply_filters( 'booster_get_message', '', 'desc' ),
286
+ 'custom_attributes' => apply_filters( 'booster_get_message', '', 'readonly' ),
287
  ),
288
  ) );
289
  $this->admin_add_product_info_fields( $settings, $single_or_archive );
295
  * @version 2.4.0
296
  */
297
  function admin_add_product_info_fields( &$settings, $single_or_archive ) {
298
+ for ( $i = 1; $i <= apply_filters( 'booster_get_option', 4, get_option( 'wcj_more_product_info_on_' . $single_or_archive . '_fields_total', 4 ) ); $i++ ) {
299
  $field_id = 'wcj_more_product_info_on_' . $single_or_archive . '_' . $i ;
300
  $default_value = '';
301
  switch ( $i ) {
includes/class-wcj-product-input-fields.php CHANGED
@@ -143,9 +143,9 @@ class WCJ_Product_Input_Fields extends WCJ_Module {
143
  'desc_tip' => __( 'You will be able to change this number later as well as define the fields, for each product individually, in product\'s "Edit".', 'woocommerce-jetpack' ),
144
  'default' => 1,
145
  'type' => 'number',
146
- 'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
147
  'custom_attributes' => array_merge(
148
- is_array( apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ) ) ? apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ) : array(),
149
  array(
150
  'step' => '1',
151
  'min' => '1',
@@ -180,9 +180,9 @@ class WCJ_Product_Input_Fields extends WCJ_Module {
180
  'id' => 'wcj_product_input_fields_global_total_number',
181
  'default' => 1,
182
  'type' => 'custom_number',
183
- 'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
184
  'custom_attributes' => array_merge(
185
- is_array( apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ) ) ? apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ) : array(),
186
  array(
187
  'step' => '1',
188
  'min' => '1',
@@ -192,7 +192,7 @@ class WCJ_Product_Input_Fields extends WCJ_Module {
192
  );
193
 
194
  $options = $this->get_options();
195
- for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_product_input_fields_global_total_number', 1 ) ); $i++ ) {
196
  foreach( $options as $option ) {
197
  $settings[] = array(
198
  'title' => ( 'wcj_product_input_fields_enabled_global_' === $option['id'] ) ? __( 'Product Input Field', 'woocommerce-jetpack' ) . ' #' . $i : '',
143
  'desc_tip' => __( 'You will be able to change this number later as well as define the fields, for each product individually, in product\'s "Edit".', 'woocommerce-jetpack' ),
144
  'default' => 1,
145
  'type' => 'number',
146
+ 'desc' => apply_filters( 'booster_get_message', '', 'desc' ),
147
  'custom_attributes' => array_merge(
148
+ is_array( apply_filters( 'booster_get_message', '', 'readonly' ) ) ? apply_filters( 'booster_get_message', '', 'readonly' ) : array(),
149
  array(
150
  'step' => '1',
151
  'min' => '1',
180
  'id' => 'wcj_product_input_fields_global_total_number',
181
  'default' => 1,
182
  'type' => 'custom_number',
183
+ 'desc' => apply_filters( 'booster_get_message', '', 'desc' ),
184
  'custom_attributes' => array_merge(
185
+ is_array( apply_filters( 'booster_get_message', '', 'readonly' ) ) ? apply_filters( 'booster_get_message', '', 'readonly' ) : array(),
186
  array(
187
  'step' => '1',
188
  'min' => '1',
192
  );
193
 
194
  $options = $this->get_options();
195
+ for ( $i = 1; $i <= apply_filters( 'booster_get_option', 1, get_option( 'wcj_product_input_fields_global_total_number', 1 ) ); $i++ ) {
196
  foreach( $options as $option ) {
197
  $settings[] = array(
198
  'title' => ( 'wcj_product_input_fields_enabled_global_' === $option['id'] ) ? __( 'Product Input Field', 'woocommerce-jetpack' ) . ' #' . $i : '',
includes/class-wcj-product-listings.php CHANGED
@@ -141,7 +141,7 @@ class WCJ_Product_Listings extends WCJ_Module {
141
  $the_text = get_option( 'wcj_products_per_page_text', __( 'Products <strong>%from% - %to%</strong> from <strong>%total%</strong>. Products on page %select_form%', 'woocommerce-jetpack' ) );
142
  $select_form = '<select name="wcj_products_per_page" id="wcj_products_per_page" class="sortby rounded_corners_class" onchange="this.form.submit()">';
143
  $html .= str_replace( array( '%from%', '%to%', '%total%', '%select_form%' ), array( $products_from, $products_to, $products_total, $select_form ), $the_text );
144
- $products_per_page_select_options = apply_filters( 'wcj_get_option_filter', '10|10' . PHP_EOL . '25|25' . PHP_EOL . '50|50' . PHP_EOL . '100|100' . PHP_EOL . 'All|-1', get_option( 'wcj_products_per_page_select_options', '10|10' . PHP_EOL . '25|25' . PHP_EOL . '50|50' . PHP_EOL . '100|100' . PHP_EOL . 'All|-1' ) );
145
  $products_per_page_select_options = explode( PHP_EOL, $products_per_page_select_options );
146
  foreach ( $products_per_page_select_options as $products_per_page_select_option ) {
147
  $the_option = explode( '|', $products_per_page_select_option );
@@ -182,7 +182,7 @@ class WCJ_Product_Listings extends WCJ_Module {
182
  public function remove_subcategory_count( $count_html ) {
183
  if (
184
  ( is_shop() && 'yes' === get_option( 'wcj_product_listings_hide_cats_count_on_shop' ) ) ||
185
- ( ! is_shop() && 'yes' === apply_filters( 'wcj_get_option_filter', 'wcj', get_option( 'wcj_product_listings_hide_cats_count_on_archive' ) ) )
186
  ) {
187
  return '';
188
  }
@@ -290,8 +290,8 @@ class WCJ_Product_Listings extends WCJ_Module {
290
  'id' => 'wcj_product_listings_hide_cats_count_on_archive',
291
  'default' => 'no',
292
  'type' => 'checkbox',
293
- 'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'disabled' ),
294
- 'desc_tip' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
295
  );
296
  $updated_settings[] = array(
297
  'title' => __( 'WooJetpack: Exclude Subcategories on Category Pages', 'woocommerce-jetpack' ),
@@ -409,8 +409,8 @@ class WCJ_Product_Listings extends WCJ_Module {
409
  'id' => 'wcj_product_listings_hide_cats_count_on_archive',
410
  'default' => 'no',
411
  'type' => 'checkbox',
412
- 'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'disabled' ),
413
- 'desc_tip' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
414
  ),
415
  array(
416
  'title' => __( 'Exclude Subcategories', 'woocommerce-jetpack' ),
@@ -457,8 +457,8 @@ class WCJ_Product_Listings extends WCJ_Module {
457
  'default' => '10|10' . PHP_EOL . '25|25' . PHP_EOL . '50|50' . PHP_EOL . '100|100' . PHP_EOL . 'All|-1',
458
  'type' => 'textarea',
459
  'css' => 'height:200px;',
460
- 'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ),
461
- 'desc_tip' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc_no_link' ),
462
  ),
463
  array(
464
  'title' => __( 'Default', 'woocommerce-jetpack' ),
141
  $the_text = get_option( 'wcj_products_per_page_text', __( 'Products <strong>%from% - %to%</strong> from <strong>%total%</strong>. Products on page %select_form%', 'woocommerce-jetpack' ) );
142
  $select_form = '<select name="wcj_products_per_page" id="wcj_products_per_page" class="sortby rounded_corners_class" onchange="this.form.submit()">';
143
  $html .= str_replace( array( '%from%', '%to%', '%total%', '%select_form%' ), array( $products_from, $products_to, $products_total, $select_form ), $the_text );
144
+ $products_per_page_select_options = apply_filters( 'booster_get_option', '10|10' . PHP_EOL . '25|25' . PHP_EOL . '50|50' . PHP_EOL . '100|100' . PHP_EOL . 'All|-1', get_option( 'wcj_products_per_page_select_options', '10|10' . PHP_EOL . '25|25' . PHP_EOL . '50|50' . PHP_EOL . '100|100' . PHP_EOL . 'All|-1' ) );
145
  $products_per_page_select_options = explode( PHP_EOL, $products_per_page_select_options );
146
  foreach ( $products_per_page_select_options as $products_per_page_select_option ) {
147
  $the_option = explode( '|', $products_per_page_select_option );
182
  public function remove_subcategory_count( $count_html ) {
183
  if (
184
  ( is_shop() && 'yes' === get_option( 'wcj_product_listings_hide_cats_count_on_shop' ) ) ||
185
+ ( ! is_shop() && 'yes' === apply_filters( 'booster_get_option', 'wcj', get_option( 'wcj_product_listings_hide_cats_count_on_archive' ) ) )
186
  ) {
187
  return '';
188
  }
290
  'id' => 'wcj_product_listings_hide_cats_count_on_archive',
291
  'default' => 'no',
292
  'type' => 'checkbox',
293
+ 'custom_attributes' => apply_filters( 'booster_get_message', '', 'disabled' ),
294
+ 'desc_tip' => apply_filters( 'booster_get_message', '', 'desc' ),
295
  );
296
  $updated_settings[] = array(
297
  'title' => __( 'WooJetpack: Exclude Subcategories on Category Pages', 'woocommerce-jetpack' ),
409
  'id' => 'wcj_product_listings_hide_cats_count_on_archive',
410
  'default' => 'no',
411
  'type' => 'checkbox',
412
+ 'custom_attributes' => apply_filters( 'booster_get_message', '', 'disabled' ),
413
+ 'desc_tip' => apply_filters( 'booster_get_message', '', 'desc' ),
414
  ),
415
  array(
416
  'title' => __( 'Exclude Subcategories', 'woocommerce-jetpack' ),
457
  'default' => '10|10' . PHP_EOL . '25|25' . PHP_EOL . '50|50' . PHP_EOL . '100|100' . PHP_EOL . 'All|-1',
458
  'type' => 'textarea',
459
  'css' => 'height:200px;',
460
+ 'custom_attributes' => apply_filters( 'booster_get_message', '', 'readonly' ),
461
+ 'desc_tip' => apply_filters( 'booster_get_message', '', 'desc_no_link' ),
462
  ),
463
  array(
464
  'title' => __( 'Default', 'woocommerce-jetpack' ),
includes/class-wcj-product-open-pricing.php CHANGED
@@ -80,7 +80,7 @@ class WCJ_Product_Open_Pricing extends WCJ_Module {
80
  * @since 2.4.8
81
  */
82
  function save_meta_box_value( $option_value, $option_name, $module_id ) {
83
- if ( true === apply_filters( 'wcj_get_option_filter', false, true ) ) {
84
  return $option_value;
85
  }
86
  if ( 'no' === $option_value ) {
80
  * @since 2.4.8
81
  */
82
  function save_meta_box_value( $option_value, $option_name, $module_id ) {
83
+ if ( true === apply_filters( 'booster_get_option', false, true ) ) {
84
  return $option_value;
85
  }
86
  if ( 'no' === $option_value ) {
includes/class-wcj-product-price-by-formula.php CHANGED
@@ -155,7 +155,7 @@ class WCJ_Product_Price_by_Formula extends WCJ_Module {
155
  * @since 2.5.0
156
  */
157
  function save_meta_box_value( $option_value, $option_name, $module_id ) {
158
- if ( true === apply_filters( 'wcj_get_option_filter', false, true ) ) {
159
  return $option_value;
160
  }
161
  if ( 'no' === $option_value ) {
@@ -321,8 +321,8 @@ class WCJ_Product_Price_by_Formula extends WCJ_Module {
321
  'id' => 'wcj_product_price_by_formula_total_params',
322
  'default' => 1,
323
  'type' => 'custom_number',
324
- /* 'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
325
- 'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ), */
326
  ),
327
  );
328
  $total_number = get_option( 'wcj_product_price_by_formula_total_params', 1 );
155
  * @since 2.5.0
156
  */
157
  function save_meta_box_value( $option_value, $option_name, $module_id ) {
158
+ if ( true === apply_filters( 'booster_get_option', false, true ) ) {
159
  return $option_value;
160
  }
161
  if ( 'no' === $option_value ) {
321
  'id' => 'wcj_product_price_by_formula_total_params',
322
  'default' => 1,
323
  'type' => 'custom_number',
324
+ /* 'desc' => apply_filters( 'booster_get_message', '', 'desc' ),
325
+ 'custom_attributes' => apply_filters( 'booster_get_message', '', 'readonly' ), */
326
  ),
327
  );
328
  $total_number = get_option( 'wcj_product_price_by_formula_total_params', 1 );
includes/class-wcj-product-tabs.php CHANGED
@@ -54,17 +54,17 @@ class WCJ_Product_Tabs extends WCJ_Module {
54
 
55
  // Priority and Title
56
  if ( isset( $tabs['description'] ) ) {
57
- $tabs['description']['priority'] = apply_filters( 'wcj_get_option_filter', 10, get_option( 'wcj_product_info_product_tabs_description_priority' ) );
58
  if ( get_option( 'wcj_product_info_product_tabs_description_title' ) !== '' )
59
  $tabs['description']['title'] = get_option( 'wcj_product_info_product_tabs_description_title' );
60
  }
61
  if ( isset( $tabs['reviews'] ) ) {
62
- $tabs['reviews']['priority'] = apply_filters( 'wcj_get_option_filter', 20, get_option( 'wcj_product_info_product_tabs_reviews_priority' ) );
63
  if ( get_option( 'wcj_product_info_product_tabs_reviews_title' ) !== '' )
64
  $tabs['reviews']['title'] = get_option( 'wcj_product_info_product_tabs_reviews_title' );
65
  }
66
  if ( isset( $tabs['additional_information'] ) ) {
67
- $tabs['additional_information']['priority'] = apply_filters( 'wcj_get_option_filter', 30, get_option( 'wcj_product_info_product_tabs_additional_information_priority' ) );
68
  if ( get_option( 'wcj_product_info_product_tabs_additional_information_title' ) !== '' )
69
  $tabs['additional_information']['title'] = get_option( 'wcj_product_info_product_tabs_additional_information_title' );
70
  }
@@ -73,7 +73,7 @@ class WCJ_Product_Tabs extends WCJ_Module {
73
  // Add New
74
  // Add New - Global
75
  global $product;
76
- for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_custom_product_tabs_global_total_number', 1 ) ); $i++ ) {
77
  $key = 'global_' . $i;
78
  if ( '' != get_option( 'wcj_custom_product_tabs_title_' . $key, '' ) && '' != get_option( 'wcj_custom_product_tabs_content_' . $key, '' ) ) {
79
 
@@ -202,7 +202,7 @@ class WCJ_Product_Tabs extends WCJ_Module {
202
  $current_post_id = get_the_ID();
203
  $option_name = 'wcj_custom_product_tabs_local_total_number';
204
  if ( ! ( $total_custom_tabs = get_post_meta( $current_post_id, '_' . $option_name, true ) ) )
205
- $total_custom_tabs = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_custom_product_tabs_local_total_number_default', 1 ) );
206
  if ( 'yes' !== get_option( 'wcj_custom_product_tabs_local_enabled' ) )
207
  $total_custom_tabs = 0;
208
 
@@ -260,7 +260,7 @@ class WCJ_Product_Tabs extends WCJ_Module {
260
  'wcj_custom_product_tabs_priority_local_',
261
  'wcj_custom_product_tabs_content_local_',
262
  );
263
- $default_total_custom_tabs = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_custom_product_tabs_local_total_number_default', 1 ) );
264
  $total_custom_tabs_before_saving = get_post_meta( $post_id, '_' . 'wcj_custom_product_tabs_local_total_number', true );
265
  $total_custom_tabs_before_saving = ( '' != $total_custom_tabs_before_saving ) ? $total_custom_tabs_before_saving : $default_total_custom_tabs;
266
  for ( $i = 1; $i <= $total_custom_tabs_before_saving; $i++ ) {
@@ -393,11 +393,11 @@ class WCJ_Product_Tabs extends WCJ_Module {
393
  $current_post_id = get_the_ID();
394
  $option_name = 'wcj_custom_product_tabs_local_total_number';
395
  if ( ! ( $total_custom_tabs = get_post_meta( $current_post_id, '_' . $option_name, true ) ) )
396
- $total_custom_tabs = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_custom_product_tabs_local_total_number_default', 1 ) );
397
  $html = '';
398
 
399
- $is_disabled = apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly_string' );
400
- $is_disabled_message = apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' );
401
 
402
  $html .= '<table>';
403
  $html .= '<tr>';
@@ -505,9 +505,9 @@ class WCJ_Product_Tabs extends WCJ_Module {
505
  'id' => 'wcj_custom_product_tabs_global_total_number',
506
  'default' => 1,
507
  'type' => 'number',
508
- 'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
509
  'custom_attributes' => array_merge(
510
- is_array( apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ) ) ? apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ) : array(),
511
  array(
512
  'step' => '1',
513
  'min' => '0',
@@ -534,7 +534,7 @@ class WCJ_Product_Tabs extends WCJ_Module {
534
 
535
  $products_options = apply_filters( 'wcj_get_products_filter', array() );
536
 
537
- for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_custom_product_tabs_global_total_number', 1 ) ); $i++ ) {
538
  $settings = array_merge( $settings,
539
  array(
540
  array(
@@ -693,9 +693,9 @@ class WCJ_Product_Tabs extends WCJ_Module {
693
  'id' => 'wcj_custom_product_tabs_local_total_number_default',
694
  'default' => 1,
695
  'type' => 'number',
696
- 'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
697
  'custom_attributes' => array_merge(
698
- is_array( apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ) ) ? apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ) : array(),
699
  array(
700
  'step' => '1',
701
  'min' => '0',
@@ -704,7 +704,7 @@ class WCJ_Product_Tabs extends WCJ_Module {
704
  ),
705
  ) );
706
 
707
- for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_custom_product_tabs_local_total_number_default', 1 ) ); $i++ ) {
708
  $settings = array_merge( $settings, array(
709
  array(
710
  'title' => __( 'Custom Product Tab', 'woocommerce-jetpack' ) . ' #' . $i,
@@ -825,8 +825,8 @@ class WCJ_Product_Tabs extends WCJ_Module {
825
  'id' => 'wcj_product_info_product_tabs_description_priority',
826
  'default' => 10,
827
  'type' => 'number',
828
- 'desc' => __( 'Priority (i.e. Order).', 'woocommerce-jetpack' ) . ' ' . apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
829
- 'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ),
830
  ),
831
  array(
832
  'title' => __( 'Additional Information Tab', 'woocommerce-jetpack' ),
@@ -848,8 +848,8 @@ class WCJ_Product_Tabs extends WCJ_Module {
848
  'id' => 'wcj_product_info_product_tabs_additional_information_priority',
849
  'default' => 20,
850
  'type' => 'number',
851
- 'desc' => __( 'Priority (i.e. Order).', 'woocommerce-jetpack' ) . ' ' . apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
852
- 'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ),
853
  ),
854
  array(
855
  'title' => __( 'Reviews Tab', 'woocommerce-jetpack' ),
@@ -871,8 +871,8 @@ class WCJ_Product_Tabs extends WCJ_Module {
871
  'id' => 'wcj_product_info_product_tabs_reviews_priority',
872
  'default' => 30,
873
  'type' => 'number',
874
- 'desc' => __( 'Priority (i.e. Order).', 'woocommerce-jetpack' ) . ' ' . apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
875
- 'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ),
876
  ),
877
  array(
878
  'type' => 'sectionend',
54
 
55
  // Priority and Title
56
  if ( isset( $tabs['description'] ) ) {
57
+ $tabs['description']['priority'] = apply_filters( 'booster_get_option', 10, get_option( 'wcj_product_info_product_tabs_description_priority' ) );
58
  if ( get_option( 'wcj_product_info_product_tabs_description_title' ) !== '' )
59
  $tabs['description']['title'] = get_option( 'wcj_product_info_product_tabs_description_title' );
60
  }
61
  if ( isset( $tabs['reviews'] ) ) {
62
+ $tabs['reviews']['priority'] = apply_filters( 'booster_get_option', 20, get_option( 'wcj_product_info_product_tabs_reviews_priority' ) );
63
  if ( get_option( 'wcj_product_info_product_tabs_reviews_title' ) !== '' )
64
  $tabs['reviews']['title'] = get_option( 'wcj_product_info_product_tabs_reviews_title' );
65
  }
66
  if ( isset( $tabs['additional_information'] ) ) {
67
+ $tabs['additional_information']['priority'] = apply_filters( 'booster_get_option', 30, get_option( 'wcj_product_info_product_tabs_additional_information_priority' ) );
68
  if ( get_option( 'wcj_product_info_product_tabs_additional_information_title' ) !== '' )
69
  $tabs['additional_information']['title'] = get_option( 'wcj_product_info_product_tabs_additional_information_title' );
70
  }
73
  // Add New
74
  // Add New - Global
75
  global $product;
76
+ for ( $i = 1; $i <= apply_filters( 'booster_get_option', 1, get_option( 'wcj_custom_product_tabs_global_total_number', 1 ) ); $i++ ) {
77
  $key = 'global_' . $i;
78
  if ( '' != get_option( 'wcj_custom_product_tabs_title_' . $key, '' ) && '' != get_option( 'wcj_custom_product_tabs_content_' . $key, '' ) ) {
79
 
202
  $current_post_id = get_the_ID();
203
  $option_name = 'wcj_custom_product_tabs_local_total_number';
204
  if ( ! ( $total_custom_tabs = get_post_meta( $current_post_id, '_' . $option_name, true ) ) )
205
+ $total_custom_tabs = apply_filters( 'booster_get_option', 1, get_option( 'wcj_custom_product_tabs_local_total_number_default', 1 ) );
206
  if ( 'yes' !== get_option( 'wcj_custom_product_tabs_local_enabled' ) )
207
  $total_custom_tabs = 0;
208
 
260
  'wcj_custom_product_tabs_priority_local_',
261
  'wcj_custom_product_tabs_content_local_',
262
  );
263
+ $default_total_custom_tabs = apply_filters( 'booster_get_option', 1, get_option( 'wcj_custom_product_tabs_local_total_number_default', 1 ) );
264
  $total_custom_tabs_before_saving = get_post_meta( $post_id, '_' . 'wcj_custom_product_tabs_local_total_number', true );
265
  $total_custom_tabs_before_saving = ( '' != $total_custom_tabs_before_saving ) ? $total_custom_tabs_before_saving : $default_total_custom_tabs;
266
  for ( $i = 1; $i <= $total_custom_tabs_before_saving; $i++ ) {
393
  $current_post_id = get_the_ID();
394
  $option_name = 'wcj_custom_product_tabs_local_total_number';
395
  if ( ! ( $total_custom_tabs = get_post_meta( $current_post_id, '_' . $option_name, true ) ) )
396
+ $total_custom_tabs = apply_filters( 'booster_get_option', 1, get_option( 'wcj_custom_product_tabs_local_total_number_default', 1 ) );
397
  $html = '';
398
 
399
+ $is_disabled = apply_filters( 'booster_get_message', '', 'readonly_string' );
400
+ $is_disabled_message = apply_filters( 'booster_get_message', '', 'desc' );
401
 
402
  $html .= '<table>';
403
  $html .= '<tr>';
505
  'id' => 'wcj_custom_product_tabs_global_total_number',
506
  'default' => 1,
507
  'type' => 'number',
508
+ 'desc' => apply_filters( 'booster_get_message', '', 'desc' ),
509
  'custom_attributes' => array_merge(
510
+ is_array( apply_filters( 'booster_get_message', '', 'readonly' ) ) ? apply_filters( 'booster_get_message', '', 'readonly' ) : array(),
511
  array(
512
  'step' => '1',
513
  'min' => '0',
534
 
535
  $products_options = apply_filters( 'wcj_get_products_filter', array() );
536
 
537
+ for ( $i = 1; $i <= apply_filters( 'booster_get_option', 1, get_option( 'wcj_custom_product_tabs_global_total_number', 1 ) ); $i++ ) {
538
  $settings = array_merge( $settings,
539
  array(
540
  array(
693
  'id' => 'wcj_custom_product_tabs_local_total_number_default',
694
  'default' => 1,
695
  'type' => 'number',
696
+ 'desc' => apply_filters( 'booster_get_message', '', 'desc' ),
697
  'custom_attributes' => array_merge(
698
+ is_array( apply_filters( 'booster_get_message', '', 'readonly' ) ) ? apply_filters( 'booster_get_message', '', 'readonly' ) : array(),
699
  array(
700
  'step' => '1',
701
  'min' => '0',
704
  ),
705
  ) );
706
 
707
+ for ( $i = 1; $i <= apply_filters( 'booster_get_option', 1, get_option( 'wcj_custom_product_tabs_local_total_number_default', 1 ) ); $i++ ) {
708
  $settings = array_merge( $settings, array(
709
  array(
710
  'title' => __( 'Custom Product Tab', 'woocommerce-jetpack' ) . ' #' . $i,
825
  'id' => 'wcj_product_info_product_tabs_description_priority',
826
  'default' => 10,
827
  'type' => 'number',
828
+ 'desc' => __( 'Priority (i.e. Order).', 'woocommerce-jetpack' ) . ' ' . apply_filters( 'booster_get_message', '', 'desc' ),
829
+ 'custom_attributes' => apply_filters( 'booster_get_message', '', 'readonly' ),
830
  ),
831
  array(
832
  'title' => __( 'Additional Information Tab', 'woocommerce-jetpack' ),
848
  'id' => 'wcj_product_info_product_tabs_additional_information_priority',
849
  'default' => 20,
850
  'type' => 'number',
851
+ 'desc' => __( 'Priority (i.e. Order).', 'woocommerce-jetpack' ) . ' ' . apply_filters( 'booster_get_message', '', 'desc' ),
852
+ 'custom_attributes' => apply_filters( 'booster_get_message', '', 'readonly' ),
853
  ),
854
  array(
855
  'title' => __( 'Reviews Tab', 'woocommerce-jetpack' ),
871
  'id' => 'wcj_product_info_product_tabs_reviews_priority',
872
  'default' => 30,
873
  'type' => 'number',
874
+ 'desc' => __( 'Priority (i.e. Order).', 'woocommerce-jetpack' ) . ' ' . apply_filters( 'booster_get_message', '', 'desc' ),
875
+ 'custom_attributes' => apply_filters( 'booster_get_message', '', 'readonly' ),
876
  ),
877
  array(
878
  'type' => 'sectionend',
includes/class-wcj-products-xml.php CHANGED
@@ -35,7 +35,7 @@ class WCJ_Products_XML extends WCJ_Module {
35
  add_action( 'admin_init', array( $this, 'schedule_the_events' ) );
36
  add_action( 'admin_init', array( $this, 'wcj_create_products_xml' ) );
37
  add_filter( 'cron_schedules', array( $this, 'cron_add_custom_intervals' ) );
38
- $total_number = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_products_xml_total_files', 1 ) );
39
  for ( $i = 1; $i <= $total_number; $i++ ) {
40
  add_action( 'wcj_create_products_xml_hook_' . $i, array( $this, 'create_products_xml_cron' ), PHP_INT_MAX, 2 );
41
  }
@@ -56,11 +56,11 @@ class WCJ_Products_XML extends WCJ_Module {
56
  'daily',
57
  'weekly',
58
  );
59
- $total_number = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_products_xml_total_files', 1 ) );
60
  for ( $i = 1; $i <= $total_number; $i++ ) {
61
  $event_hook = 'wcj_create_products_xml_hook_' . $i;
62
  if ( 'yes' === get_option( 'wcj_products_xml_enabled_' . $i, 'yes' ) ) {
63
- $selected_interval = apply_filters( 'wcj_get_option_filter', 'weekly', get_option( 'wcj_create_products_xml_period_' . $i, 'weekly' ) );
64
  foreach ( $update_intervals as $interval ) {
65
  $event_timestamp = wp_next_scheduled( $event_hook, array( $interval, $i ) );
66
  if ( $selected_interval === $interval ) {
@@ -204,16 +204,16 @@ class WCJ_Products_XML extends WCJ_Module {
204
  'default' => 1,
205
  'type' => 'custom_number',
206
  'desc_tip' => __( 'Press Save changes after you change this number.', 'woocommerce-jetpack' ),
207
- 'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
208
- 'custom_attributes' => is_array( apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ) ) ?
209
- apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ) : array( 'step' => '1', 'min' => '1', ),
210
  ),
211
  array(
212
  'type' => 'sectionend',
213
  'id' => 'wcj_products_xml_options',
214
  ),
215
  );
216
- $total_number = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_products_xml_total_files', 1 ) );
217
  for ( $i = 1; $i <= $total_number; $i++ ) {
218
  $products_xml_cron_desc = '';
219
  if ( $this->is_enabled() ) {
@@ -294,8 +294,8 @@ class WCJ_Products_XML extends WCJ_Module {
294
  'daily' => __( 'Update Daily', 'woocommerce-jetpack' ),
295
  'weekly' => __( 'Update Weekly', 'woocommerce-jetpack' ),
296
  ),
297
- 'desc_tip' => __( 'Possible update periods are: every minute, hourly, twice daily, daily and weekly.', 'woocommerce-jetpack' ) . ' ' . apply_filters( 'get_wc_jetpack_plus_message', '', 'desc_no_link' ),
298
- 'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'disabled' ),
299
  ),
300
  array(
301
  'type' => 'sectionend',
35
  add_action( 'admin_init', array( $this, 'schedule_the_events' ) );
36
  add_action( 'admin_init', array( $this, 'wcj_create_products_xml' ) );
37
  add_filter( 'cron_schedules', array( $this, 'cron_add_custom_intervals' ) );
38
+ $total_number = apply_filters( 'booster_get_option', 1, get_option( 'wcj_products_xml_total_files', 1 ) );
39
  for ( $i = 1; $i <= $total_number; $i++ ) {
40
  add_action( 'wcj_create_products_xml_hook_' . $i, array( $this, 'create_products_xml_cron' ), PHP_INT_MAX, 2 );
41
  }
56
  'daily',
57
  'weekly',
58
  );
59
+ $total_number = apply_filters( 'booster_get_option', 1, get_option( 'wcj_products_xml_total_files', 1 ) );
60
  for ( $i = 1; $i <= $total_number; $i++ ) {
61
  $event_hook = 'wcj_create_products_xml_hook_' . $i;
62
  if ( 'yes' === get_option( 'wcj_products_xml_enabled_' . $i, 'yes' ) ) {
63
+ $selected_interval = apply_filters( 'booster_get_option', 'weekly', get_option( 'wcj_create_products_xml_period_' . $i, 'weekly' ) );
64
  foreach ( $update_intervals as $interval ) {
65
  $event_timestamp = wp_next_scheduled( $event_hook, array( $interval, $i ) );
66
  if ( $selected_interval === $interval ) {
204
  'default' => 1,
205
  'type' => 'custom_number',
206
  'desc_tip' => __( 'Press Save changes after you change this number.', 'woocommerce-jetpack' ),
207
+ 'desc' => apply_filters( 'booster_get_message', '', 'desc' ),
208
+ 'custom_attributes' => is_array( apply_filters( 'booster_get_message', '', 'readonly' ) ) ?
209
+ apply_filters( 'booster_get_message', '', 'readonly' ) : array( 'step' => '1', 'min' => '1', ),
210
  ),
211
  array(
212
  'type' => 'sectionend',
213
  'id' => 'wcj_products_xml_options',
214
  ),
215
  );
216
+ $total_number = apply_filters( 'booster_get_option', 1, get_option( 'wcj_products_xml_total_files', 1 ) );
217
  for ( $i = 1; $i <= $total_number; $i++ ) {
218
  $products_xml_cron_desc = '';
219
  if ( $this->is_enabled() ) {
294
  'daily' => __( 'Update Daily', 'woocommerce-jetpack' ),
295
  'weekly' => __( 'Update Weekly', 'woocommerce-jetpack' ),
296
  ),
297
+ 'desc_tip' => __( 'Possible update periods are: every minute, hourly, twice daily, daily and weekly.', 'woocommerce-jetpack' ) . ' ' . apply_filters( 'booster_get_message', '', 'desc_no_link' ),
298
+ 'custom_attributes' => apply_filters( 'booster_get_message', '', 'disabled' ),
299
  ),
300
  array(
301
  'type' => 'sectionend',
includes/class-wcj-purchase-data.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * The WooCommerce Jetpack Purchase Data class.
6
  *
7
- * @version 2.5.7
8
  * @since 2.2.0
9
  * @author Algoritmika Ltd.
10
  */
@@ -54,7 +54,7 @@ class WCJ_Purchase_Data extends WCJ_Module {
54
  * Output custom columns for orders
55
  *
56
  * @param string $column
57
- * @version 2.5.6
58
  * @since 2.2.4
59
  * @todo forecasted profit
60
  */
@@ -68,7 +68,9 @@ class WCJ_Purchase_Data extends WCJ_Module {
68
  $the_profit = 0;
69
  $product_id = ( isset( $item['variation_id'] ) && 0 != $item['variation_id'] ) ? $item['variation_id'] : $item['product_id'];
70
  if ( 0 != ( $purchase_price = wc_get_product_purchase_price( $product_id ) ) ) {
71
- $the_profit = ( $item['line_total'] + $item['line_tax'] ) - $purchase_price * $item['qty'];
 
 
72
  } else {
73
  // $the_profit = ( $item['line_total'] + $item['line_tax'] ) * $average_profit_margin;
74
  $is_forecasted = true;
@@ -138,7 +140,7 @@ class WCJ_Purchase_Data extends WCJ_Module {
138
  'enabled' => get_option( 'wcj_purchase_price_affiliate_commission_enabled', 'no' ),
139
  ),
140
  );
141
- $total_number = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_purchase_data_custom_price_fields_total_number', 1 ) );
142
  for ( $i = 1; $i <= $total_number; $i++ ) {
143
  $the_title = get_option( 'wcj_purchase_data_custom_price_field_name_' . $i, '' );
144
  if ( '' == $the_title ) {
@@ -308,11 +310,11 @@ class WCJ_Purchase_Data extends WCJ_Module {
308
  'id' => 'wcj_purchase_data_custom_price_fields_total_number',
309
  'default' => 1,
310
  'type' => 'custom_number',
311
- 'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
312
- 'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ),
313
  ),
314
  );
315
- $total_number = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_purchase_data_custom_price_fields_total_number', 1 ) );
316
  for ( $i = 1; $i <= $total_number; $i++ ) {
317
  $settings = array_merge( $settings, array(
318
  array(
4
  *
5
  * The WooCommerce Jetpack Purchase Data class.
6
  *
7
+ * @version 2.5.9
8
  * @since 2.2.0
9
  * @author Algoritmika Ltd.
10
  */
54
  * Output custom columns for orders
55
  *
56
  * @param string $column
57
+ * @version 2.5.9
58
  * @since 2.2.4
59
  * @todo forecasted profit
60
  */
68
  $the_profit = 0;
69
  $product_id = ( isset( $item['variation_id'] ) && 0 != $item['variation_id'] ) ? $item['variation_id'] : $item['product_id'];
70
  if ( 0 != ( $purchase_price = wc_get_product_purchase_price( $product_id ) ) ) {
71
+ // $line_total = ( 'yes' === get_option('woocommerce_prices_include_tax') ) ? ( $item['line_total'] + $item['line_tax'] ) : $item['line_total'];
72
+ $line_total = ( $the_order->prices_include_tax ) ? ( $item['line_total'] + $item['line_tax'] ) : $item['line_total'];
73
+ $the_profit = $line_total - $purchase_price * $item['qty'];
74
  } else {
75
  // $the_profit = ( $item['line_total'] + $item['line_tax'] ) * $average_profit_margin;
76
  $is_forecasted = true;
140
  'enabled' => get_option( 'wcj_purchase_price_affiliate_commission_enabled', 'no' ),
141
  ),
142
  );
143
+ $total_number = apply_filters( 'booster_get_option', 1, get_option( 'wcj_purchase_data_custom_price_fields_total_number', 1 ) );
144
  for ( $i = 1; $i <= $total_number; $i++ ) {
145
  $the_title = get_option( 'wcj_purchase_data_custom_price_field_name_' . $i, '' );
146
  if ( '' == $the_title ) {
310
  'id' => 'wcj_purchase_data_custom_price_fields_total_number',
311
  'default' => 1,
312
  'type' => 'custom_number',
313
+ 'desc' => apply_filters( 'booster_get_message', '', 'desc' ),
314
+ 'custom_attributes' => apply_filters( 'booster_get_message', '', 'readonly' ),
315
  ),
316
  );
317
+ $total_number = apply_filters( 'booster_get_option', 1, get_option( 'wcj_purchase_data_custom_price_fields_total_number', 1 ) );
318
  for ( $i = 1; $i <= $total_number; $i++ ) {
319
  $settings = array_merge( $settings, array(
320
  array(
includes/class-wcj-shipping-calculator.php CHANGED
@@ -32,7 +32,7 @@ class WCJ_Shipping_Calculator extends WCJ_Module {
32
  add_filter( 'woocommerce_shipping_calculator_enable_postcode', array( $this, 'enable_postcode' ) );
33
  add_action( 'wp_head', array( $this, 'add_custom_styles' ) );
34
  // add_filter( 'gettext', array( $this, 'change_labels' ), 20, 3 );
35
- if ( 'yes' === apply_filters( 'wcj_get_option_filter', 'no', get_option( 'wcj_shipping_calculator_labels_enabled', 'no' ) ) ) {
36
  add_action( 'wp_enqueue_scripts', array( $this, 'change_labels' ) );
37
  }
38
  }
@@ -184,24 +184,24 @@ class WCJ_Shipping_Calculator extends WCJ_Module {
184
  'id' => 'wcj_shipping_calculator_labels_enabled',
185
  'default' => 'no',
186
  'type' => 'checkbox',
187
- 'desc_tip' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
188
- 'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'disabled' ),
189
  ),
190
  array(
191
  'title' => __( 'Label for Calculate Shipping', 'woocommerce-jetpack' ),
192
  'id' => 'wcj_shipping_calculator_label_calculate_shipping',
193
  'default' => __( 'Calculate Shipping', 'woocommerce-jetpack' ),
194
  'type' => 'text',
195
- 'desc_tip' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc_no_link' ),
196
- 'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ),
197
  ),
198
  array(
199
  'title' => __( 'Label for Update Totals', 'woocommerce-jetpack' ),
200
  'id' => 'wcj_shipping_calculator_label_update_totals',
201
  'default' => __( 'Update Totals', 'woocommerce-jetpack' ),
202
  'type' => 'text',
203
- 'desc_tip' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc_no_link' ),
204
- 'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ),
205
  ),
206
  array(
207
  'type' => 'sectionend',
32
  add_filter( 'woocommerce_shipping_calculator_enable_postcode', array( $this, 'enable_postcode' ) );
33
  add_action( 'wp_head', array( $this, 'add_custom_styles' ) );
34
  // add_filter( 'gettext', array( $this, 'change_labels' ), 20, 3 );
35
+ if ( 'yes' === apply_filters( 'booster_get_option', 'no', get_option( 'wcj_shipping_calculator_labels_enabled', 'no' ) ) ) {
36
  add_action( 'wp_enqueue_scripts', array( $this, 'change_labels' ) );
37
  }
38
  }
184
  'id' => 'wcj_shipping_calculator_labels_enabled',
185
  'default' => 'no',
186
  'type' => 'checkbox',
187
+ 'desc_tip' => apply_filters( 'booster_get_message', '', 'desc' ),
188
+ 'custom_attributes' => apply_filters( 'booster_get_message', '', 'disabled' ),
189
  ),
190
  array(
191
  'title' => __( 'Label for Calculate Shipping', 'woocommerce-jetpack' ),
192
  'id' => 'wcj_shipping_calculator_label_calculate_shipping',
193
  'default' => __( 'Calculate Shipping', 'woocommerce-jetpack' ),
194
  'type' => 'text',
195
+ 'desc_tip' => apply_filters( 'booster_get_message', '', 'desc_no_link' ),
196
+ 'custom_attributes' => apply_filters( 'booster_get_message', '', 'readonly' ),
197
  ),
198
  array(
199
  'title' => __( 'Label for Update Totals', 'woocommerce-jetpack' ),
200
  'id' => 'wcj_shipping_calculator_label_update_totals',
201
  'default' => __( 'Update Totals', 'woocommerce-jetpack' ),
202
  'type' => 'text',
203
+ 'desc_tip' => apply_filters( 'booster_get_message', '', 'desc_no_link' ),
204
+ 'custom_attributes' => apply_filters( 'booster_get_message', '', 'readonly' ),
205
  ),
206
  array(
207
  'type' => 'sectionend',
includes/class-wcj-shipping.php CHANGED
@@ -206,12 +206,12 @@ class WCJ_Shipping extends WCJ_Module {
206
  'id' => 'wcj_shipping_custom_shipping_total_number',
207
  'default' => 1,
208
  'type' => 'custom_number',
209
- 'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
210
- 'custom_attributes' => is_array( apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ) ) ?
211
- apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ) : array( 'step' => '1', 'min' => '0' ),
212
  ),
213
  ) );
214
- $total_number = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_shipping_custom_shipping_total_number', 1 ) );
215
  for ( $i = 1; $i <= $total_number; $i++ ) {
216
  $settings[] = array(
217
  'title' => __( 'Admin Title Custom Shipping', 'woocommerce-jetpack' ) . ' #' . $i,
206
  'id' => 'wcj_shipping_custom_shipping_total_number',
207
  'default' => 1,
208
  'type' => 'custom_number',
209
+ 'desc' => apply_filters( 'booster_get_message', '', 'desc' ),
210
+ 'custom_attributes' => is_array( apply_filters( 'booster_get_message', '', 'readonly' ) ) ?
211
+ apply_filters( 'booster_get_message', '', 'readonly' ) : array( 'step' => '1', 'min' => '0' ),
212
  ),
213
  ) );
214
+ $total_number = apply_filters( 'booster_get_option', 1, get_option( 'wcj_shipping_custom_shipping_total_number', 1 ) );
215
  for ( $i = 1; $i <= $total_number; $i++ ) {
216
  $settings[] = array(
217
  'title' => __( 'Admin Title Custom Shipping', 'woocommerce-jetpack' ) . ' #' . $i,
includes/class-wcj-sku.php CHANGED
@@ -85,10 +85,10 @@ class WCJ_SKU extends WCJ_Module {
85
  */
86
  function set_sku_with_variable( $product_id, $is_preview ) {
87
 
88
- /* if ( 'random' === apply_filters( 'wcj_get_option_filter', 'product_id', get_option( 'wcj_sku_number_generation', 'product_id' ) ) ) {
89
  $sku_number = rand();
90
  } */
91
- if ( 'sequential' === apply_filters( 'wcj_get_option_filter', 'product_id', get_option( 'wcj_sku_number_generation', 'product_id' ) ) ) {
92
  $sku_number = $this->sequential_counter;
93
  $this->sequential_counter++;
94
  } else { // if 'product_id'
@@ -98,7 +98,7 @@ class WCJ_SKU extends WCJ_Module {
98
  $this->set_sku( $product_id, $sku_number, '', $is_preview, $product_id );
99
 
100
  // Handling variable products
101
- $variation_handling = apply_filters( 'wcj_get_option_filter', 'as_variable', get_option( 'wcj_sku_variations_handling', 'as_variable' ) );
102
  $product = wc_get_product( $product_id );
103
  if ( $product->is_type( 'variable' ) ) {
104
  $variations = $this->get_all_variations( $product );
@@ -109,7 +109,7 @@ class WCJ_SKU extends WCJ_Module {
109
  }
110
  else if ( 'as_variation' === $variation_handling ) {
111
  foreach ( $variations as $variation ) {
112
- if ( 'sequential' === apply_filters( 'wcj_get_option_filter', 'product_id', get_option( 'wcj_sku_number_generation', 'product_id' ) ) ) {
113
  $sku_number = $this->sequential_counter;
114
  $this->sequential_counter++;
115
  } else { // if 'product_id'
@@ -152,7 +152,7 @@ class WCJ_SKU extends WCJ_Module {
152
  }
153
 
154
  $the_sku = sprintf( '%s%s%0' . get_option( 'wcj_sku_minimum_number_length', 0 ) . 'd%s%s%s',
155
- apply_filters( 'wcj_get_option_filter', '', $category_prefix ),
156
  get_option( 'wcj_sku_prefix', '' ),
157
  $sku_number,
158
  get_option( 'wcj_sku_suffix', '' ),
@@ -179,8 +179,8 @@ class WCJ_SKU extends WCJ_Module {
179
  * @version 2.5.2
180
  */
181
  function set_all_products_skus( $is_preview ) {
182
- if ( 'sequential' === apply_filters( 'wcj_get_option_filter', 'product_id', get_option( 'wcj_sku_number_generation', 'product_id' ) ) ) {
183
- $this->sequential_counter = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_sku_number_generation_sequential', 1 ) );
184
  }
185
  $limit = 96;
186
  $offset = 0;
@@ -201,7 +201,7 @@ class WCJ_SKU extends WCJ_Module {
201
  $offset += $limit;
202
  }
203
  wp_reset_postdata();
204
- if ( 'sequential' === apply_filters( 'wcj_get_option_filter', 'product_id', get_option( 'wcj_sku_number_generation', 'product_id' ) ) && ! $is_preview ) {
205
  update_option( 'wcj_sku_number_generation_sequential', $this->sequential_counter );
206
  }
207
  }
@@ -216,11 +216,11 @@ class WCJ_SKU extends WCJ_Module {
216
  return;
217
  }
218
  if ( false === $update ) {
219
- if ( 'sequential' === apply_filters( 'wcj_get_option_filter', 'product_id', get_option( 'wcj_sku_number_generation', 'product_id' ) ) ) {
220
- $this->sequential_counter = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_sku_number_generation_sequential', 1 ) );
221
  }
222
  $this->set_sku_with_variable( $post_ID, false );
223
- if ( 'sequential' === apply_filters( 'wcj_get_option_filter', 'product_id', get_option( 'wcj_sku_number_generation', 'product_id' ) ) ) {
224
  update_option( 'wcj_sku_number_generation_sequential', $this->sequential_counter );
225
  }
226
  }
@@ -283,17 +283,17 @@ class WCJ_SKU extends WCJ_Module {
283
  'sequential' => __( 'Sequential', 'woocommerce-jetpack' ),
284
  // 'random' => __( 'Random (including variations)', 'woocommerce-jetpack' ),
285
  ),
286
- 'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
287
- 'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'disabled' ),
288
  ),
289
  array(
290
  'title' => __( 'Sequential Number Generation Counter', 'woocommerce-jetpack' ),
291
  'id' => 'wcj_sku_number_generation_sequential',
292
  'default' => 1,
293
  'type' => 'number',
294
- 'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
295
  'custom_attributes' => array_merge(
296
- is_array( apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ) ) ? apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ) : array(),
297
  array( 'step' => '1', 'min' => '0', )
298
  ),
299
  ),
@@ -314,8 +314,8 @@ class WCJ_SKU extends WCJ_Module {
314
  'id' => 'wcj_sku_suffix',
315
  'default' => '',
316
  'type' => 'text',
317
- // 'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
318
- // 'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ),
319
  ),
320
  array(
321
  'title' => __( 'Variable Products Variations', 'woocommerce-jetpack' ),
@@ -328,8 +328,8 @@ class WCJ_SKU extends WCJ_Module {
328
  'as_variation' => __( 'Generate different SKU for each variation', 'woocommerce-jetpack' ),
329
  'as_variable_with_suffix' => __( 'SKU same as parent\'s product + variation letter suffix', 'woocommerce-jetpack' ),
330
  ),
331
- 'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
332
- 'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'disabled' ),
333
  ),
334
  array(
335
  'type' => 'sectionend',
@@ -353,8 +353,8 @@ class WCJ_SKU extends WCJ_Module {
353
  'id' => 'wcj_sku_prefix_cat_' . $product_category->term_id,
354
  'default' => '',
355
  'type' => 'text',
356
- 'desc_tip' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc_no_link' ),
357
- 'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ),
358
  ),
359
  array(
360
  'title' => '',
@@ -362,8 +362,8 @@ class WCJ_SKU extends WCJ_Module {
362
  'id' => 'wcj_sku_suffix_cat_' . $product_category->term_id,
363
  'default' => '',
364
  'type' => 'text',
365
- // 'desc_tip' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc_no_link' ),
366
- // 'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ),
367
  ),
368
  ) );
369
  }
85
  */
86
  function set_sku_with_variable( $product_id, $is_preview ) {
87
 
88
+ /* if ( 'random' === apply_filters( 'booster_get_option', 'product_id', get_option( 'wcj_sku_number_generation', 'product_id' ) ) ) {
89
  $sku_number = rand();
90
  } */
91
+ if ( 'sequential' === apply_filters( 'booster_get_option', 'product_id', get_option( 'wcj_sku_number_generation', 'product_id' ) ) ) {
92
  $sku_number = $this->sequential_counter;
93
  $this->sequential_counter++;
94
  } else { // if 'product_id'
98
  $this->set_sku( $product_id, $sku_number, '', $is_preview, $product_id );
99
 
100
  // Handling variable products
101
+ $variation_handling = apply_filters( 'booster_get_option', 'as_variable', get_option( 'wcj_sku_variations_handling', 'as_variable' ) );
102
  $product = wc_get_product( $product_id );
103
  if ( $product->is_type( 'variable' ) ) {
104
  $variations = $this->get_all_variations( $product );
109
  }
110
  else if ( 'as_variation' === $variation_handling ) {
111
  foreach ( $variations as $variation ) {
112
+ if ( 'sequential' === apply_filters( 'booster_get_option', 'product_id', get_option( 'wcj_sku_number_generation', 'product_id' ) ) ) {
113
  $sku_number = $this->sequential_counter;
114
  $this->sequential_counter++;
115
  } else { // if 'product_id'
152
  }
153
 
154
  $the_sku = sprintf( '%s%s%0' . get_option( 'wcj_sku_minimum_number_length', 0 ) . 'd%s%s%s',
155
+ apply_filters( 'booster_get_option', '', $category_prefix ),
156
  get_option( 'wcj_sku_prefix', '' ),
157
  $sku_number,
158
  get_option( 'wcj_sku_suffix', '' ),
179
  * @version 2.5.2
180
  */
181
  function set_all_products_skus( $is_preview ) {
182
+ if ( 'sequential' === apply_filters( 'booster_get_option', 'product_id', get_option( 'wcj_sku_number_generation', 'product_id' ) ) ) {
183
+ $this->sequential_counter = apply_filters( 'booster_get_option', 1, get_option( 'wcj_sku_number_generation_sequential', 1 ) );
184
  }
185
  $limit = 96;
186
  $offset = 0;
201
  $offset += $limit;
202
  }
203
  wp_reset_postdata();
204
+ if ( 'sequential' === apply_filters( 'booster_get_option', 'product_id', get_option( 'wcj_sku_number_generation', 'product_id' ) ) && ! $is_preview ) {
205
  update_option( 'wcj_sku_number_generation_sequential', $this->sequential_counter );
206
  }
207
  }
216
  return;
217
  }
218
  if ( false === $update ) {
219
+ if ( 'sequential' === apply_filters( 'booster_get_option', 'product_id', get_option( 'wcj_sku_number_generation', 'product_id' ) ) ) {
220
+ $this->sequential_counter = apply_filters( 'booster_get_option', 1, get_option( 'wcj_sku_number_generation_sequential', 1 ) );
221
  }
222
  $this->set_sku_with_variable( $post_ID, false );
223
+ if ( 'sequential' === apply_filters( 'booster_get_option', 'product_id', get_option( 'wcj_sku_number_generation', 'product_id' ) ) ) {
224
  update_option( 'wcj_sku_number_generation_sequential', $this->sequential_counter );
225
  }
226
  }
283
  'sequential' => __( 'Sequential', 'woocommerce-jetpack' ),
284
  // 'random' => __( 'Random (including variations)', 'woocommerce-jetpack' ),
285
  ),
286
+ 'desc' => apply_filters( 'booster_get_message', '', 'desc' ),
287
+ 'custom_attributes' => apply_filters( 'booster_get_message', '', 'disabled' ),
288
  ),
289
  array(
290
  'title' => __( 'Sequential Number Generation Counter', 'woocommerce-jetpack' ),
291
  'id' => 'wcj_sku_number_generation_sequential',
292
  'default' => 1,
293
  'type' => 'number',
294
+ 'desc' => apply_filters( 'booster_get_message', '', 'desc' ),
295
  'custom_attributes' => array_merge(
296
+ is_array( apply_filters( 'booster_get_message', '', 'readonly' ) ) ? apply_filters( 'booster_get_message', '', 'readonly' ) : array(),
297
  array( 'step' => '1', 'min' => '0', )
298
  ),
299
  ),
314
  'id' => 'wcj_sku_suffix',
315
  'default' => '',
316
  'type' => 'text',
317
+ // 'desc' => apply_filters( 'booster_get_message', '', 'desc' ),
318
+ // 'custom_attributes' => apply_filters( 'booster_get_message', '', 'readonly' ),
319
  ),
320
  array(
321
  'title' => __( 'Variable Products Variations', 'woocommerce-jetpack' ),
328
  'as_variation' => __( 'Generate different SKU for each variation', 'woocommerce-jetpack' ),
329
  'as_variable_with_suffix' => __( 'SKU same as parent\'s product + variation letter suffix', 'woocommerce-jetpack' ),
330
  ),
331
+ 'desc' => apply_filters( 'booster_get_message', '', 'desc' ),
332
+ 'custom_attributes' => apply_filters( 'booster_get_message', '', 'disabled' ),
333
  ),
334
  array(
335
  'type' => 'sectionend',
353
  'id' => 'wcj_sku_prefix_cat_' . $product_category->term_id,
354
  'default' => '',
355
  'type' => 'text',
356
+ 'desc_tip' => apply_filters( 'booster_get_message', '', 'desc_no_link' ),
357
+ 'custom_attributes' => apply_filters( 'booster_get_message', '', 'readonly' ),
358
  ),
359
  array(
360
  'title' => '',
362
  'id' => 'wcj_sku_suffix_cat_' . $product_category->term_id,
363
  'default' => '',
364
  'type' => 'text',
365
+ // 'desc_tip' => apply_filters( 'booster_get_message', '', 'desc_no_link' ),
366
+ // 'custom_attributes' => apply_filters( 'booster_get_message', '', 'readonly' ),
367
  ),
368
  ) );
369
  }
includes/class-wcj-sorting.php CHANGED
@@ -38,7 +38,7 @@ class WCJ_Sorting extends WCJ_Module {
38
 
39
  if ( 'yes' === get_option( 'wcj_sorting_remove_all_enabled' ) ) {
40
  // Remove sorting
41
- add_action( apply_filters( 'wcj_get_option_filter', 'wcj_empty_action', 'init' ), array( $this, 'remove_sorting' ), 100 );
42
  }
43
 
44
  // Settings: Add 'Remove All Sorting' checkbox to WooCommerce > Settings > Products
@@ -69,8 +69,8 @@ class WCJ_Sorting extends WCJ_Module {
69
  'type' => 'checkbox',
70
  'default' => 'no',
71
  'desc' => __( 'Completely remove sorting from the shop front end', 'woocommerce-jetpack' ),
72
- 'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'disabled' ),
73
- 'desc_tip' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
74
  );
75
  }
76
  $updated_settings[] = $section;
@@ -130,12 +130,12 @@ class WCJ_Sorting extends WCJ_Module {
130
  $args['meta_key'] = '';
131
  break;
132
  case 'sku_asc':
133
- $args['orderby'] = ( 'no' === apply_filters( 'wcj_get_option_filter', 'no', get_option( 'wcj_sorting_by_sku_num_enabled', 'no' ) ) ) ? 'meta_value' : 'meta_value_num';
134
  $args['order'] = 'asc';
135
  $args['meta_key'] = '_sku';
136
  break;
137
  case 'sku_desc':
138
- $args['orderby'] = ( 'no' === apply_filters( 'wcj_get_option_filter', 'no', get_option( 'wcj_sorting_by_sku_num_enabled', 'no' ) ) ) ? 'meta_value' : 'meta_value_num';
139
  $args['order'] = 'desc';
140
  $args['meta_key'] = '_sku';
141
  break;
@@ -169,11 +169,11 @@ class WCJ_Sorting extends WCJ_Module {
169
  array(
170
  'title' => __( 'Remove All Sorting', 'woocommerce-jetpack' ),
171
  'desc' => __( 'Remove all sorting (including WooCommerce default)', 'woocommerce-jetpack' ),
172
- 'desc_tip' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
173
  'id' => 'wcj_sorting_remove_all_enabled',
174
  'default' => 'no',
175
  'type' => 'checkbox',
176
- 'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'disabled' ),
177
  ),
178
  array(
179
  'type' => 'sectionend',
@@ -233,8 +233,8 @@ class WCJ_Sorting extends WCJ_Module {
233
  'id' => 'wcj_sorting_by_sku_num_enabled',
234
  'default' => 'no',
235
  'type' => 'checkbox',
236
- 'desc_tip' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
237
- 'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'disabled' ),
238
  ),
239
  array(
240
  'title' => __( 'Sort by stock quantity', 'woocommerce-jetpack' ),
38
 
39
  if ( 'yes' === get_option( 'wcj_sorting_remove_all_enabled' ) ) {
40
  // Remove sorting
41
+ add_action( apply_filters( 'booster_get_option', 'wcj_empty_action', 'init' ), array( $this, 'remove_sorting' ), 100 );
42
  }
43
 
44
  // Settings: Add 'Remove All Sorting' checkbox to WooCommerce > Settings > Products
69
  'type' => 'checkbox',
70
  'default' => 'no',
71
  'desc' => __( 'Completely remove sorting from the shop front end', 'woocommerce-jetpack' ),
72
+ 'custom_attributes' => apply_filters( 'booster_get_message', '', 'disabled' ),
73
+ 'desc_tip' => apply_filters( 'booster_get_message', '', 'desc' ),
74
  );
75
  }
76
  $updated_settings[] = $section;
130
  $args['meta_key'] = '';
131
  break;
132
  case 'sku_asc':
133
+ $args['orderby'] = ( 'no' === apply_filters( 'booster_get_option', 'no', get_option( 'wcj_sorting_by_sku_num_enabled', 'no' ) ) ) ? 'meta_value' : 'meta_value_num';
134
  $args['order'] = 'asc';
135
  $args['meta_key'] = '_sku';
136
  break;
137
  case 'sku_desc':
138
+ $args['orderby'] = ( 'no' === apply_filters( 'booster_get_option', 'no', get_option( 'wcj_sorting_by_sku_num_enabled', 'no' ) ) ) ? 'meta_value' : 'meta_value_num';
139
  $args['order'] = 'desc';
140
  $args['meta_key'] = '_sku';
141
  break;
169
  array(
170
  'title' => __( 'Remove All Sorting', 'woocommerce-jetpack' ),
171
  'desc' => __( 'Remove all sorting (including WooCommerce default)', 'woocommerce-jetpack' ),
172
+ 'desc_tip' => apply_filters( 'booster_get_message', '', 'desc' ),
173
  'id' => 'wcj_sorting_remove_all_enabled',
174
  'default' => 'no',
175
  'type' => 'checkbox',
176
+ 'custom_attributes' => apply_filters( 'booster_get_message', '', 'disabled' ),
177
  ),
178
  array(
179
  'type' => 'sectionend',
233
  'id' => 'wcj_sorting_by_sku_num_enabled',
234
  'default' => 'no',
235
  'type' => 'checkbox',
236
+ 'desc_tip' => apply_filters( 'booster_get_message', '', 'desc' ),
237
+ 'custom_attributes' => apply_filters( 'booster_get_message', '', 'disabled' ),
238
  ),
239
  array(
240
  'title' => __( 'Sort by stock quantity', 'woocommerce-jetpack' ),
includes/class-wcj-wholesale-price.php CHANGED
@@ -111,7 +111,7 @@ class WCJ_Wholesale_Price extends WCJ_Module {
111
  $max_qty_level = 1;
112
  $discount = 0;
113
  if ( wcj_is_product_wholesale_enabled_per_product( $product_id ) ) {
114
- for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 1, get_post_meta( $product_id, '_' . 'wcj_wholesale_price_levels_number' . $role_option_name_addon, true ) ); $i++ ) {
115
  $level_qty = get_post_meta( $product_id, '_' . 'wcj_wholesale_price_level_min_qty' . $role_option_name_addon . '_' . $i, true );
116
  if ( $quantity >= $level_qty && $level_qty >= $max_qty_level ) {
117
  $max_qty_level = $level_qty;
@@ -119,7 +119,7 @@ class WCJ_Wholesale_Price extends WCJ_Module {
119
  }
120
  }
121
  } else {
122
- for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_wholesale_price_levels_number' . $role_option_name_addon, 1 ) ); $i++ ) {
123
  $level_qty = get_option( 'wcj_wholesale_price_level_min_qty' . $role_option_name_addon . '_' . $i, PHP_INT_MAX );
124
  if ( $quantity >= $level_qty && $level_qty >= $max_qty_level ) {
125
  $max_qty_level = $level_qty;
@@ -278,11 +278,11 @@ class WCJ_Wholesale_Price extends WCJ_Module {
278
  'default' => 0,
279
  'type' => 'number',
280
  'title' => __( 'Number of levels', 'woocommerce-jetpack' ),
281
- 'tooltip' => __( 'Save product after you change this number.', 'woocommerce-jetpack' ) . apply_filters( 'wcj_get_option_filter', ' ' . __( 'Free Booster\'s version is limited to one level maximum. Please visit http://booster.io to get full version.', 'woocommerce-jetpack' ), '' ),
282
- 'custom_attributes' => 'min="0" max="' . apply_filters( 'wcj_get_option_filter', 1, 1000 ) . '"',
283
  ),
284
  );
285
- for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 1, get_post_meta( $product_id, '_' . 'wcj_wholesale_price_levels_number', true ) ); $i++ ) {
286
  $options = array_merge( $options, array(
287
  /* array(
288
  'type' => 'title',
@@ -313,11 +313,11 @@ class WCJ_Wholesale_Price extends WCJ_Module {
313
  'default' => 0,
314
  'type' => 'number',
315
  'title' => __( 'Number of levels', 'woocommerce-jetpack' ) . ' [' . $user_role_key . ']',
316
- 'tooltip' => __( 'Save product after you change this number.', 'woocommerce-jetpack' ) . apply_filters( 'wcj_get_option_filter', ' ' . __( 'Free Booster\'s version is limited to one level maximum. Please visit http://booster.io to get full version.', 'woocommerce-jetpack' ), '' ),
317
- 'custom_attributes' => 'min="0" max="' . apply_filters( 'wcj_get_option_filter', 1, 1000 ) . '"',
318
  ),
319
  ) );
320
- for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 1, get_post_meta( $product_id, '_' . 'wcj_wholesale_price_levels_number_' . $user_role_key, true ) ); $i++ ) {
321
  $options = array_merge( $options, array(
322
  /* array(
323
  'type' => 'title',
@@ -456,14 +456,14 @@ class WCJ_Wholesale_Price extends WCJ_Module {
456
  'id' => 'wcj_wholesale_price_levels_number',
457
  'default' => 1,
458
  'type' => 'custom_number',
459
- 'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
460
  'custom_attributes' => array_merge(
461
- is_array( apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ) ) ? apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ) : array(),
462
  array('step' => '1', 'min' => '1', ) ),
463
  'css' => 'width:100px;',
464
  ),
465
  );
466
- for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_wholesale_price_levels_number', 1 ) ); $i++ ) {
467
  $settings[] = array(
468
  'title' => __( 'Min quantity', 'woocommerce-jetpack' ) . ' #' . $i,
469
  'desc' => __( 'Minimum quantity to apply discount', 'woocommerce-jetpack' ),
@@ -511,14 +511,14 @@ class WCJ_Wholesale_Price extends WCJ_Module {
511
  'id' => 'wcj_wholesale_price_levels_number_' . $user_role_key,
512
  'default' => 1,
513
  'type' => 'custom_number',
514
- 'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
515
  'custom_attributes' => array_merge(
516
- is_array( apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ) ) ? apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ) : array(),
517
  array('step' => '1', 'min' => '1', ) ),
518
  'css' => 'width:100px;',
519
  ),
520
  ) );
521
- for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_wholesale_price_levels_number_' . $user_role_key, 1 ) ); $i++ ) {
522
  $settings = array_merge( $settings, array(
523
  array(
524
  'title' => __( 'Min quantity', 'woocommerce-jetpack' ) . ' #' . $i . ' [' . $user_role_key . ']',
111
  $max_qty_level = 1;
112
  $discount = 0;
113
  if ( wcj_is_product_wholesale_enabled_per_product( $product_id ) ) {
114
+ for ( $i = 1; $i <= apply_filters( 'booster_get_option', 1, get_post_meta( $product_id, '_' . 'wcj_wholesale_price_levels_number' . $role_option_name_addon, true ) ); $i++ ) {
115
  $level_qty = get_post_meta( $product_id, '_' . 'wcj_wholesale_price_level_min_qty' . $role_option_name_addon . '_' . $i, true );
116
  if ( $quantity >= $level_qty && $level_qty >= $max_qty_level ) {
117
  $max_qty_level = $level_qty;
119
  }
120
  }
121
  } else {
122
+ for ( $i = 1; $i <= apply_filters( 'booster_get_option', 1, get_option( 'wcj_wholesale_price_levels_number' . $role_option_name_addon, 1 ) ); $i++ ) {
123
  $level_qty = get_option( 'wcj_wholesale_price_level_min_qty' . $role_option_name_addon . '_' . $i, PHP_INT_MAX );
124
  if ( $quantity >= $level_qty && $level_qty >= $max_qty_level ) {
125
  $max_qty_level = $level_qty;
278
  'default' => 0,
279
  'type' => 'number',
280
  'title' => __( 'Number of levels', 'woocommerce-jetpack' ),
281
+ 'tooltip' => __( 'Save product after you change this number.', 'woocommerce-jetpack' ) . apply_filters( 'booster_get_option', ' ' . __( 'Free Booster\'s version is limited to one level maximum. Please visit http://booster.io to get full version.', 'woocommerce-jetpack' ), '' ),
282
+ 'custom_attributes' => 'min="0" max="' . apply_filters( 'booster_get_option', 1, 1000 ) . '"',
283
  ),
284
  );
285
+ for ( $i = 1; $i <= apply_filters( 'booster_get_option', 1, get_post_meta( $product_id, '_' . 'wcj_wholesale_price_levels_number', true ) ); $i++ ) {
286
  $options = array_merge( $options, array(
287
  /* array(
288
  'type' => 'title',
313
  'default' => 0,
314
  'type' => 'number',
315
  'title' => __( 'Number of levels', 'woocommerce-jetpack' ) . ' [' . $user_role_key . ']',
316
+ 'tooltip' => __( 'Save product after you change this number.', 'woocommerce-jetpack' ) . apply_filters( 'booster_get_option', ' ' . __( 'Free Booster\'s version is limited to one level maximum. Please visit http://booster.io to get full version.', 'woocommerce-jetpack' ), '' ),
317
+ 'custom_attributes' => 'min="0" max="' . apply_filters( 'booster_get_option', 1, 1000 ) . '"',
318
  ),
319
  ) );
320
+ for ( $i = 1; $i <= apply_filters( 'booster_get_option', 1, get_post_meta( $product_id, '_' . 'wcj_wholesale_price_levels_number_' . $user_role_key, true ) ); $i++ ) {
321
  $options = array_merge( $options, array(
322
  /* array(
323
  'type' => 'title',
456
  'id' => 'wcj_wholesale_price_levels_number',
457
  'default' => 1,
458
  'type' => 'custom_number',
459
+ 'desc' => apply_filters( 'booster_get_message', '', 'desc' ),
460
  'custom_attributes' => array_merge(
461
+ is_array( apply_filters( 'booster_get_message', '', 'readonly' ) ) ? apply_filters( 'booster_get_message', '', 'readonly' ) : array(),
462
  array('step' => '1', 'min' => '1', ) ),
463
  'css' => 'width:100px;',
464
  ),
465
  );
466
+ for ( $i = 1; $i <= apply_filters( 'booster_get_option', 1, get_option( 'wcj_wholesale_price_levels_number', 1 ) ); $i++ ) {
467
  $settings[] = array(
468
  'title' => __( 'Min quantity', 'woocommerce-jetpack' ) . ' #' . $i,
469
  'desc' => __( 'Minimum quantity to apply discount', 'woocommerce-jetpack' ),
511
  'id' => 'wcj_wholesale_price_levels_number_' . $user_role_key,
512
  'default' => 1,
513
  'type' => 'custom_number',
514
+ 'desc' => apply_filters( 'booster_get_message', '', 'desc' ),
515
  'custom_attributes' => array_merge(
516
+ is_array( apply_filters( 'booster_get_message', '', 'readonly' ) ) ? apply_filters( 'booster_get_message', '', 'readonly' ) : array(),
517
  array('step' => '1', 'min' => '1', ) ),
518
  'css' => 'width:100px;',
519
  ),
520
  ) );
521
+ for ( $i = 1; $i <= apply_filters( 'booster_get_option', 1, get_option( 'wcj_wholesale_price_levels_number_' . $user_role_key, 1 ) ); $i++ ) {
522
  $settings = array_merge( $settings, array(
523
  array(
524
  'title' => __( 'Min quantity', 'woocommerce-jetpack' ) . ' #' . $i . ' [' . $user_role_key . ']',
includes/classes/class-wcj-invoice.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * The WooCommerce Jetpack Invoice class.
6
  *
7
- * @version 2.3.0
8
  * @author Algoritmika Ltd.
9
  */
10
 
@@ -52,11 +52,18 @@ class WCJ_Invoice {
52
  /**
53
  * create.
54
  *
55
- * @version 2.3.0
 
56
  */
57
  function create( $date = '' ) {
58
  $order_id = $this->order_id;
59
  $invoice_type = $this->invoice_type;
 
 
 
 
 
 
60
  //if ( '' == get_post_meta( $order_id, '_wcj_invoicing_' . $invoice_type . '_number', true ) ) {
61
  if ( 'yes' === get_option( 'wcj_invoicing_' . $invoice_type . '_sequential_enabled' ) ) {
62
  $the_invoice_number = get_option( 'wcj_invoicing_' . $invoice_type . '_numbering_counter', 1 );
@@ -66,7 +73,7 @@ class WCJ_Invoice {
66
  }
67
  $the_date = ( '' == $date ) ? current_time( 'timestamp' ) : $date;
68
  update_post_meta( $order_id, '_wcj_invoicing_' . $invoice_type . '_number_id', $the_invoice_number );
69
- //update_post_meta( $order_id, '_wcj_invoicing_' . $invoice_type . '_number', $this->get_invoice_full_number( $the_invoice_number ) );
70
  update_post_meta( $order_id, '_wcj_invoicing_' . $invoice_type . '_date', $the_date );
71
  //}
72
  }
4
  *
5
  * The WooCommerce Jetpack Invoice class.
6
  *
7
+ * @version 2.5.9
8
  * @author Algoritmika Ltd.
9
  */
10
 
52
  /**
53
  * create.
54
  *
55
+ * @version 2.5.9
56
+ * @todo use mysql transaction enabled (as in "wcj_order_number_use_mysql_transaction_enabled")
57
  */
58
  function create( $date = '' ) {
59
  $order_id = $this->order_id;
60
  $invoice_type = $this->invoice_type;
61
+ if ( 'yes' === apply_filters( 'booster_get_option', 'no', get_option( 'wcj_invoicing_' . $invoice_type . '_skip_zero_total', 'no' ) ) ) {
62
+ $_order = wc_get_order( $order_id );
63
+ if ( 0 == $_order->get_total() ) {
64
+ return;
65
+ }
66
+ }
67
  //if ( '' == get_post_meta( $order_id, '_wcj_invoicing_' . $invoice_type . '_number', true ) ) {
68
  if ( 'yes' === get_option( 'wcj_invoicing_' . $invoice_type . '_sequential_enabled' ) ) {
69
  $the_invoice_number = get_option( 'wcj_invoicing_' . $invoice_type . '_numbering_counter', 1 );
73
  }
74
  $the_date = ( '' == $date ) ? current_time( 'timestamp' ) : $date;
75
  update_post_meta( $order_id, '_wcj_invoicing_' . $invoice_type . '_number_id', $the_invoice_number );
76
+ // update_post_meta( $order_id, '_wcj_invoicing_' . $invoice_type . '_number', $this->get_invoice_full_number( $the_invoice_number ) );
77
  update_post_meta( $order_id, '_wcj_invoicing_' . $invoice_type . '_date', $the_date );
78
  //}
79
  }
includes/classes/class-wcj-module.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * The WooCommerce Jetpack Module class.
6
  *
7
- * @version 2.5.7
8
  * @since 2.2.0
9
  * @author Algoritmika Ltd.
10
  */
@@ -44,7 +44,7 @@ if ( ! class_exists( 'WCJ_Module' ) ) :
44
  * @since 2.5.3
45
  */
46
  function save_meta_box_value( $option_value, $option_name, $module_id ) {
47
- if ( true === apply_filters( 'wcj_get_option_filter', false, true ) ) {
48
  return $option_value;
49
  }
50
  if ( 'no' === $option_value ) {
@@ -96,25 +96,17 @@ if ( ! class_exists( 'WCJ_Module' ) ) :
96
  /**
97
  * reset_settings.
98
  *
99
- * @version 2.5.0
100
  * @since 2.4.0
101
  */
102
  function reset_settings() {
103
  if ( isset( $_GET['wcj_reset_settings'] ) && $this->id === $_GET['wcj_reset_settings'] && wcj_is_user_role( 'administrator' ) && ! isset( $_POST['save'] ) ) {
104
- global $wcj_notice;
105
- if ( ! isset( $_GET['wcj_confirm_reset_settings'] ) ) {
106
- $wcj_notice .= __( 'Are you sure you want to reset current module\'s settings to default values?', 'woocommerce-jetpack' );
107
- $yes_button_style = "background: green; border-color: green; box-shadow: 0 1px 0 green; text-shadow: 0 -1px 1px #0a0,1px 0 1px #0a0,0 1px 1px #0a0,-1px 0 1px #0a0;";
108
- $no_button_style = "background: red; border-color: red; box-shadow: 0 1px 0 red; text-shadow: 0 -1px 1px #a00,1px 0 1px #a00,0 1px 1px #a00,-1px 0 1px #a00;";
109
- $wcj_notice .= ' ' . '<a class="button-primary" style="' . $yes_button_style . '" href="' . add_query_arg( 'wcj_confirm_reset_settings', 'yes' ) . '">' . __( 'Yes', 'woocommerce-jetpack' ) . '</a>';
110
- $wcj_notice .= ' ' . '<a class="button-primary" style="' . $no_button_style . '" href="' . remove_query_arg( 'wcj_reset_settings' ) . '">' . __( 'No', 'woocommerce-jetpack' ) . '</a>';
111
- } else {
112
- foreach ( $this->get_settings() as $settings ) {
113
- $default_value = isset( $settings['default'] ) ? $settings['default'] : '';
114
- update_option( $settings['id'], $default_value );
115
- }
116
- $wcj_notice .= __( 'Settings have been reset to defaults.', 'woocommerce-jetpack' );
117
  }
 
 
118
  }
119
  }
120
 
@@ -460,7 +452,7 @@ if ( ! class_exists( 'WCJ_Module' ) ) :
460
  /**
461
  * add_reset_settings_button.
462
  *
463
- * @version 2.4.7
464
  * @since 2.4.0
465
  */
466
  function add_reset_settings_button( $settings ) {
@@ -477,14 +469,9 @@ if ( ! class_exists( 'WCJ_Module' ) ) :
477
  __( 'Reset Submodule to Default Settings', 'woocommerce-jetpack' ),
478
  'id' => 'wcj_' . $this->id . '_reset_settings',
479
  'type' => 'custom_link',
480
- 'link' => '<a class="button-primary" style="' . $reset_button_style . '" href="' . add_query_arg( 'wcj_reset_settings', $this->id, remove_query_arg( 'wcj_confirm_reset_settings' ) ) . '">' . __( 'Reset settings', 'woocommerce-jetpack' ) . '</a>',
 
481
  ),
482
- /* array(
483
- 'title' => __( 'Reset to Default Settings', 'woocommerce-jetpack' ),
484
- 'id' => 'wcj_' . $this->id . '_reset_settings',
485
- 'type' => 'custom_link',
486
- 'link' => '<input name="wcj_reset_settings" class="button-primary" type="submit" value="Reset settings">',
487
- ), */
488
  array(
489
  'type' => 'sectionend',
490
  'id' => 'wcj_' . $this->id . '_reset_settings_options',
4
  *
5
  * The WooCommerce Jetpack Module class.
6
  *
7
+ * @version 2.5.9
8
  * @since 2.2.0
9
  * @author Algoritmika Ltd.
10
  */
44
  * @since 2.5.3
45
  */
46
  function save_meta_box_value( $option_value, $option_name, $module_id ) {
47
+ if ( true === apply_filters( 'booster_get_option', false, true ) ) {
48
  return $option_value;
49
  }
50
  if ( 'no' === $option_value ) {
96
  /**
97
  * reset_settings.
98
  *
99
+ * @version 2.5.9
100
  * @since 2.4.0
101
  */
102
  function reset_settings() {
103
  if ( isset( $_GET['wcj_reset_settings'] ) && $this->id === $_GET['wcj_reset_settings'] && wcj_is_user_role( 'administrator' ) && ! isset( $_POST['save'] ) ) {
104
+ foreach ( $this->get_settings() as $settings ) {
105
+ $default_value = isset( $settings['default'] ) ? $settings['default'] : '';
106
+ update_option( $settings['id'], $default_value );
 
 
 
 
 
 
 
 
 
 
107
  }
108
+ wp_safe_redirect( remove_query_arg( 'wcj_reset_settings' ) );
109
+ exit();
110
  }
111
  }
112
 
452
  /**
453
  * add_reset_settings_button.
454
  *
455
+ * @version 2.5.9
456
  * @since 2.4.0
457
  */
458
  function add_reset_settings_button( $settings ) {
469
  __( 'Reset Submodule to Default Settings', 'woocommerce-jetpack' ),
470
  'id' => 'wcj_' . $this->id . '_reset_settings',
471
  'type' => 'custom_link',
472
+ 'link' => '<a onclick="return confirm(\'' . __( 'Are you sure?', 'woocommerce-jetpack' ) . '\')" class="button-primary" style="' .
473
+ $reset_button_style . '" href="' . add_query_arg( 'wcj_reset_settings', $this->id ) . '">' . __( 'Reset settings', 'woocommerce-jetpack' ) . '</a>',
474
  ),
 
 
 
 
 
 
475
  array(
476
  'type' => 'sectionend',
477
  'id' => 'wcj_' . $this->id . '_reset_settings_options',
includes/classes/class-wcj-pdf-invoice.php CHANGED
@@ -120,14 +120,14 @@ class WCJ_PDF_Invoice extends WCJ_Invoice {
120
  $pdf->setFontSubsetting( true );
121
 
122
  // Set font
123
- /* if ( 'DroidSansFallback' === apply_filters( 'wcj_get_option_filter', 'dejavusans', get_option( 'wcj_invoicing_' . $invoice_type . '_general_font_family', 'dejavusans' ) ) ) {
124
  $pdf->addTTFfont( wcj_plugin_path() . '/includes/lib/tcpdf_min/fonts/' . 'DroidSansFallback.ttf' );
125
  } */
126
  // dejavusans is a UTF-8 Unicode font, if you only need to print standard ASCII chars, you can use core fonts like helvetica or times to reduce file size.
127
  $pdf->SetFont(
128
- apply_filters( 'wcj_get_option_filter', 'dejavusans', get_option( 'wcj_invoicing_' . $invoice_type . '_general_font_family', 'dejavusans' ) ),
129
  '',
130
- apply_filters( 'wcj_get_option_filter', 8, get_option( 'wcj_invoicing_' . $invoice_type . '_general_font_size', 8 ) ),
131
  '',
132
  true );
133
 
120
  $pdf->setFontSubsetting( true );
121
 
122
  // Set font
123
+ /* if ( 'DroidSansFallback' === apply_filters( 'booster_get_option', 'dejavusans', get_option( 'wcj_invoicing_' . $invoice_type . '_general_font_family', 'dejavusans' ) ) ) {
124
  $pdf->addTTFfont( wcj_plugin_path() . '/includes/lib/tcpdf_min/fonts/' . 'DroidSansFallback.ttf' );
125
  } */
126
  // dejavusans is a UTF-8 Unicode font, if you only need to print standard ASCII chars, you can use core fonts like helvetica or times to reduce file size.
127
  $pdf->SetFont(
128
+ apply_filters( 'booster_get_option', 'dejavusans', get_option( 'wcj_invoicing_' . $invoice_type . '_general_font_family', 'dejavusans' ) ),
129
  '',
130
+ apply_filters( 'booster_get_option', 8, get_option( 'wcj_invoicing_' . $invoice_type . '_general_font_size', 8 ) ),
131
  '',
132
  true );
133
 
includes/classes/class-wcj-product.php CHANGED
@@ -42,7 +42,7 @@ class WCJ_Product {
42
  if ( 'yes' === get_option( 'wcj_purchase_price_affiliate_commission_enabled', 'no' ) ) {
43
  $purchase_price += get_post_meta( $this->id, '_' . 'wcj_purchase_price_affiliate_commission', true );
44
  }
45
- $total_number = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_purchase_data_custom_price_fields_total_number', 1 ) );
46
  for ( $i = 1; $i <= $total_number; $i++ ) {
47
  if ( '' == get_option( 'wcj_purchase_data_custom_price_field_name_' . $i, '' ) ) {
48
  continue;
42
  if ( 'yes' === get_option( 'wcj_purchase_price_affiliate_commission_enabled', 'no' ) ) {
43
  $purchase_price += get_post_meta( $this->id, '_' . 'wcj_purchase_price_affiliate_commission', true );
44
  }
45
+ $total_number = apply_filters( 'booster_get_option', 1, get_option( 'wcj_purchase_data_custom_price_fields_total_number', 1 ) );
46
  for ( $i = 1; $i <= $total_number; $i++ ) {
47
  if ( '' == get_option( 'wcj_purchase_data_custom_price_field_name_' . $i, '' ) ) {
48
  continue;
includes/classes/class-wcj-tcpdf.php CHANGED
@@ -47,7 +47,7 @@ class WCJ_TCPDF extends TCPDF {
47
  //$this->SetFont('helvetica', 'I', 8);
48
 
49
  $invoice_type = $this->invoice_type;
50
- $footer_text = apply_filters( 'wcj_get_option_filter', 'Page %page_number% / %total_pages%', get_option( 'wcj_invoicing_' . $invoice_type . '_footer_text' ) );
51
  //$this->Cell( 0, 0, do_shortcode( $footer_text ), 0, false, 'L', 0, '', 0, false, 'T', 'M' );
52
  $footer_text = str_replace( '%page_number%', $this->getAliasNumPage(), $footer_text );
53
  $footer_text = str_replace( '%total_pages%', $this->getAliasNbPages(), $footer_text );
47
  //$this->SetFont('helvetica', 'I', 8);
48
 
49
  $invoice_type = $this->invoice_type;
50
+ $footer_text = apply_filters( 'booster_get_option', 'Page %page_number% / %total_pages%', get_option( 'wcj_invoicing_' . $invoice_type . '_footer_text' ) );
51
  //$this->Cell( 0, 0, do_shortcode( $footer_text ), 0, false, 'L', 0, '', 0, false, 'T', 'M' );
52
  $footer_text = str_replace( '%page_number%', $this->getAliasNumPage(), $footer_text );
53
  $footer_text = str_replace( '%total_pages%', $this->getAliasNbPages(), $footer_text );
includes/exchange-rates/class-wcj-exchange-rates-crons.php CHANGED
@@ -111,8 +111,8 @@ class WCJ_Exchange_Rates_Crons {
111
 
112
  if ( wcj_is_module_enabled( 'price_by_country' ) ) {
113
  // Currency Pairs - Preparation - Price by Country
114
- if ( 'manual' != apply_filters( 'wcj_get_option_filter', 'manual', get_option( 'wcj_price_by_country_auto_exchange_rates', 'manual' ) ) ) {
115
- for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_price_by_country_total_groups_number', 1 ) ); $i++ ) {
116
  $currency_to = get_option( 'wcj_price_by_country_exchange_rate_currency_group_' . $i );
117
  $currency_pairs = $this->get_currency_pair( $currency_pairs, $currency_to, 'wcj_price_by_country_exchange_rate_group_' . $i );
118
  }
@@ -121,8 +121,8 @@ class WCJ_Exchange_Rates_Crons {
121
 
122
  if ( wcj_is_module_enabled( 'multicurrency' ) ) {
123
  // Currency Pairs - Preparation - Multicurrency
124
- if ( 'manual' != apply_filters( 'wcj_get_option_filter', 'manual', get_option( 'wcj_multicurrency_exchange_rate_update_auto', 'manual' ) ) ) {
125
- for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 2, get_option( 'wcj_multicurrency_total_number', 2 ) ); $i++ ) {
126
  $currency_to = get_option( 'wcj_multicurrency_currency_' . $i );
127
  $currency_pairs = $this->get_currency_pair( $currency_pairs, $currency_to, 'wcj_multicurrency_exchange_rate_' . $i );
128
  }
@@ -131,8 +131,8 @@ class WCJ_Exchange_Rates_Crons {
131
 
132
  if ( wcj_is_module_enabled( 'multicurrency_base_price' ) ) {
133
  // Currency Pairs - Preparation - Multicurrency Product Base Price
134
- if ( 'manual' != apply_filters( 'wcj_get_option_filter', 'manual', get_option( 'wcj_multicurrency_base_price_exchange_rate_update', 'manual' ) ) ) {
135
- for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_multicurrency_base_price_total_number', 1 ) ); $i++ ) {
136
  $currency_to = get_option( 'wcj_multicurrency_base_price_currency_' . $i );
137
  $currency_pairs = $this->get_currency_pair( $currency_pairs, $currency_to, 'wcj_multicurrency_base_price_exchange_rate_' . $i );
138
  }
@@ -141,8 +141,8 @@ class WCJ_Exchange_Rates_Crons {
141
 
142
  if ( wcj_is_module_enabled( 'currency_per_product' ) ) {
143
  // Currency Pairs - Preparation - Currency per Product
144
- if ( 'manual' != apply_filters( 'wcj_get_option_filter', 'manual', get_option( 'wcj_currency_per_product_exchange_rate_update', 'manual' ) ) ) {
145
- for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_currency_per_product_total_number', 1 ) ); $i++ ) {
146
  $currency_to = get_option( 'wcj_currency_per_product_currency_' . $i );
147
  $currency_pairs = $this->get_currency_pair( $currency_pairs, $currency_to, 'wcj_currency_per_product_exchange_rate_' . $i );
148
  }
@@ -151,7 +151,7 @@ class WCJ_Exchange_Rates_Crons {
151
 
152
  if ( wcj_is_module_enabled( 'payment_gateways_currency' ) ) {
153
  // Currency Pairs - Preparation - Gateway Currency
154
- if ( 'manual' != apply_filters( 'wcj_get_option_filter', 'manual', get_option( 'wcj_gateways_currency_exchange_rate_update_auto', 'manual' ) ) ) {
155
  global $woocommerce;
156
  $available_gateways = $woocommerce->payment_gateways->payment_gateways();
157
  foreach ( $available_gateways as $key => $gateway ) {
111
 
112
  if ( wcj_is_module_enabled( 'price_by_country' ) ) {
113
  // Currency Pairs - Preparation - Price by Country
114
+ if ( 'manual' != apply_filters( 'booster_get_option', 'manual', get_option( 'wcj_price_by_country_auto_exchange_rates', 'manual' ) ) ) {
115
+ for ( $i = 1; $i <= apply_filters( 'booster_get_option', 1, get_option( 'wcj_price_by_country_total_groups_number', 1 ) ); $i++ ) {
116
  $currency_to = get_option( 'wcj_price_by_country_exchange_rate_currency_group_' . $i );
117
  $currency_pairs = $this->get_currency_pair( $currency_pairs, $currency_to, 'wcj_price_by_country_exchange_rate_group_' . $i );
118
  }
121
 
122
  if ( wcj_is_module_enabled( 'multicurrency' ) ) {
123
  // Currency Pairs - Preparation - Multicurrency
124
+ if ( 'manual' != apply_filters( 'booster_get_option', 'manual', get_option( 'wcj_multicurrency_exchange_rate_update_auto', 'manual' ) ) ) {
125
+ for ( $i = 1; $i <= apply_filters( 'booster_get_option', 2, get_option( 'wcj_multicurrency_total_number', 2 ) ); $i++ ) {
126
  $currency_to = get_option( 'wcj_multicurrency_currency_' . $i );
127
  $currency_pairs = $this->get_currency_pair( $currency_pairs, $currency_to, 'wcj_multicurrency_exchange_rate_' . $i );
128
  }
131
 
132
  if ( wcj_is_module_enabled( 'multicurrency_base_price' ) ) {
133
  // Currency Pairs - Preparation - Multicurrency Product Base Price
134
+ if ( 'manual' != apply_filters( 'booster_get_option', 'manual', get_option( 'wcj_multicurrency_base_price_exchange_rate_update', 'manual' ) ) ) {
135
+ for ( $i = 1; $i <= apply_filters( 'booster_get_option', 1, get_option( 'wcj_multicurrency_base_price_total_number', 1 ) ); $i++ ) {
136
  $currency_to = get_option( 'wcj_multicurrency_base_price_currency_' . $i );
137
  $currency_pairs = $this->get_currency_pair( $currency_pairs, $currency_to, 'wcj_multicurrency_base_price_exchange_rate_' . $i );
138
  }
141
 
142
  if ( wcj_is_module_enabled( 'currency_per_product' ) ) {
143
  // Currency Pairs - Preparation - Currency per Product
144
+ if ( 'manual' != apply_filters( 'booster_get_option', 'manual', get_option( 'wcj_currency_per_product_exchange_rate_update', 'manual' ) ) ) {
145
+ for ( $i = 1; $i <= apply_filters( 'booster_get_option', 1, get_option( 'wcj_currency_per_product_total_number', 1 ) ); $i++ ) {
146
  $currency_to = get_option( 'wcj_currency_per_product_currency_' . $i );
147
  $currency_pairs = $this->get_currency_pair( $currency_pairs, $currency_to, 'wcj_currency_per_product_exchange_rate_' . $i );
148
  }
151
 
152
  if ( wcj_is_module_enabled( 'payment_gateways_currency' ) ) {
153
  // Currency Pairs - Preparation - Gateway Currency
154
+ if ( 'manual' != apply_filters( 'booster_get_option', 'manual', get_option( 'wcj_gateways_currency_exchange_rate_update_auto', 'manual' ) ) ) {
155
  global $woocommerce;
156
  $available_gateways = $woocommerce->payment_gateways->payment_gateways();
157
  foreach ( $available_gateways as $key => $gateway ) {
includes/export/class-wcj-exporter-customers.php ADDED
@@ -0,0 +1,191 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * WooCommerce Jetpack Exporter Customers
4
+ *
5
+ * The WooCommerce Jetpack Exporter Customers class.
6
+ *
7
+ * @version 2.5.9
8
+ * @since 2.5.9
9
+ * @author Algoritmika Ltd.
10
+ */
11
+
12
+ if ( ! defined( 'ABSPATH' ) ) exit;
13
+
14
+ if ( ! class_exists( 'WCJ_Exporter_Customers' ) ) :
15
+
16
+ class WCJ_Exporter_Customers {
17
+
18
+ /**
19
+ * Constructor.
20
+ *
21
+ * @version 2.5.9
22
+ * @since 2.5.9
23
+ */
24
+ function __construct() {
25
+ return true;
26
+ }
27
+
28
+ /**
29
+ * export_customers.
30
+ *
31
+ * @version 2.5.9
32
+ * @since 2.4.8
33
+ */
34
+ function export_customers( $fields_helper ) {
35
+
36
+ // Standard Fields
37
+ $all_fields = $fields_helper->get_customer_export_fields();
38
+ $fields_ids = get_option( 'wcj_export_customers_fields', $fields_helper->get_customer_export_default_fields_ids() );
39
+ $titles = array();
40
+ foreach( $fields_ids as $field_id ) {
41
+ $titles[] = $all_fields[ $field_id ];
42
+ }
43
+
44
+ // Get the Data
45
+ $data = array();
46
+ $data[] = $titles;
47
+ $customers = get_users( 'role=customer' );
48
+ foreach ( $customers as $customer ) {
49
+ $row = array();
50
+ foreach( $fields_ids as $field_id ) {
51
+ switch ( $field_id ) {
52
+ case 'customer-id':
53
+ $row[] = $customer->ID;
54
+ break;
55
+ case 'customer-email':
56
+ $row[] = $customer->user_email;
57
+ break;
58
+ case 'customer-login':
59
+ $row[] = $customer->user_login;
60
+ break;
61
+ case 'customer-nicename':
62
+ $row[] = $customer->user_nicename;
63
+ break;
64
+ case 'customer-url':
65
+ $row[] = $customer->user_url;
66
+ break;
67
+ case 'customer-registered':
68
+ $row[] = $customer->user_registered;
69
+ break;
70
+ case 'customer-display-name':
71
+ $row[] = $customer->display_name;
72
+ break;
73
+ case 'customer-first-name':
74
+ $row[] = $customer->first_name;
75
+ break;
76
+ case 'customer-last-name':
77
+ $row[] = $customer->last_name;
78
+ break;
79
+ case 'customer-debug':
80
+ $row[] = '<pre>' . print_r( $customer, true ) . '</pre>';
81
+ break;
82
+ }
83
+ }
84
+ $data[] = $row;
85
+ }
86
+ return $data;
87
+ }
88
+
89
+ /**
90
+ * export_customers_from_orders.
91
+ *
92
+ * @version 2.5.9
93
+ * @since 2.4.8
94
+ * @todo (maybe) add more order fields (shipping)
95
+ */
96
+ function export_customers_from_orders( $fields_helper ) {
97
+
98
+ // Standard Fields
99
+ $all_fields = $fields_helper->get_customer_from_order_export_fields();
100
+ $fields_ids = get_option( 'wcj_export_customers_from_orders_fields', $fields_helper->get_customer_from_order_export_default_fields_ids() );
101
+ $titles = array();
102
+ foreach( $fields_ids as $field_id ) {
103
+ $titles[] = $all_fields[ $field_id ];
104
+ }
105
+
106
+ // Get the Data
107
+ $data = array();
108
+ $data[] = $titles;
109
+ $total_customers = 0;
110
+ $orders = array();
111
+ $offset = 0;
112
+ $block_size = 1024;
113
+ while( true ) {
114
+ $args_orders = array(
115
+ 'post_type' => 'shop_order',
116
+ 'post_status' => 'any',
117
+ 'posts_per_page' => $block_size,
118
+ 'orderby' => 'date',
119
+ 'order' => 'DESC',
120
+ 'offset' => $offset,
121
+ 'fields' => 'ids',
122
+ );
123
+ $loop_orders = new WP_Query( $args_orders );
124
+ if ( ! $loop_orders->have_posts() ) {
125
+ break;
126
+ }
127
+ foreach ( $loop_orders->posts as $order_id ) {
128
+ $order = wc_get_order( $order_id );
129
+ if ( isset( $order->billing_email ) && '' != $order->billing_email && ! in_array( $order->billing_email, $orders ) ) {
130
+ $emails_to_skip = array(); // `emails_to_skip` is not really used...
131
+ if ( ! in_array( $order->billing_email, $emails_to_skip ) ) {
132
+ $total_customers++;
133
+ $row = array();
134
+ foreach( $fields_ids as $field_id ) {
135
+ switch ( $field_id ) {
136
+ case 'customer-nr':
137
+ $row[] = $total_customers;
138
+ break;
139
+ case 'customer-billing-email':
140
+ $row[] = $order->billing_email;
141
+ break;
142
+ case 'customer-billing-first-name':
143
+ $row[] = $order->billing_first_name;
144
+ break;
145
+ case 'customer-billing-last-name':
146
+ $row[] = $order->billing_last_name;
147
+ break;
148
+ case 'customer-billing-company':
149
+ $row[] = $order->billing_company;
150
+ break;
151
+ case 'customer-billing-address-1':
152
+ $row[] = $order->billing_address_1;
153
+ break;
154
+ case 'customer-billing-address-2':
155
+ $row[] = $order->billing_address_2;
156
+ break;
157
+ case 'customer-billing-city':
158
+ $row[] = $order->billing_city;
159
+ break;
160
+ case 'customer-billing-state':
161
+ $row[] = $order->billing_state;
162
+ break;
163
+ case 'customer-billing-postcode':
164
+ $row[] = $order->billing_postcode;
165
+ break;
166
+ case 'customer-billing-country':
167
+ $row[] = $order->billing_country;
168
+ break;
169
+ case 'customer-billing-phone':
170
+ $row[] = $order->billing_phone;
171
+ break;
172
+ case 'customer-last-order-date':
173
+ $row[] = get_the_date( get_option( 'date_format' ), $order_id );
174
+ break;
175
+ }
176
+ }
177
+ $data[] = $row;
178
+ $orders[] = $order->billing_email;
179
+ }
180
+ }
181
+ }
182
+ $offset += $block_size;
183
+ }
184
+ return $data;
185
+ }
186
+
187
+ }
188
+
189
+ endif;
190
+
191
+ return new WCJ_Exporter_Customers();
includes/export/class-wcj-exporter-orders.php ADDED
@@ -0,0 +1,395 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * WooCommerce Jetpack Exporter Orders
4
+ *
5
+ * The WooCommerce Jetpack Exporter Orders class.
6
+ *
7
+ * @version 2.5.9
8
+ * @since 2.5.9
9
+ * @author Algoritmika Ltd.
10
+ * @todo filter export by date
11
+ */
12
+
13
+ if ( ! defined( 'ABSPATH' ) ) exit;
14
+
15
+ if ( ! class_exists( 'WCJ_Exporter_Orders' ) ) :
16
+
17
+ class WCJ_Exporter_Orders {
18
+
19
+ /**
20
+ * Constructor.
21
+ *
22
+ * @version 2.5.9
23
+ * @since 2.5.9
24
+ */
25
+ function __construct() {
26
+ return true;
27
+ }
28
+
29
+ /**
30
+ * get_export_orders_row.
31
+ *
32
+ * @version 2.5.9
33
+ * @since 2.5.9
34
+ */
35
+ function get_export_orders_row( $fields_ids, $order_id, $order, $items, $items_product_input_fields, $item, $item_id ) {
36
+ $row = array();
37
+ foreach( $fields_ids as $field_id ) {
38
+ switch ( $field_id ) {
39
+ case 'item-product-input-fields':
40
+ $row[] = wcj_get_product_input_fields( $item );
41
+ break;
42
+ case 'item-debug':
43
+ $row[] = '<pre>' . print_r( $item, true ) . '</pre>';
44
+ break;
45
+ case 'item-name':
46
+ $row[] = $item['name'];
47
+ break;
48
+ case 'item-meta':
49
+ $row[] = wcj_get_order_item_meta_info( $item_id, $item, $order );
50
+ break;
51
+ case 'item-variation-meta':
52
+ $row[] = ( 0 != $item['variation_id'] ) ? wcj_get_order_item_meta_info( $item_id, $item, $order, true ) : '';
53
+ break;
54
+ case 'item-qty':
55
+ $row[] = $item['qty'];
56
+ break;
57
+ case 'item-tax-class':
58
+ $row[] = $item['tax_class'];
59
+ break;
60
+ case 'item-product-id':
61
+ $row[] = $item['product_id'];
62
+ break;
63
+ case 'item-variation-id':
64
+ $row[] = $item['variation_id'];
65
+ break;
66
+ case 'item-line-subtotal':
67
+ $row[] = $item['line_subtotal'];
68
+ break;
69
+ case 'item-line-total':
70
+ $row[] = $item['line_total'];
71
+ break;
72
+ case 'item-line-subtotal-tax':
73
+ $row[] = $item['line_subtotal_tax'];
74
+ break;
75
+ case 'item-line-tax':
76
+ $row[] = $item['line_tax'];
77
+ break;
78
+ case 'item-line-total-plus-tax':
79
+ $row[] = $item['line_total'] + $item['line_tax'];
80
+ break;
81
+ case 'item-line-subtotal-plus-tax':
82
+ $row[] = $item['line_subtotal'] + $item['line_subtotal_tax'];
83
+ break;
84
+ case 'order-id':
85
+ $row[] = $order_id;
86
+ break;
87
+ case 'order-number':
88
+ $row[] = $order->get_order_number();
89
+ break;
90
+ case 'order-status':
91
+ $row[] = $order->get_status();
92
+ break;
93
+ case 'order-date':
94
+ $row[] = get_the_date( get_option( 'date_format' ), $order_id );
95
+ break;
96
+ case 'order-time':
97
+ $row[] = get_the_time( get_option( 'time_format' ), $order_id );
98
+ break;
99
+ case 'order-item-count':
100
+ $row[] = $order->get_item_count();
101
+ break;
102
+ case 'order-items':
103
+ $row[] = $items;
104
+ break;
105
+ case 'order-items-product-input-fields':
106
+ $row[] = $items_product_input_fields;
107
+ break;
108
+ case 'order-currency':
109
+ $row[] = $order->get_order_currency();
110
+ break;
111
+ case 'order-total':
112
+ $row[] = $order->get_total();
113
+ break;
114
+ case 'order-total-tax':
115
+ $row[] = $order->get_total_tax();
116
+ break;
117
+ case 'order-payment-method':
118
+ $row[] = $order->payment_method_title;
119
+ break;
120
+ case 'order-notes':
121
+ $row[] = $order->customer_note;
122
+ break;
123
+ case 'billing-first-name':
124
+ $row[] = $order->billing_first_name;
125
+ break;
126
+ case 'billing-last-name':
127
+ $row[] = $order->billing_last_name;
128
+ break;
129
+ case 'billing-company':
130
+ $row[] = $order->billing_company;
131
+ break;
132
+ case 'billing-address-1':
133
+ $row[] = $order->billing_address_1;
134
+ break;
135
+ case 'billing-address-2':
136
+ $row[] = $order->billing_address_2;
137
+ break;
138
+ case 'billing-city':
139
+ $row[] = $order->billing_city;
140
+ break;
141
+ case 'billing-state':
142
+ $row[] = $order->billing_state;
143
+ break;
144
+ case 'billing-postcode':
145
+ $row[] = $order->billing_postcode;
146
+ break;
147
+ case 'billing-country':
148
+ $row[] = $order->billing_country;
149
+ break;
150
+ case 'billing-phone':
151
+ $row[] = $order->billing_phone;
152
+ break;
153
+ case 'billing-email':
154
+ $row[] = $order->billing_email;
155
+ break;
156
+ case 'shipping-first-name':
157
+ $row[] = $order->shipping_first_name;
158
+ break;
159
+ case 'shipping-last-name':
160
+ $row[] = $order->shipping_last_name;
161
+ break;
162
+ case 'shipping-company':
163
+ $row[] = $order->shipping_company;
164
+ break;
165
+ case 'shipping-address-1':
166
+ $row[] = $order->shipping_address_1;
167
+ break;
168
+ case 'shipping-address-2':
169
+ $row[] = $order->shipping_address_2;
170
+ break;
171
+ case 'shipping-city':
172
+ $row[] = $order->shipping_city;
173
+ break;
174
+ case 'shipping-state':
175
+ $row[] = $order->shipping_state;
176
+ break;
177
+ case 'shipping-postcode':
178
+ $row[] = $order->shipping_postcode;
179
+ break;
180
+ case 'shipping-country':
181
+ $row[] = $order->shipping_country;
182
+ break;
183
+ }
184
+ }
185
+ return $row;
186
+ }
187
+
188
+ /**
189
+ * export_orders.
190
+ *
191
+ * @version 2.5.9
192
+ * @since 2.4.8
193
+ * @todo (maybe) metainfo as separate column
194
+ */
195
+ function export_orders( $fields_helper ) {
196
+
197
+ // Standard Fields
198
+ $all_fields = $fields_helper->get_order_export_fields();
199
+ $fields_ids = get_option( 'wcj_export_orders_fields', $fields_helper->get_order_export_default_fields_ids() );
200
+ $titles = array();
201
+ foreach( $fields_ids as $field_id ) {
202
+ $titles[] = $all_fields[ $field_id ];
203
+ }
204
+
205
+ // Additional Fields
206
+ $total_number = apply_filters( 'booster_get_option', 1, get_option( 'wcj_export_orders_fields_additional_total_number', 1 ) );
207
+ for ( $i = 1; $i <= $total_number; $i++ ) {
208
+ if ( 'yes' === get_option( 'wcj_export_orders_fields_additional_enabled_' . $i, 'no' ) ) {
209
+ $titles[] = get_option( 'wcj_export_orders_fields_additional_title_' . $i, '' );
210
+ }
211
+ }
212
+
213
+ $data = array();
214
+ $data[] = $titles;
215
+ $offset = 0;
216
+ $block_size = 1024;
217
+ while( true ) {
218
+ $args_orders = array(
219
+ 'post_type' => 'shop_order',
220
+ 'post_status' => 'any',
221
+ 'posts_per_page' => $block_size,
222
+ 'orderby' => 'date',
223
+ 'order' => 'DESC',
224
+ 'offset' => $offset,
225
+ 'fields' => 'ids',
226
+ );
227
+ $loop_orders = new WP_Query( $args_orders );
228
+ if ( ! $loop_orders->have_posts() ) break;
229
+ foreach ( $loop_orders->posts as $order_id ) {
230
+ $order = wc_get_order( $order_id );
231
+
232
+ if ( isset( $_POST['wcj_filter_by_order_billing_country'] ) && '' != $_POST['wcj_filter_by_order_billing_country'] ) {
233
+ if ( $order->billing_country != $_POST['wcj_filter_by_order_billing_country'] ) {
234
+ continue;
235
+ }
236
+ }
237
+
238
+ $filter_by_product_title = true;
239
+ if ( isset( $_POST['wcj_filter_by_product_title'] ) && '' != $_POST['wcj_filter_by_product_title'] ) {
240
+ $filter_by_product_title = false;
241
+ }
242
+ $items = array();
243
+ $items_product_input_fields = array();
244
+ foreach ( $order->get_items() as $item_id => $item ) {
245
+ if ( in_array( 'order-items', $fields_ids ) ) {
246
+ $meta_info = ( 0 != $item['variation_id'] ) ? wcj_get_order_item_meta_info( $item_id, $item, $order, true ) : '';
247
+ if ( '' != $meta_info ) {
248
+ $meta_info = ' [' . $meta_info . ']';
249
+ }
250
+ $items[] = $item['name'] . $meta_info;
251
+ }
252
+ if ( in_array( 'order-items-product-input-fields', $fields_ids ) ) {
253
+ $item_product_input_fields = wcj_get_product_input_fields( $item );
254
+ if ( '' != $item_product_input_fields ) {
255
+ $items_product_input_fields[] = $item_product_input_fields;
256
+ }
257
+ }
258
+ if ( ! $filter_by_product_title ) {
259
+ // if ( $item['name'] === $_POST['wcj_filter_by_product_title'] ) {
260
+ if ( false !== strpos( $item['name'], $_POST['wcj_filter_by_product_title'] ) ) {
261
+ $filter_by_product_title = true;
262
+ }
263
+ }
264
+ }
265
+ $items = implode( ' / ', $items );
266
+ $items_product_input_fields = implode( ' / ', $items_product_input_fields );
267
+ if ( ! $filter_by_product_title ) {
268
+ continue;
269
+ }
270
+
271
+ $row = $this->get_export_orders_row( $fields_ids, $order_id, $order, $items, $items_product_input_fields, null, null );
272
+
273
+ // Additional Fields
274
+ $total_number = apply_filters( 'booster_get_option', 1, get_option( 'wcj_export_orders_fields_additional_total_number', 1 ) );
275
+ for ( $i = 1; $i <= $total_number; $i++ ) {
276
+ if ( 'yes' === get_option( 'wcj_export_orders_fields_additional_enabled_' . $i, 'no' ) ) {
277
+ if ( '' != ( $additional_field_value = get_option( 'wcj_export_orders_fields_additional_value_' . $i, '' ) ) ) {
278
+ if ( 'meta' === get_option( 'wcj_export_orders_fields_additional_type_' . $i, 'meta' ) ) {
279
+ $row[] = get_post_meta( $order_id, $additional_field_value, true );
280
+ } else {
281
+ global $post;
282
+ $post = get_post( $order_id );
283
+ setup_postdata( $post );
284
+ $row[] = do_shortcode( $additional_field_value );
285
+ wp_reset_postdata();
286
+ }
287
+ } else {
288
+ $row[] = '';
289
+ }
290
+ }
291
+ }
292
+
293
+ $data[] = $row;
294
+ }
295
+ $offset += $block_size;
296
+ }
297
+ return $data;
298
+ }
299
+
300
+ /**
301
+ * export_orders_items.
302
+ *
303
+ * @version 2.5.9
304
+ * @since 2.5.9
305
+ */
306
+ function export_orders_items( $fields_helper ) {
307
+
308
+ // Standard Fields
309
+ $all_fields = $fields_helper->get_order_items_export_fields();
310
+ $fields_ids = get_option( 'wcj_export_orders_items_fields', $fields_helper->get_order_items_export_default_fields_ids() );
311
+ $titles = array();
312
+ foreach( $fields_ids as $field_id ) {
313
+ $titles[] = $all_fields[ $field_id ];
314
+ }
315
+
316
+ // Additional Fields
317
+ $total_number = apply_filters( 'booster_get_option', 1, get_option( 'wcj_export_orders_items_fields_additional_total_number', 1 ) );
318
+ for ( $i = 1; $i <= $total_number; $i++ ) {
319
+ if ( 'yes' === get_option( 'wcj_export_orders_items_fields_additional_enabled_' . $i, 'no' ) ) {
320
+ $titles[] = get_option( 'wcj_export_orders_items_fields_additional_title_' . $i, '' );
321
+ }
322
+ }
323
+
324
+ $data = array();
325
+ $data[] = $titles;
326
+ $offset = 0;
327
+ $block_size = 1024;
328
+ while( true ) {
329
+ $args_orders = array(
330
+ 'post_type' => 'shop_order',
331
+ 'post_status' => 'any',
332
+ 'posts_per_page' => $block_size,
333
+ 'orderby' => 'date',
334
+ 'order' => 'DESC',
335
+ 'offset' => $offset,
336
+ 'fields' => 'ids',
337
+ );
338
+ $loop_orders = new WP_Query( $args_orders );
339
+ if ( ! $loop_orders->have_posts() ) break;
340
+ foreach ( $loop_orders->posts as $order_id ) {
341
+ $order = wc_get_order( $order_id );
342
+
343
+ if ( isset( $_POST['wcj_filter_by_order_billing_country'] ) && '' != $_POST['wcj_filter_by_order_billing_country'] ) {
344
+ if ( $order->billing_country != $_POST['wcj_filter_by_order_billing_country'] ) {
345
+ continue;
346
+ }
347
+ }
348
+
349
+ foreach ( $order->get_items() as $item_id => $item ) {
350
+
351
+ $row = $this->get_export_orders_row( $fields_ids, $order_id, $order, null, null, $item, $item_id );
352
+
353
+ // Additional Fields
354
+ $total_number = apply_filters( 'booster_get_option', 1, get_option( 'wcj_export_orders_items_fields_additional_total_number', 1 ) );
355
+ for ( $i = 1; $i <= $total_number; $i++ ) {
356
+ if ( 'yes' === get_option( 'wcj_export_orders_items_fields_additional_enabled_' . $i, 'no' ) ) {
357
+ if ( '' != ( $additional_field_value = get_option( 'wcj_export_orders_items_fields_additional_value_' . $i, '' ) ) ) {
358
+ if ( 'meta' === get_option( 'wcj_export_orders_items_fields_additional_type_' . $i, 'meta' ) ) {
359
+ $row[] = get_post_meta( $order_id, $additional_field_value, true );
360
+ } elseif ( 'meta_product' === get_option( 'wcj_export_orders_items_fields_additional_type_' . $i, 'meta' ) ) {
361
+ $product_id = ( 0 != $item['variation_id'] ) ? $item['variation_id'] : $item['product_id'];
362
+ $row[] = get_post_meta( $product_id, $additional_field_value, true );
363
+ } elseif ( 'shortcode' === get_option( 'wcj_export_orders_items_fields_additional_type_' . $i, 'meta' ) ) {
364
+ global $post;
365
+ $post = get_post( $order_id );
366
+ setup_postdata( $post );
367
+ $row[] = do_shortcode( $additional_field_value );
368
+ wp_reset_postdata();
369
+ } elseif ( 'shortcode_product' === get_option( 'wcj_export_orders_items_fields_additional_type_' . $i, 'meta' ) ) {
370
+ global $post;
371
+ $product_id = ( 0 != $item['variation_id'] ) ? $item['variation_id'] : $item['product_id'];
372
+ $post = get_post( $product_id );
373
+ setup_postdata( $post );
374
+ $row[] = do_shortcode( $additional_field_value );
375
+ wp_reset_postdata();
376
+ }
377
+ } else {
378
+ $row[] = '';
379
+ }
380
+ }
381
+ }
382
+
383
+ $data[] = $row;
384
+ }
385
+ }
386
+ $offset += $block_size;
387
+ }
388
+ return $data;
389
+ }
390
+
391
+ }
392
+
393
+ endif;
394
+
395
+ return new WCJ_Exporter_Orders();
includes/export/class-wcj-exporter-products.php ADDED
@@ -0,0 +1,277 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * WooCommerce Jetpack Exporter Products
4
+ *
5
+ * The WooCommerce Jetpack Exporter Products class.
6
+ *
7
+ * @version 2.5.9
8
+ * @since 2.5.9
9
+ * @author Algoritmika Ltd.
10
+ */
11
+
12
+ if ( ! defined( 'ABSPATH' ) ) exit;
13
+
14
+ if ( ! class_exists( 'WCJ_Exporter_Products' ) ) :
15
+
16
+ class WCJ_Exporter_Products {
17
+
18
+ /**
19
+ * Constructor.
20
+ *
21
+ * @version 2.5.9
22
+ * @since 2.5.9
23
+ */
24
+ function __construct() {
25
+ return true;
26
+ }
27
+
28
+ /**
29
+ * get_variable_or_grouped_product_info.
30
+ *
31
+ * @version 2.5.7
32
+ * @since 2.5.7
33
+ */
34
+ function get_variable_or_grouped_product_info( $_product, $which_info ) {
35
+ $all_variations_data = array();
36
+ foreach ( $_product->get_children() as $child_id ) {
37
+ $variation = $_product->get_child( $child_id );
38
+ switch ( $which_info ) {
39
+ case 'price':
40
+ $all_variations_data[] = ( '' === $variation->get_price() ) ? '-' : $variation->get_price();
41
+ break;
42
+ case 'regular_price':
43
+ $all_variations_data[] = ( '' === $variation->get_regular_price() ) ? '-' : $variation->get_regular_price();
44
+ break;
45
+ case 'sale_price':
46
+ $all_variations_data[] = ( '' === $variation->get_sale_price() ) ? '-' : $variation->get_sale_price();
47
+ break;
48
+ case 'total_stock':
49
+ $all_variations_data[] = ( null === $variation->get_total_stock() ) ? '-' : $variation->get_total_stock();
50
+ break;
51
+ case 'stock_quantity':
52
+ $all_variations_data[] = ( null === $variation->get_stock_quantity() ) ? '-' : $variation->get_stock_quantity();
53
+ break;
54
+ }
55
+ }
56
+ return implode( '/', $all_variations_data );
57
+ }
58
+
59
+ /**
60
+ * export_products.
61
+ *
62
+ * @version 2.5.9
63
+ * @since 2.5.3
64
+ * @todo export variations; product attributes;
65
+ */
66
+ function export_products( $fields_helper ) {
67
+
68
+ // Standard Fields
69
+ $all_fields = $fields_helper->get_product_export_fields();
70
+ $fields_ids = get_option( 'wcj_export_products_fields', $fields_helper->get_product_export_default_fields_ids() );
71
+ $titles = array();
72
+ foreach( $fields_ids as $field_id ) {
73
+ $titles[] = $all_fields[ $field_id ];
74
+ }
75
+
76
+ // Additional Fields
77
+ $total_number = apply_filters( 'booster_get_option', 1, get_option( 'wcj_export_products_fields_additional_total_number', 1 ) );
78
+ for ( $i = 1; $i <= $total_number; $i++ ) {
79
+ if ( 'yes' === get_option( 'wcj_export_products_fields_additional_enabled_' . $i, 'no' ) ) {
80
+ $titles[] = get_option( 'wcj_export_products_fields_additional_title_' . $i, '' );
81
+ }
82
+ }
83
+
84
+ $data = array();
85
+ $data[] = $titles;
86
+ $offset = 0;
87
+ $block_size = 1024;
88
+ while( true ) {
89
+ $args = array(
90
+ 'post_type' => 'product',
91
+ 'post_status' => 'any',
92
+ 'posts_per_page' => $block_size,
93
+ 'orderby' => 'date',
94
+ 'order' => 'DESC',
95
+ 'offset' => $offset,
96
+ 'fields' => 'ids',
97
+ );
98
+ $loop = new WP_Query( $args );
99
+ if ( ! $loop->have_posts() ) {
100
+ break;
101
+ }
102
+ foreach ( $loop->posts as $product_id ) {
103
+ $_product = wc_get_product( $product_id );
104
+ $row = array();
105
+ foreach( $fields_ids as $field_id ) {
106
+ switch ( $field_id ) {
107
+ case 'product-id':
108
+ $row[] = $product_id;
109
+ break;
110
+ case 'product-name':
111
+ $row[] = $_product->get_title();
112
+ break;
113
+ case 'product-sku':
114
+ $row[] = $_product->get_sku();
115
+ break;
116
+ case 'product-stock-quantity':
117
+ $row[] = ( $_product->is_type( 'variable' ) || $_product->is_type( 'grouped' ) ?
118
+ $this->get_variable_or_grouped_product_info( $_product, 'stock_quantity' ) : $_product->get_stock_quantity() );
119
+ break;
120
+ case 'product-stock':
121
+ $row[] = ( $_product->is_type( 'variable' ) || $_product->is_type( 'grouped' ) ?
122
+ $this->get_variable_or_grouped_product_info( $_product, 'total_stock' ) : $_product->get_total_stock() );
123
+ break;
124
+ case 'product-regular-price':
125
+ $row[] = ( $_product->is_type( 'variable' ) || $_product->is_type( 'grouped' ) ?
126
+ $this->get_variable_or_grouped_product_info( $_product, 'regular_price' ) : $_product->get_regular_price() );
127
+ break;
128
+ case 'product-sale-price':
129
+ $row[] = ( $_product->is_type( 'variable' ) || $_product->is_type( 'grouped' ) ?
130
+ $this->get_variable_or_grouped_product_info( $_product, 'sale_price' ) : $_product->get_sale_price() );
131
+ break;
132
+ case 'product-price':
133
+ $row[] = ( $_product->is_type( 'variable' ) || $_product->is_type( 'grouped' ) ?
134
+ $this->get_variable_or_grouped_product_info( $_product, 'price' ) : $_product->get_price() );
135
+ break;
136
+ case 'product-type':
137
+ $row[] = $_product->get_type();
138
+ break;
139
+ /* case 'product-attributes':
140
+ $row[] = ( ! empty( $_product->get_attributes() ) ? serialize( $_product->get_attributes() ) : '' );
141
+ break; */
142
+ case 'product-image-url':
143
+ $row[] = wcj_get_product_image_url( $product_id, 'full' );
144
+ break;
145
+ case 'product-short-description':
146
+ $row[] = $_product->post->post_excerpt;
147
+ break;
148
+ case 'product-description':
149
+ $row[] = $_product->post->post_content;
150
+ break;
151
+ case 'product-status':
152
+ $row[] = $_product->post->post_status;
153
+ break;
154
+ case 'product-url':
155
+ $row[] = $_product->get_permalink();
156
+ break;
157
+ case 'product-shipping-class':
158
+ $row[] = $_product->get_shipping_class();
159
+ break;
160
+ case 'product-shipping-class-id':
161
+ $row[] = $_product->get_shipping_class_id();
162
+ break;
163
+ case 'product-width':
164
+ $row[] = $_product->get_width();
165
+ break;
166
+ case 'product-length':
167
+ $row[] = $_product->get_length();
168
+ break;
169
+ case 'product-height':
170
+ $row[] = $_product->get_height();
171
+ break;
172
+ case 'product-weight':
173
+ $row[] = $_product->get_weight();
174
+ break;
175
+ case 'product-downloadable':
176
+ $row[] = $_product->downloadable;
177
+ break;
178
+ case 'product-virtual':
179
+ $row[] = $_product->virtual;
180
+ break;
181
+ case 'product-sold-individually':
182
+ $row[] = $_product->sold_individually;
183
+ break;
184
+ case 'product-tax-status':
185
+ $row[] = $_product->get_tax_status();
186
+ break;
187
+ case 'product-tax-class':
188
+ $row[] = $_product->get_tax_class();
189
+ break;
190
+ case 'product-manage-stock':
191
+ $row[] = $_product->manage_stock;
192
+ break;
193
+ case 'product-stock-status':
194
+ $row[] = $_product->stock_status;
195
+ break;
196
+ case 'product-backorders':
197
+ $row[] = $_product->backorders;
198
+ break;
199
+ case 'product-featured':
200
+ $row[] = $_product->featured;
201
+ break;
202
+ case 'product-visibility':
203
+ $row[] = $_product->visibility;
204
+ break;
205
+ case 'product-price-including-tax':
206
+ $row[] = $_product->get_price_including_tax();
207
+ break;
208
+ case 'product-price-excluding-tax':
209
+ $row[] = $_product->get_price_excluding_tax();
210
+ break;
211
+ case 'product-display-price':
212
+ $row[] = $_product->get_display_price();
213
+ break;
214
+ case 'product-average-rating':
215
+ $row[] = $_product->get_average_rating();
216
+ break;
217
+ case 'product-rating-count':
218
+ $row[] = $_product->get_rating_count();
219
+ break;
220
+ case 'product-review-count':
221
+ $row[] = $_product->get_review_count();
222
+ break;
223
+ case 'product-categories':
224
+ $row[] = $_product->get_categories();
225
+ break;
226
+ case 'product-tags':
227
+ $row[] = $_product->get_tags();
228
+ break;
229
+ case 'product-dimensions':
230
+ $row[] = $_product->get_dimensions();
231
+ break;
232
+ case 'product-formatted-name':
233
+ $row[] = $_product->get_formatted_name();
234
+ break;
235
+ case 'product-availability':
236
+ $availability = $_product->get_availability();
237
+ $row[] = $availability['availability'];
238
+ break;
239
+ case 'product-availability-class':
240
+ $availability = $_product->get_availability();
241
+ $row[] = $availability['class'];
242
+ break;
243
+ }
244
+ }
245
+
246
+ // Additional Fields
247
+ $total_number = apply_filters( 'booster_get_option', 1, get_option( 'wcj_export_products_fields_additional_total_number', 1 ) );
248
+ for ( $i = 1; $i <= $total_number; $i++ ) {
249
+ if ( 'yes' === get_option( 'wcj_export_products_fields_additional_enabled_' . $i, 'no' ) ) {
250
+ if ( '' != ( $additional_field_value = get_option( 'wcj_export_products_fields_additional_value_' . $i, '' ) ) ) {
251
+ if ( 'meta' === get_option( 'wcj_export_products_fields_additional_type_' . $i, 'meta' ) ) {
252
+ $row[] = get_post_meta( $product_id, $additional_field_value, true );
253
+ } else {
254
+ global $post;
255
+ $post = get_post( $product_id );
256
+ setup_postdata( $post );
257
+ $row[] = do_shortcode( $additional_field_value );
258
+ wp_reset_postdata();
259
+ }
260
+ } else {
261
+ $row[] = '';
262
+ }
263
+ }
264
+ }
265
+
266
+ $data[] = $row;
267
+ }
268
+ $offset += $block_size;
269
+ }
270
+ return $data;
271
+ }
272
+
273
+ }
274
+
275
+ endif;
276
+
277
+ return new WCJ_Exporter_Products();
includes/export/class-wcj-fields-helper.php ADDED
@@ -0,0 +1,354 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * WooCommerce Jetpack Export Fields Helper
4
+ *
5
+ * The WooCommerce Jetpack Export Fields Helper class.
6
+ *
7
+ * @version 2.5.9
8
+ * @since 2.5.9
9
+ * @author Algoritmika Ltd.
10
+ */
11
+
12
+ if ( ! defined( 'ABSPATH' ) ) exit;
13
+
14
+ if ( ! class_exists( 'WCJ_Export_Fields_Helper' ) ) :
15
+
16
+ class WCJ_Export_Fields_Helper {
17
+
18
+ /**
19
+ * Constructor.
20
+ *
21
+ * @version 2.5.9
22
+ * @since 2.5.9
23
+ */
24
+ function __construct() {
25
+ }
26
+
27
+ /**
28
+ * get_customer_from_order_export_fields.
29
+ *
30
+ * @version 2.5.9
31
+ * @since 2.5.9
32
+ */
33
+ function get_customer_from_order_export_fields() {
34
+ return array(
35
+ 'customer-nr' => __( 'Customer Nr.', 'woocommerce-jetpack' ),
36
+ 'customer-billing-email' => __( 'Billing Email', 'woocommerce-jetpack' ),
37
+ 'customer-billing-first-name' => __( 'Billing First Name', 'woocommerce-jetpack' ),
38
+ 'customer-billing-last-name' => __( 'Billing Last Name', 'woocommerce-jetpack' ),
39
+ 'customer-billing-company' => __( 'Billing Company', 'woocommerce-jetpack' ),
40
+ 'customer-billing-address-1' => __( 'Billing Address 1', 'woocommerce-jetpack' ),
41
+ 'customer-billing-address-2' => __( 'Billing Address 2', 'woocommerce-jetpack' ),
42
+ 'customer-billing-city' => __( 'Billing City', 'woocommerce-jetpack' ),
43
+ 'customer-billing-state' => __( 'Billing State', 'woocommerce-jetpack' ),
44
+ 'customer-billing-postcode' => __( 'Billing Postcode', 'woocommerce-jetpack' ),
45
+ 'customer-billing-country' => __( 'Billing Country', 'woocommerce-jetpack' ),
46
+ 'customer-billing-phone' => __( 'Billing Phone', 'woocommerce-jetpack' ),
47
+ 'customer-last-order-date' => __( 'Last Order Date', 'woocommerce-jetpack' ),
48
+ );
49
+ }
50
+
51
+ /**
52
+ * get_customer_from_order_export_default_fields_ids.
53
+ *
54
+ * @version 2.5.9
55
+ * @since 2.5.9
56
+ */
57
+ function get_customer_from_order_export_default_fields_ids() {
58
+ return array(
59
+ 'customer-nr',
60
+ 'customer-billing-email',
61
+ 'customer-billing-first-name',
62
+ 'customer-billing-last-name',
63
+ 'customer-last-order-date',
64
+ );
65
+ }
66
+
67
+ /**
68
+ * get_customer_export_fields.
69
+ *
70
+ * @version 2.5.9
71
+ * @since 2.5.9
72
+ */
73
+ function get_customer_export_fields() {
74
+ return array(
75
+ 'customer-id' => __( 'Customer ID', 'woocommerce-jetpack' ),
76
+ 'customer-email' => __( 'Email', 'woocommerce-jetpack' ),
77
+ 'customer-first-name' => __( 'First Name', 'woocommerce-jetpack' ),
78
+ 'customer-last-name' => __( 'Last Name', 'woocommerce-jetpack' ),
79
+ 'customer-login' => __( 'Login', 'woocommerce-jetpack' ),
80
+ 'customer-nicename' => __( 'Nicename', 'woocommerce-jetpack' ),
81
+ 'customer-url' => __( 'URL', 'woocommerce-jetpack' ),
82
+ 'customer-registered' => __( 'Registered', 'woocommerce-jetpack' ),
83
+ 'customer-display-name' => __( 'Display Name', 'woocommerce-jetpack' ),
84
+ // 'customer-debug' => __( 'Debug', 'woocommerce-jetpack' ),
85
+ );
86
+ }
87
+
88
+ /**
89
+ * get_customer_export_default_fields_ids.
90
+ *
91
+ * @version 2.5.9
92
+ * @since 2.5.9
93
+ */
94
+ function get_customer_export_default_fields_ids() {
95
+ return array(
96
+ 'customer-id',
97
+ 'customer-email',
98
+ 'customer-first-name',
99
+ 'customer-last-name',
100
+ );
101
+ }
102
+
103
+ /**
104
+ * get_order_items_export_fields.
105
+ *
106
+ * @version 2.5.9
107
+ * @since 2.5.9
108
+ */
109
+ function get_order_items_export_fields() {
110
+ return array(
111
+ 'order-id' => __( 'Order ID', 'woocommerce-jetpack' ),
112
+ 'order-number' => __( 'Order Number', 'woocommerce-jetpack' ),
113
+ 'order-status' => __( 'Order Status', 'woocommerce-jetpack' ),
114
+ 'order-date' => __( 'Order Date', 'woocommerce-jetpack' ),
115
+ 'order-time' => __( 'Order Time', 'woocommerce-jetpack' ),
116
+ 'order-item-count' => __( 'Order Item Count', 'woocommerce-jetpack' ),
117
+ 'order-currency' => __( 'Order Currency', 'woocommerce-jetpack' ),
118
+ 'order-total' => __( 'Order Total', 'woocommerce-jetpack' ),
119
+ 'order-total-tax' => __( 'Order Total Tax', 'woocommerce-jetpack' ),
120
+ 'order-payment-method' => __( 'Order Payment Method', 'woocommerce-jetpack' ),
121
+ 'order-notes' => __( 'Order Notes', 'woocommerce-jetpack' ),
122
+ 'billing-first-name' => __( 'Billing First Name', 'woocommerce-jetpack' ),
123
+ 'billing-last-name' => __( 'Billing Last Name', 'woocommerce-jetpack' ),
124
+ 'billing-company' => __( 'Billing Company', 'woocommerce-jetpack' ),
125
+ 'billing-address-1' => __( 'Billing Address 1', 'woocommerce-jetpack' ),
126
+ 'billing-address-2' => __( 'Billing Address 2', 'woocommerce-jetpack' ),
127
+ 'billing-city' => __( 'Billing City', 'woocommerce-jetpack' ),
128
+ 'billing-state' => __( 'Billing State', 'woocommerce-jetpack' ),
129
+ 'billing-postcode' => __( 'Billing Postcode', 'woocommerce-jetpack' ),
130
+ 'billing-country' => __( 'Billing Country', 'woocommerce-jetpack' ),
131
+ 'billing-phone' => __( 'Billing Phone', 'woocommerce-jetpack' ),
132
+ 'billing-email' => __( 'Billing Email', 'woocommerce-jetpack' ),
133
+ 'shipping-first-name' => __( 'Shipping First Name', 'woocommerce-jetpack' ),
134
+ 'shipping-last-name' => __( 'Shipping Last Name', 'woocommerce-jetpack' ),
135
+ 'shipping-company' => __( 'Shipping Company', 'woocommerce-jetpack' ),
136
+ 'shipping-address-1' => __( 'Shipping Address 1', 'woocommerce-jetpack' ),
137
+ 'shipping-address-2' => __( 'Shipping Address 2', 'woocommerce-jetpack' ),
138
+ 'shipping-city' => __( 'Shipping City', 'woocommerce-jetpack' ),
139
+ 'shipping-state' => __( 'Shipping State', 'woocommerce-jetpack' ),
140
+ 'shipping-postcode' => __( 'Shipping Postcode', 'woocommerce-jetpack' ),
141
+ 'shipping-country' => __( 'Shipping Country', 'woocommerce-jetpack' ),
142
+
143
+ 'item-name' => __( 'Item Name', 'woocommerce-jetpack' ),
144
+ 'item-meta' => __( 'Item Meta', 'woocommerce-jetpack' ),
145
+ 'item-variation-meta' => __( 'Item Variation Meta', 'woocommerce-jetpack' ),
146
+ 'item-qty' => __( 'Item Quantity', 'woocommerce-jetpack' ),
147
+ 'item-tax-class' => __( 'Item Tax Class', 'woocommerce-jetpack' ),
148
+ 'item-product-id' => __( 'Item Product ID', 'woocommerce-jetpack' ),
149
+ 'item-variation-id' => __( 'Item Variation ID', 'woocommerce-jetpack' ),
150
+ 'item-line-subtotal' => __( 'Item Line Subtotal', 'woocommerce-jetpack' ),
151
+ 'item-line-total' => __( 'Item Line Total', 'woocommerce-jetpack' ),
152
+ 'item-line-subtotal-tax' => __( 'Item Line Subtotal Tax', 'woocommerce-jetpack' ),
153
+ 'item-line-tax' => __( 'Item Line Tax', 'woocommerce-jetpack' ),
154
+ 'item-line-subtotal-plus-tax' => __( 'Item Line Subtotal Plus Tax', 'woocommerce-jetpack' ),
155
+ 'item-line-total-plus-tax' => __( 'Item Line Total Plus Tax', 'woocommerce-jetpack' ),
156
+ 'item-product-input-fields' => __( 'Item Product Input Fields', 'woocommerce-jetpack' ),
157
+ // 'item-debug' => __( 'Item Debug', 'woocommerce-jetpack' ),
158
+ );
159
+ }
160
+
161
+ /**
162
+ * get_order_items_export_default_fields_ids.
163
+ *
164
+ * @version 2.5.9
165
+ * @since 2.5.9
166
+ */
167
+ function get_order_items_export_default_fields_ids() {
168
+ return array(
169
+ 'order-number',
170
+ 'order-status',
171
+ 'order-date',
172
+ 'order-currency',
173
+ 'order-payment-method',
174
+ 'item-name',
175
+ 'item-variation-meta',
176
+ 'item-qty',
177
+ 'item-tax-class',
178
+ 'item-product-id',
179
+ 'item-variation-id',
180
+ 'item-line-total',
181
+ 'item-line-tax',
182
+ 'item-line-total-plus-tax',
183
+ );
184
+ }
185
+
186
+ /**
187
+ * get_order_export_fields.
188
+ *
189
+ * @version 2.5.7
190
+ * @since 2.5.6
191
+ */
192
+ function get_order_export_fields() {
193
+ return array(
194
+ 'order-id' => __( 'Order ID', 'woocommerce-jetpack' ),
195
+ 'order-number' => __( 'Order Number', 'woocommerce-jetpack' ),
196
+ 'order-status' => __( 'Order Status', 'woocommerce-jetpack' ),
197
+ 'order-date' => __( 'Order Date', 'woocommerce-jetpack' ),
198
+ 'order-time' => __( 'Order Time', 'woocommerce-jetpack' ),
199
+ 'order-item-count' => __( 'Order Item Count', 'woocommerce-jetpack' ),
200
+ 'order-items' => __( 'Order Items', 'woocommerce-jetpack' ),
201
+ 'order-items-product-input-fields' => __( 'Order Items Product Input Fields', 'woocommerce-jetpack' ),
202
+ 'order-currency' => __( 'Order Currency', 'woocommerce-jetpack' ),
203
+ 'order-total' => __( 'Order Total', 'woocommerce-jetpack' ),
204
+ 'order-total-tax' => __( 'Order Total Tax', 'woocommerce-jetpack' ),
205
+ 'order-payment-method' => __( 'Order Payment Method', 'woocommerce-jetpack' ),
206
+ 'order-notes' => __( 'Order Notes', 'woocommerce-jetpack' ),
207
+ 'billing-first-name' => __( 'Billing First Name', 'woocommerce-jetpack' ),
208
+ 'billing-last-name' => __( 'Billing Last Name', 'woocommerce-jetpack' ),
209
+ 'billing-company' => __( 'Billing Company', 'woocommerce-jetpack' ),
210
+ 'billing-address-1' => __( 'Billing Address 1', 'woocommerce-jetpack' ),
211
+ 'billing-address-2' => __( 'Billing Address 2', 'woocommerce-jetpack' ),
212
+ 'billing-city' => __( 'Billing City', 'woocommerce-jetpack' ),
213
+ 'billing-state' => __( 'Billing State', 'woocommerce-jetpack' ),
214
+ 'billing-postcode' => __( 'Billing Postcode', 'woocommerce-jetpack' ),
215
+ 'billing-country' => __( 'Billing Country', 'woocommerce-jetpack' ),
216
+ 'billing-phone' => __( 'Billing Phone', 'woocommerce-jetpack' ),
217
+ 'billing-email' => __( 'Billing Email', 'woocommerce-jetpack' ),
218
+ 'shipping-first-name' => __( 'Shipping First Name', 'woocommerce-jetpack' ),
219
+ 'shipping-last-name' => __( 'Shipping Last Name', 'woocommerce-jetpack' ),
220
+ 'shipping-company' => __( 'Shipping Company', 'woocommerce-jetpack' ),
221
+ 'shipping-address-1' => __( 'Shipping Address 1', 'woocommerce-jetpack' ),
222
+ 'shipping-address-2' => __( 'Shipping Address 2', 'woocommerce-jetpack' ),
223
+ 'shipping-city' => __( 'Shipping City', 'woocommerce-jetpack' ),
224
+ 'shipping-state' => __( 'Shipping State', 'woocommerce-jetpack' ),
225
+ 'shipping-postcode' => __( 'Shipping Postcode', 'woocommerce-jetpack' ),
226
+ 'shipping-country' => __( 'Shipping Country', 'woocommerce-jetpack' ),
227
+ );
228
+ }
229
+
230
+ /**
231
+ * get_order_export_default_fields_ids.
232
+ *
233
+ * @version 2.5.7
234
+ * @since 2.5.6
235
+ */
236
+ function get_order_export_default_fields_ids() {
237
+ return array(
238
+ 'order-id',
239
+ 'order-number',
240
+ 'order-status',
241
+ 'order-date',
242
+ 'order-time',
243
+ 'order-item-count',
244
+ 'order-items',
245
+ 'order-currency',
246
+ 'order-total',
247
+ 'order-total-tax',
248
+ 'order-payment-method',
249
+ 'order-notes',
250
+ 'billing-first-name',
251
+ 'billing-last-name',
252
+ 'billing-company',
253
+ 'billing-address-1',
254
+ 'billing-address-2',
255
+ 'billing-city',
256
+ 'billing-state',
257
+ 'billing-postcode',
258
+ 'billing-country',
259
+ 'billing-phone',
260
+ 'billing-email',
261
+ 'shipping-first-name',
262
+ 'shipping-last-name',
263
+ 'shipping-company',
264
+ 'shipping-address-1',
265
+ 'shipping-address-2',
266
+ 'shipping-city',
267
+ 'shipping-state',
268
+ 'shipping-postcode',
269
+ 'shipping-country',
270
+ );
271
+ }
272
+
273
+ /**
274
+ * get_product_export_fields.
275
+ *
276
+ * @version 2.5.9
277
+ * @since 2.5.7
278
+ */
279
+ function get_product_export_fields() {
280
+ return array(
281
+ 'product-id' => __( 'Product ID', 'woocommerce-jetpack' ),
282
+ 'product-name' => __( 'Name', 'woocommerce-jetpack' ),
283
+ 'product-sku' => __( 'SKU', 'woocommerce-jetpack' ),
284
+ 'product-stock' => __( 'Total Stock', 'woocommerce-jetpack' ),
285
+ 'product-stock-quantity' => __( 'Stock Quantity', 'woocommerce-jetpack' ),
286
+ 'product-regular-price' => __( 'Regular Price', 'woocommerce-jetpack' ),
287
+ 'product-sale-price' => __( 'Sale Price', 'woocommerce-jetpack' ),
288
+ 'product-price' => __( 'Price', 'woocommerce-jetpack' ),
289
+ 'product-type' => __( 'Type', 'woocommerce-jetpack' ),
290
+ // 'product-attributes' => __( 'Attributes', 'woocommerce-jetpack' ),
291
+ 'product-image-url' => __( 'Image URL', 'woocommerce-jetpack' ),
292
+ 'product-short-description' => __( 'Short Description', 'woocommerce-jetpack' ),
293
+ 'product-description' => __( 'Description', 'woocommerce-jetpack' ),
294
+ 'product-status' => __( 'Status', 'woocommerce-jetpack' ),
295
+ 'product-url' => __( 'URL', 'woocommerce-jetpack' ),
296
+ 'product-shipping-class' => __( 'Shipping Class', 'woocommerce-jetpack' ),
297
+ 'product-shipping-class-id' => __( 'Shipping Class ID', 'woocommerce-jetpack' ),
298
+ 'product-width' => __( 'Width', 'woocommerce-jetpack' ),
299
+ 'product-length' => __( 'Length', 'woocommerce-jetpack' ),
300
+ 'product-height' => __( 'Height', 'woocommerce-jetpack' ),
301
+ 'product-weight' => __( 'Weight', 'woocommerce-jetpack' ),
302
+ 'product-downloadable' => __( 'Downloadable', 'woocommerce-jetpack' ),
303
+ 'product-virtual' => __( 'Virtual', 'woocommerce-jetpack' ),
304
+ 'product-sold-individually' => __( 'Sold Individually', 'woocommerce-jetpack' ),
305
+ 'product-tax-status' => __( 'Tax Status', 'woocommerce-jetpack' ),
306
+ 'product-tax-class' => __( 'Tax Class', 'woocommerce-jetpack' ),
307
+ 'product-manage-stock' => __( 'Manage Stock', 'woocommerce-jetpack' ),
308
+ 'product-stock-status' => __( 'Stock Status', 'woocommerce-jetpack' ),
309
+ 'product-backorders' => __( 'Backorders', 'woocommerce-jetpack' ),
310
+ 'product-featured' => __( 'Featured', 'woocommerce-jetpack' ),
311
+ 'product-visibility' => __( 'Visibility', 'woocommerce-jetpack' ),
312
+ 'product-price-including-tax' => __( 'Price Including Tax', 'woocommerce-jetpack' ),
313
+ 'product-price-excluding-tax' => __( 'Price Excluding Tax', 'woocommerce-jetpack' ),
314
+ 'product-display-price' => __( 'Display Price', 'woocommerce-jetpack' ),
315
+ 'product-average-rating' => __( 'Average Rating', 'woocommerce-jetpack' ),
316
+ 'product-rating-count' => __( 'Rating Count', 'woocommerce-jetpack' ),
317
+ 'product-review-count' => __( 'Review Count', 'woocommerce-jetpack' ),
318
+ 'product-categories' => __( 'Categories', 'woocommerce-jetpack' ),
319
+ 'product-tags' => __( 'Tags', 'woocommerce-jetpack' ),
320
+ 'product-dimensions' => __( 'Dimensions', 'woocommerce-jetpack' ),
321
+ 'product-formatted-name' => __( 'Formatted Name', 'woocommerce-jetpack' ),
322
+ 'product-availability' => __( 'Availability', 'woocommerce-jetpack' ),
323
+ 'product-availability-class' => __( 'Availability Class', 'woocommerce-jetpack' ),
324
+ );
325
+ }
326
+
327
+ /**
328
+ * get_product_export_default_fields_ids.
329
+ *
330
+ * @version 2.5.7
331
+ * @since 2.5.7
332
+ */
333
+ function get_product_export_default_fields_ids() {
334
+ return array(
335
+ 'product-id',
336
+ 'product-name',
337
+ 'product-sku',
338
+ 'product-stock',
339
+ 'product-regular-price',
340
+ 'product-sale-price',
341
+ 'product-price',
342
+ 'product-type',
343
+ 'product-image-url',
344
+ 'product-short-description',
345
+ 'product-status',
346
+ 'product-url',
347
+ );
348
+ }
349
+
350
+ }
351
+
352
+ endif;
353
+
354
+ return new WCJ_Export_Fields_Helper();
includes/functions/wcj-functions-number-to-words-bg.php CHANGED
@@ -4,195 +4,203 @@
4
  *
5
  * The WooCommerce Jetpack Functions.
6
  *
7
- * @version 2.5.0
8
  * @author Algoritmika Ltd.
9
  */
10
 
11
- function convert_number_to_words_bg($num, $tri = 0) {
12
- $edinici = array(
13
- 0 => "",
14
- 1 => array(
15
- 0 => " един",
16
- 1 => "",
17
- 2 => " eдин",
18
- 3 => " eдин",
19
- 4 => " eдин",
20
- 5 => " eдин",
21
- 6 => " eдин",
22
- 7 => " eдин",
23
- 8 => " eдин",
24
- 9 => " eдин",
25
- 10 => " eдин",
26
- ),
27
- 2 => array(
28
- 0 => " два",
29
- 1 => " двe",
30
- 2 => " два",
31
- 3 => " два",
32
- 4 => " два",
33
- 5 => " два",
34
- 6 => " два",
35
- 7 => " два",
36
- 8 => " два",
37
- 9 => " два",
38
- 10 => " два",
39
- ),
40
- 3 => " три",
41
- 4 => " четири",
42
- 5 => " пет",
43
- 6 => " шест",
44
- 7 => " седем",
45
- 8 => " осем",
46
- 9 => " девет",
47
- 10 => " десет",
48
- 11 => " единадесет",
49
- 12 => " дванадесет",
50
- 13 => " тринадесет",
51
- 14 => " четиринадесет",
52
- 15 => " петнадесет",
53
- 16 => " шестнадесет",
54
- 17 => " седемнадесет",
55
- 18 => " осемнадесет",
56
- 19 => " деветнадесет"
57
- );
58
-
59
- $desetici = array(
60
- 0 => "",
61
- 1 => "",
62
- 2 => " двадесет",
63
- 3 => " тридесет",
64
- 4 => " четиридесет",
65
- 5 => " петдесет",
66
- 6 => " шестдесет",
67
- 7 => " седемдесет",
68
- 8 => " осемдесет",
69
- 9 => " деведесет"
70
- );
71
-
72
- $stotici = array (
73
- 0 => "",
74
- 1 => " сто",
75
- 2 => " двеста",
76
- 3 => " триста",
77
- 4 => " четиристотин",
78
- 5 => " петстотин",
79
- 6 => " шестстотин",
80
- 7 => " седемстотин",
81
- 8 => " осемстотин",
82
- 9 => " деветстотин",
83
- );
84
-
85
- $tripleti = array(
86
- 0 => "",
87
- 1 => array(
88
- 0 => " хиляда",
89
- 1 => " хиляди"),
90
- 2 => array(
91
- 0 => " милион",
92
- 1 => " милиона"),
93
- 3 => array(
94
- 0 => " билион",
95
- 1 => " билионa"),
96
- 4 => array(
97
- 0 => " трилион",
98
- 1 => " трилиона"),
99
- 5 => array(
100
- 0 => " квадрилион",
101
- 1 => " квадрилиона"),
102
- 6 => array(
103
- 0 => " квинтилион",
104
- 1 => " квинтилиони"),
105
- 7 => array(
106
- 0 => " сикстилион",
107
- 1 => " сикстилион"),
108
- 8 => array(
109
- 0 => " септилион",
110
- 1 => " септилиони"),
111
- 9 => array(
112
- 0 => " октилион",
113
- 1 => " октилион"),
114
- 10 => array(
115
- 0 => " нонилион",
116
- 1 => " нонилиои")
117
- );
118
-
119
- //взимаме само цялата част от числото, без стойността
120
- //след десетичната запетая
121
- $n = explode(".", $num);
122
- $num = $n[0];
123
- $r = (int) ($num / 1000);
124
- $x = ($num / 100) % 10;
125
- $y = $num % 100;
126
-
127
- $str = "";
128
-
129
- // стотици
130
- if ($x > 0) {
131
- $str = $stotici[$x];
132
- }
133
- // единици и десетици
134
- if ($y < 20) {
135
- if($y == 0 && $r > 0) {
136
- $str = ' и '.$str;
137
- }
138
- if(is_array($edinici[$y]) && isset($edinici[$y][$tri])) {
139
- $str .= ' '.$edinici[$y][$tri];
140
- }
141
- else {
142
- $str .= ' '.$edinici[$y];
143
  }
144
- }
145
- else {
146
- if($edinici[$y % 10]) {
147
- $str .= $desetici[(int) ($y / 10)];
148
- $str .= ' и';
149
- if(is_array($edinici[$y % 10]) && isset($edinici[$y % 10][$tri])) {
150
- $str .= $edinici[$y % 10][$tri];
151
  }
152
  else {
153
- $str .= $edinici[$y % 10];
154
  }
155
  }
156
  else {
157
- $str .= ' и'.$desetici[(int) ($y / 10)];
 
 
 
 
 
 
 
 
 
 
 
 
158
  }
159
- }
160
-
161
- // добавяне на модификатор - хиляди, милиони, билиони
162
-
163
- if ($str != "") {
164
- //Ако има зададени опции за единствено и мн. число
165
- if(is_array($tripleti[$tri])) {
166
- //мн. число ли е?
167
- if($num > 1) {
168
- $str .= $tripleti[$tri][1];
 
 
 
169
  }
170
  else {
171
- $str .= $tripleti[$tri][0];
172
  }
 
 
173
  }
174
- else {
175
- $str .= $tripleti[$tri];
 
 
 
 
 
 
 
 
 
 
 
 
176
  }
177
- $str = str_replace('един стотин', 'сто', $str);
178
- $str = str_replace('един хиляди', 'хиляда', $str);
179
- }
180
-
181
- //ако сме на първата стъпка (т.е. определяме числото до стотици)
182
- if($tri == 0) {
183
- //добавяме префикс за лева
184
- $str .= ' лева';
185
- //и ако има сетнати стотинки ги добавяме и тях
186
- if(isset($n[1])) {
187
- $str .= ' и '.$n[1].'ст.';
188
  }
189
  }
190
-
191
- // продължаване рекрусивно?
192
- if ($r > 0) {
193
- return convert_number_to_words_bg($r, $tri+1).$str;
194
- }
195
- else {
196
- return $str;
197
- }
198
  }
4
  *
5
  * The WooCommerce Jetpack Functions.
6
  *
7
+ * @version 2.5.9
8
  * @author Algoritmika Ltd.
9
  */
10
 
11
+ if ( ! function_exists( 'convert_number_to_words_bg' ) ) {
12
+ /**
13
+ * convert_number_to_words_bg.
14
+ *
15
+ * @version 2.5.9
16
+ * @return string
17
+ */
18
+ function convert_number_to_words_bg( $num, $tri = 0 ) {
19
+ $edinici = array(
20
+ 0 => "",
21
+ 1 => array(
22
+ 0 => " един",
23
+ 1 => "",
24
+ 2 => " eдин",
25
+ 3 => " eдин",
26
+ 4 => " eдин",
27
+ 5 => " eдин",
28
+ 6 => " eдин",
29
+ 7 => " eдин",
30
+ 8 => " eдин",
31
+ 9 => " eдин",
32
+ 10 => " eдин",
33
+ ),
34
+ 2 => array(
35
+ 0 => " два",
36
+ 1 => " двe",
37
+ 2 => " два",
38
+ 3 => " два",
39
+ 4 => " два",
40
+ 5 => " два",
41
+ 6 => " два",
42
+ 7 => " два",
43
+ 8 => " два",
44
+ 9 => " два",
45
+ 10 => " два",
46
+ ),
47
+ 3 => " три",
48
+ 4 => " четири",
49
+ 5 => " пет",
50
+ 6 => " шест",
51
+ 7 => " седем",
52
+ 8 => " осем",
53
+ 9 => " девет",
54
+ 10 => " десет",
55
+ 11 => " единадесет",
56
+ 12 => " дванадесет",
57
+ 13 => " тринадесет",
58
+ 14 => " четиринадесет",
59
+ 15 => " петнадесет",
60
+ 16 => " шестнадесет",
61
+ 17 => " седемнадесет",
62
+ 18 => " осемнадесет",
63
+ 19 => " деветнадесет"
64
+ );
65
+
66
+ $desetici = array(
67
+ 0 => "",
68
+ 1 => "",
69
+ 2 => " двадесет",
70
+ 3 => " тридесет",
71
+ 4 => " четиридесет",
72
+ 5 => " петдесет",
73
+ 6 => " шестдесет",
74
+ 7 => " седемдесет",
75
+ 8 => " осемдесет",
76
+ 9 => " деведесет"
77
+ );
78
+
79
+ $stotici = array (
80
+ 0 => "",
81
+ 1 => " сто",
82
+ 2 => " двеста",
83
+ 3 => " триста",
84
+ 4 => " четиристотин",
85
+ 5 => " петстотин",
86
+ 6 => " шестстотин",
87
+ 7 => " седемстотин",
88
+ 8 => " осемстотин",
89
+ 9 => " деветстотин",
90
+ );
91
+
92
+ $tripleti = array(
93
+ 0 => "",
94
+ 1 => array(
95
+ 0 => " хиляда",
96
+ 1 => " хиляди"),
97
+ 2 => array(
98
+ 0 => " милион",
99
+ 1 => " милиона"),
100
+ 3 => array(
101
+ 0 => " билион",
102
+ 1 => " билионa"),
103
+ 4 => array(
104
+ 0 => " трилион",
105
+ 1 => " трилиона"),
106
+ 5 => array(
107
+ 0 => " квадрилион",
108
+ 1 => " квадрилиона"),
109
+ 6 => array(
110
+ 0 => " квинтилион",
111
+ 1 => " квинтилиони"),
112
+ 7 => array(
113
+ 0 => " сикстилион",
114
+ 1 => " сикстилион"),
115
+ 8 => array(
116
+ 0 => " септилион",
117
+ 1 => " септилиони"),
118
+ 9 => array(
119
+ 0 => " октилион",
120
+ 1 => " октилион"),
121
+ 10 => array(
122
+ 0 => " нонилион",
123
+ 1 => " нонилиои")
124
+ );
125
+
126
+ //взимаме само цялата част от числото, без стойността
127
+ //след десетичната запетая
128
+ $n = explode(".", $num);
129
+ $num = $n[0];
130
+ $r = (int) ($num / 1000);
131
+ $x = ($num / 100) % 10;
132
+ $y = $num % 100;
133
+
134
+ $str = "";
135
+
136
+ // стотици
137
+ if ($x > 0) {
138
+ $str = $stotici[$x];
 
 
 
 
139
  }
140
+ // единици и десетици
141
+ if ($y < 20) {
142
+ if($y == 0 && $r > 0) {
143
+ $str = ' и '.$str;
144
+ }
145
+ if(is_array($edinici[$y]) && isset($edinici[$y][$tri])) {
146
+ $str .= ' '.$edinici[$y][$tri];
147
  }
148
  else {
149
+ $str .= ' '.$edinici[$y];
150
  }
151
  }
152
  else {
153
+ if($edinici[$y % 10]) {
154
+ $str .= $desetici[(int) ($y / 10)];
155
+ $str .= ' и';
156
+ if(is_array($edinici[$y % 10]) && isset($edinici[$y % 10][$tri])) {
157
+ $str .= $edinici[$y % 10][$tri];
158
+ }
159
+ else {
160
+ $str .= $edinici[$y % 10];
161
+ }
162
+ }
163
+ else {
164
+ $str .= ' и'.$desetici[(int) ($y / 10)];
165
+ }
166
  }
167
+
168
+ // добавяне на модификатор - хиляди, милиони, билиони
169
+
170
+ if ($str != "") {
171
+ //Ако има зададени опции за единствено и мн. число
172
+ if(is_array($tripleti[$tri])) {
173
+ //мн. число ли е?
174
+ if($num > 1) {
175
+ $str .= $tripleti[$tri][1];
176
+ }
177
+ else {
178
+ $str .= $tripleti[$tri][0];
179
+ }
180
  }
181
  else {
182
+ $str .= $tripleti[$tri];
183
  }
184
+ $str = str_replace('един стотин', 'сто', $str);
185
+ $str = str_replace('един хиляди', 'хиляда', $str);
186
  }
187
+
188
+ //ако сме на първата стъпка (т.е. определяме числото до стотици)
189
+ /* if($tri == 0) {
190
+ //добавяме префикс за лева
191
+ $str .= ' лева';
192
+ //и ако има сетнати стотинки ги добавяме и тях
193
+ if(isset($n[1])) {
194
+ $str .= ' и '.$n[1].'ст.';
195
+ }
196
+ } */
197
+
198
+ // продължаване рекрусивно?
199
+ if ($r > 0) {
200
+ return convert_number_to_words_bg($r, $tri+1).$str;
201
  }
202
+ else {
203
+ return $str;
 
 
 
 
 
 
 
 
 
204
  }
205
  }
 
 
 
 
 
 
 
 
206
  }
includes/functions/wcj-functions-number-to-words-lt.php ADDED
@@ -0,0 +1,160 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * WooCommerce Jetpack Functions
4
+ *
5
+ * The WooCommerce Jetpack Functions.
6
+ *
7
+ * @version 2.5.9
8
+ * @since 2.5.9
9
+ * @author Algoritmika Ltd.
10
+ */
11
+
12
+ if ( ! function_exists( 'convert_number_to_words_lt' ) ) {
13
+ /**
14
+ * convert_number_to_words_lt.
15
+ *
16
+ * @version 2.5.9
17
+ * @since 2.5.9
18
+ * @return string
19
+ */
20
+ function convert_number_to_words_lt( $number ) {
21
+ $hyphen = ' ';
22
+ $conjunction = ' ';
23
+ $separator = ', ';
24
+ $negative = 'minus ';
25
+ $decimal = ' . ';
26
+ $dictionary = array(
27
+ 0 => 'nulis',
28
+ 1 => 'vienas',
29
+ 2 => 'du',
30
+ 3 => 'trys',
31
+ 4 => 'keturi',
32
+ 5 => 'penki',
33
+ 6 => 'šeši',
34
+ 7 => 'septyni',
35
+ 8 => 'aštuoni',
36
+ 9 => 'devyni',
37
+ 10 => 'dešimt',
38
+ 11 => 'vienuolika',
39
+ 12 => 'dvylika',
40
+ 13 => 'trylika',
41
+ 14 => 'keturiolika',
42
+ 15 => 'penkiolika',
43
+ 16 => 'šešiolika',
44
+ 17 => 'septyniolika',
45
+ 18 => 'aštoniolika',
46
+ 19 => 'devyniolika',
47
+ 20 => 'dvidešimt',
48
+ 30 => 'trisdešimt',
49
+ 40 => 'keturiasdešimt',
50
+ 50 => 'penkiasdešimt',
51
+ 60 => 'šešiasdešimt',
52
+ 70 => 'septyniasdešimt',
53
+ 80 => 'aštuoniasdešimt',
54
+ 90 => 'devyniasdešimt',
55
+ 100 => 'šimtas',
56
+ 200 => 'šimtai',
57
+ 1000 => 'tūkstantis',
58
+ 2000 => 'tūkstančiai',
59
+ 10000 => 'tūkstančių',
60
+ 1000000 => 'milijonas',
61
+ 2000000 => 'milijonai',
62
+ 10000000 => 'milijonų',
63
+ 1000000000 => 'bilijonas',
64
+ 2000000000 => 'bilijonai',
65
+ 10000000000 => 'bilijonų',
66
+ 1000000000000 => 'trilijonas',
67
+ 2000000000000 => 'trilijonai',
68
+ 10000000000000 => 'trilijonų',
69
+ 1000000000000000 => 'kvadrilijonas',
70
+ 2000000000000000 => 'kvadrilijonai',
71
+ 10000000000000000 => 'kvadrilijonų',
72
+ 1000000000000000000 => 'kvintilijonas',
73
+ 2000000000000000000 => 'kvintilijonai',
74
+ 10000000000000000000 => 'kvintilijonų',
75
+ );
76
+
77
+ if (!is_numeric($number)) {
78
+ return false;
79
+ }
80
+
81
+ if (($number >= 0 && (int) $number < 0) || (int) $number < 0 - PHP_INT_MAX) {
82
+ // overflow
83
+ trigger_error(
84
+ 'convert_number_to_words_lt only accepts numbers between -' . PHP_INT_MAX . ' and ' . PHP_INT_MAX,
85
+ E_USER_WARNING
86
+ );
87
+ return false;
88
+ }
89
+
90
+ if ($number < 0) {
91
+ return $negative . convert_number_to_words_lt(abs($number));
92
+ }
93
+
94
+ $string = $fraction = null;
95
+
96
+ if (strpos($number, '.') !== false) {
97
+ list($number, $fraction) = explode('.', $number);
98
+ }
99
+
100
+ switch (true) {
101
+ case $number < 21:
102
+ $string = $dictionary[$number];
103
+ break;
104
+ case $number < 100:
105
+ $tens = ((int) ($number / 10)) * 10;
106
+ $units = $number % 10;
107
+ $string = $dictionary[$tens];
108
+ if ($units) {
109
+ $string .= $hyphen . $dictionary[$units];
110
+ }
111
+ break;
112
+ case $number < 200:
113
+ $hundreds = $number / 100;
114
+ $remainder = $number % 100;
115
+ $string = $dictionary[$hundreds] . ' ' . $dictionary[100];
116
+ if ($remainder) {
117
+ $string .= $conjunction . convert_number_to_words_lt($remainder);
118
+ }
119
+ break;
120
+ case $number < 1000:
121
+ $hundreds = $number / 100;
122
+ $remainder = $number % 100;
123
+ $string = $dictionary[$hundreds] . ' ' . $dictionary[200];
124
+ if ($remainder) {
125
+ $string .= $conjunction . convert_number_to_words_lt($remainder);
126
+ }
127
+ break;
128
+
129
+ default:
130
+ $baseUnit = pow(1000, floor(log($number, 1000)));
131
+ $numBaseUnits = (int) ($number / $baseUnit);
132
+ $number1=(string)$number;
133
+ if ($numBaseUnits==1){
134
+ $baseUnits=$baseUnit;
135
+ }elseif($numBaseUnits <10) {
136
+ $baseUnits=$baseUnit*2;
137
+ } else {
138
+ $baseUnits=$baseUnit*10;}
139
+
140
+ $remainder = $number % $baseUnit;
141
+ $string = convert_number_to_words_lt($numBaseUnits) . ' ' . $dictionary[$baseUnits];
142
+ if ($remainder) {
143
+ $string .= $remainder < 100 ? $conjunction : $separator;
144
+ $string .= convert_number_to_words_lt($remainder);
145
+ }
146
+ break;
147
+ }
148
+
149
+ if (null !== $fraction && is_numeric($fraction)) {
150
+ $string .= $decimal;
151
+ $words = array();
152
+ foreach (str_split((string) $fraction) as $number) {
153
+ $words[] = $dictionary[$number];
154
+ }
155
+ $string .= implode(' ', $words);
156
+ }
157
+
158
+ return $string;
159
+ }
160
+ }
includes/functions/wcj-functions.php CHANGED
@@ -4,10 +4,72 @@
4
  *
5
  * The WooCommerce Jetpack Functions.
6
  *
7
- * @version 2.5.8
8
  * @author Algoritmika Ltd.
9
  */
10
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  if ( ! function_exists( 'wcj_get_product_image_url' ) ) {
12
  /**
13
  * wcj_get_product_image_url.
@@ -49,7 +111,7 @@ if ( ! function_exists( 'wcj_get_currency_exchange_rate_product_base_currency' )
49
  */
50
  function wcj_get_currency_exchange_rate_product_base_currency( $currency_code ) {
51
  $currency_exchange_rate = 1;
52
- $total_number = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_multicurrency_base_price_total_number', 1 ) );
53
  for ( $i = 1; $i <= $total_number; $i++ ) {
54
  if ( $currency_code === get_option( 'wcj_multicurrency_base_price_currency_' . $i ) ) {
55
  $currency_exchange_rate = get_option( 'wcj_multicurrency_base_price_exchange_rate_' . $i );
@@ -196,7 +258,7 @@ if ( ! function_exists( 'wcj_update_products_price_by_country_for_single_product
196
  $_product = wc_get_product( $product_id );
197
  if ( $_product->is_type( 'variable' ) ) {
198
  $available_variations = $_product->get_available_variations();
199
- for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_price_by_country_total_groups_number', 1 ) ); $i++ ) {
200
  $min_variation_price = PHP_INT_MAX;
201
  $max_variation_price = 0;
202
  foreach ( $available_variations as $variation ) {
@@ -225,7 +287,7 @@ if ( ! function_exists( 'wcj_update_products_price_by_country_for_single_product
225
  if ( wcj_is_module_enabled( 'multicurrency_base_price' ) ) {
226
  $_old_price = wcj_price_by_product_base_currency( $_old_price, $product_id );
227
  }
228
- for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_price_by_country_total_groups_number', 1 ) ); $i++ ) {
229
  $price_by_country = wcj_price_by_country( $_old_price, $product_id, $i, 'woocommerce_get_price' );
230
  update_post_meta( $product_id, '_' . 'wcj_price_by_country_' . $i, $price_by_country );
231
  }
@@ -327,7 +389,7 @@ if ( ! function_exists( 'wcj_get_currency_by_country' ) ) {
327
  */
328
  function wcj_get_currency_by_country( $country_code ) {
329
  $currency_code = '';
330
- for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_price_by_country_total_groups_number', 1 ) ); $i++ ) {
331
  switch ( get_option( 'wcj_price_by_country_selection', 'comma_list' ) ) {
332
  case 'comma_list':
333
  $country_exchange_rate_group = get_option( 'wcj_price_by_country_exchange_rate_countries_group_' . $i );
@@ -361,7 +423,7 @@ if ( ! function_exists( 'wcj_get_currency_exchange_rate' ) ) {
361
  $currency_exchange_rate = 1;
362
  if ( wcj_is_module_enabled( $module ) ) {
363
  if ( 'multicurrency' === $module ) {
364
- $total_number = apply_filters( 'wcj_get_option_filter', 2, get_option( 'wcj_multicurrency_total_number', 2 ) );
365
  for ( $i = 1; $i <= $total_number; $i++ ) {
366
  if ( $currency_code === get_option( 'wcj_multicurrency_currency_' . $i ) ) {
367
  $currency_exchange_rate = get_option( 'wcj_multicurrency_exchange_rate_' . $i );
@@ -1145,7 +1207,7 @@ if ( ! function_exists( 'wcj_get_currencies_names_and_symbols' ) ) {
1145
  }
1146
  if ( wcj_is_module_enabled( 'currency' ) && ( 'all' === $scope || 'custom_only' === $scope ) ) {
1147
  // Custom currencies
1148
- $custom_currency_total_number = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_currency_custom_currency_total_number', 1 ) );
1149
  for ( $i = 1; $i <= $custom_currency_total_number; $i++) {
1150
  $custom_currency_code = get_option( 'wcj_currency_custom_currency_code_' . $i );
1151
  $custom_currency_name = get_option( 'wcj_currency_custom_currency_name_' . $i );
@@ -1180,7 +1242,7 @@ if ( ! function_exists( 'wcj_get_currency_symbol' ) ) {
1180
  $currencies = wcj_get_currencies_names_and_symbols( 'symbols', 'no_custom' );
1181
  if ( isset( $currencies[ $currency_code ] ) ) {
1182
  if ( wcj_is_module_enabled( 'currency' ) ) {
1183
- $return = apply_filters( 'wcj_get_option_filter', $currencies[ $currency_code ], get_option( 'wcj_currency_' . $currency_code, $currencies[ $currency_code ] ) );
1184
  } else {
1185
  $return = $currencies[ $currency_code ];
1186
  }
4
  *
5
  * The WooCommerce Jetpack Functions.
6
  *
7
+ * @version 2.5.9
8
  * @author Algoritmika Ltd.
9
  */
10
 
11
+ if ( ! function_exists( 'wcj_get_order_item_meta_info' ) ) {
12
+ /**
13
+ * wcj_get_order_item_meta_info.
14
+ *
15
+ * from woocommerce\includes\admin\meta-boxes\views\html-order-item-meta.php
16
+ *
17
+ * @version 2.5.9
18
+ * @since 2.5.9
19
+ */
20
+ function wcj_get_order_item_meta_info( $item_id, $item, $_order, $exclude_wcj_meta = false, $_product = null ) {
21
+ $meta_info = '';
22
+ if ( $metadata = $_order->has_meta( $item_id ) ) {
23
+ $meta_info = array();
24
+ foreach ( $metadata as $meta ) {
25
+
26
+ // Skip hidden core fields
27
+ if ( in_array( $meta['meta_key'], apply_filters( 'woocommerce_hidden_order_itemmeta', array(
28
+ '_qty',
29
+ '_tax_class',
30
+ '_product_id',
31
+ '_variation_id',
32
+ '_line_subtotal',
33
+ '_line_subtotal_tax',
34
+ '_line_total',
35
+ '_line_tax',
36
+ 'method_id',
37
+ 'cost'
38
+ ) ) ) ) {
39
+ continue;
40
+ }
41
+
42
+ if ( $exclude_wcj_meta && ( 'wcj' === substr( $meta['meta_key'], 0, 3 ) || '_wcj' === substr( $meta['meta_key'], 0, 4 ) ) ) {
43
+ continue;
44
+ }
45
+
46
+ // Skip serialised meta
47
+ if ( is_serialized( $meta['meta_value'] ) ) {
48
+ continue;
49
+ }
50
+
51
+ // Get attribute data
52
+ if ( taxonomy_exists( wc_sanitize_taxonomy_name( $meta['meta_key'] ) ) ) {
53
+ $term = get_term_by( 'slug', $meta['meta_value'], wc_sanitize_taxonomy_name( $meta['meta_key'] ) );
54
+ $meta['meta_key'] = wc_attribute_label( wc_sanitize_taxonomy_name( $meta['meta_key'] ) );
55
+ $meta['meta_value'] = isset( $term->name ) ? $term->name : $meta['meta_value'];
56
+ } else {
57
+ $the_product = null;
58
+ if ( is_object( $_product ) ) {
59
+ $the_product = $_product;
60
+ } elseif ( is_object( $item ) ) {
61
+ $the_product = $_order->get_product_from_item( $item );
62
+ }
63
+ $meta['meta_key'] = ( is_object( $the_product ) ) ? wc_attribute_label( $meta['meta_key'], $the_product ) : $meta['meta_key'];
64
+ }
65
+ $meta_info[] = wp_kses_post( rawurldecode( $meta['meta_key'] ) ) . ': ' . wp_kses_post( rawurldecode( $meta['meta_value'] ) );
66
+ }
67
+ $meta_info = implode( ', ', $meta_info );
68
+ }
69
+ return $meta_info;
70
+ }
71
+ }
72
+
73
  if ( ! function_exists( 'wcj_get_product_image_url' ) ) {
74
  /**
75
  * wcj_get_product_image_url.
111
  */
112
  function wcj_get_currency_exchange_rate_product_base_currency( $currency_code ) {
113
  $currency_exchange_rate = 1;
114
+ $total_number = apply_filters( 'booster_get_option', 1, get_option( 'wcj_multicurrency_base_price_total_number', 1 ) );
115
  for ( $i = 1; $i <= $total_number; $i++ ) {
116
  if ( $currency_code === get_option( 'wcj_multicurrency_base_price_currency_' . $i ) ) {
117
  $currency_exchange_rate = get_option( 'wcj_multicurrency_base_price_exchange_rate_' . $i );
258
  $_product = wc_get_product( $product_id );
259
  if ( $_product->is_type( 'variable' ) ) {
260
  $available_variations = $_product->get_available_variations();
261
+ for ( $i = 1; $i <= apply_filters( 'booster_get_option', 1, get_option( 'wcj_price_by_country_total_groups_number', 1 ) ); $i++ ) {
262
  $min_variation_price = PHP_INT_MAX;
263
  $max_variation_price = 0;
264
  foreach ( $available_variations as $variation ) {
287
  if ( wcj_is_module_enabled( 'multicurrency_base_price' ) ) {
288
  $_old_price = wcj_price_by_product_base_currency( $_old_price, $product_id );
289
  }
290
+ for ( $i = 1; $i <= apply_filters( 'booster_get_option', 1, get_option( 'wcj_price_by_country_total_groups_number', 1 ) ); $i++ ) {
291
  $price_by_country = wcj_price_by_country( $_old_price, $product_id, $i, 'woocommerce_get_price' );
292
  update_post_meta( $product_id, '_' . 'wcj_price_by_country_' . $i, $price_by_country );
293
  }
389
  */
390
  function wcj_get_currency_by_country( $country_code ) {
391
  $currency_code = '';
392
+ for ( $i = 1; $i <= apply_filters( 'booster_get_option', 1, get_option( 'wcj_price_by_country_total_groups_number', 1 ) ); $i++ ) {
393
  switch ( get_option( 'wcj_price_by_country_selection', 'comma_list' ) ) {
394
  case 'comma_list':
395
  $country_exchange_rate_group = get_option( 'wcj_price_by_country_exchange_rate_countries_group_' . $i );
423
  $currency_exchange_rate = 1;
424
  if ( wcj_is_module_enabled( $module ) ) {
425
  if ( 'multicurrency' === $module ) {
426
+ $total_number = apply_filters( 'booster_get_option', 2, get_option( 'wcj_multicurrency_total_number', 2 ) );
427
  for ( $i = 1; $i <= $total_number; $i++ ) {
428
  if ( $currency_code === get_option( 'wcj_multicurrency_currency_' . $i ) ) {
429
  $currency_exchange_rate = get_option( 'wcj_multicurrency_exchange_rate_' . $i );
1207
  }
1208
  if ( wcj_is_module_enabled( 'currency' ) && ( 'all' === $scope || 'custom_only' === $scope ) ) {
1209
  // Custom currencies
1210
+ $custom_currency_total_number = apply_filters( 'booster_get_option', 1, get_option( 'wcj_currency_custom_currency_total_number', 1 ) );
1211
  for ( $i = 1; $i <= $custom_currency_total_number; $i++) {
1212
  $custom_currency_code = get_option( 'wcj_currency_custom_currency_code_' . $i );
1213
  $custom_currency_name = get_option( 'wcj_currency_custom_currency_name_' . $i );
1242
  $currencies = wcj_get_currencies_names_and_symbols( 'symbols', 'no_custom' );
1243
  if ( isset( $currencies[ $currency_code ] ) ) {
1244
  if ( wcj_is_module_enabled( 'currency' ) ) {
1245
+ $return = apply_filters( 'booster_get_option', $currencies[ $currency_code ], get_option( 'wcj_currency_' . $currency_code, $currencies[ $currency_code ] ) );
1246
  } else {
1247
  $return = $currencies[ $currency_code ];
1248
  }
includes/functions/wcj-invoicing-functions.php CHANGED
@@ -66,7 +66,7 @@ if ( ! function_exists( 'wcj_get_enabled_invoice_types' ) ) {
66
  $invoice_types = wcj_get_invoice_types();
67
  $enabled_invoice_types = array();
68
  foreach ( $invoice_types as $k => $invoice_type ) {
69
- $z = ( 0 === $k ) ? get_option( 'wcj_invoicing_' . $invoice_type['id'] . '_create_on' ) : apply_filters( 'wcj_get_option_filter', 'disabled', get_option( 'wcj_invoicing_' . $invoice_type['id'] . '_create_on' ) );
70
  if ( 'disabled' === $z )
71
  continue;
72
  $enabled_invoice_types[] = $invoice_type;
66
  $invoice_types = wcj_get_invoice_types();
67
  $enabled_invoice_types = array();
68
  foreach ( $invoice_types as $k => $invoice_type ) {
69
+ $z = ( 0 === $k ) ? get_option( 'wcj_invoicing_' . $invoice_type['id'] . '_create_on' ) : apply_filters( 'booster_get_option', 'disabled', get_option( 'wcj_invoicing_' . $invoice_type['id'] . '_create_on' ) );
70
  if ( 'disabled' === $z )
71
  continue;
72
  $enabled_invoice_types[] = $invoice_type;
includes/gateways/class-wc-gateway-wcj-custom.php CHANGED
@@ -111,8 +111,8 @@ if ( ! function_exists( 'init_wc_gateway_wcj_custom_class' ) ) {
111
  'type' => 'number',
112
  'desc_tip' => __( 'If you want to set minimum order amount (excluding fees) to show this gateway on frontend, enter a number here. Set to 0 to disable.', 'woocommerce-jetpack' ),
113
  'default' => 0,
114
- 'description' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
115
- 'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'disabled' ),
116
  ),
117
 
118
  'enable_for_methods' => array(
@@ -169,8 +169,8 @@ if ( ! function_exists( 'init_wc_gateway_wcj_custom_class' ) ) {
169
  );
170
 
171
  if ( 1 != $this->id_count ) {
172
- $this->form_fields['enabled']['description'] = apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' );
173
- $this->form_fields['enabled']['custom_attributes'] = apply_filters( 'get_wc_jetpack_plus_message', '', 'disabled' );
174
  }
175
  }
176
 
@@ -195,7 +195,7 @@ if ( ! function_exists( 'init_wc_gateway_wcj_custom_class' ) ) {
195
  public function is_available() {
196
 
197
  // Check min amount
198
- $min_amount = apply_filters( 'wcj_get_option_filter', 0, $this->min_amount );
199
  if ( $min_amount > 0 && isset( WC()->cart->total ) && '' != WC()->cart->total && isset( WC()->cart->fee_total ) ) {
200
  $total_excluding_fees = WC()->cart->total - WC()->cart->fee_total;
201
  if ( $total_excluding_fees < $min_amount )
@@ -388,7 +388,7 @@ if ( ! function_exists( 'init_wc_gateway_wcj_custom_class' ) ) {
388
  * @version 2.5.6
389
  */
390
  function add_wc_gateway_wcj_custom_classes( $methods ) {
391
- $the_number = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_custom_payment_gateways_number', 1 ) );
392
  for ( $i = 1; $i <= $the_number; $i++ ) {
393
  $the_method = new WC_Gateway_WCJ_Custom_Template();
394
  $the_method->init( $i );
111
  'type' => 'number',
112
  'desc_tip' => __( 'If you want to set minimum order amount (excluding fees) to show this gateway on frontend, enter a number here. Set to 0 to disable.', 'woocommerce-jetpack' ),
113
  'default' => 0,
114
+ 'description' => apply_filters( 'booster_get_message', '', 'desc' ),
115
+ 'custom_attributes' => apply_filters( 'booster_get_message', '', 'disabled' ),
116
  ),
117
 
118
  'enable_for_methods' => array(
169
  );
170
 
171
  if ( 1 != $this->id_count ) {
172
+ $this->form_fields['enabled']['description'] = apply_filters( 'booster_get_message', '', 'desc' );
173
+ $this->form_fields['enabled']['custom_attributes'] = apply_filters( 'booster_get_message', '', 'disabled' );
174
  }
175
  }
176
 
195
  public function is_available() {
196
 
197
  // Check min amount
198
+ $min_amount = apply_filters( 'booster_get_option', 0, $this->min_amount );
199
  if ( $min_amount > 0 && isset( WC()->cart->total ) && '' != WC()->cart->total && isset( WC()->cart->fee_total ) ) {
200
  $total_excluding_fees = WC()->cart->total - WC()->cart->fee_total;
201
  if ( $total_excluding_fees < $min_amount )
388
  * @version 2.5.6
389
  */
390
  function add_wc_gateway_wcj_custom_classes( $methods ) {
391
+ $the_number = apply_filters( 'booster_get_option', 1, get_option( 'wcj_custom_payment_gateways_number', 1 ) );
392
  for ( $i = 1; $i <= $the_number; $i++ ) {
393
  $the_method = new WC_Gateway_WCJ_Custom_Template();
394
  $the_method->init( $i );
includes/input-fields/class-wcj-product-input-fields-abstract.php CHANGED
@@ -247,7 +247,7 @@ class WCJ_Product_Input_Fields_Abstract {
247
  ) {
248
  foreach ( $order->get_items() as $item_key => $item ) {
249
  $product_id = $item['product_id'];
250
- $total_number = apply_filters( 'wcj_get_option_filter', 1, $this->get_value( 'wcj_' . 'product_input_fields' . '_' . $this->scope . '_total_number', $product_id, 1 ) );
251
  for ( $i = 1; $i <= $total_number; $i++ ) {
252
  if ( isset( $item[ 'wcj_product_input_fields_' . $this->scope . '_' . $i ] ) ) {
253
  $the_value = $item[ 'wcj_product_input_fields_' . $this->scope . '_' . $i ];
@@ -270,7 +270,7 @@ class WCJ_Product_Input_Fields_Abstract {
270
  function hide_custom_input_fields_default_output_in_admin_order( $hidden_metas ) {
271
  $total_number = 0;
272
  if ( 'global' === $this->scope ) {
273
- $total_number = apply_filters( 'wcj_get_option_filter', 1, $this->get_value( 'wcj_' . 'product_input_fields' . '_' . $this->scope . '_total_number', 0, 1 ) );
274
  } else {
275
  $max_number_of_fields_for_local = 100;
276
  $total_number = $max_number_of_fields_for_local; // TODO: not the best solution!
@@ -293,7 +293,7 @@ class WCJ_Product_Input_Fields_Abstract {
293
  return;
294
  }
295
  echo '<table cellspacing="0" class="display_meta">';
296
- $total_number = apply_filters( 'wcj_get_option_filter', 1, $this->get_value( 'wcj_' . 'product_input_fields' . '_' . $this->scope . '_total_number', $_product->id, 1 ) );
297
  for ( $i = 1; $i <= $total_number; $i++ ) {
298
 
299
  $the_nice_name = $this->get_value( 'wcj_product_input_fields_title_' . $this->scope . '_' . $i, $_product->id, '' );
@@ -426,7 +426,7 @@ class WCJ_Product_Input_Fields_Abstract {
426
  * @version 2.5.2
427
  */
428
  public function validate_product_input_fields_on_add_to_cart( $passed, $product_id ) {
429
- $total_number = apply_filters( 'wcj_get_option_filter', 1, $this->get_value( 'wcj_' . 'product_input_fields' . '_' . $this->scope . '_total_number', $product_id, 1 ) );
430
  for ( $i = 1; $i <= $total_number; $i++ ) {
431
 
432
  $is_enabled = $this->get_value( 'wcj_product_input_fields_enabled_' . $this->scope . '_' . $i, $product_id, 'no' );
@@ -491,7 +491,7 @@ class WCJ_Product_Input_Fields_Abstract {
491
  public function add_product_input_fields_to_frontend() {
492
  global $product;
493
  //if ( ! $product ) // return;
494
- $total_number = apply_filters( 'wcj_get_option_filter', 1, $this->get_value( 'wcj_' . 'product_input_fields' . '_' . $this->scope . '_total_number', $product->id, 1 ) );
495
 
496
  for ( $i = 1; $i <= $total_number; $i++ ) {
497
 
@@ -665,7 +665,7 @@ class WCJ_Product_Input_Fields_Abstract {
665
  * add_product_input_fields_to_cart_item_data - from $_POST to $cart_item_data
666
  */
667
  public function add_product_input_fields_to_cart_item_data( $cart_item_data, $product_id, $variation_id ) {
668
- $total_number = apply_filters( 'wcj_get_option_filter', 1, $this->get_value( 'wcj_' . 'product_input_fields' . '_' . $this->scope . '_total_number', $product_id, 1 ) );
669
  for ( $i = 1; $i <= $total_number; $i++ ) {
670
  $type = $this->get_value( 'wcj_product_input_fields_type_' . $this->scope . '_' . $i, $product_id, '' );
671
  $value_name = 'wcj_product_input_fields_' . $this->scope . '_' . $i;
@@ -689,7 +689,7 @@ class WCJ_Product_Input_Fields_Abstract {
689
  * get_cart_item_product_input_fields_from_session.
690
  */
691
  public function get_cart_item_product_input_fields_from_session( $item, $values, $key ) {
692
- $total_number = apply_filters( 'wcj_get_option_filter', 1, $this->get_value( 'wcj_' . 'product_input_fields' . '_' . $this->scope . '_total_number', $item['product_id'], 1 ) );
693
  for ( $i = 1; $i <= $total_number; $i++ ) {
694
  if ( array_key_exists( 'wcj_product_input_fields_' . $this->scope . '_' . $i, $values ) )
695
  $item[ 'wcj_product_input_fields_' . $this->scope . '_' . $i ] = $values[ 'wcj_product_input_fields_' . $this->scope . '_' . $i ];
@@ -704,7 +704,7 @@ class WCJ_Product_Input_Fields_Abstract {
704
  */
705
  public function add_product_input_fields_to_order_item_name( $name, $item, $is_cart = false ) {
706
 
707
- $total_number = apply_filters( 'wcj_get_option_filter', 1, $this->get_value( 'wcj_' . 'product_input_fields' . '_' . $this->scope . '_total_number', $item['product_id'], 1 ) );
708
  if ( $total_number < 1 ) {
709
  return $name;
710
  }
@@ -782,7 +782,7 @@ class WCJ_Product_Input_Fields_Abstract {
782
  * @version 2.5.0
783
  */
784
  public function add_product_input_fields_to_order_item_meta( $item_id, $values, $cart_item_key ) {
785
- $total_number = apply_filters( 'wcj_get_option_filter', 1, $this->get_value( 'wcj_' . 'product_input_fields' . '_' . $this->scope . '_total_number', $values['product_id'], 1 ) );
786
  for ( $i = 1; $i <= $total_number; $i++ ) {
787
  if ( array_key_exists( 'wcj_product_input_fields_' . $this->scope . '_' . $i , $values ) ) {
788
  $type = $this->get_value( 'wcj_product_input_fields_type_' . $this->scope . '_' . $i, $values['product_id'], '' );
247
  ) {
248
  foreach ( $order->get_items() as $item_key => $item ) {
249
  $product_id = $item['product_id'];
250
+ $total_number = apply_filters( 'booster_get_option', 1, $this->get_value( 'wcj_' . 'product_input_fields' . '_' . $this->scope . '_total_number', $product_id, 1 ) );
251
  for ( $i = 1; $i <= $total_number; $i++ ) {
252
  if ( isset( $item[ 'wcj_product_input_fields_' . $this->scope . '_' . $i ] ) ) {
253
  $the_value = $item[ 'wcj_product_input_fields_' . $this->scope . '_' . $i ];
270
  function hide_custom_input_fields_default_output_in_admin_order( $hidden_metas ) {
271
  $total_number = 0;
272
  if ( 'global' === $this->scope ) {
273
+ $total_number = apply_filters( 'booster_get_option', 1, $this->get_value( 'wcj_' . 'product_input_fields' . '_' . $this->scope . '_total_number', 0, 1 ) );
274
  } else {
275
  $max_number_of_fields_for_local = 100;
276
  $total_number = $max_number_of_fields_for_local; // TODO: not the best solution!
293
  return;
294
  }
295
  echo '<table cellspacing="0" class="display_meta">';
296
+ $total_number = apply_filters( 'booster_get_option', 1, $this->get_value( 'wcj_' . 'product_input_fields' . '_' . $this->scope . '_total_number', $_product->id, 1 ) );
297
  for ( $i = 1; $i <= $total_number; $i++ ) {
298
 
299
  $the_nice_name = $this->get_value( 'wcj_product_input_fields_title_' . $this->scope . '_' . $i, $_product->id, '' );
426
  * @version 2.5.2
427
  */
428
  public function validate_product_input_fields_on_add_to_cart( $passed, $product_id ) {
429
+ $total_number = apply_filters( 'booster_get_option', 1, $this->get_value( 'wcj_' . 'product_input_fields' . '_' . $this->scope . '_total_number', $product_id, 1 ) );
430
  for ( $i = 1; $i <= $total_number; $i++ ) {
431
 
432
  $is_enabled = $this->get_value( 'wcj_product_input_fields_enabled_' . $this->scope . '_' . $i, $product_id, 'no' );
491
  public function add_product_input_fields_to_frontend() {
492
  global $product;
493
  //if ( ! $product ) // return;
494
+ $total_number = apply_filters( 'booster_get_option', 1, $this->get_value( 'wcj_' . 'product_input_fields' . '_' . $this->scope . '_total_number', $product->id, 1 ) );
495
 
496
  for ( $i = 1; $i <= $total_number; $i++ ) {
497
 
665
  * add_product_input_fields_to_cart_item_data - from $_POST to $cart_item_data
666
  */
667
  public function add_product_input_fields_to_cart_item_data( $cart_item_data, $product_id, $variation_id ) {
668
+ $total_number = apply_filters( 'booster_get_option', 1, $this->get_value( 'wcj_' . 'product_input_fields' . '_' . $this->scope . '_total_number', $product_id, 1 ) );
669
  for ( $i = 1; $i <= $total_number; $i++ ) {
670
  $type = $this->get_value( 'wcj_product_input_fields_type_' . $this->scope . '_' . $i, $product_id, '' );
671
  $value_name = 'wcj_product_input_fields_' . $this->scope . '_' . $i;
689
  * get_cart_item_product_input_fields_from_session.
690
  */
691
  public function get_cart_item_product_input_fields_from_session( $item, $values, $key ) {
692
+ $total_number = apply_filters( 'booster_get_option', 1, $this->get_value( 'wcj_' . 'product_input_fields' . '_' . $this->scope . '_total_number', $item['product_id'], 1 ) );
693
  for ( $i = 1; $i <= $total_number; $i++ ) {
694
  if ( array_key_exists( 'wcj_product_input_fields_' . $this->scope . '_' . $i, $values ) )
695
  $item[ 'wcj_product_input_fields_' . $this->scope . '_' . $i ] = $values[ 'wcj_product_input_fields_' . $this->scope . '_' . $i ];
704
  */
705
  public function add_product_input_fields_to_order_item_name( $name, $item, $is_cart = false ) {
706
 
707
+ $total_number = apply_filters( 'booster_get_option', 1, $this->get_value( 'wcj_' . 'product_input_fields' . '_' . $this->scope . '_total_number', $item['product_id'], 1 ) );
708
  if ( $total_number < 1 ) {
709
  return $name;
710
  }
782
  * @version 2.5.0
783
  */
784
  public function add_product_input_fields_to_order_item_meta( $item_id, $values, $cart_item_key ) {
785
+ $total_number = apply_filters( 'booster_get_option', 1, $this->get_value( 'wcj_' . 'product_input_fields' . '_' . $this->scope . '_total_number', $values['product_id'], 1 ) );
786
  for ( $i = 1; $i <= $total_number; $i++ ) {
787
  if ( array_key_exists( 'wcj_product_input_fields_' . $this->scope . '_' . $i , $values ) ) {
788
  $type = $this->get_value( 'wcj_product_input_fields_type_' . $this->scope . '_' . $i, $values['product_id'], '' );
includes/input-fields/class-wcj-product-input-fields-per-product.php CHANGED
@@ -80,7 +80,7 @@ class WCJ_Product_Input_Fields_Per_Product extends WCJ_Product_Input_Fields_Abst
80
  return;
81
 
82
  // Save enabled, required, title etc.
83
- $default_total_input_fields = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_product_input_fields_local_total_number_default', 1 ) );
84
  $total_input_fields_before_saving = get_post_meta( $post_id, '_' . 'wcj_product_input_fields_local_total_number', true );
85
  $total_input_fields_before_saving = ( '' != $total_input_fields_before_saving ) ? $total_input_fields_before_saving : $default_total_input_fields;
86
  $options = $this->get_options();
@@ -132,15 +132,15 @@ class WCJ_Product_Input_Fields_Per_Product extends WCJ_Product_Input_Fields_Abst
132
  $current_post_id = get_the_ID();
133
  $option_name = 'wcj_' . $meta_box_id . '_local_total_number';
134
  // If none total number set - check for the default
135
- if ( ! ( $total_number = apply_filters( 'wcj_get_option_filter', 1, get_post_meta( $current_post_id, '_' . $option_name, true ) ) ) )
136
- $total_number = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_' . $meta_box_id . '_local_total_number_default', 1 ) );
137
 
138
  // Start html
139
  $html = '';
140
 
141
  // Total number
142
- $is_disabled = apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly_string' );
143
- $is_disabled_message = apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' );
144
  $html .= '<table>';
145
  $html .= '<tr>';
146
  $html .= '<th>';
80
  return;
81
 
82
  // Save enabled, required, title etc.
83
+ $default_total_input_fields = apply_filters( 'booster_get_option', 1, get_option( 'wcj_product_input_fields_local_total_number_default', 1 ) );
84
  $total_input_fields_before_saving = get_post_meta( $post_id, '_' . 'wcj_product_input_fields_local_total_number', true );
85
  $total_input_fields_before_saving = ( '' != $total_input_fields_before_saving ) ? $total_input_fields_before_saving : $default_total_input_fields;
86
  $options = $this->get_options();
132
  $current_post_id = get_the_ID();
133
  $option_name = 'wcj_' . $meta_box_id . '_local_total_number';
134
  // If none total number set - check for the default
135
+ if ( ! ( $total_number = apply_filters( 'booster_get_option', 1, get_post_meta( $current_post_id, '_' . $option_name, true ) ) ) )
136
+ $total_number = apply_filters( 'booster_get_option', 1, get_option( 'wcj_' . $meta_box_id . '_local_total_number_default', 1 ) );
137
 
138
  // Start html
139
  $html = '';
140
 
141
  // Total number
142
+ $is_disabled = apply_filters( 'booster_get_message', '', 'readonly_string' );
143
+ $is_disabled_message = apply_filters( 'booster_get_message', '', 'desc' );
144
  $html .= '<table>';
145
  $html .= '<tr>';
146
  $html .= '<th>';
includes/pdf-invoices/settings/class-wcj-pdf-invoicing-emails.php CHANGED
@@ -129,7 +129,7 @@ class WCJ_PDF_Invoicing_Emails extends WCJ_Module {
129
  'customer_reset_password' => __( 'Customer - Reset Password', 'woocommerce-jetpack' ),
130
  );
131
  if ( 'yes' === get_option( 'wcj_emails_enabled', 'no' ) ) {
132
- for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_emails_custom_emails_total_number', 1 ) ); $i++ ) {
133
  $available_emails[ 'wcj_custom' . '_' . $i ] = __( 'Custom', 'woocommerce-jetpack' ) . ' #' . $i;
134
  }
135
  }
129
  'customer_reset_password' => __( 'Customer - Reset Password', 'woocommerce-jetpack' ),
130
  );
131
  if ( 'yes' === get_option( 'wcj_emails_enabled', 'no' ) ) {
132
+ for ( $i = 1; $i <= apply_filters( 'booster_get_option', 1, get_option( 'wcj_emails_custom_emails_total_number', 1 ) ); $i++ ) {
133
  $available_emails[ 'wcj_custom' . '_' . $i ] = __( 'Custom', 'woocommerce-jetpack' ) . ' #' . $i;
134
  }
135
  }
includes/pdf-invoices/settings/class-wcj-pdf-invoicing-footer.php CHANGED
@@ -53,9 +53,9 @@ class WCJ_PDF_Invoicing_Footer extends WCJ_Module {
53
  'default' => 'Page %page_number% / %total_pages%',
54
  'type' => 'textarea',
55
  'css' => 'width:66%;min-width:300px;height:165px;',
56
- 'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
57
  'desc_tip' => __( 'You can use HTML here, as well as any WordPress shortcodes. There is two more predefined values you can use: %page_number% and %total_pages%.', 'woocommerce-jetpack' ),
58
- 'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ),
59
  ),
60
  array(
61
  'title' => __( 'Footer Text Color', 'woocommerce-jetpack' ),
53
  'default' => 'Page %page_number% / %total_pages%',
54
  'type' => 'textarea',
55
  'css' => 'width:66%;min-width:300px;height:165px;',
56
+ 'desc' => apply_filters( 'booster_get_message', '', 'desc' ),
57
  'desc_tip' => __( 'You can use HTML here, as well as any WordPress shortcodes. There is two more predefined values you can use: %page_number% and %total_pages%.', 'woocommerce-jetpack' ),
58
+ 'custom_attributes' => apply_filters( 'booster_get_message', '', 'readonly' ),
59
  ),
60
  array(
61
  'title' => __( 'Footer Text Color', 'woocommerce-jetpack' ),
includes/pdf-invoices/settings/class-wcj-pdf-invoicing-styling.php CHANGED
@@ -59,7 +59,7 @@ class WCJ_PDF_Invoicing_Styling extends WCJ_Module {
59
 
60
  $settings[] = array(
61
  'title' => __( 'Font Family', 'woocommerce-jetpack' ),
62
- 'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
63
  'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_general_font_family',
64
  'default' => 'dejavusans',
65
  'type' => 'select',
@@ -73,7 +73,7 @@ class WCJ_PDF_Invoicing_Styling extends WCJ_Module {
73
  'cordiaupc' => 'CordiaUPC',
74
  'thsarabun' => 'THSarabunPSK',
75
  ),
76
- 'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'disabled' ),
77
  );
78
 
79
  $settings[] = array(
59
 
60
  $settings[] = array(
61
  'title' => __( 'Font Family', 'woocommerce-jetpack' ),
62
+ 'desc' => apply_filters( 'booster_get_message', '', 'desc' ),
63
  'id' => 'wcj_invoicing_' . $invoice_type['id'] . '_general_font_family',
64
  'default' => 'dejavusans',
65
  'type' => 'select',
73
  'cordiaupc' => 'CordiaUPC',
74
  'thsarabun' => 'THSarabunPSK',
75
  ),
76
+ 'custom_attributes' => apply_filters( 'booster_get_message', '', 'disabled' ),
77
  );
78
 
79
  $settings[] = array(
includes/price-by-country/class-wcj-price-by-country-core.php CHANGED
@@ -264,7 +264,7 @@ class WCJ_Price_by_Country_Core {
264
  }
265
 
266
  // Get the country group id - go through all the groups, first found group is returned
267
- for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_price_by_country_total_groups_number', 1 ) ); $i++ ) {
268
  switch ( get_option( 'wcj_price_by_country_selection', 'comma_list' ) ) {
269
  case 'comma_list':
270
  $country_exchange_rate_group = get_option( 'wcj_price_by_country_exchange_rate_countries_group_' . $i );
264
  }
265
 
266
  // Get the country group id - go through all the groups, first found group is returned
267
+ for ( $i = 1; $i <= apply_filters( 'booster_get_option', 1, get_option( 'wcj_price_by_country_total_groups_number', 1 ) ); $i++ ) {
268
  switch ( get_option( 'wcj_price_by_country_selection', 'comma_list' ) ) {
269
  case 'comma_list':
270
  $country_exchange_rate_group = get_option( 'wcj_price_by_country_exchange_rate_countries_group_' . $i );
includes/price-by-country/class-wcj-price-by-country-group-generator.php CHANGED
@@ -73,7 +73,7 @@ class WCJ_Price_By_Country_Group_Generator {
73
  if ( isset( $_POST['save'] ) ) {
74
  return;
75
  }
76
- if ( /* ! is_admin() || */ ! wcj_is_user_role( 'administrator' ) || 1 === apply_filters( 'wcj_get_option_filter', 1, '' ) ) {
77
  $wcj_notice = __( 'Create All Country Groups Failed.', 'woocommerce-jetpack' );
78
  return;
79
  }
73
  if ( isset( $_POST['save'] ) ) {
74
  return;
75
  }
76
+ if ( /* ! is_admin() || */ ! wcj_is_user_role( 'administrator' ) || 1 === apply_filters( 'booster_get_option', 1, '' ) ) {
77
  $wcj_notice = __( 'Create All Country Groups Failed.', 'woocommerce-jetpack' );
78
  return;
79
  }
includes/price-by-country/class-wcj-price-by-country-local.php CHANGED
@@ -111,7 +111,7 @@ class WCJ_Price_by_Country_Local {
111
  * get_total_country_groups_number.
112
  */
113
  function get_total_country_groups_number() {
114
- return apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_price_by_country_total_groups_number', 1 ) );
115
  }
116
 
117
  /**
111
  * get_total_country_groups_number.
112
  */
113
  function get_total_country_groups_number() {
114
+ return apply_filters( 'booster_get_option', 1, get_option( 'wcj_price_by_country_total_groups_number', 1 ) );
115
  }
116
 
117
  /**
includes/reports/class-wcj-currency-reports.php CHANGED
@@ -47,19 +47,19 @@ class WCJ_Currency_Reports {
47
  $currency_symbols[ $the_current_code ] = $the_current_code;
48
  $currency_symbols[ get_woocommerce_currency() ] = get_woocommerce_currency();
49
  if ( wcj_is_module_enabled( 'price_by_country' ) ) {
50
- for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_price_by_country_total_groups_number', 1 ) ); $i++ ) {
51
  $the_code = get_option( 'wcj_price_by_country_exchange_rate_currency_group_' . $i );
52
  $currency_symbols[ $the_code ] = $the_code;
53
  }
54
  }
55
  if ( wcj_is_module_enabled( 'multicurrency' ) ) {
56
- for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 2, get_option( 'wcj_multicurrency_total_number', 2 ) ); $i++ ) {
57
  $the_code = get_option( 'wcj_multicurrency_currency_' . $i );
58
  $currency_symbols[ $the_code ] = $the_code;
59
  }
60
  }
61
  /* if ( wcj_is_module_enabled( 'multicurrency_base_price' ) ) {
62
- for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_multicurrency_base_price_total_number', 1 ) ); $i++ ) {
63
  $the_code = get_option( 'wcj_multicurrency_base_price_currency_' . $i );
64
  $currency_symbols[ $the_code ] = $the_code;
65
  }
47
  $currency_symbols[ $the_current_code ] = $the_current_code;
48
  $currency_symbols[ get_woocommerce_currency() ] = get_woocommerce_currency();
49
  if ( wcj_is_module_enabled( 'price_by_country' ) ) {
50
+ for ( $i = 1; $i <= apply_filters( 'booster_get_option', 1, get_option( 'wcj_price_by_country_total_groups_number', 1 ) ); $i++ ) {
51
  $the_code = get_option( 'wcj_price_by_country_exchange_rate_currency_group_' . $i );
52
  $currency_symbols[ $the_code ] = $the_code;
53
  }
54
  }
55
  if ( wcj_is_module_enabled( 'multicurrency' ) ) {
56
+ for ( $i = 1; $i <= apply_filters( 'booster_get_option', 2, get_option( 'wcj_multicurrency_total_number', 2 ) ); $i++ ) {
57
  $the_code = get_option( 'wcj_multicurrency_currency_' . $i );
58
  $currency_symbols[ $the_code ] = $the_code;
59
  }
60
  }
61
  /* if ( wcj_is_module_enabled( 'multicurrency_base_price' ) ) {
62
+ for ( $i = 1; $i <= apply_filters( 'booster_get_option', 1, get_option( 'wcj_multicurrency_base_price_total_number', 1 ) ); $i++ ) {
63
  $the_code = get_option( 'wcj_multicurrency_base_price_currency_' . $i );
64
  $currency_symbols[ $the_code ] = $the_code;
65
  }
includes/shipping/class-wc-shipping-wcj-custom.php CHANGED
@@ -200,7 +200,7 @@ if ( ! function_exists( 'init_wc_shipping_wcj_custom_class' ) ) {
200
  * @version 2.5.6
201
  */
202
  function add_wc_shipping_wcj_custom_class( $methods ) {
203
- $total_number = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_shipping_custom_shipping_total_number', 1 ) );
204
  for ( $i = 1; $i <= $total_number; $i++ ) {
205
  $the_method = new WC_Shipping_WCJ_Custom_Template();
206
  $the_method->init( $i );
200
  * @version 2.5.6
201
  */
202
  function add_wc_shipping_wcj_custom_class( $methods ) {
203
+ $total_number = apply_filters( 'booster_get_option', 1, get_option( 'wcj_shipping_custom_shipping_total_number', 1 ) );
204
  for ( $i = 1; $i <= $total_number; $i++ ) {
205
  $the_method = new WC_Shipping_WCJ_Custom_Template();
206
  $the_method->init( $i );
includes/shortcodes/class-wcj-general-shortcodes.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * The WooCommerce Jetpack General Shortcodes class.
6
  *
7
- * @version 2.5.8
8
  * @author Algoritmika Ltd.
9
  */
10
 
@@ -129,7 +129,7 @@ class WCJ_General_Shortcodes extends WCJ_Shortcodes {
129
  $shortcode_currencies = explode( ',', $shortcode_currencies );
130
  }
131
  if ( empty( $shortcode_currencies ) ) {
132
- $total_number = apply_filters( 'wcj_get_option_filter', 2, get_option( 'wcj_multicurrency_total_number', 2 ) );
133
  for ( $i = 1; $i <= $total_number; $i++ ) {
134
  $shortcode_currencies[] = get_option( 'wcj_multicurrency_currency_' . $i );
135
  }
@@ -163,7 +163,7 @@ class WCJ_General_Shortcodes extends WCJ_Shortcodes {
163
  }
164
 
165
  $wholesale_price_levels = array();
166
- for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_wholesale_price_levels_number' . $role_option_name_addon, 1 ) ); $i++ ) {
167
  $level_qty = get_option( 'wcj_wholesale_price_level_min_qty' . $role_option_name_addon . '_' . $i, PHP_INT_MAX );
168
  $discount = get_option( 'wcj_wholesale_price_level_discount_percent' . $role_option_name_addon . '_' . $i, 0 );
169
  $wholesale_price_levels[] = array( 'quantity' => $level_qty, 'discount' => $discount, );
@@ -340,7 +340,7 @@ class WCJ_General_Shortcodes extends WCJ_Shortcodes {
340
  /**
341
  * wcj_country_select_drop_down_list.
342
  *
343
- * @version 2.5.4
344
  */
345
  function wcj_country_select_drop_down_list( $atts, $content ) {
346
 
@@ -382,7 +382,7 @@ class WCJ_General_Shortcodes extends WCJ_Shortcodes {
382
 
383
  $data_icon = '';
384
  if ( 'yes' === get_option( 'wcj_price_by_country_jquery_wselect_enabled', 'no' ) ) {
385
- $data_icon = ' data-icon="' . wcj_plugin_url() . '/assets/images/flag-icons/' . $country_code . '.png"';
386
  }
387
 
388
  $option_label = ( 'yes' === $atts['replace_with_currency'] ) ? $currencies_names_and_symbols[ wcj_get_currency_by_country( $country_code ) ] : $country_name;
@@ -395,7 +395,7 @@ class WCJ_General_Shortcodes extends WCJ_Shortcodes {
395
 
396
  $data_icon = '';
397
  if ( 'yes' === get_option( 'wcj_price_by_country_jquery_wselect_enabled', 'no' ) ) {
398
- $data_icon = ' data-icon="' . wcj_plugin_url() . '/assets/images/flag-icons/' . $country_code . '.png"';
399
  }
400
 
401
  $option_label = ( 'yes' === $atts['replace_with_currency'] ) ? $currencies_names_and_symbols[ wcj_get_currency_by_country( $country_code ) ] : $countries[ $country_code ];
4
  *
5
  * The WooCommerce Jetpack General Shortcodes class.
6
  *
7
+ * @version 2.5.9
8
  * @author Algoritmika Ltd.
9
  */
10
 
129
  $shortcode_currencies = explode( ',', $shortcode_currencies );
130
  }
131
  if ( empty( $shortcode_currencies ) ) {
132
+ $total_number = apply_filters( 'booster_get_option', 2, get_option( 'wcj_multicurrency_total_number', 2 ) );
133
  for ( $i = 1; $i <= $total_number; $i++ ) {
134
  $shortcode_currencies[] = get_option( 'wcj_multicurrency_currency_' . $i );
135
  }
163
  }
164
 
165
  $wholesale_price_levels = array();
166
+ for ( $i = 1; $i <= apply_filters( 'booster_get_option', 1, get_option( 'wcj_wholesale_price_levels_number' . $role_option_name_addon, 1 ) ); $i++ ) {
167
  $level_qty = get_option( 'wcj_wholesale_price_level_min_qty' . $role_option_name_addon . '_' . $i, PHP_INT_MAX );
168
  $discount = get_option( 'wcj_wholesale_price_level_discount_percent' . $role_option_name_addon . '_' . $i, 0 );
169
  $wholesale_price_levels[] = array( 'quantity' => $level_qty, 'discount' => $discount, );
340
  /**
341
  * wcj_country_select_drop_down_list.
342
  *
343
+ * @version 2.5.9
344
  */
345
  function wcj_country_select_drop_down_list( $atts, $content ) {
346
 
382
 
383
  $data_icon = '';
384
  if ( 'yes' === get_option( 'wcj_price_by_country_jquery_wselect_enabled', 'no' ) ) {
385
+ $data_icon = ' data-icon="' . wcj_plugin_url() . '/assets/images/flag-icons/' . strtolower( $country_code ) . '.png"';
386
  }
387
 
388
  $option_label = ( 'yes' === $atts['replace_with_currency'] ) ? $currencies_names_and_symbols[ wcj_get_currency_by_country( $country_code ) ] : $country_name;
395
 
396
  $data_icon = '';
397
  if ( 'yes' === get_option( 'wcj_price_by_country_jquery_wselect_enabled', 'no' ) ) {
398
+ $data_icon = ' data-icon="' . wcj_plugin_url() . '/assets/images/flag-icons/' . strtolower( $country_code ) . '.png"';
399
  }
400
 
401
  $option_label = ( 'yes' === $atts['replace_with_currency'] ) ? $currencies_names_and_symbols[ wcj_get_currency_by_country( $country_code ) ] : $countries[ $country_code ];
includes/shortcodes/class-wcj-order-items-shortcodes.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * The WooCommerce Jetpack Order Items Shortcodes class.
6
  *
7
- * @version 2.5.8
8
  * @author Algoritmika Ltd.
9
  */
10
 
@@ -29,7 +29,7 @@ class WCJ_Order_Items_Shortcodes extends WCJ_Shortcodes {
29
  /**
30
  * add_extra_atts.
31
  *
32
- * @version 2.5.8
33
  */
34
  function add_extra_atts( $atts ) {
35
  $modified_atts = array_merge( array(
@@ -47,6 +47,7 @@ class WCJ_Order_Items_Shortcodes extends WCJ_Shortcodes {
47
  'product_image_width' => 0,
48
  'product_image_height' => 0,
49
  'price_prefix' => '',
 
50
  'style_item_name_variation' => 'font-size:smaller;',
51
  'variation_as_metadata' => 'yes',
52
  'wc_extra_product_options_show_price' => 'no',
@@ -161,10 +162,10 @@ class WCJ_Order_Items_Shortcodes extends WCJ_Shortcodes {
161
  *
162
  * from woocommerce\includes\admin\meta-boxes\views\html-order-item-meta.php
163
  *
164
- * @version 2.5.8
165
  * @since 2.5.8
166
  */
167
- function get_meta_info( $item_id, $atts, $the_product ) {
168
  $meta_info = '';
169
  if ( $metadata = $this->the_order->has_meta( $item_id ) ) {
170
  $meta_info = array();
@@ -209,7 +210,7 @@ class WCJ_Order_Items_Shortcodes extends WCJ_Shortcodes {
209
  /**
210
  * wcj_order_items_table.
211
  *
212
- * @version 2.5.8
213
  */
214
  function wcj_order_items_table( $atts, $content = '' ) {
215
 
@@ -293,6 +294,9 @@ class WCJ_Order_Items_Shortcodes extends WCJ_Shortcodes {
293
  case 'item_number':
294
  $data[ $item_counter ][] = $item_counter;
295
  break;
 
 
 
296
  case 'item_name':
297
  case 'product_name': // "product_" because of possible variation
298
  if ( true === $item['is_custom'] ) {
@@ -300,11 +304,11 @@ class WCJ_Order_Items_Shortcodes extends WCJ_Shortcodes {
300
  } else {
301
  $the_item_title = $item['name'];
302
  // Variation (if needed)
303
- if ( is_object( $the_product ) && $the_product->is_type( 'variation' ) && ! in_array( 'item_variation', $columns ) ) { // todo - $the_product is not (always) required?
304
  $the_item_title .= '<div style="' . $atts['style_item_name_variation'] . '">';
305
  if ( 'yes' === $atts['variation_as_metadata'] ) {
306
- $the_item_title .= $this->get_meta_info( $item_id, $atts, $the_product );
307
- } else {
308
  $the_item_title .= str_replace( 'pa_', '', urldecode( $the_product->get_formatted_variation_attributes( true ) ) ); // todo - do we need pa_ replacement?
309
  }
310
  $the_item_title .= '</div>';
@@ -380,10 +384,10 @@ class WCJ_Order_Items_Shortcodes extends WCJ_Shortcodes {
380
  break;
381
  case 'item_variation':
382
  case 'product_variation':
383
- if ( is_object( $the_product ) && $the_product->is_type( 'variation' ) ) { // todo - $the_product is not (always) required?
384
  if ( 'yes' === $atts['variation_as_metadata'] ) {
385
- $data[ $item_counter ][] = $this->get_meta_info( $item_id, $atts, $the_product );
386
- } else {
387
  $data[ $item_counter ][] = str_replace( 'pa_', '', urldecode( $the_product->get_formatted_variation_attributes( true ) ) ); // todo - do we need pa_ replacement?
388
  }
389
  } else {
@@ -405,7 +409,7 @@ class WCJ_Order_Items_Shortcodes extends WCJ_Shortcodes {
405
  $data[ $item_counter ][] = ( true === $item['is_custom'] || ! is_object( $the_product ) ) ? '' : $the_product->get_sku();
406
  break;
407
  case 'item_quantity':
408
- $data[ $item_counter ][] = $item['qty'];
409
  break;
410
  case 'item_total_tax_excl':
411
  $data[ $item_counter ][] = $this->wcj_price_shortcode( $the_order->get_item_total( $item, false, true ), $atts );
4
  *
5
  * The WooCommerce Jetpack Order Items Shortcodes class.
6
  *
7
+ * @version 2.5.9
8
  * @author Algoritmika Ltd.
9
  */
10
 
29
  /**
30
  * add_extra_atts.
31
  *
32
+ * @version 2.5.9
33
  */
34
  function add_extra_atts( $atts ) {
35
  $modified_atts = array_merge( array(
47
  'product_image_width' => 0,
48
  'product_image_height' => 0,
49
  'price_prefix' => '',
50
+ 'quantity_prefix' => '',
51
  'style_item_name_variation' => 'font-size:smaller;',
52
  'variation_as_metadata' => 'yes',
53
  'wc_extra_product_options_show_price' => 'no',
162
  *
163
  * from woocommerce\includes\admin\meta-boxes\views\html-order-item-meta.php
164
  *
165
+ * @version 2.5.9
166
  * @since 2.5.8
167
  */
168
+ function get_meta_info( $item_id, $the_product ) {
169
  $meta_info = '';
170
  if ( $metadata = $this->the_order->has_meta( $item_id ) ) {
171
  $meta_info = array();
210
  /**
211
  * wcj_order_items_table.
212
  *
213
+ * @version 2.5.9
214
  */
215
  function wcj_order_items_table( $atts, $content = '' ) {
216
 
294
  case 'item_number':
295
  $data[ $item_counter ][] = $item_counter;
296
  break;
297
+ case 'item_meta':
298
+ $data[ $item_counter ][] = wcj_get_order_item_meta_info( $item_id, null, $this->the_order, false, $the_product );
299
+ break;
300
  case 'item_name':
301
  case 'product_name': // "product_" because of possible variation
302
  if ( true === $item['is_custom'] ) {
304
  } else {
305
  $the_item_title = $item['name'];
306
  // Variation (if needed)
307
+ if ( 0 != $item['variation_id'] && ! in_array( 'item_variation', $columns ) ) {
308
  $the_item_title .= '<div style="' . $atts['style_item_name_variation'] . '">';
309
  if ( 'yes' === $atts['variation_as_metadata'] ) {
310
+ $the_item_title .= wcj_get_order_item_meta_info( $item_id, null, $this->the_order, true, $the_product );
311
+ } elseif ( is_object( $the_product ) && $the_product->is_type( 'variation' ) ) {
312
  $the_item_title .= str_replace( 'pa_', '', urldecode( $the_product->get_formatted_variation_attributes( true ) ) ); // todo - do we need pa_ replacement?
313
  }
314
  $the_item_title .= '</div>';
384
  break;
385
  case 'item_variation':
386
  case 'product_variation':
387
+ if ( 0 != $item['variation_id'] ) {
388
  if ( 'yes' === $atts['variation_as_metadata'] ) {
389
+ $data[ $item_counter ][] = wcj_get_order_item_meta_info( $item_id, null, $this->the_order, true, $the_product );
390
+ } elseif ( is_object( $the_product ) && $the_product->is_type( 'variation' ) ) {
391
  $data[ $item_counter ][] = str_replace( 'pa_', '', urldecode( $the_product->get_formatted_variation_attributes( true ) ) ); // todo - do we need pa_ replacement?
392
  }
393
  } else {
409
  $data[ $item_counter ][] = ( true === $item['is_custom'] || ! is_object( $the_product ) ) ? '' : $the_product->get_sku();
410
  break;
411
  case 'item_quantity':
412
+ $data[ $item_counter ][] = $atts['quantity_prefix'] . $item['qty'];
413
  break;
414
  case 'item_total_tax_excl':
415
  $data[ $item_counter ][] = $this->wcj_price_shortcode( $the_order->get_item_total( $item, false, true ), $atts );
includes/shortcodes/class-wcj-orders-shortcodes.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * The WooCommerce Jetpack Orders Shortcodes class.
6
  *
7
- * @version 2.5.8
8
  * @author Algoritmika Ltd.
9
  */
10
 
@@ -798,10 +798,20 @@ class WCJ_Orders_Shortcodes extends WCJ_Shortcodes {
798
  return $this->wcj_price_shortcode( $order_total, $atts );
799
  }
800
 
 
 
 
 
 
 
 
 
 
 
801
  /**
802
  * wcj_order_total_in_words.
803
  *
804
- * @version 2.5.0
805
  */
806
  function wcj_order_total_in_words( $atts ) {
807
 
@@ -816,8 +826,18 @@ class WCJ_Orders_Shortcodes extends WCJ_Shortcodes {
816
  $cents = $atts['decimal'];
817
 
818
  switch ( $atts['lang'] ) {
 
 
 
 
 
 
819
  case 'BG':
820
- return convert_number_to_words_bg( $order_total );
 
 
 
 
821
  default: // 'EN'
822
  return sprintf( $the_number_in_words,
823
  ucfirst( convert_number_to_words( $order_total_whole ) ),
4
  *
5
  * The WooCommerce Jetpack Orders Shortcodes class.
6
  *
7
+ * @version 2.5.9
8
  * @author Algoritmika Ltd.
9
  */
10
 
798
  return $this->wcj_price_shortcode( $order_total, $atts );
799
  }
800
 
801
+ /**
802
+ * mb_ucfirst - for wcj_order_total_in_words.
803
+ *
804
+ * @version 2.5.9
805
+ * @since 2.5.9
806
+ */
807
+ function mb_ucfirst( $string ) {
808
+ return mb_strtoupper( mb_substr( $string, 0, 1 ) ) . mb_substr( $string, 1 );
809
+ }
810
+
811
  /**
812
  * wcj_order_total_in_words.
813
  *
814
+ * @version 2.5.9
815
  */
816
  function wcj_order_total_in_words( $atts ) {
817
 
826
  $cents = $atts['decimal'];
827
 
828
  switch ( $atts['lang'] ) {
829
+ case 'LT':
830
+ return sprintf( $the_number_in_words,
831
+ $this->mb_ucfirst( convert_number_to_words_lt( $order_total_whole ) ),
832
+ $dollars,
833
+ $this->mb_ucfirst( convert_number_to_words_lt( $order_total_decimal ) ),
834
+ $cents );
835
  case 'BG':
836
+ return sprintf( $the_number_in_words,
837
+ $this->mb_ucfirst( trim( convert_number_to_words_bg( $order_total_whole ) ) ),
838
+ $dollars,
839
+ $this->mb_ucfirst( trim( convert_number_to_words_bg( $order_total_decimal ) ) ),
840
+ $cents );
841
  default: // 'EN'
842
  return sprintf( $the_number_in_words,
843
  ucfirst( convert_number_to_words( $order_total_whole ) ),
includes/shortcodes/class-wcj-products-add-form-shortcodes.php CHANGED
@@ -38,7 +38,7 @@ class WCJ_Products_Add_Form_Shortcodes extends WCJ_Shortcodes {
38
  'sale_price_enabled' => get_option( 'wcj_product_by_user_sale_price_enabled', 'no' ),
39
  'cats_enabled' => get_option( 'wcj_product_by_user_cats_enabled', 'no' ),
40
  'tags_enabled' => get_option( 'wcj_product_by_user_tags_enabled', 'no' ),
41
- 'image_enabled' => apply_filters( 'wcj_get_option_filter', 'no', get_option( 'wcj_product_by_user_image_enabled', 'no' ) ),
42
 
43
  'desc_required' => get_option( 'wcj_product_by_user_desc_required', 'no' ),
44
  'short_desc_required' => get_option( 'wcj_product_by_user_short_desc_required', 'no' ),
@@ -46,7 +46,7 @@ class WCJ_Products_Add_Form_Shortcodes extends WCJ_Shortcodes {
46
  'sale_price_required' => get_option( 'wcj_product_by_user_sale_price_required', 'no' ),
47
  'cats_required' => get_option( 'wcj_product_by_user_cats_required', 'no' ),
48
  'tags_required' => get_option( 'wcj_product_by_user_tags_required', 'no' ),
49
- 'image_required' => apply_filters( 'wcj_get_option_filter', 'no', get_option( 'wcj_product_by_user_image_required', 'no' ) ),
50
 
51
  'visibility' => implode( ',', get_option( 'wcj_product_by_user_user_visibility', array() ) ),
52
  'module' => 'product_by_user',
38
  'sale_price_enabled' => get_option( 'wcj_product_by_user_sale_price_enabled', 'no' ),
39
  'cats_enabled' => get_option( 'wcj_product_by_user_cats_enabled', 'no' ),
40
  'tags_enabled' => get_option( 'wcj_product_by_user_tags_enabled', 'no' ),
41
+ 'image_enabled' => apply_filters( 'booster_get_option', 'no', get_option( 'wcj_product_by_user_image_enabled', 'no' ) ),
42
 
43
  'desc_required' => get_option( 'wcj_product_by_user_desc_required', 'no' ),
44
  'short_desc_required' => get_option( 'wcj_product_by_user_short_desc_required', 'no' ),
46
  'sale_price_required' => get_option( 'wcj_product_by_user_sale_price_required', 'no' ),
47
  'cats_required' => get_option( 'wcj_product_by_user_cats_required', 'no' ),
48
  'tags_required' => get_option( 'wcj_product_by_user_tags_required', 'no' ),
49
+ 'image_required' => apply_filters( 'booster_get_option', 'no', get_option( 'wcj_product_by_user_image_required', 'no' ) ),
50
 
51
  'visibility' => implode( ',', get_option( 'wcj_product_by_user_user_visibility', array() ) ),
52
  'module' => 'product_by_user',
includes/shortcodes/class-wcj-products-shortcodes.php CHANGED
@@ -614,13 +614,13 @@ class WCJ_Products_Shortcodes extends WCJ_Shortcodes {
614
 
615
  $wholesale_price_levels = array();
616
  if ( wcj_is_product_wholesale_enabled_per_product( $this->the_product->id ) ) {
617
- for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 1, get_post_meta( $this->the_product->id, '_' . 'wcj_wholesale_price_levels_number' . $role_option_name_addon, true ) ); $i++ ) {
618
  $level_qty = get_post_meta( $this->the_product->id, '_' . 'wcj_wholesale_price_level_min_qty' . $role_option_name_addon . '_' . $i, true );
619
  $discount = get_post_meta( $this->the_product->id, '_' . 'wcj_wholesale_price_level_discount' . $role_option_name_addon . '_' . $i, true );
620
  $wholesale_price_levels[] = array( 'quantity' => $level_qty, 'discount' => $discount, );
621
  }
622
  } else {
623
- for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_wholesale_price_levels_number' . $role_option_name_addon, 1 ) ); $i++ ) {
624
  $level_qty = get_option( 'wcj_wholesale_price_level_min_qty' . $role_option_name_addon . '_' . $i, PHP_INT_MAX );
625
  $discount = get_option( 'wcj_wholesale_price_level_discount_percent' . $role_option_name_addon . '_' . $i, 0 );
626
  $wholesale_price_levels[] = array( 'quantity' => $level_qty, 'discount' => $discount, );
614
 
615
  $wholesale_price_levels = array();
616
  if ( wcj_is_product_wholesale_enabled_per_product( $this->the_product->id ) ) {
617
+ for ( $i = 1; $i <= apply_filters( 'booster_get_option', 1, get_post_meta( $this->the_product->id, '_' . 'wcj_wholesale_price_levels_number' . $role_option_name_addon, true ) ); $i++ ) {
618
  $level_qty = get_post_meta( $this->the_product->id, '_' . 'wcj_wholesale_price_level_min_qty' . $role_option_name_addon . '_' . $i, true );
619
  $discount = get_post_meta( $this->the_product->id, '_' . 'wcj_wholesale_price_level_discount' . $role_option_name_addon . '_' . $i, true );
620
  $wholesale_price_levels[] = array( 'quantity' => $level_qty, 'discount' => $discount, );
621
  }
622
  } else {
623
+ for ( $i = 1; $i <= apply_filters( 'booster_get_option', 1, get_option( 'wcj_wholesale_price_levels_number' . $role_option_name_addon, 1 ) ); $i++ ) {
624
  $level_qty = get_option( 'wcj_wholesale_price_level_min_qty' . $role_option_name_addon . '_' . $i, PHP_INT_MAX );
625
  $discount = get_option( 'wcj_wholesale_price_level_discount_percent' . $role_option_name_addon . '_' . $i, 0 );
626
  $wholesale_price_levels[] = array( 'quantity' => $level_qty, 'discount' => $discount, );
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: algoritmika,anbinder
3
  Tags: woocommerce,booster for woocommerce,woocommerce jetpack
4
  Requires at least: 4.4
5
  Tested up to: 4.7
6
- Stable tag: 2.5.8
7
  License: GNU General Public License v3.0
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
@@ -37,6 +37,7 @@ Booster for WooCommerce is a WordPress plugin that supercharges your site with a
37
  * *Add to Cart Labels* - Change text for Add to Cart button by WooCommerce product type, by product category or for individual products.
38
  * *Call for Price* - Create any custom price label for all WooCommerce products with empty price.
39
  * *Custom Price Labels* - Create any custom price label for any WooCommerce product.
 
40
  * *More Button Labels* - Set WooCommerce "Place order" button label.
41
 
42
  **Products**
@@ -82,7 +83,7 @@ Booster for WooCommerce is a WordPress plugin that supercharges your site with a
82
  **Shipping & Orders**
83
 
84
  * *Address Formats* - Set address format in WooCommerce orders on per country basis. Force base country display.
85
- * *Left to Free Shipping* - Display "left to free shipping" info.
86
  * *Order Custom Statuses* - Custom statuses for WooCommerce orders.
87
  * *Order Minimum Amount* - Minimum WooCommerce order amount (optionally by user role).
88
  * *Order Numbers* - WooCommerce sequential order numbering, custom order number prefix, suffix and number width.
@@ -137,6 +138,34 @@ You can see the differences between versions in this [table](http://booster.io/b
137
 
138
  == Changelog ==
139
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
140
  = 2.5.8 - 09/12/2016 =
141
  * Fix - `wcj_current_filter_priority()` modified for compatibility with WordPress since v4.7.
142
  * Dev - Shortcodes - General - `[wcj_get_left_to_free_shipping]` - `multiply_by` attribute added (and to `wcj_get_left_to_free_shipping()` function).
3
  Tags: woocommerce,booster for woocommerce,woocommerce jetpack
4
  Requires at least: 4.4
5
  Tested up to: 4.7
6
+ Stable tag: 2.5.9
7
  License: GNU General Public License v3.0
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
37
  * *Add to Cart Labels* - Change text for Add to Cart button by WooCommerce product type, by product category or for individual products.
38
  * *Call for Price* - Create any custom price label for all WooCommerce products with empty price.
39
  * *Custom Price Labels* - Create any custom price label for any WooCommerce product.
40
+ * *Free Price Labels* - WooCommerce free price labels.
41
  * *More Button Labels* - Set WooCommerce "Place order" button label.
42
 
43
  **Products**
83
  **Shipping & Orders**
84
 
85
  * *Address Formats* - Set address format in WooCommerce orders on per country basis. Force base country display.
86
+ * *Left to Free Shipping* - Display "left to free shipping" info in WooCommerce.
87
  * *Order Custom Statuses* - Custom statuses for WooCommerce orders.
88
  * *Order Minimum Amount* - Minimum WooCommerce order amount (optionally by user role).
89
  * *Order Numbers* - WooCommerce sequential order numbering, custom order number prefix, suffix and number width.
138
 
139
  == Changelog ==
140
 
141
+ = 2.5.9 - 19/12/2016 =
142
+ * Dev - `WCJ_Module` - "Reset settings" button now uses JS confirmation; `wp_safe_redirect` added.
143
+ * Dev - Shortcodes - Orders - `[wcj_order_items_table]` - `columns` - `item_meta` column added.
144
+ * Dev - Shortcodes - Orders - `[wcj_order_items_table]` - `quantity_prefix` attribute added.
145
+ * Dev - Shortcodes - Orders - `[wcj_order_total_in_words]` - `LT` - Lithuanian language function added.
146
+ * Fix - Shortcodes - Orders - `[wcj_order_total_in_words]` - `BG` - not including national currency; Upper-case for first letter.
147
+ * Fix - PRICES & CURRENCIES - Prices and Currencies by Country - Add Countries Flags Images to Select Drop-Down Box - Flag image missing bug fixed.
148
+ * Dev - BUTTON & PRICE LABELS - Free Price Labels - Initial module release.
149
+ * Fix - PRODUCTS - Product Cost Price - Checking if order prices included taxes, when calculating "Profit" column.
150
+ * Dev - PDF INVOICING & PACKING SLIPS - General - "Do not create if order total equals zero" option added.
151
+ * Dev - EMAILS & MISC. - Export - "Export Orders Items" tool added.
152
+ * Dev - EMAILS & MISC. - Export - "Filter by All Fields" added.
153
+ * Dev - EMAILS & MISC. - Export - "Download XML" button added.
154
+ * Dev - EMAILS & MISC. - Export - Code refactoring.
155
+ * Dev - EMAILS & MISC. - Export - Customers - New customer fields added: "Login", "Nicename", "URL", "Registered", "Display Name".
156
+ * Dev - EMAILS & MISC. - Export - Customers - "Export Customers Fields" option added.
157
+ * Dev - EMAILS & MISC. - Export - Customers from Orders - `WP_Query` optimized to return `ids` only.
158
+ * Dev - EMAILS & MISC. - Export - Customers from Orders - "Export Customers from Orders Fields" option added.
159
+ * Dev - EMAILS & MISC. - Export - Customers from Orders - New fields added: "Billing Company", "Billing Address 1", "Billing Address 2", "Billing City", "Billing State", "Billing Postcode", "Billing Country", "Billing Phone".
160
+ * Dev - EMAILS & MISC. - Export - Orders - "Additional Export Orders Fields" options added.
161
+ * Dev - EMAILS & MISC. - Export - Orders - Corresponding data is gathered only if "Order Items" or "Order Items Product Input Fields" columns are enabled.
162
+ * Dev - EMAILS & MISC. - Export - Orders - Item meta info added to "Order Items" column.
163
+ * Dev - EMAILS & MISC. - Export - Products - New product fields added: "Price Including Tax", "Price Excluding Tax", "Display Price", "Average Rating", "Rating Count", "Review Count", "Categories", "Tags", "Dimensions", "Formatted Name", "Availability", "Availability Class".
164
+ * Tweak - Shortcodes - Orders - `[wcj_order_items_table]` - `get_meta_info` - replaced with `wcj_get_order_item_meta_info()`.
165
+ * Tweak - SHIPPING & ORDERS - Left to Free Shipping - Description updated.
166
+ * Tweak - EMAILS & MISC. - Export - Divided settings into separate sections.
167
+ * Tweak - Filters renamed.
168
+
169
  = 2.5.8 - 09/12/2016 =
170
  * Fix - `wcj_current_filter_priority()` modified for compatibility with WordPress since v4.7.
171
  * Dev - Shortcodes - General - `[wcj_get_left_to_free_shipping]` - `multiply_by` attribute added (and to `wcj_get_left_to_free_shipping()` function).
woocommerce-jetpack.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Booster for WooCommerce
4
  Plugin URI: http://booster.io
5
  Description: Supercharge your WooCommerce site with these awesome powerful features.
6
- Version: 2.5.8
7
  Author: Algoritmika Ltd
8
  Author URI: http://www.algoritmika.com
9
  Text Domain: woocommerce-jetpack
@@ -28,7 +28,7 @@ if ( ! class_exists( 'WC_Jetpack' ) ) :
28
  * Main WC_Jetpack Class
29
  *
30
  * @class WC_Jetpack
31
- * @version 2.5.8
32
  */
33
 
34
  final class WC_Jetpack {
@@ -39,7 +39,7 @@ final class WC_Jetpack {
39
  * @var string
40
  * @since 2.4.7
41
  */
42
- public $version = '2.5.8';
43
 
44
  /**
45
  * @var WC_Jetpack The single instance of the class
@@ -78,7 +78,7 @@ final class WC_Jetpack {
78
  /**
79
  * WC_Jetpack Constructor.
80
  *
81
- * @version 2.5.7
82
  * @access public
83
  */
84
  public function __construct() {
@@ -103,11 +103,11 @@ final class WC_Jetpack {
103
  // Settings
104
  if ( is_admin() ) {
105
  add_filter( 'woocommerce_get_settings_pages', array( $this, 'add_wcj_settings_tab' ), PHP_INT_MAX );
106
- add_filter( 'get_wc_jetpack_plus_message', array( $this, 'get_wcj_plus_message' ), 100, 2 );
107
  add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), array( $this, 'action_links' ) );
108
  add_action( 'admin_menu', array( $this, 'jetpack_menu' ), 100 );
109
  add_filter( 'admin_footer_text', array( $this, 'admin_footer_text' ), 2 );
110
- // add_action( 'admin_notices', array( $this, 'name_changed_notice' ) );
111
  }
112
 
113
  // Scripts
@@ -314,42 +314,43 @@ final class WC_Jetpack {
314
  }
315
 
316
  /**
317
- * name_changed_notice.
318
  *
319
- * @version 2.2.4
320
- * @since 2.2.4
321
  */
322
- /* public function name_changed_notice() {
323
-
324
- if ( ! is_admin() ) return;
325
-
326
- //require_once( ABSPATH . 'wp-includes/pluggable.php' );
327
- if ( ! wcj_is_user_role( 'administrator' ) ) return;
328
-
329
- $user_id = get_current_user_id();
330
-
331
- // Reset
332
- // update_option( 'wcj_rename_message_hidden', 'no' );
333
- // update_user_meta( $user_id, 'wcj_rename_message_hidden', 'no' );
334
-
335
- if ( isset( $_GET['wcj_rename_message_hide'] ) ) {
336
- // Hide message for current user
337
- update_user_meta( $user_id, 'wcj_rename_message_hidden', 'yes' );
338
- // update_option( 'wcj_rename_message_hidden', 'yes' );
339
- } else {
340
- $is_message_hidden = get_user_meta( $user_id, 'wcj_rename_message_hidden', true );
341
- // $is_message_hidden = get_option( 'wcj_rename_message_hidden', 'no' );
342
- if ( 'yes' != $is_message_hidden ) {
343
- // Show message
344
- $class = 'update-nag';
345
- $message = __( '<strong>WooCommerce Jetpack</strong> plugin changed its name to <strong>Booster for WooCommerce</strong>.', 'woocommerce-jetpack' );
346
- $button = '<a href="' . add_query_arg( 'wcj_rename_message_hide', '1' ) . '">'
347
- . '<button>' . __( 'Got it! Hide this message', 'woocommerce-jetpack' ) . '</button>'
348
- . '</a>';
349
- echo '<div class="' . $class . '"><p>' . $message . '</p><p>' . $button . '</p></div>';
350
  }
351
  }
352
- } */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
353
 
354
  /**
355
  * admin_footer_text
@@ -359,10 +360,6 @@ final class WC_Jetpack {
359
  function admin_footer_text( $footer_text ) {
360
  if ( isset( $_GET['page'] ) ) {
361
  if ( 'wcj-tools' === $_GET['page'] || ( 'wc-settings' === $_GET['page'] && isset( $_GET['tab'] ) && 'jetpack' === $_GET['tab'] ) ) {
362
- /* $rocket_icons = '';
363
- for ( $i = 0; $i < 5; $i++ ) {
364
- $rocket_icons .= wcj_get_rocket_icon();
365
- } */
366
  $rocket_icons = wcj_get_5_rocket_image();
367
  $rating_link = '<a href="https://wordpress.org/support/view/plugin-reviews/woocommerce-jetpack?filter=5#postform" target="_blank">' . $rocket_icons . '</a>';
368
  return sprintf(
@@ -401,7 +398,7 @@ final class WC_Jetpack {
401
  '<a href="' . admin_url( 'admin.php?page=wc-settings&tab=jetpack' ) . '">' . __( 'Settings', 'woocommerce' ) . '</a>',
402
  '<a href="' . esc_url( 'http://booster.io/' ) . '">' . __( 'Docs', 'woocommerce' ) . '</a>',
403
  );
404
- if ( 1 === apply_filters( 'wcj_get_option_filter', 1, '' ) ) {
405
  $custom_links[] = '<a href="' . esc_url( 'http://booster.io/plus/' ) . '">' . __( 'Unlock all', 'woocommerce' ) . '</a>';
406
  }
407
  return array_merge( $custom_links, $links );
@@ -488,13 +485,14 @@ final class WC_Jetpack {
488
  /**
489
  * include_functions.
490
  *
491
- * @version 2.5.0
492
  */
493
  private function include_functions() {
494
  include_once( 'includes/functions/wcj-debug-functions.php' );
495
  include_once( 'includes/functions/wcj-functions.php' );
496
  include_once( 'includes/functions/wcj-functions-number-to-words.php' );
497
  include_once( 'includes/functions/wcj-functions-number-to-words-bg.php' );
 
498
  include_once( 'includes/functions/wcj-html-functions.php' );
499
  include_once( 'includes/functions/wcj-country-functions.php' );
500
  include_once( 'includes/functions/wcj-invoicing-functions.php' );
@@ -524,12 +522,13 @@ final class WC_Jetpack {
524
  /**
525
  * Include modules and submodules
526
  *
527
- * @version 2.5.8
528
  */
529
  function include_modules() {
530
  $modules_files = array(
531
  'includes/class-wcj-price-labels.php',
532
  'includes/class-wcj-call-for-price.php',
 
533
  'includes/class-wcj-product-listings.php',
534
  'includes/class-wcj-sorting.php',
535
  'includes/class-wcj-product-custom-info.php',
3
  Plugin Name: Booster for WooCommerce
4
  Plugin URI: http://booster.io
5
  Description: Supercharge your WooCommerce site with these awesome powerful features.
6
+ Version: 2.5.9
7
  Author: Algoritmika Ltd
8
  Author URI: http://www.algoritmika.com
9
  Text Domain: woocommerce-jetpack
28
  * Main WC_Jetpack Class
29
  *
30
  * @class WC_Jetpack
31
+ * @version 2.5.9
32
  */
33
 
34
  final class WC_Jetpack {
39
  * @var string
40
  * @since 2.4.7
41
  */
42
+ public $version = '2.5.9';
43
 
44
  /**
45
  * @var WC_Jetpack The single instance of the class
78
  /**
79
  * WC_Jetpack Constructor.
80
  *
81
+ * @version 2.5.9
82
  * @access public
83
  */
84
  public function __construct() {
103
  // Settings
104
  if ( is_admin() ) {
105
  add_filter( 'woocommerce_get_settings_pages', array( $this, 'add_wcj_settings_tab' ), PHP_INT_MAX );
106
+ add_filter( 'booster_get_message', array( $this, 'get_wcj_plus_message' ), 100, 2 );
107
  add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), array( $this, 'action_links' ) );
108
  add_action( 'admin_menu', array( $this, 'jetpack_menu' ), 100 );
109
  add_filter( 'admin_footer_text', array( $this, 'admin_footer_text' ), 2 );
110
+ add_action( 'admin_notices', array( $this, 'check_plus_version' ) );
111
  }
112
 
113
  // Scripts
314
  }
315
 
316
  /**
317
+ * check_plus_version.
318
  *
319
+ * @version 2.5.9
320
+ * @since 2.5.9
321
  */
322
+ function check_plus_version() {
323
+ if ( ! is_admin() ) {
324
+ return;
325
+ }
326
+ // Check if Plus is installed and activated
327
+ $is_plus_active = false;
328
+ $active_plugins = apply_filters( 'active_plugins', get_option( 'active_plugins', array() ) );
329
+ if ( is_multisite() ) {
330
+ $active_plugins = array_merge( $active_plugins, array_keys( get_site_option( 'active_sitewide_plugins', array() ) ) );
331
+ }
332
+ foreach ( $active_plugins as $active_plugin ) {
333
+ $active_plugin = explode( '/', $active_plugin );
334
+ if ( isset( $active_plugin[1] ) && 'woocommerce-jetpack-plus.php' === $active_plugin[1] ) {
335
+ $is_plus_active = true;
336
+ break;
 
 
 
 
 
 
 
 
 
 
 
 
 
337
  }
338
  }
339
+ // Check Plus version
340
+ if ( $is_plus_active ) {
341
+ $plus_version = get_option( 'booster_plus_version', false );
342
+ $required_plus_version = '1.1.0';
343
+ if ( 0 != version_compare( $plus_version, $required_plus_version ) ) {
344
+ $class = 'notice notice-error';
345
+ $message = sprintf(
346
+ __( 'Please upgrade <strong>Booster Plus for WooCommerce</strong> plugin to version %s. Please visit <a href="%s">your account</a> on booster.io to download the latest Booster Plus version.', 'woocommerce-jetpack' ),
347
+ $required_plus_version,
348
+ 'http://booster.io/my-account/?utm_source=plus_update'
349
+ );
350
+ echo '<div class="' . $class . '"><p>' . $message . '</p></div>';
351
+ }
352
+ }
353
+ }
354
 
355
  /**
356
  * admin_footer_text
360
  function admin_footer_text( $footer_text ) {
361
  if ( isset( $_GET['page'] ) ) {
362
  if ( 'wcj-tools' === $_GET['page'] || ( 'wc-settings' === $_GET['page'] && isset( $_GET['tab'] ) && 'jetpack' === $_GET['tab'] ) ) {
 
 
 
 
363
  $rocket_icons = wcj_get_5_rocket_image();
364
  $rating_link = '<a href="https://wordpress.org/support/view/plugin-reviews/woocommerce-jetpack?filter=5#postform" target="_blank">' . $rocket_icons . '</a>';
365
  return sprintf(
398
  '<a href="' . admin_url( 'admin.php?page=wc-settings&tab=jetpack' ) . '">' . __( 'Settings', 'woocommerce' ) . '</a>',
399
  '<a href="' . esc_url( 'http://booster.io/' ) . '">' . __( 'Docs', 'woocommerce' ) . '</a>',
400
  );
401
+ if ( 1 === apply_filters( 'booster_get_option', 1, '' ) ) {
402
  $custom_links[] = '<a href="' . esc_url( 'http://booster.io/plus/' ) . '">' . __( 'Unlock all', 'woocommerce' ) . '</a>';
403
  }
404
  return array_merge( $custom_links, $links );
485
  /**
486
  * include_functions.
487
  *
488
+ * @version 2.5.9
489
  */
490
  private function include_functions() {
491
  include_once( 'includes/functions/wcj-debug-functions.php' );
492
  include_once( 'includes/functions/wcj-functions.php' );
493
  include_once( 'includes/functions/wcj-functions-number-to-words.php' );
494
  include_once( 'includes/functions/wcj-functions-number-to-words-bg.php' );
495
+ include_once( 'includes/functions/wcj-functions-number-to-words-lt.php' );
496
  include_once( 'includes/functions/wcj-html-functions.php' );
497
  include_once( 'includes/functions/wcj-country-functions.php' );
498
  include_once( 'includes/functions/wcj-invoicing-functions.php' );
522
  /**
523
  * Include modules and submodules
524
  *
525
+ * @version 2.5.9
526
  */
527
  function include_modules() {
528
  $modules_files = array(
529
  'includes/class-wcj-price-labels.php',
530
  'includes/class-wcj-call-for-price.php',
531
+ 'includes/class-wcj-free-price.php',
532
  'includes/class-wcj-product-listings.php',
533
  'includes/class-wcj-sorting.php',
534
  'includes/class-wcj-product-custom-info.php',