Booster for WooCommerce - Version 3.1.1

Version Description

  • 17/09/2017 =
  • Dev - Version message added.
  • Dev - WCJ_Module - create_meta_box() - show_value option added.
  • Dev - WCJ_Module - create_meta_box() - class option added.
  • Dev - Functions - Order - [wcj_get_order_id] - Check added (is_object( $_order )).
  • Dev - Shortcodes - General - [wcj_current_currency_code] and [wcj_current_currency_symbol] shortcodes added.
  • Dev - Shortcodes - Products - [wcj_product_you_save] - multiply_by attribute added.
  • Fix - PRICES & CURRENCIES - Product Price by Formula - "Enable Price Calculation By Formula For All Products" option fixed (disabled).
  • Dev - PRICES & CURRENCIES - Product Price by Formula - Settings restyled.
  • Dev - PRODUCTS - Product Visibility by Country - Admin Options - "Visibility Method" option added.
  • Dev - PRODUCTS - Product Visibility by Country - Admin Options - "Country List" option added.
  • Dev - PRODUCTS - Related Products - Hide - "Include/Exclude Categories/Tags/Products" options added.
  • Fix - PRODUCTS - Related Products - "Clear all products transients" button - post_status error fixed.
  • Fix - PDF INVOICING & PACKING SLIPS - General - "Do not create if order total equals zero" fixed (for "Invoice").
  • Dev - PDF INVOICING & PACKING SLIPS - Emails - add_pdf_invoice_email_attachment() - Check added (is_object( $order )).
Download this release

Release Info

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

Code changes from version 3.1.0 to 3.1.1

includes/admin/class-wc-settings-jetpack.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce - Settings
4
  *
5
- * @version 3.1.0
6
  * @since 1.0.0
7
  * @author Algoritmika Ltd.
8
  */
@@ -438,7 +438,7 @@ class WC_Settings_Jetpack extends WC_Settings_Page {
438
  /**
439
  * get_manager_settings.
440
  *
441
- * @version 3.1.0
442
  * @since 2.6.0
443
  * @return array
444
  */
@@ -459,6 +459,7 @@ class WC_Settings_Jetpack extends WC_Settings_Page {
459
  __( 'Gateways per Product or Category', 'woocommerce-jetpack' ),
460
  __( 'Product Input Fields', 'woocommerce-jetpack' ),
461
  __( 'Global Discount', 'woocommerce-jetpack' ),
 
462
  ) ) ),
463
  'id' => 'wcj_list_for_products',
464
  'default' => 'yes',
2
  /**
3
  * Booster for WooCommerce - Settings
4
  *
5
+ * @version 3.1.1
6
  * @since 1.0.0
7
  * @author Algoritmika Ltd.
8
  */
438
  /**
439
  * get_manager_settings.
440
  *
441
+ * @version 3.1.1
442
  * @since 2.6.0
443
  * @return array
444
  */
459
  __( 'Gateways per Product or Category', 'woocommerce-jetpack' ),
460
  __( 'Product Input Fields', 'woocommerce-jetpack' ),
461
  __( 'Global Discount', 'woocommerce-jetpack' ),
462
+ __( 'Related Products', 'woocommerce-jetpack' ),
463
  ) ) ),
464
  'id' => 'wcj_list_for_products',
465
  'default' => 'yes',
includes/class-wcj-product-by-country.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce - Module - Product Visibility by Country
4
  *
5
- * @version 3.1.0
6
  * @since 2.5.0
7
  * @author Algoritmika Ltd.
8
  */
@@ -69,16 +69,30 @@ class WCJ_Product_By_Country extends WCJ_Module {
69
  /**
70
  * render_product_column.
71
  *
72
- * @version 2.9.0
73
  * @since 2.9.0
74
  */
75
  function render_product_column( $column ) {
76
  if ( 'wcj_product_by_country_visible_countries' === $column ) {
77
- if ( $countries = get_post_meta( get_the_ID(), '_' . 'wcj_product_by_country_visible', true ) ) {
78
- if ( is_array( $countries ) ) {
79
- echo implode( ', ', $countries );
 
 
 
 
 
 
 
 
 
 
 
 
 
80
  }
81
  }
 
82
  }
83
  }
84
 
@@ -130,15 +144,33 @@ class WCJ_Product_By_Country extends WCJ_Module {
130
  /**
131
  * is_product_visible_in_country.
132
  *
133
- * @version 3.1.0
134
  * @since 3.1.0
135
  */
136
  function is_product_visible_in_country( $product_id, $country ) {
137
- $countries = get_post_meta( $product_id, '_' . 'wcj_product_by_country_visible', true );
138
- if ( is_array( $countries ) && in_array( 'EU', $countries ) ) {
139
- $countries = array_merge( $countries, wcj_get_european_union_countries() );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
140
  }
141
- return ( is_array( $countries ) && ! in_array( $country, $countries ) ? false : true );
142
  }
143
 
144
  /**
2
  /**
3
  * Booster for WooCommerce - Module - Product Visibility by Country
4
  *
5
+ * @version 3.1.1
6
  * @since 2.5.0
7
  * @author Algoritmika Ltd.
8
  */
69
  /**
70
  * render_product_column.
71
  *
72
+ * @version 3.1.1
73
  * @since 2.9.0
74
  */
75
  function render_product_column( $column ) {
76
  if ( 'wcj_product_by_country_visible_countries' === $column ) {
77
+ $result = '';
78
+ if ( 'invisible' != apply_filters( 'booster_get_option', 'visible', get_option( 'wcj_product_by_country_visibility_method', 'visible' ) ) ) {
79
+ if ( $countries = get_post_meta( get_the_ID(), '_' . 'wcj_product_by_country_visible', true ) ) {
80
+ if ( is_array( $countries ) ) {
81
+ $result .= '<span style="color:green;">' . implode( ', ', $countries ) . '</span>';
82
+ }
83
+ }
84
+ }
85
+ if ( 'visible' != apply_filters( 'booster_get_option', 'visible', get_option( 'wcj_product_by_country_visibility_method', 'visible' ) ) ) {
86
+ if ( $countries = get_post_meta( get_the_ID(), '_' . 'wcj_product_by_country_invisible', true ) ) {
87
+ if ( is_array( $countries ) ) {
88
+ if ( '' != $result ) {
89
+ $result .= '<br>';
90
+ }
91
+ $result .= '<span style="color:red;">' . implode( ', ', $countries ) . '</span>';
92
+ }
93
  }
94
  }
95
+ echo $result;
96
  }
97
  }
98
 
144
  /**
145
  * is_product_visible_in_country.
146
  *
147
+ * @version 3.1.1
148
  * @since 3.1.0
149
  */
150
  function is_product_visible_in_country( $product_id, $country ) {
151
+ if ( 'invisible' != apply_filters( 'booster_get_option', 'visible', get_option( 'wcj_product_by_country_visibility_method', 'visible' ) ) ) {
152
+ $countries = get_post_meta( $product_id, '_' . 'wcj_product_by_country_visible', true );
153
+ if ( ! empty( $countries ) && is_array( $countries ) ) {
154
+ if ( in_array( 'EU', $countries ) ) {
155
+ $countries = array_merge( $countries, wcj_get_european_union_countries() );
156
+ }
157
+ if ( ! in_array( $country, $countries ) ) {
158
+ return false;
159
+ }
160
+ }
161
+ }
162
+ if ( 'visible' != apply_filters( 'booster_get_option', 'visible', get_option( 'wcj_product_by_country_visibility_method', 'visible' ) ) ) {
163
+ $countries = get_post_meta( $product_id, '_' . 'wcj_product_by_country_invisible', true );
164
+ if ( ! empty( $countries ) && is_array( $countries ) ) {
165
+ if ( in_array( 'EU', $countries ) ) {
166
+ $countries = array_merge( $countries, wcj_get_european_union_countries() );
167
+ }
168
+ if ( in_array( $country, $countries ) ) {
169
+ return false;
170
+ }
171
+ }
172
  }
173
+ return true;
174
  }
175
 
176
  /**
includes/class-wcj-related-products.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce - Module - Related Products
4
  *
5
- * @version 2.8.0
6
  * @author Algoritmika Ltd.
7
  */
8
 
@@ -30,7 +30,7 @@ class WCJ_Related_Products extends WCJ_Module {
30
  /**
31
  * Constructor.
32
  *
33
- * @version 2.8.0
34
  */
35
  function __construct() {
36
 
@@ -88,19 +88,56 @@ class WCJ_Related_Products extends WCJ_Module {
88
 
89
  // Hide Related
90
  if ( 'yes' === get_option( 'wcj_product_info_related_products_hide', 'no' ) ) {
91
- add_action( 'init', array( $this, 'remove_output_related_products_action' ), PHP_INT_MAX );
92
  }
93
 
94
  }
95
  }
96
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
97
  /**
98
  * remove_output_related_products_action.
99
  *
100
- * @version 2.8.0
101
  * @since 2.8.0
102
  */
103
  function remove_output_related_products_action( $args ) {
 
 
 
104
  remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20 );
105
  }
106
 
@@ -322,7 +359,7 @@ class WCJ_Related_Products extends WCJ_Module {
322
  /**
323
  * maybe_delete_product_transients.
324
  *
325
- * @since 2.6.0
326
  * @version 2.6.0
327
  */
328
  function maybe_delete_product_transients() {
@@ -332,7 +369,7 @@ class WCJ_Related_Products extends WCJ_Module {
332
  while( true ) {
333
  $args = array(
334
  'post_type' => 'product',
335
- 'post_status' => $post_status,
336
  'posts_per_page' => $block_size,
337
  'offset' => $offset,
338
  'orderby' => 'title',
2
  /**
3
  * Booster for WooCommerce - Module - Related Products
4
  *
5
+ * @version 3.1.1
6
  * @author Algoritmika Ltd.
7
  */
8
 
30
  /**
31
  * Constructor.
32
  *
33
+ * @version 3.1.1
34
  */
35
  function __construct() {
36
 
88
 
89
  // Hide Related
90
  if ( 'yes' === get_option( 'wcj_product_info_related_products_hide', 'no' ) ) {
91
+ add_action( ( $this->do_hide_for_all_products() ? 'init' : 'wp_head' ), array( $this, 'remove_output_related_products_action' ), PHP_INT_MAX );
92
  }
93
 
94
  }
95
  }
96
 
97
+ /**
98
+ * do_hide_for_all_products.
99
+ *
100
+ * @version 3.1.1
101
+ * @since 3.1.1
102
+ */
103
+ function do_hide_for_all_products() {
104
+ return (
105
+ '' == get_option( 'wcj_product_info_related_products_hide_products_incl', '' ) &&
106
+ '' == get_option( 'wcj_product_info_related_products_hide_products_excl', '' ) &&
107
+ '' == get_option( 'wcj_product_info_related_products_hide_cats_incl', '' ) &&
108
+ '' == get_option( 'wcj_product_info_related_products_hide_cats_excl', '' ) &&
109
+ '' == get_option( 'wcj_product_info_related_products_hide_tags_incl', '' ) &&
110
+ '' == get_option( 'wcj_product_info_related_products_hide_tags_excl', '' )
111
+ );
112
+ }
113
+
114
+ /**
115
+ * do_hide_for_product.
116
+ *
117
+ * @version 3.1.1
118
+ * @since 3.1.1
119
+ */
120
+ function do_hide_for_product( $product_id ) {
121
+ return wcj_is_enabled_for_product( $product_id, array(
122
+ 'include_products' => get_option( 'wcj_product_info_related_products_hide_products_incl', '' ),
123
+ 'exclude_products' => get_option( 'wcj_product_info_related_products_hide_products_excl', '' ),
124
+ 'include_categories' => get_option( 'wcj_product_info_related_products_hide_cats_incl', '' ),
125
+ 'exclude_categories' => get_option( 'wcj_product_info_related_products_hide_cats_excl', '' ),
126
+ 'include_tags' => get_option( 'wcj_product_info_related_products_hide_tags_incl', '' ),
127
+ 'exclude_tags' => get_option( 'wcj_product_info_related_products_hide_tags_excl', '' ),
128
+ ) );
129
+ }
130
+
131
  /**
132
  * remove_output_related_products_action.
133
  *
134
+ * @version 3.1.1
135
  * @since 2.8.0
136
  */
137
  function remove_output_related_products_action( $args ) {
138
+ if ( ! $this->do_hide_for_all_products() && ! $this->do_hide_for_product( get_the_ID() ) ) {
139
+ return;
140
+ }
141
  remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20 );
142
  }
143
 
359
  /**
360
  * maybe_delete_product_transients.
361
  *
362
+ * @since 3.1.1
363
  * @version 2.6.0
364
  */
365
  function maybe_delete_product_transients() {
369
  while( true ) {
370
  $args = array(
371
  'post_type' => 'product',
372
+ 'post_status' => 'any',
373
  'posts_per_page' => $block_size,
374
  'offset' => $offset,
375
  'orderby' => 'title',
includes/classes/class-wcj-invoice.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce Invoice
4
  *
5
- * @version 2.5.9
6
  * @author Algoritmika Ltd.
7
  */
8
 
@@ -50,13 +50,13 @@ class WCJ_Invoice {
50
  /**
51
  * create.
52
  *
53
- * @version 2.5.9
54
  * @todo use mysql transaction enabled (as in "wcj_order_number_use_mysql_transaction_enabled")
55
  */
56
  function create( $date = '' ) {
57
  $order_id = $this->order_id;
58
  $invoice_type = $this->invoice_type;
59
- if ( 'yes' === apply_filters( 'booster_get_option', 'no', get_option( 'wcj_invoicing_' . $invoice_type . '_skip_zero_total', 'no' ) ) ) {
60
  $_order = wc_get_order( $order_id );
61
  if ( 0 == $_order->get_total() ) {
62
  return;
2
  /**
3
  * Booster for WooCommerce Invoice
4
  *
5
+ * @version 3.1.1
6
  * @author Algoritmika Ltd.
7
  */
8
 
50
  /**
51
  * create.
52
  *
53
+ * @version 3.1.1
54
  * @todo use mysql transaction enabled (as in "wcj_order_number_use_mysql_transaction_enabled")
55
  */
56
  function create( $date = '' ) {
57
  $order_id = $this->order_id;
58
  $invoice_type = $this->invoice_type;
59
+ if ( 'yes' === get_option( 'wcj_invoicing_' . $invoice_type . '_skip_zero_total', 'no' ) ) {
60
  $_order = wc_get_order( $order_id );
61
  if ( 0 == $_order->get_total() ) {
62
  return;
includes/classes/class-wcj-module.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce Module
4
  *
5
- * @version 3.0.0
6
  * @since 2.2.0
7
  * @author Algoritmika Ltd.
8
  */
@@ -274,8 +274,10 @@ if ( ! class_exists( 'WCJ_Module' ) ) :
274
  /**
275
  * create_meta_box.
276
  *
277
- * @version 2.9.0
278
- * @todo placeholder for textarea
 
 
279
  */
280
  function create_meta_box() {
281
  $current_post_id = get_the_ID();
@@ -297,7 +299,9 @@ if ( ! class_exists( 'WCJ_Module' ) ) :
297
  } else {
298
  $option_value = ( isset( $option['default'] ) ) ? $option['default'] : '';
299
  }
300
- $css = ( isset( $option['css'] ) ) ? $option['css'] : '';
 
 
301
  $input_ending = '';
302
  if ( 'select' === $option['type'] ) {
303
  if ( isset( $option['multiple'] ) ) {
@@ -338,7 +342,8 @@ if ( ! class_exists( 'WCJ_Module' ) ) :
338
  }
339
  switch ( $option['type'] ) {
340
  case 'price':
341
- $field_html = '<input style="' . $css . '" class="short wc_input_price" type="number" step="' . apply_filters( 'wcj_get_meta_box_options_type_price_step', '0.0001' ) . '"' . $input_ending;
 
342
  break;
343
  case 'date':
344
  $field_html = '<input style="' . $css . '" class="input-text" display="date" type="text"' . $input_ending;
@@ -347,7 +352,9 @@ if ( ! class_exists( 'WCJ_Module' ) ) :
347
  $field_html = '<textarea style="' . $css . '" id="' . $option['name'] . '" name="' . $option['name'] . '">' . $option_value . '</textarea>';
348
  break;
349
  case 'select':
350
- $field_html = '<select' . $custom_attributes . ' style="' . $css . '" id="' . $option['name'] . '" name="' . $option_name . '">' . $options . '</select>';
 
 
351
  break;
352
  default:
353
  $field_html = '<input style="' . $css . '" class="short" type="' . $option['type'] . '"' . $input_ending;
@@ -355,7 +362,7 @@ if ( ! class_exists( 'WCJ_Module' ) ) :
355
  }
356
  $html .= '<tr>';
357
  $maybe_tooltip = ( isset( $option['tooltip'] ) && '' != $option['tooltip'] ) ? wc_help_tip( $option['tooltip'], true ) : '';
358
- $html .= '<th style="text-align:left;width:25%;">' . $option['title'] . $maybe_tooltip . '</th>';
359
  if ( isset( $option['desc'] ) && '' != $option['desc'] ) {
360
  $html .= '<td style="font-style:italic;width:25%;">' . $option['desc'] . '</td>';
361
  }
2
  /**
3
  * Booster for WooCommerce Module
4
  *
5
+ * @version 3.1.1
6
  * @since 2.2.0
7
  * @author Algoritmika Ltd.
8
  */
274
  /**
275
  * create_meta_box.
276
  *
277
+ * @version 3.1.1
278
+ * @todo `placeholder` for textarea
279
+ * @todo `class` for all types (now only for select)
280
+ * @todo `show_value` for all types (now only for multiple select)
281
  */
282
  function create_meta_box() {
283
  $current_post_id = get_the_ID();
299
  } else {
300
  $option_value = ( isset( $option['default'] ) ) ? $option['default'] : '';
301
  }
302
+ $css = ( isset( $option['css'] ) ? $option['css'] : '' );
303
+ $class = ( isset( $option['class'] ) ? $option['class'] : '' );
304
+ $show_value = ( isset( $option['show_value'] ) && $option['show_value'] );
305
  $input_ending = '';
306
  if ( 'select' === $option['type'] ) {
307
  if ( isset( $option['multiple'] ) ) {
342
  }
343
  switch ( $option['type'] ) {
344
  case 'price':
345
+ $field_html = '<input style="' . $css . '" class="short wc_input_price" type="number" step="' .
346
+ apply_filters( 'wcj_get_meta_box_options_type_price_step', '0.0001' ) . '"' . $input_ending;
347
  break;
348
  case 'date':
349
  $field_html = '<input style="' . $css . '" class="input-text" display="date" type="text"' . $input_ending;
352
  $field_html = '<textarea style="' . $css . '" id="' . $option['name'] . '" name="' . $option['name'] . '">' . $option_value . '</textarea>';
353
  break;
354
  case 'select':
355
+ $field_html = '<select' . $custom_attributes . ' class="' . $class . '" style="' . $css . '" id="' . $option['name'] . '" name="' .
356
+ $option_name . '">' . $options . '</select>' .
357
+ ( $show_value && ! empty( $option_value ) ? sprintf( '<em>' . __( 'Selected: %s.', 'woocommerce-jetpack' ), implode( ', ', $option_value ) ) . '</em>' : '' );
358
  break;
359
  default:
360
  $field_html = '<input style="' . $css . '" class="short" type="' . $option['type'] . '"' . $input_ending;
362
  }
363
  $html .= '<tr>';
364
  $maybe_tooltip = ( isset( $option['tooltip'] ) && '' != $option['tooltip'] ) ? wc_help_tip( $option['tooltip'], true ) : '';
365
+ $html .= '<th style="text-align:left;width:25%;font-weight:bold;">' . $option['title'] . $maybe_tooltip . '</th>';
366
  if ( isset( $option['desc'] ) && '' != $option['desc'] ) {
367
  $html .= '<td style="font-style:italic;width:25%;">' . $option['desc'] . '</td>';
368
  }
includes/functions/wcj-order-functions.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce - Functions - Order
4
  *
5
- * @version 3.1.0
6
  * @since 2.9.0
7
  * @author Algoritmika Ltd.
8
  */
@@ -37,10 +37,13 @@ if ( ! function_exists( 'wcj_get_order_id' ) ) {
37
  /**
38
  * wcj_get_order_id.
39
  *
40
- * @version 2.7.0
41
  * @since 2.7.0
42
  */
43
  function wcj_get_order_id( $_order ) {
 
 
 
44
  return ( WCJ_IS_WC_VERSION_BELOW_3 ) ? $_order->id : $_order->get_id();
45
  }
46
  }
2
  /**
3
  * Booster for WooCommerce - Functions - Order
4
  *
5
+ * @version 3.1.1
6
  * @since 2.9.0
7
  * @author Algoritmika Ltd.
8
  */
37
  /**
38
  * wcj_get_order_id.
39
  *
40
+ * @version 3.1.1
41
  * @since 2.7.0
42
  */
43
  function wcj_get_order_id( $_order ) {
44
+ if ( ! $_order || ! is_object( $_order ) ) {
45
+ return 0;
46
+ }
47
  return ( WCJ_IS_WC_VERSION_BELOW_3 ) ? $_order->id : $_order->get_id();
48
  }
49
  }
includes/pdf-invoices/submodules/class-wcj-pdf-invoicing-emails.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce - PDF Invoicing - Email Options
4
  *
5
- * @version 2.8.0
6
  * @author Algoritmika Ltd.
7
  */
8
 
@@ -48,9 +48,12 @@ class WCJ_PDF_Invoicing_Emails extends WCJ_Module {
48
  /**
49
  * add_pdf_invoice_email_attachment.
50
  *
51
- * @version 2.8.0
52
  */
53
  function add_pdf_invoice_email_attachment( $attachments, $status, $order ) {
 
 
 
54
  $invoice_types_ids = wcj_get_enabled_invoice_types_ids();
55
  foreach ( $invoice_types_ids as $invoice_type_id ) {
56
  if ( false === $this->do_attach_for_payment_method( $invoice_type_id, wcj_order_get_payment_method( $order ) ) ) {
2
  /**
3
  * Booster for WooCommerce - PDF Invoicing - Email Options
4
  *
5
+ * @version 3.1.1
6
  * @author Algoritmika Ltd.
7
  */
8
 
48
  /**
49
  * add_pdf_invoice_email_attachment.
50
  *
51
+ * @version 3.1.1
52
  */
53
  function add_pdf_invoice_email_attachment( $attachments, $status, $order ) {
54
+ if ( ! $order || ! is_object( $order ) ) {
55
+ return $attachments;
56
+ }
57
  $invoice_types_ids = wcj_get_enabled_invoice_types_ids();
58
  foreach ( $invoice_types_ids as $invoice_type_id ) {
59
  if ( false === $this->do_attach_for_payment_method( $invoice_type_id, wcj_order_get_payment_method( $order ) ) ) {
includes/settings/meta-box/wcj-settings-meta-box-product-by-country.php CHANGED
@@ -2,21 +2,46 @@
2
  /**
3
  * Booster for WooCommerce - Settings Meta Box - Product Visibility by Country
4
  *
5
- * @version 2.8.0
6
  * @since 2.8.0
7
  * @author Algoritmika Ltd.
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
11
 
12
- return array(
13
- array(
14
- 'title' => __( 'Visible in Countries', 'woocommerce-jetpack' ),
15
- 'name' => 'wcj_product_by_country_visible',
16
- 'default' => '',
17
- 'type' => 'select',
18
- 'options' => wcj_get_countries(),
19
- 'multiple' => true,
20
- 'css' => 'height:300px;',
21
- ),
22
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  /**
3
  * Booster for WooCommerce - Settings Meta Box - Product Visibility by Country
4
  *
5
+ * @version 3.1.1
6
  * @since 2.8.0
7
  * @author Algoritmika Ltd.
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
11
 
12
+ $countries = ( 'wc' === apply_filters( 'booster_get_option', 'all', get_option( 'wcj_product_by_country_country_list', 'all' ) ) ? WC()->countries->get_allowed_countries() : wcj_get_countries() );
13
+
14
+ $options = array();
15
+ if ( 'invisible' != apply_filters( 'booster_get_option', 'visible', get_option( 'wcj_product_by_country_visibility_method', 'visible' ) ) ) {
16
+ $options = array_merge( $options, array(
17
+ array(
18
+ 'title' => __( 'Visible in Countries', 'woocommerce-jetpack' ),
19
+ 'tooltip' => __( 'Use "Control" key to select/deselect multiple countries. Hold "Control" and "A" to select all countries. Leave empty to disable.', 'woocommerce-jetpack' ),
20
+ 'name' => 'wcj_product_by_country_visible',
21
+ 'default' => '',
22
+ 'type' => 'select',
23
+ 'options' => $countries,
24
+ 'multiple' => true,
25
+ 'css' => 'height:200px;',
26
+ 'class' => 'widefat',
27
+ 'show_value' => true,
28
+ ),
29
+ ) );
30
+ }
31
+ if ( 'visible' != apply_filters( 'booster_get_option', 'visible', get_option( 'wcj_product_by_country_visibility_method', 'visible' ) ) ) {
32
+ $options = array_merge( $options, array(
33
+ array(
34
+ 'title' => __( 'Invisible in Countries', 'woocommerce-jetpack' ),
35
+ 'tooltip' => __( 'Use "Control" key to select/deselect multiple countries. Hold "Control" and "A" to select all countries. Leave empty to disable.', 'woocommerce-jetpack' ),
36
+ 'name' => 'wcj_product_by_country_invisible',
37
+ 'default' => '',
38
+ 'type' => 'select',
39
+ 'options' => $countries,
40
+ 'multiple' => true,
41
+ 'css' => 'height:200px;',
42
+ 'class' => 'widefat',
43
+ 'show_value' => true,
44
+ ),
45
+ ) );
46
+ }
47
+ return $options;
includes/settings/wcj-settings-product-by-country.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce - Settings - Product Visibility by Country
4
  *
5
- * @version 3.1.0
6
  * @since 2.9.0
7
  * @author Algoritmika Ltd.
8
  */
@@ -54,7 +54,7 @@ return array(
54
  'desc' => sprintf(
55
  __( 'If "Manually" option is selected, you can add country selection drop box to frontend with "%s" widget or %s shortcode.', 'woocommerce-jetpack' ),
56
  __( 'Booster - Selector', 'woocommerce-jetpack' ),
57
- '<code>' . '[wcj_selector selector_type="country"]' . '</code>' ) . ' ' . apply_filters( 'booster_get_message', '', 'desc' ),
58
  'id' => 'wcj_product_by_country_selection_method',
59
  'default' => 'by_ip',
60
  'type' => 'select',
@@ -63,6 +63,7 @@ return array(
63
  'manual' => __( 'Manually', 'woocommerce-jetpack' ),
64
  ),
65
  'custom_attributes' => apply_filters( 'booster_get_message', '', 'disabled' ),
 
66
  ),
67
  array(
68
  'type' => 'sectionend',
@@ -73,6 +74,36 @@ return array(
73
  'type' => 'title',
74
  'id' => 'wcj_product_by_country_admin_options',
75
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
76
  array(
77
  'title' => __( 'Admin Products List Column', 'woocommerce-jetpack' ),
78
  'desc_tip' => __( 'This will add "Countries" column to the admin products list.', 'woocommerce-jetpack' ),
2
  /**
3
  * Booster for WooCommerce - Settings - Product Visibility by Country
4
  *
5
+ * @version 3.1.1
6
  * @since 2.9.0
7
  * @author Algoritmika Ltd.
8
  */
54
  'desc' => sprintf(
55
  __( 'If "Manually" option is selected, you can add country selection drop box to frontend with "%s" widget or %s shortcode.', 'woocommerce-jetpack' ),
56
  __( 'Booster - Selector', 'woocommerce-jetpack' ),
57
+ '<code>' . '[wcj_selector selector_type="country"]' . '</code>' ) . '<br>' . apply_filters( 'booster_get_message', '', 'desc' ),
58
  'id' => 'wcj_product_by_country_selection_method',
59
  'default' => 'by_ip',
60
  'type' => 'select',
63
  'manual' => __( 'Manually', 'woocommerce-jetpack' ),
64
  ),
65
  'custom_attributes' => apply_filters( 'booster_get_message', '', 'disabled' ),
66
+ 'css' => 'min-width:250px;',
67
  ),
68
  array(
69
  'type' => 'sectionend',
74
  'type' => 'title',
75
  'id' => 'wcj_product_by_country_admin_options',
76
  ),
77
+ array(
78
+ 'title' => __( 'Country List', 'woocommerce-jetpack' ),
79
+ 'desc_tip' => __( 'This option sets which countries will be added to list in product\'s edit page. Possible values: "All countries" or "WooCommerce selling locations".', 'woocommerce-jetpack' ),
80
+ 'desc' => sprintf( __( 'If "WooCommerce selling locations" option is selected, country list will be set by <a href="%s">WooCommerce > Settings > General > Selling location(s)</a>.', 'woocommerce-jetpack' ),
81
+ admin_url( 'admin.php?page=wc-settings' ) ) . '<br>' . apply_filters( 'booster_get_message', '', 'desc' ),
82
+ 'id' => 'wcj_product_by_country_country_list',
83
+ 'default' => 'all',
84
+ 'type' => 'select',
85
+ 'options' => array(
86
+ 'all' => __( 'All countries', 'woocommerce-jetpack' ),
87
+ 'wc' => __( 'WooCommerce selling locations', 'woocommerce-jetpack' ),
88
+ ),
89
+ 'custom_attributes' => apply_filters( 'booster_get_message', '', 'disabled' ),
90
+ 'css' => 'min-width:250px;',
91
+ ),
92
+ array(
93
+ 'title' => __( 'Visibility Method', 'woocommerce-jetpack' ),
94
+ 'desc_tip' => __( 'This option sets how do you want to set product\'s visibility. Possible values: "Set visible countries", "Set invisible countries" or "Set both".', 'woocommerce-jetpack' ),
95
+ 'id' => 'wcj_product_by_country_visibility_method',
96
+ 'default' => 'visible',
97
+ 'type' => 'select',
98
+ 'options' => array(
99
+ 'visible' => __( 'Set visible countries', 'woocommerce-jetpack' ),
100
+ 'invisible' => __( 'Set invisible countries', 'woocommerce-jetpack' ),
101
+ 'both' => __( 'Set both', 'woocommerce-jetpack' ),
102
+ ),
103
+ 'desc' => '<br>' . apply_filters( 'booster_get_message', '', 'desc' ),
104
+ 'custom_attributes' => apply_filters( 'booster_get_message', '', 'disabled' ),
105
+ 'css' => 'min-width:250px;',
106
+ ),
107
  array(
108
  'title' => __( 'Admin Products List Column', 'woocommerce-jetpack' ),
109
  'desc_tip' => __( 'This will add "Countries" column to the admin products list.', 'woocommerce-jetpack' ),
includes/settings/wcj-settings-product-price-by-formula.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce - Settings - Product Price by Formula
4
  *
5
- * @version 2.8.0
6
  * @since 2.8.0
7
  * @author Algoritmika Ltd.
8
  */
@@ -18,10 +18,12 @@ $settings = array(
18
  ),
19
  array(
20
  'title' => __( 'Formula', 'woocommerce-jetpack' ),
21
- 'desc' => __( 'Use "x" variable for product\'s base price. For example: x+p1*p2', 'woocommerce-jetpack' ),
 
22
  'type' => 'text',
23
  'id' => 'wcj_product_price_by_formula_eval',
24
  'default' => '',
 
25
  ),
26
  array(
27
  'title' => __( 'Enable Price Calculation By Formula For All Products', 'woocommerce-jetpack' ),
@@ -30,15 +32,13 @@ $settings = array(
30
  'id' => 'wcj_product_price_by_formula_enable_for_all_products',
31
  'default' => 'no',
32
  'desc_tip' => apply_filters( 'booster_get_message', '', 'desc_no_link' ),
33
- 'custom_attributes' => apply_filters( 'booster_get_message', '', 'readonly' ),
34
  ),
35
  array(
36
  'title' => __( 'Total Params', 'woocommerce-jetpack' ),
37
  'id' => 'wcj_product_price_by_formula_total_params',
38
  'default' => 1,
39
  'type' => 'custom_number',
40
- /* 'desc' => apply_filters( 'booster_get_message', '', 'desc' ),
41
- 'custom_attributes' => apply_filters( 'booster_get_message', '', 'readonly' ), */
42
  ),
43
  );
44
  $total_number = get_option( 'wcj_product_price_by_formula_total_params', 1 );
2
  /**
3
  * Booster for WooCommerce - Settings - Product Price by Formula
4
  *
5
+ * @version 3.1.1
6
  * @since 2.8.0
7
  * @author Algoritmika Ltd.
8
  */
18
  ),
19
  array(
20
  'title' => __( 'Formula', 'woocommerce-jetpack' ),
21
+ 'desc' => sprintf( __( 'Use %s variable for product\'s base price. For example: %s.', 'woocommerce-jetpack' ),
22
+ '<code>' . 'x' . '</code>', '<code>' . 'x+p1*p2' . '</code>' ),
23
  'type' => 'text',
24
  'id' => 'wcj_product_price_by_formula_eval',
25
  'default' => '',
26
+ 'class' => 'widefat',
27
  ),
28
  array(
29
  'title' => __( 'Enable Price Calculation By Formula For All Products', 'woocommerce-jetpack' ),
32
  'id' => 'wcj_product_price_by_formula_enable_for_all_products',
33
  'default' => 'no',
34
  'desc_tip' => apply_filters( 'booster_get_message', '', 'desc_no_link' ),
35
+ 'custom_attributes' => apply_filters( 'booster_get_message', '', 'disabled' ),
36
  ),
37
  array(
38
  'title' => __( 'Total Params', 'woocommerce-jetpack' ),
39
  'id' => 'wcj_product_price_by_formula_total_params',
40
  'default' => 1,
41
  'type' => 'custom_number',
 
 
42
  ),
43
  );
44
  $total_number = get_option( 'wcj_product_price_by_formula_total_params', 1 );
includes/settings/wcj-settings-related-products.php CHANGED
@@ -2,13 +2,22 @@
2
  /**
3
  * Booster for WooCommerce - Settings - Related Products
4
  *
5
- * @version 2.8.0
6
  * @since 2.8.0
7
  * @author Algoritmika Ltd.
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
11
 
 
 
 
 
 
 
 
 
 
12
  $orderby_options = array(
13
  'rand' => __( 'Random', 'woocommerce-jetpack' ),
14
  'date' => __( 'Date', 'woocommerce-jetpack' ),
@@ -23,6 +32,7 @@ if ( WCJ_IS_WC_VERSION_BELOW_3 ) {
23
  $orderby_options['menu_order'] = __( 'Menu order', 'woocommerce-jetpack' );
24
  $orderby_options['price'] = __( 'Price', 'woocommerce-jetpack' );
25
  }
 
26
  $settings = array(
27
  array(
28
  'title' => __( 'General', 'woocommerce-jetpack' ),
@@ -161,6 +171,64 @@ $settings = array_merge( $settings, array(
161
  'default' => 'no',
162
  'type' => 'checkbox',
163
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
164
  array(
165
  'type' => 'sectionend',
166
  'id' => 'wcj_product_info_related_products_hide_options',
2
  /**
3
  * Booster for WooCommerce - Settings - Related Products
4
  *
5
+ * @version 3.1.1
6
  * @since 2.8.0
7
  * @author Algoritmika Ltd.
8
  */
9
 
10
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
11
 
12
+ $is_multiselect_products = ( 'yes' === get_option( 'wcj_list_for_products', 'yes' ) );
13
+ $products = ( $is_multiselect_products ? wcj_get_products() : false );
14
+ $product_cats = wcj_get_terms( 'product_cat' );
15
+ $product_tags = wcj_get_terms( 'product_tag' );
16
+ wcj_maybe_convert_and_update_option_value( array(
17
+ array( 'id' => 'wcj_product_info_related_products_hide_products_incl', 'default' => '' ),
18
+ array( 'id' => 'wcj_product_info_related_products_hide_products_excl', 'default' => '' ),
19
+ ), $is_multiselect_products );
20
+
21
  $orderby_options = array(
22
  'rand' => __( 'Random', 'woocommerce-jetpack' ),
23
  'date' => __( 'Date', 'woocommerce-jetpack' ),
32
  $orderby_options['menu_order'] = __( 'Menu order', 'woocommerce-jetpack' );
33
  $orderby_options['price'] = __( 'Price', 'woocommerce-jetpack' );
34
  }
35
+
36
  $settings = array(
37
  array(
38
  'title' => __( 'General', 'woocommerce-jetpack' ),
171
  'default' => 'no',
172
  'type' => 'checkbox',
173
  ),
174
+ array(
175
+ 'title' => __( 'Include Product Categories', 'woocommerce-jetpack' ),
176
+ 'desc_tip' => __( 'Set this field to hide related products on selected product categories only. Leave blank to hide on all products.', 'woocommerce-jetpack' ),
177
+ 'id' => 'wcj_product_info_related_products_hide_cats_incl',
178
+ 'default' => '',
179
+ 'class' => 'chosen_select',
180
+ 'type' => 'multiselect',
181
+ 'options' => $product_cats,
182
+ ),
183
+ array(
184
+ 'title' => __( 'Exclude Product Categories', 'woocommerce-jetpack' ),
185
+ 'desc_tip' => __( 'Set this field to NOT hide related products on selected product categories. Leave blank to hide on all products.', 'woocommerce-jetpack' ),
186
+ 'id' => 'wcj_product_info_related_products_hide_cats_excl',
187
+ 'default' => '',
188
+ 'class' => 'chosen_select',
189
+ 'type' => 'multiselect',
190
+ 'options' => $product_cats,
191
+ ),
192
+ array(
193
+ 'title' => __( 'Include Product Tags', 'woocommerce-jetpack' ),
194
+ 'desc_tip' => __( 'Set this field to hide related products on selected product tags only. Leave blank to hide on all products.', 'woocommerce-jetpack' ),
195
+ 'id' => 'wcj_product_info_related_products_hide_tags_incl',
196
+ 'default' => '',
197
+ 'class' => 'chosen_select',
198
+ 'type' => 'multiselect',
199
+ 'options' => $product_tags,
200
+ ),
201
+ array(
202
+ 'title' => __( 'Exclude Product Tags', 'woocommerce-jetpack' ),
203
+ 'desc_tip' => __( 'Set this field to NOT hide related products on selected product tags. Leave blank to hide on all products.', 'woocommerce-jetpack' ),
204
+ 'id' => 'wcj_product_info_related_products_hide_tags_excl',
205
+ 'default' => '',
206
+ 'class' => 'chosen_select',
207
+ 'type' => 'multiselect',
208
+ 'options' => $product_tags,
209
+ ),
210
+ wcj_get_settings_as_multiselect_or_text(
211
+ array(
212
+ 'title' => __( 'Include Products', 'woocommerce-jetpack' ),
213
+ 'desc_tip' => __( 'Set this field to hide related products on selected products only. Leave blank to hide on all products.', 'woocommerce-jetpack' ),
214
+ 'id' => 'wcj_product_info_related_products_hide_products_incl',
215
+ 'default' => '',
216
+ 'class' => 'widefat',
217
+ ),
218
+ $products,
219
+ $is_multiselect_products
220
+ ),
221
+ wcj_get_settings_as_multiselect_or_text(
222
+ array(
223
+ 'title' => __( 'Exclude Products', 'woocommerce-jetpack' ),
224
+ 'desc_tip' => __( 'Set this field to NOT hide related products on selected products. Leave blank to hide on all products.', 'woocommerce-jetpack' ),
225
+ 'id' => 'wcj_product_info_related_products_hide_products_excl',
226
+ 'default' => '',
227
+ 'class' => 'widefat',
228
+ ),
229
+ $products,
230
+ $is_multiselect_products
231
+ ),
232
  array(
233
  'type' => 'sectionend',
234
  'id' => 'wcj_product_info_related_products_hide_options',
includes/shortcodes/class-wcj-general-shortcodes.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce - Shortcodes - General
4
  *
5
- * @version 3.1.0
6
  * @author Algoritmika Ltd.
7
  */
8
 
@@ -15,7 +15,7 @@ class WCJ_General_Shortcodes extends WCJ_Shortcodes {
15
  /**
16
  * Constructor.
17
  *
18
- * @version 3.1.0
19
  */
20
  function __construct() {
21
 
@@ -29,6 +29,8 @@ class WCJ_General_Shortcodes extends WCJ_Shortcodes {
29
  'wcj_currency_select_drop_down_list',
30
  'wcj_currency_select_link_list',
31
  'wcj_currency_select_radio_list',
 
 
32
  'wcj_current_date',
33
  'wcj_current_datetime',
34
  'wcj_current_time',
@@ -79,6 +81,26 @@ class WCJ_General_Shortcodes extends WCJ_Shortcodes {
79
 
80
  }
81
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
82
  /**
83
  * wcj_selector.
84
  *
2
  /**
3
  * Booster for WooCommerce - Shortcodes - General
4
  *
5
+ * @version 3.1.1
6
  * @author Algoritmika Ltd.
7
  */
8
 
15
  /**
16
  * Constructor.
17
  *
18
+ * @version 3.1.1
19
  */
20
  function __construct() {
21
 
29
  'wcj_currency_select_drop_down_list',
30
  'wcj_currency_select_link_list',
31
  'wcj_currency_select_radio_list',
32
+ 'wcj_current_currency_code',
33
+ 'wcj_current_currency_symbol',
34
  'wcj_current_date',
35
  'wcj_current_datetime',
36
  'wcj_current_time',
81
 
82
  }
83
 
84
+ /**
85
+ * wcj_current_currency_code.
86
+ *
87
+ * @version 3.1.1
88
+ * @since 3.1.1
89
+ */
90
+ function wcj_current_currency_code( $atts ) {
91
+ return get_woocommerce_currency();
92
+ }
93
+
94
+ /**
95
+ * wcj_current_currency_symbol.
96
+ *
97
+ * @version 3.1.1
98
+ * @since 3.1.1
99
+ */
100
+ function wcj_current_currency_symbol( $atts ) {
101
+ return get_woocommerce_currency_symbol();
102
+ }
103
+
104
  /**
105
  * wcj_selector.
106
  *
includes/shortcodes/class-wcj-products-shortcodes.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Booster for WooCommerce - Shortcodes - Products
4
  *
5
- * @version 3.1.0
6
  * @author Algoritmika Ltd.
7
  */
8
 
@@ -594,7 +594,7 @@ class WCJ_Products_Shortcodes extends WCJ_Shortcodes {
594
  * wcj_product_you_save.
595
  *
596
  * @return string
597
- * @version 2.4.0
598
  */
599
  function wcj_product_you_save( $atts ) {
600
  if ( $this->the_product->is_on_sale() ) {
@@ -603,6 +603,9 @@ class WCJ_Products_Shortcodes extends WCJ_Shortcodes {
603
  } else {
604
  $you_save = ( $this->the_product->get_regular_price() - $this->the_product->get_sale_price() );
605
  }
 
 
 
606
  return ( 'yes' === $atts['hide_currency'] ) ? $you_save : wc_price( $you_save );
607
  } else {
608
  return ( 'yes' === $atts['hide_if_zero'] ) ? '' : 0;
2
  /**
3
  * Booster for WooCommerce - Shortcodes - Products
4
  *
5
+ * @version 3.1.1
6
  * @author Algoritmika Ltd.
7
  */
8
 
594
  * wcj_product_you_save.
595
  *
596
  * @return string
597
+ * @version 3.1.1
598
  */
599
  function wcj_product_you_save( $atts ) {
600
  if ( $this->the_product->is_on_sale() ) {
603
  } else {
604
  $you_save = ( $this->the_product->get_regular_price() - $this->the_product->get_sale_price() );
605
  }
606
+ if ( '' !== $atts['multiply_by'] && is_numeric( $atts['multiply_by'] ) ) {
607
+ $you_save *= $atts['multiply_by'];
608
+ }
609
  return ( 'yes' === $atts['hide_currency'] ) ? $you_save : wc_price( $you_save );
610
  } else {
611
  return ( 'yes' === $atts['hide_if_zero'] ) ? '' : 0;
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.8
6
- Stable tag: 3.1.0
7
  License: GNU General Public License v3.0
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
@@ -167,6 +167,22 @@ You can see the differences between versions in this [table](https://booster.io/
167
 
168
  == Changelog ==
169
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
170
  = 3.1.0 - 11/09/2017 =
171
  * Dev - Shortcodes - `visibility` attribute - `wrong_user_text` attribute set to empty string by default now; `wrong_user_text_not_logged_in` attribute added (defaults to empty string).
172
  * Dev - Shortcodes - `location` and `not_location` attributes - `wcj_get_user_location()` - Code refactoring.
3
  Tags: woocommerce,booster for woocommerce,woocommerce jetpack
4
  Requires at least: 4.4
5
  Tested up to: 4.8
6
+ Stable tag: 3.1.1
7
  License: GNU General Public License v3.0
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
167
 
168
  == Changelog ==
169
 
170
+ = 3.1.1 - 17/09/2017 =
171
+ * Dev - Version message added.
172
+ * Dev - `WCJ_Module` - `create_meta_box()` - `show_value` option added.
173
+ * Dev - `WCJ_Module` - `create_meta_box()` - `class` option added.
174
+ * Dev - Functions - Order - `[wcj_get_order_id]` - Check added (`is_object( $_order )`).
175
+ * Dev - Shortcodes - General - `[wcj_current_currency_code]` and `[wcj_current_currency_symbol]` shortcodes added.
176
+ * Dev - Shortcodes - Products - `[wcj_product_you_save]` - `multiply_by` attribute added.
177
+ * Fix - PRICES & CURRENCIES - Product Price by Formula - "Enable Price Calculation By Formula For All Products" option fixed (`disabled`).
178
+ * Dev - PRICES & CURRENCIES - Product Price by Formula - Settings restyled.
179
+ * Dev - PRODUCTS - Product Visibility by Country - Admin Options - "Visibility Method" option added.
180
+ * Dev - PRODUCTS - Product Visibility by Country - Admin Options - "Country List" option added.
181
+ * Dev - PRODUCTS - Related Products - Hide - "Include/Exclude Categories/Tags/Products" options added.
182
+ * Fix - PRODUCTS - Related Products - "Clear all products transients" button - `post_status` error fixed.
183
+ * Fix - PDF INVOICING & PACKING SLIPS - General - "Do not create if order total equals zero" fixed (for "Invoice").
184
+ * Dev - PDF INVOICING & PACKING SLIPS - Emails - `add_pdf_invoice_email_attachment()` - Check added (`is_object( $order )`).
185
+
186
  = 3.1.0 - 11/09/2017 =
187
  * Dev - Shortcodes - `visibility` attribute - `wrong_user_text` attribute set to empty string by default now; `wrong_user_text_not_logged_in` attribute added (defaults to empty string).
188
  * Dev - Shortcodes - `location` and `not_location` attributes - `wcj_get_user_location()` - Code refactoring.
woocommerce-jetpack.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Booster for WooCommerce
4
  Plugin URI: https://booster.io
5
  Description: Supercharge your WooCommerce site with these awesome powerful features.
6
- Version: 3.1.0
7
  Author: Algoritmika Ltd
8
  Author URI: https://booster.io
9
  Text Domain: woocommerce-jetpack
@@ -64,7 +64,7 @@ require_once( 'includes/constants/wcj-constants.php' );
64
  * Main WC_Jetpack Class
65
  *
66
  * @class WC_Jetpack
67
- * @version 3.1.0
68
  */
69
  final class WC_Jetpack {
70
 
@@ -74,7 +74,7 @@ final class WC_Jetpack {
74
  * @var string
75
  * @since 2.4.7
76
  */
77
- public $version = '3.1.0';
78
 
79
  /**
80
  * @var WC_Jetpack The single instance of the class
@@ -146,7 +146,7 @@ final class WC_Jetpack {
146
  /**
147
  * check_plus_version.
148
  *
149
- * @version 3.0.1
150
  * @since 2.5.9
151
  */
152
  function check_plus_version() {
@@ -173,13 +173,21 @@ final class WC_Jetpack {
173
  }
174
  // Check Plus version
175
  if ( ! $is_plus_v3_active && $is_plus_active ) {
176
- $plus_version = get_option( 'booster_plus_version', false );
177
  $required_plus_version = '1.1.0';
178
- if ( version_compare( $plus_version, $required_plus_version, '<' ) ) {
179
- $class = 'notice notice-error';
180
- $message = sprintf(
181
- __( 'Please upgrade <strong>Booster Plus for WooCommerce</strong> plugin. Please visit <a target="_blank" href="%s">your account page</a> on booster.io to download the latest Booster Plus version.', 'woocommerce-jetpack' ),
182
- 'https://booster.io/my-account/?utm_source=plus_update'
 
 
 
 
 
 
 
 
183
  );
184
  echo '<div class="' . $class . '"><p>' . $message . '</p></div>';
185
  }
3
  Plugin Name: Booster for WooCommerce
4
  Plugin URI: https://booster.io
5
  Description: Supercharge your WooCommerce site with these awesome powerful features.
6
+ Version: 3.1.1
7
  Author: Algoritmika Ltd
8
  Author URI: https://booster.io
9
  Text Domain: woocommerce-jetpack
64
  * Main WC_Jetpack Class
65
  *
66
  * @class WC_Jetpack
67
+ * @version 3.1.1
68
  */
69
  final class WC_Jetpack {
70
 
74
  * @var string
75
  * @since 2.4.7
76
  */
77
+ public $version = '3.1.1';
78
 
79
  /**
80
  * @var WC_Jetpack The single instance of the class
146
  /**
147
  * check_plus_version.
148
  *
149
+ * @version 3.1.1
150
  * @since 2.5.9
151
  */
152
  function check_plus_version() {
173
  }
174
  // Check Plus version
175
  if ( ! $is_plus_v3_active && $is_plus_active ) {
176
+ $plus_version = get_option( 'booster_plus_version', false );
177
  $required_plus_version = '1.1.0';
178
+ $notice_type = ( version_compare( $plus_version, $required_plus_version, '<' ) ? 'error' : 'warning' );
179
+ global $pagenow;
180
+ if ( 'error' === $notice_type || 'plugins.php' === $pagenow ) {
181
+ $class = 'notice notice-' . $notice_type;
182
+ $message = ( 'error' === $notice_type ?
183
+ sprintf(
184
+ __( 'Please upgrade <strong>Booster Plus for WooCommerce</strong> plugin. Visit <a target="_blank" href="%s">your account page</a> on booster.io to download the latest Booster Plus version.', 'woocommerce-jetpack' ),
185
+ 'https://booster.io/my-account/?utm_source=plus_update'
186
+ ) :
187
+ sprintf(
188
+ __( 'There is new version of <strong>Booster Plus for WooCommerce</strong> plugin available. We recommend upgrading. Please visit <a target="_blank" href="%s">your account page</a> on booster.io to download the latest Booster Plus version.', 'woocommerce-jetpack' ),
189
+ 'https://booster.io/my-account/?utm_source=plus_update'
190
+ )
191
  );
192
  echo '<div class="' . $class . '"><p>' . $message . '</p></div>';
193
  }