Booster for WooCommerce - Version 2.3.1

Version Description

  • 02/10/2015 =
  • Dev - PAYMENT GATEWAYS - Gateways Icons - Remove Icon option added.
  • Dev - PAYMENT GATEWAYS - Gateways Icons - Module extended to include all payment gateways (including custom, created with other plugins).
Download this release

Release Info

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

Code changes from version 2.3.0 to 2.3.1

includes/class-wcj-add-to-cart.php CHANGED
@@ -14,37 +14,37 @@ if ( ! class_exists( 'WCJ_Add_To_Cart' ) ) :
14
 
15
  class WCJ_Add_To_Cart {
16
 
17
- /**
18
- * Constructor.
19
- */
20
- public function __construct() {
21
 
22
- // Main hooks
23
- if ( 'yes' === get_option( 'wcj_add_to_cart_enabled' ) ) {
24
  include_once( 'add-to-cart/class-wcj-add-to-cart-per-category.php' );
25
  include_once( 'add-to-cart/class-wcj-add-to-cart-per-product.php' );
26
  include_once( 'add-to-cart/class-wcj-add-to-cart-per-product-type.php' );
27
- }
28
-
29
- // Settings hooks
30
- add_filter( 'wcj_settings_sections', array( $this, 'settings_section' ) );
31
- add_filter( 'wcj_settings_add_to_cart', array( $this, 'get_settings' ), 100 );
32
- add_filter( 'wcj_features_status', array( $this, 'add_enabled_option' ), 100 );
33
- }
34
-
35
- /**
36
- * add_enabled_option.
37
- */
38
- public function add_enabled_option( $settings ) {
39
- $all_settings = $this->get_settings();
40
- $settings[] = $all_settings[1];
41
- return $settings;
42
- }
43
-
44
- /**
45
- * get_per_product_type_settings.
46
- */
47
- function get_per_product_type_settings() {
48
 
49
  $settings = array();
50
 
@@ -178,51 +178,51 @@ class WCJ_Add_To_Cart {
178
  return $settings;
179
  }
180
 
181
- /**
182
- * get_per_product_settings.
183
- */
184
- function get_per_product_settings() {
185
 
186
- $settings = array(
187
 
188
- array(
189
  'title' => __( 'Per Product Options', 'woocommerce-jetpack' ),
190
  'type' => 'title',
191
  'desc' => __( 'This section lets you set Add to Cart button text on per product basis. When enabled, label for each product can be changed in "Edit Product".', 'woocommerce-jetpack' ),
192
  'id' => 'wcj_add_to_cart_per_product_options' ),
193
 
194
- array(
195
- 'title' => __( 'Per Product Labels', 'woocommerce-jetpack' ),
196
- 'desc' => __( 'Enable Section', 'woocommerce-jetpack' ),
197
  'desc_tip' => '',
198
- 'id' => 'wcj_add_to_cart_per_product_enabled',
199
- 'default' => 'yes',
200
- 'type' => 'checkbox',
201
- ),
202
 
203
- array( 'type' => 'sectionend', 'id' => 'wcj_add_to_cart_per_product_options' ),
204
- );
205
 
206
  return $settings;
207
  }
208
 
209
- /**
210
- * get_per_category_settings.
211
- */
212
- function get_per_category_settings() {
213
 
214
  $settings = array(
215
 
216
- array( 'title' => __( 'Per Category Options', 'woocommerce-jetpack' ), 'type' => 'title', 'desc' => __( 'This sections lets you set Add to Cart button text on per category basis.', 'woocommerce-jetpack' ), 'id' => 'wcj_add_to_cart_per_category_options' ),
217
 
218
- array(
219
- 'title' => __( 'Per Category Labels', 'woocommerce-jetpack' ),
220
- 'desc' => __( 'Enable Section', 'woocommerce-jetpack' ),
221
  'desc_tip' => '',
222
- 'id' => 'wcj_add_to_cart_per_category_enabled',
223
- 'default' => 'yes',
224
- 'type' => 'checkbox',
225
- ),
226
 
227
  array(
228
  'title' => __( 'Category Groups Number', 'woocommerce-jetpack' ),
@@ -261,7 +261,7 @@ class WCJ_Add_To_Cart {
261
  //delete_option( 'wcj_add_to_cart_per_category_group_' . $i );
262
  } */
263
 
264
- $settings = array_merge( $settings, array(
265
  array(
266
  'title' => __( 'Group', 'woocommerce-jetpack' ) . ' #' . $i,
267
  'desc' => __( 'Enable', 'woocommerce-jetpack' ),
@@ -317,10 +317,10 @@ class WCJ_Add_To_Cart {
317
  return $settings;
318
  }
319
 
320
- /**
321
- * get_settings.
322
- */
323
- function get_settings() {
324
 
325
  $settings = array(
326
 
@@ -344,16 +344,16 @@ class WCJ_Add_To_Cart {
344
 
345
  $settings = array_merge( $settings, $this->get_per_product_type_settings() );
346
 
347
- return $settings;
348
- }
349
 
350
- /**
351
- * settings_section.
352
- */
353
- function settings_section( $sections ) {
354
- $sections['add_to_cart'] = __( 'Add to Cart Labels', 'woocommerce-jetpack' );
355
- return $sections;
356
- }
357
  }
358
 
359
  endif;
14
 
15
  class WCJ_Add_To_Cart {
16
 
17
+ /**
18
+ * Constructor.
19
+ */
20
+ public function __construct() {
21
 
22
+ // Main hooks
23
+ if ( 'yes' === get_option( 'wcj_add_to_cart_enabled' ) ) {
24
  include_once( 'add-to-cart/class-wcj-add-to-cart-per-category.php' );
25
  include_once( 'add-to-cart/class-wcj-add-to-cart-per-product.php' );
26
  include_once( 'add-to-cart/class-wcj-add-to-cart-per-product-type.php' );
27
+ }
28
+
29
+ // Settings hooks
30
+ add_filter( 'wcj_settings_sections', array( $this, 'settings_section' ) );
31
+ add_filter( 'wcj_settings_add_to_cart', array( $this, 'get_settings' ), 100 );
32
+ add_filter( 'wcj_features_status', array( $this, 'add_enabled_option' ), 100 );
33
+ }
34
+
35
+ /**
36
+ * add_enabled_option.
37
+ */
38
+ public function add_enabled_option( $settings ) {
39
+ $all_settings = $this->get_settings();
40
+ $settings[] = $all_settings[1];
41
+ return $settings;
42
+ }
43
+
44
+ /**
45
+ * get_per_product_type_settings.
46
+ */
47
+ function get_per_product_type_settings() {
48
 
49
  $settings = array();
50
 
178
  return $settings;
179
  }
180
 
181
+ /**
182
+ * get_per_product_settings.
183
+ */
184
+ function get_per_product_settings() {
185
 
186
+ $settings = array(
187
 
188
+ array(
189
  'title' => __( 'Per Product Options', 'woocommerce-jetpack' ),
190
  'type' => 'title',
191
  'desc' => __( 'This section lets you set Add to Cart button text on per product basis. When enabled, label for each product can be changed in "Edit Product".', 'woocommerce-jetpack' ),
192
  'id' => 'wcj_add_to_cart_per_product_options' ),
193
 
194
+ array(
195
+ 'title' => __( 'Per Product Labels', 'woocommerce-jetpack' ),
196
+ 'desc' => __( 'Enable Section', 'woocommerce-jetpack' ),
197
  'desc_tip' => '',
198
+ 'id' => 'wcj_add_to_cart_per_product_enabled',
199
+ 'default' => 'yes',
200
+ 'type' => 'checkbox',
201
+ ),
202
 
203
+ array( 'type' => 'sectionend', 'id' => 'wcj_add_to_cart_per_product_options' ),
204
+ );
205
 
206
  return $settings;
207
  }
208
 
209
+ /**
210
+ * get_per_category_settings.
211
+ */
212
+ function get_per_category_settings() {
213
 
214
  $settings = array(
215
 
216
+ array( 'title' => __( 'Per Category Options', 'woocommerce-jetpack' ), 'type' => 'title', 'desc' => __( 'This sections lets you set Add to Cart button text on per category basis.', 'woocommerce-jetpack' ), 'id' => 'wcj_add_to_cart_per_category_options' ),
217
 
218
+ array(
219
+ 'title' => __( 'Per Category Labels', 'woocommerce-jetpack' ),
220
+ 'desc' => __( 'Enable Section', 'woocommerce-jetpack' ),
221
  'desc_tip' => '',
222
+ 'id' => 'wcj_add_to_cart_per_category_enabled',
223
+ 'default' => 'yes',
224
+ 'type' => 'checkbox',
225
+ ),
226
 
227
  array(
228
  'title' => __( 'Category Groups Number', 'woocommerce-jetpack' ),
261
  //delete_option( 'wcj_add_to_cart_per_category_group_' . $i );
262
  } */
263
 
264
+ $settings = array_merge( $settings, array(
265
  array(
266
  'title' => __( 'Group', 'woocommerce-jetpack' ) . ' #' . $i,
267
  'desc' => __( 'Enable', 'woocommerce-jetpack' ),
317
  return $settings;
318
  }
319
 
320
+ /**
321
+ * get_settings.
322
+ */
323
+ function get_settings() {
324
 
325
  $settings = array(
326
 
344
 
345
  $settings = array_merge( $settings, $this->get_per_product_type_settings() );
346
 
347
+ return $settings;
348
+ }
349
 
350
+ /**
351
+ * settings_section.
352
+ */
353
+ function settings_section( $sections ) {
354
+ $sections['add_to_cart'] = __( 'Add to Cart Labels', 'woocommerce-jetpack' );
355
+ return $sections;
356
+ }
357
  }
358
 
359
  endif;
includes/class-wcj-checkout-custom-fields.php CHANGED
@@ -119,7 +119,7 @@ class WCJ_Checkout_Custom_Fields extends WCJ_Module {
119
  );
120
  }
121
  }
122
- return $fields;
123
  }
124
 
125
  /**
@@ -374,7 +374,7 @@ class WCJ_Checkout_Custom_Fields extends WCJ_Module {
374
  *
375
  * @version 2.3.0
376
  */
377
- public function get_settings() {
378
 
379
  $settings = array(
380
 
119
  );
120
  }
121
  }
122
+ return $fields;
123
  }
124
 
125
  /**
374
  *
375
  * @version 2.3.0
376
  */
377
+ public function get_settings() {
378
 
379
  $settings = array(
380
 
includes/class-wcj-checkout-custom-info.php CHANGED
@@ -15,34 +15,34 @@ if ( ! class_exists( 'WCJ_Checkout_Custom_Info' ) ) :
15
 
16
  class WCJ_Checkout_Custom_Info extends WCJ_Module {
17
 
18
- /**
19
- * Constructor.
20
- */
21
- public function __construct() {
22
 
23
  $this->id = 'checkout_custom_info';
24
  $this->short_desc = __( 'Checkout Custom Info', 'woocommerce-jetpack' );
25
  $this->desc = __( 'Add custom info to WooCommerce checkout page.', 'woocommerce-jetpack' );
26
  parent::__construct();
27
 
28
- if ( $this->is_enabled() ) {
29
  for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_checkout_custom_info_total_number', 1 ) ); $i++) {
30
  add_action(
31
  get_option( 'wcj_checkout_custom_info_hook_' . $i, 'woocommerce_checkout_after_order_review' ),
32
  array( $this, 'add_checkout_custom_info' )
33
  );
34
  }
35
- }
36
- }
37
 
38
- /**
39
- * get_settings.
40
- */
41
- function get_settings() {
42
 
43
  //global $woocommerce;
44
 
45
- $settings = array();
46
 
47
  // Checkout Custom Info Options
48
  $settings[] = array( 'title' => __( 'Checkout Custom Info Blocks', 'woocommerce-jetpack' ), 'type' => 'title', 'desc' => '', 'id' => 'wcj_checkout_custom_info_blocks_options' );
@@ -91,7 +91,8 @@ class WCJ_Checkout_Custom_Info extends WCJ_Module {
91
  'woocommerce_checkout_after_order_review' => __( 'After order review', 'woocommerce-jetpack' ),
92
  'woocommerce_after_checkout_form' => __( 'After checkout form', 'woocommerce-jetpack' ),
93
 
94
- /*'woocommerce_before_checkout_shipping_form' => __( 'woocommerce_before_checkout_shipping_form', 'woocommerce-jetpack' ),
 
95
  'woocommerce_after_checkout_shipping_form' => __( 'woocommerce_after_checkout_shipping_form', 'woocommerce-jetpack' ),
96
  'woocommerce_before_order_notes' => __( 'woocommerce_before_order_notes', 'woocommerce-jetpack' ),
97
  'woocommerce_after_order_notes' => __( 'woocommerce_after_order_notes', 'woocommerce-jetpack' ),
@@ -106,7 +107,8 @@ class WCJ_Checkout_Custom_Info extends WCJ_Module {
106
  'woocommerce_review_order_before_shipping' => __( 'woocommerce_review_order_before_shipping', 'woocommerce-jetpack' ),
107
  'woocommerce_review_order_after_shipping' => __( 'woocommerce_review_order_after_shipping', 'woocommerce-jetpack' ),
108
  'woocommerce_review_order_before_order_total' => __( 'woocommerce_review_order_before_order_total', 'woocommerce-jetpack' ),
109
- 'woocommerce_review_order_after_order_total' => __( 'woocommerce_review_order_after_order_total', 'woocommerce-jetpack' ),*/
 
110
  ),
111
  'css' => 'width:250px;',
112
  ),
@@ -123,12 +125,12 @@ class WCJ_Checkout_Custom_Info extends WCJ_Module {
123
  ) );
124
  }
125
 
126
- return $this->add_enable_module_setting( $settings );
127
- }
128
 
129
- /**
130
- * add_checkout_custom_info.
131
- */
132
  function add_checkout_custom_info() {
133
  $current_filter = current_filter();
134
  $total_number = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_checkout_custom_info_total_number', 1 ) );
15
 
16
  class WCJ_Checkout_Custom_Info extends WCJ_Module {
17
 
18
+ /**
19
+ * Constructor.
20
+ */
21
+ public function __construct() {
22
 
23
  $this->id = 'checkout_custom_info';
24
  $this->short_desc = __( 'Checkout Custom Info', 'woocommerce-jetpack' );
25
  $this->desc = __( 'Add custom info to WooCommerce checkout page.', 'woocommerce-jetpack' );
26
  parent::__construct();
27
 
28
+ if ( $this->is_enabled() ) {
29
  for ( $i = 1; $i <= apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_checkout_custom_info_total_number', 1 ) ); $i++) {
30
  add_action(
31
  get_option( 'wcj_checkout_custom_info_hook_' . $i, 'woocommerce_checkout_after_order_review' ),
32
  array( $this, 'add_checkout_custom_info' )
33
  );
34
  }
35
+ }
36
+ }
37
 
38
+ /**
39
+ * get_settings.
40
+ */
41
+ function get_settings() {
42
 
43
  //global $woocommerce;
44
 
45
+ $settings = array();
46
 
47
  // Checkout Custom Info Options
48
  $settings[] = array( 'title' => __( 'Checkout Custom Info Blocks', 'woocommerce-jetpack' ), 'type' => 'title', 'desc' => '', 'id' => 'wcj_checkout_custom_info_blocks_options' );
91
  'woocommerce_checkout_after_order_review' => __( 'After order review', 'woocommerce-jetpack' ),
92
  'woocommerce_after_checkout_form' => __( 'After checkout form', 'woocommerce-jetpack' ),
93
 
94
+ /*
95
+ 'woocommerce_before_checkout_shipping_form' => __( 'woocommerce_before_checkout_shipping_form', 'woocommerce-jetpack' ),
96
  'woocommerce_after_checkout_shipping_form' => __( 'woocommerce_after_checkout_shipping_form', 'woocommerce-jetpack' ),
97
  'woocommerce_before_order_notes' => __( 'woocommerce_before_order_notes', 'woocommerce-jetpack' ),
98
  'woocommerce_after_order_notes' => __( 'woocommerce_after_order_notes', 'woocommerce-jetpack' ),
107
  'woocommerce_review_order_before_shipping' => __( 'woocommerce_review_order_before_shipping', 'woocommerce-jetpack' ),
108
  'woocommerce_review_order_after_shipping' => __( 'woocommerce_review_order_after_shipping', 'woocommerce-jetpack' ),
109
  'woocommerce_review_order_before_order_total' => __( 'woocommerce_review_order_before_order_total', 'woocommerce-jetpack' ),
110
+ 'woocommerce_review_order_after_order_total' => __( 'woocommerce_review_order_after_order_total', 'woocommerce-jetpack' ),
111
+ */
112
  ),
113
  'css' => 'width:250px;',
114
  ),
125
  ) );
126
  }
127
 
128
+ return $this->add_enable_module_setting( $settings );
129
+ }
130
 
131
+ /**
132
+ * add_checkout_custom_info.
133
+ */
134
  function add_checkout_custom_info() {
135
  $current_filter = current_filter();
136
  $total_number = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_checkout_custom_info_total_number', 1 ) );
includes/class-wcj-emails.php CHANGED
@@ -16,12 +16,12 @@ if ( ! class_exists( 'WCJ_Emails' ) ) :
16
 
17
  class WCJ_Emails {
18
 
19
- /**
20
- * Constructor.
21
- */
22
- public function __construct() {
23
- // Main hooks
24
- if ( 'yes' === get_option( 'wcj_emails_enabled' ) ) {
25
  if ( '' != get_option( 'wcj_emails_bcc_email' ) )
26
  add_filter( 'woocommerce_email_headers', array( $this, 'add_bcc_email' ) );
27
  if ( '' != get_option( 'wcj_emails_cc_email' ) )
@@ -31,30 +31,30 @@ class WCJ_Emails {
31
 
32
  // Settings
33
  add_filter( 'woocommerce_email_settings', array( $this, 'add_email_forwarding_fields' ), 100 );
34
- }
35
- // Settings hooks
36
- add_filter( 'wcj_settings_sections', array( $this, 'settings_section' ) );
37
- add_filter( 'wcj_settings_emails', array( $this, 'get_settings' ), 100 );
38
- add_filter( 'wcj_features_status', array( $this, 'add_enabled_option' ), 100 );
39
- }
40
-
41
- /**
42
- * add_payment_method_to_new_order_email.
43
- *
44
- public function add_payment_method_to_new_order_email( $order, $is_admin_email ) {
45
- if ( 'yes' === get_option( 'wcj_emails_add_payment_method_to_new_order_enabled' ) ) {
46
  echo '<p><strong>' . __( 'Payment Method:', 'woocommerce-jetpack' ) . '</strong> ' . $order->payment_method_title . '</p>';
47
  }
48
- }
49
 
50
- /**
51
- * add_enabled_option.
52
- */
53
- public function add_enabled_option( $settings ) {
54
- $all_settings = $this->get_settings();
55
- $settings[] = $all_settings[1];
56
- return $settings;
57
- }
58
 
59
  function add_email_forwarding_fields( $settings ) {
60
 
@@ -117,33 +117,33 @@ class WCJ_Emails {
117
  return $email_headers . "Cc: " . get_option( 'wcj_emails_cc_email' ) . "\r\n";
118
  }
119
 
120
- /**
121
- * get_settings.
122
- */
123
- function get_settings() {
124
 
125
- $settings = array(
126
 
127
- array( 'title' => __( 'Emails Options', 'woocommerce-jetpack' ), 'type' => 'title', 'desc' => __( '', 'woocommerce-jetpack' ), 'id' => 'wcj_emails_options' ),
128
 
129
- array(
130
- 'title' => __( 'Emails', 'woocommerce-jetpack' ),
131
- 'desc' => '<strong>' . __( 'Enable Module', 'woocommerce-jetpack' ) . '</strong>',
132
- 'desc_tip' => __( 'Add another email recipient(s) to all WooCommerce emails.', 'woocommerce-jetpack' ),
133
- 'id' => 'wcj_emails_enabled',
134
- 'default' => 'no',
135
- 'type' => 'checkbox',
136
- ),
137
 
138
  /*array(
139
- 'title' => __( 'Add Payment Method to New Order Email', 'woocommerce-jetpack' ),
140
- 'desc' => __( 'Enable', 'woocommerce-jetpack' ),
141
- 'id' => 'wcj_emails_add_payment_method_to_new_order_enabled',
142
- 'default' => 'no',
143
- 'type' => 'checkbox',
144
- ),*/
145
 
146
- array( 'type' => 'sectionend', 'id' => 'wcj_emails_options' ),
147
 
148
  array( 'title' => __( 'Email Forwarding Options', 'woocommerce-jetpack' ), 'type' => 'title', 'desc' => __( 'This section lets you add another email recipient(s) to all WooCommerce emails. Leave blank to disable.', 'woocommerce-jetpack' ), 'id' => 'wcj_emails_forwarding_options' ),
149
 
@@ -170,18 +170,18 @@ class WCJ_Emails {
170
  ),
171
 
172
  array( 'type' => 'sectionend', 'id' => 'wcj_emails_forwarding_options' ),
173
- );
174
-
175
- return $settings;
176
- }
177
-
178
- /**
179
- * settings_section.
180
- */
181
- function settings_section( $sections ) {
182
- $sections['emails'] = __( 'Emails', 'woocommerce-jetpack' );
183
- return $sections;
184
- }
185
  }
186
 
187
  endif;
16
 
17
  class WCJ_Emails {
18
 
19
+ /**
20
+ * Constructor.
21
+ */
22
+ public function __construct() {
23
+ // Main hooks
24
+ if ( 'yes' === get_option( 'wcj_emails_enabled' ) ) {
25
  if ( '' != get_option( 'wcj_emails_bcc_email' ) )
26
  add_filter( 'woocommerce_email_headers', array( $this, 'add_bcc_email' ) );
27
  if ( '' != get_option( 'wcj_emails_cc_email' ) )
31
 
32
  // Settings
33
  add_filter( 'woocommerce_email_settings', array( $this, 'add_email_forwarding_fields' ), 100 );
34
+ }
35
+ // Settings hooks
36
+ add_filter( 'wcj_settings_sections', array( $this, 'settings_section' ) );
37
+ add_filter( 'wcj_settings_emails', array( $this, 'get_settings' ), 100 );
38
+ add_filter( 'wcj_features_status', array( $this, 'add_enabled_option' ), 100 );
39
+ }
40
+
41
+ /**
42
+ * add_payment_method_to_new_order_email.
43
+ *
44
+ public function add_payment_method_to_new_order_email( $order, $is_admin_email ) {
45
+ if ( 'yes' === get_option( 'wcj_emails_add_payment_method_to_new_order_enabled' ) ) {
46
  echo '<p><strong>' . __( 'Payment Method:', 'woocommerce-jetpack' ) . '</strong> ' . $order->payment_method_title . '</p>';
47
  }
48
+ }
49
 
50
+ /**
51
+ * add_enabled_option.
52
+ */
53
+ public function add_enabled_option( $settings ) {
54
+ $all_settings = $this->get_settings();
55
+ $settings[] = $all_settings[1];
56
+ return $settings;
57
+ }
58
 
59
  function add_email_forwarding_fields( $settings ) {
60
 
117
  return $email_headers . "Cc: " . get_option( 'wcj_emails_cc_email' ) . "\r\n";
118
  }
119
 
120
+ /**
121
+ * get_settings.
122
+ */
123
+ function get_settings() {
124
 
125
+ $settings = array(
126
 
127
+ array( 'title' => __( 'Emails Options', 'woocommerce-jetpack' ), 'type' => 'title', 'desc' => __( '', 'woocommerce-jetpack' ), 'id' => 'wcj_emails_options' ),
128
 
129
+ array(
130
+ 'title' => __( 'Emails', 'woocommerce-jetpack' ),
131
+ 'desc' => '<strong>' . __( 'Enable Module', 'woocommerce-jetpack' ) . '</strong>',
132
+ 'desc_tip' => __( 'Add another email recipient(s) to all WooCommerce emails.', 'woocommerce-jetpack' ),
133
+ 'id' => 'wcj_emails_enabled',
134
+ 'default' => 'no',
135
+ 'type' => 'checkbox',
136
+ ),
137
 
138
  /*array(
139
+ 'title' => __( 'Add Payment Method to New Order Email', 'woocommerce-jetpack' ),
140
+ 'desc' => __( 'Enable', 'woocommerce-jetpack' ),
141
+ 'id' => 'wcj_emails_add_payment_method_to_new_order_enabled',
142
+ 'default' => 'no',
143
+ 'type' => 'checkbox',
144
+ ),*/
145
 
146
+ array( 'type' => 'sectionend', 'id' => 'wcj_emails_options' ),
147
 
148
  array( 'title' => __( 'Email Forwarding Options', 'woocommerce-jetpack' ), 'type' => 'title', 'desc' => __( 'This section lets you add another email recipient(s) to all WooCommerce emails. Leave blank to disable.', 'woocommerce-jetpack' ), 'id' => 'wcj_emails_forwarding_options' ),
149
 
170
  ),
171
 
172
  array( 'type' => 'sectionend', 'id' => 'wcj_emails_forwarding_options' ),
173
+ );
174
+
175
+ return $settings;
176
+ }
177
+
178
+ /**
179
+ * settings_section.
180
+ */
181
+ function settings_section( $sections ) {
182
+ $sections['emails'] = __( 'Emails', 'woocommerce-jetpack' );
183
+ return $sections;
184
+ }
185
  }
186
 
187
  endif;
includes/class-wcj-mini-cart.php CHANGED
@@ -15,31 +15,31 @@ if ( ! class_exists( 'WCJ_Mini_Cart' ) ) :
15
 
16
  class WCJ_Mini_Cart extends WCJ_Module {
17
 
18
- /**
19
- * Constructor.
20
- */
21
- public function __construct() {
22
 
23
  $this->id = 'mini_cart';
24
  $this->short_desc = __( 'Mini Cart', 'woocommerce-jetpack' );
25
  $this->desc = __( 'Customize WooCommerce mini cart widget.', 'woocommerce-jetpack' );
26
  parent::__construct();
27
 
28
- if ( $this->is_enabled() ) {
29
  $total_number = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_mini_cart_custom_info_total_number', 1 ) );
30
  for ( $i = 1; $i <= $total_number; $i++) {
31
  add_action( get_option( 'wcj_mini_cart_custom_info_hook_' . $i, 'woocommerce_after_mini_cart' ), array( $this, 'add_mini_cart_custom_info' ) );
32
  }
33
  }
34
- }
35
 
36
- /**
37
- * get_settings.
38
- */
39
- function get_settings() {
40
 
41
  // The Module settings
42
- $settings = array();
43
 
44
  // Mini Cart Custom Info Options
45
  $settings[] = array( 'title' => __( 'Mini Cart Custom Info Blocks', 'woocommerce-jetpack' ), 'type' => 'title', 'desc' => '', 'id' => 'wcj_mini_cart_custom_info_options' );
@@ -103,12 +103,12 @@ class WCJ_Mini_Cart extends WCJ_Module {
103
 
104
  //$settings[] = array( 'type' => 'sectionend', 'id' => 'wcj_mini_cart_custom_info_options' );
105
 
106
- return $this->add_enable_module_setting( $settings );
107
- }
108
 
109
- /**
110
- * add_mini_cart_custom_info.
111
- */
112
  function add_mini_cart_custom_info() {
113
  $current_filter = current_filter();
114
  $total_number = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_mini_cart_custom_info_total_number', 1 ) );
15
 
16
  class WCJ_Mini_Cart extends WCJ_Module {
17
 
18
+ /**
19
+ * Constructor.
20
+ */
21
+ public function __construct() {
22
 
23
  $this->id = 'mini_cart';
24
  $this->short_desc = __( 'Mini Cart', 'woocommerce-jetpack' );
25
  $this->desc = __( 'Customize WooCommerce mini cart widget.', 'woocommerce-jetpack' );
26
  parent::__construct();
27
 
28
+ if ( $this->is_enabled() ) {
29
  $total_number = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_mini_cart_custom_info_total_number', 1 ) );
30
  for ( $i = 1; $i <= $total_number; $i++) {
31
  add_action( get_option( 'wcj_mini_cart_custom_info_hook_' . $i, 'woocommerce_after_mini_cart' ), array( $this, 'add_mini_cart_custom_info' ) );
32
  }
33
  }
34
+ }
35
 
36
+ /**
37
+ * get_settings.
38
+ */
39
+ function get_settings() {
40
 
41
  // The Module settings
42
+ $settings = array();
43
 
44
  // Mini Cart Custom Info Options
45
  $settings[] = array( 'title' => __( 'Mini Cart Custom Info Blocks', 'woocommerce-jetpack' ), 'type' => 'title', 'desc' => '', 'id' => 'wcj_mini_cart_custom_info_options' );
103
 
104
  //$settings[] = array( 'type' => 'sectionend', 'id' => 'wcj_mini_cart_custom_info_options' );
105
 
106
+ return $this->add_enable_module_setting( $settings );
107
+ }
108
 
109
+ /**
110
+ * add_mini_cart_custom_info.
111
+ */
112
  function add_mini_cart_custom_info() {
113
  $current_filter = current_filter();
114
  $total_number = apply_filters( 'wcj_get_option_filter', 1, get_option( 'wcj_mini_cart_custom_info_total_number', 1 ) );
includes/class-wcj-more-button-labels.php CHANGED
@@ -15,28 +15,28 @@ if ( ! class_exists( 'WCJ_More_Button_Labels' ) ) :
15
 
16
  class WCJ_More_Button_Labels extends WCJ_Module {
17
 
18
- /**
19
- * Constructor.
20
- */
21
- public function __construct() {
22
 
23
  $this->id = 'more_button_labels';
24
  $this->short_desc = __( 'More Button Labels', 'woocommerce-jetpack' );
25
  $this->desc = __( 'Set WooCommerce "Place order" button label.', 'woocommerce-jetpack' );
26
  parent::__construct();
27
 
28
- //if ( 'yes' === get_option( 'wcj_more_button_labels_enabled' ) ) {
29
  if ( $this->is_enabled() ) {
30
  add_filter( 'woocommerce_order_button_text', array( $this, 'set_order_button_text' ) );
31
- }
32
- }
33
 
34
- /**
35
- * get_settings.
36
- */
37
- function get_settings() {
38
 
39
- $settings = array();
40
 
41
  // Place order (Order now) Button
42
  $settings[] = array(
@@ -58,16 +58,16 @@ class WCJ_More_Button_Labels extends WCJ_Module {
58
  'id' => 'wcj_checkout_place_order_button_options'
59
  );
60
 
61
- return $this->add_enable_module_setting( $settings );
62
- }
63
 
64
- /**
65
- * set_order_button_text.
66
- */
67
- public function set_order_button_text( $current_text ) {
68
  $new_text = get_option( 'wcj_checkout_place_order_button_text' );
69
  return ( '' != $new_text ) ? $new_text : $current_text;
70
- }
71
  }
72
 
73
  endif;
15
 
16
  class WCJ_More_Button_Labels extends WCJ_Module {
17
 
18
+ /**
19
+ * Constructor.
20
+ */
21
+ public function __construct() {
22
 
23
  $this->id = 'more_button_labels';
24
  $this->short_desc = __( 'More Button Labels', 'woocommerce-jetpack' );
25
  $this->desc = __( 'Set WooCommerce "Place order" button label.', 'woocommerce-jetpack' );
26
  parent::__construct();
27
 
28
+ //if ( 'yes' === get_option( 'wcj_more_button_labels_enabled' ) ) {
29
  if ( $this->is_enabled() ) {
30
  add_filter( 'woocommerce_order_button_text', array( $this, 'set_order_button_text' ) );
31
+ }
32
+ }
33
 
34
+ /**
35
+ * get_settings.
36
+ */
37
+ function get_settings() {
38
 
39
+ $settings = array();
40
 
41
  // Place order (Order now) Button
42
  $settings[] = array(
58
  'id' => 'wcj_checkout_place_order_button_options'
59
  );
60
 
61
+ return $this->add_enable_module_setting( $settings );
62
+ }
63
 
64
+ /**
65
+ * set_order_button_text.
66
+ */
67
+ public function set_order_button_text( $current_text ) {
68
  $new_text = get_option( 'wcj_checkout_place_order_button_text' );
69
  return ( '' != $new_text ) ? $new_text : $current_text;
70
+ }
71
  }
72
 
73
  endif;
includes/class-wcj-order-numbers.php CHANGED
@@ -26,7 +26,7 @@ class WCJ_Order_Numbers extends WCJ_Module {
26
  $this->desc = __( 'WooCommerce sequential order numbering, custom order number prefix, suffix and number width.', 'woocommerce-jetpack' );
27
  parent::__construct();
28
 
29
- if ( $this->is_enabled() ) {
30
  // add_action( 'woocommerce_new_order', array( $this, 'add_new_order_number' ), PHP_INT_MAX );
31
  add_action( 'wp_insert_post', array( $this, 'add_new_order_number' ), PHP_INT_MAX );
32
  add_filter( 'woocommerce_order_number', array( $this, 'display_order_number' ), PHP_INT_MAX, 2 );
@@ -57,7 +57,7 @@ class WCJ_Order_Numbers extends WCJ_Module {
57
  )
58
  );
59
  return $order_number;
60
- }
61
 
62
  /**
63
  * add_renumerate_orders_tool_info_to_tools_dashboard.
26
  $this->desc = __( 'WooCommerce sequential order numbering, custom order number prefix, suffix and number width.', 'woocommerce-jetpack' );
27
  parent::__construct();
28
 
29
+ if ( $this->is_enabled() ) {
30
  // add_action( 'woocommerce_new_order', array( $this, 'add_new_order_number' ), PHP_INT_MAX );
31
  add_action( 'wp_insert_post', array( $this, 'add_new_order_number' ), PHP_INT_MAX );
32
  add_filter( 'woocommerce_order_number', array( $this, 'display_order_number' ), PHP_INT_MAX, 2 );
57
  )
58
  );
59
  return $order_number;
60
+ }
61
 
62
  /**
63
  * add_renumerate_orders_tool_info_to_tools_dashboard.
includes/class-wcj-orders.php CHANGED
@@ -14,17 +14,17 @@ if ( ! class_exists( 'WCJ_Orders' ) ) :
14
 
15
  class WCJ_Orders extends WCJ_Module {
16
 
17
- /**
18
- * Constructor.
19
- */
20
- public function __construct() {
21
 
22
  $this->id = 'orders';
23
  $this->short_desc = __( 'Orders', 'woocommerce-jetpack' );
24
  $this->desc = __( 'Minimum WooCommerce order amount; orders auto-complete.', 'woocommerce-jetpack' );
25
  parent::__construct();
26
 
27
- // Main hooks
28
  if ( $this->is_enabled() ) {
29
 
30
  if ( get_option( 'wcj_order_minimum_amount' ) > 0 ) {
@@ -47,7 +47,7 @@ class WCJ_Orders extends WCJ_Module {
47
  add_filter( 'parse_query', array( $this, 'orders_by_country_admin_filter_query' ) );
48
  }
49
  }
50
- }
51
 
52
  /**
53
  * Filter the orders in admin based on options
@@ -83,9 +83,9 @@ class WCJ_Orders extends WCJ_Module {
83
  }
84
  }
85
 
86
- /**
87
- * add_order_column.
88
- */
89
  function add_order_column( $columns ) {
90
  $columns['country'] = __( 'Country', 'woocommerce-jetpack' );
91
  return $columns;
@@ -137,9 +137,9 @@ class WCJ_Orders extends WCJ_Module {
137
  ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
138
  // MINIMUM AMOUNT //
139
  ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
140
- /**
141
- * order_minimum_amount.
142
- */
143
  public function order_minimum_amount() {
144
 
145
  $minimum = get_option( 'wcj_order_minimum_amount' );
@@ -175,79 +175,79 @@ class WCJ_Orders extends WCJ_Module {
175
  wp_safe_redirect( $woocommerce->cart->get_cart_url() );
176
  }
177
 
178
- /**
179
- * Add settings arrays to Jetpack Settings.
180
- */
181
- function get_settings() {
182
 
183
- $settings = array(
184
 
185
- array( 'title' => __( 'Order Minimum Amount', 'woocommerce-jetpack' ), 'type' => 'title', 'desc' => __( 'This section lets you set minimum order amount.', 'woocommerce-jetpack' ), 'id' => 'wcj_order_minimum_amount_options' ),
186
 
187
- array(
188
- 'title' => __( 'Amount', 'woocommerce-jetpack' ),
189
- 'desc' => __( 'Minimum order amount. Set to 0 to disable.', 'woocommerce-jetpack' ),
190
- 'id' => 'wcj_order_minimum_amount',
191
- 'default' => 0,
192
- 'type' => 'number',
193
  'custom_attributes' => array(
194
  'step' => '0.0001',
195
  'min' => '0',
196
  ),
197
- ),
198
 
199
- array(
200
- 'title' => __( 'Error message', 'woocommerce-jetpack' ),
201
  'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
202
- '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' ),
203
- 'id' => 'wcj_order_minimum_amount_error_message',
204
- 'default' => 'You must have an order with a minimum of %s to place your order, your current order total is %s.',
205
- 'type' => 'textarea',
206
  'custom_attributes'
207
  => apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ),
208
  'css' => 'width:50%;min-width:300px;',
209
- ),
210
-
211
- array(
212
- 'title' => __( 'Add notice to cart page also', 'woocommerce-jetpack' ),
213
- 'desc' => __( 'Add', 'woocommerce-jetpack' ),
214
- 'id' => 'wcj_order_minimum_amount_cart_notice_enabled',
215
- 'default' => 'no',
216
- 'type' => 'checkbox',
217
- ),
218
-
219
- array(
220
- 'title' => __( 'Message on cart page', 'woocommerce-jetpack' ),
221
  'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
222
- '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' ),
223
- 'id' => 'wcj_order_minimum_amount_cart_notice_message',
224
- 'default' => 'You must have an order with a minimum of %s to place your order, your current order total is %s.',
225
- 'type' => 'textarea',
226
  'custom_attributes'
227
  => apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ),
228
  'css' => 'width:50%;min-width:300px;',
229
- ),
230
 
231
- array(
232
- 'title' => __( 'Stop customer from seeing the Checkout page if minimum amount not reached.', 'woocommerce-jetpack' ),
233
- 'desc' => __( 'Redirect back to Cart page', 'woocommerce-jetpack' ),
234
- 'id' => 'wcj_order_minimum_amount_stop_from_seeing_checkout',
235
- 'default' => 'no',
236
- 'type' => 'checkbox',
237
- ),
238
 
239
- array( 'type' => 'sectionend', 'id' => 'wcj_order_minimum_amount_options' ),
240
 
241
  array( 'title' => __( 'Orders Auto-Complete', 'woocommerce-jetpack' ), 'type' => 'title', 'desc' => __( 'This section lets you enable orders auto-complete function.', 'woocommerce-jetpack' ), 'id' => 'wcj_order_auto_complete_options' ),
242
 
243
- array(
244
- 'title' => __( 'Auto-complete all WooCommerce orders', 'woocommerce-jetpack' ),
245
- 'desc' => __( 'Enable', 'woocommerce-jetpack' ),
246
- 'desc_tip' => __( 'E.g. if you sell digital products then you are not shipping anything and you may want auto-complete all your orders.', 'woocommerce-jetpack' ),
247
- 'id' => 'wcj_order_auto_complete_enabled',
248
- 'default' => 'no',
249
- 'type' => 'checkbox',
250
- ),
251
 
252
  array( 'type' => 'sectionend', 'id' => 'wcj_order_auto_complete_options' ),
253
 
@@ -258,22 +258,22 @@ class WCJ_Orders extends WCJ_Module {
258
  'id' => 'wcj_orders_list_custom_columns_options',
259
  ),
260
 
261
- array(
262
- 'title' => __( 'Country', 'woocommerce-jetpack' ),
263
- 'desc' => __( 'Add', 'woocommerce-jetpack' ),
264
- 'id' => 'wcj_orders_list_custom_columns_country',
265
- 'default' => 'no',
266
- 'type' => 'checkbox',
267
- ),
268
 
269
  array(
270
  'type' => 'sectionend',
271
  'id' => 'wcj_orders_list_custom_columns_options',
272
  ),
273
 
274
- );
275
 
276
- return $this->add_enable_module_setting( $settings );
277
  }
278
  }
279
 
14
 
15
  class WCJ_Orders extends WCJ_Module {
16
 
17
+ /**
18
+ * Constructor.
19
+ */
20
+ public function __construct() {
21
 
22
  $this->id = 'orders';
23
  $this->short_desc = __( 'Orders', 'woocommerce-jetpack' );
24
  $this->desc = __( 'Minimum WooCommerce order amount; orders auto-complete.', 'woocommerce-jetpack' );
25
  parent::__construct();
26
 
27
+ // Main hooks
28
  if ( $this->is_enabled() ) {
29
 
30
  if ( get_option( 'wcj_order_minimum_amount' ) > 0 ) {
47
  add_filter( 'parse_query', array( $this, 'orders_by_country_admin_filter_query' ) );
48
  }
49
  }
50
+ }
51
 
52
  /**
53
  * Filter the orders in admin based on options
83
  }
84
  }
85
 
86
+ /**
87
+ * add_order_column.
88
+ */
89
  function add_order_column( $columns ) {
90
  $columns['country'] = __( 'Country', 'woocommerce-jetpack' );
91
  return $columns;
137
  ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
138
  // MINIMUM AMOUNT //
139
  ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
140
+ /**
141
+ * order_minimum_amount.
142
+ */
143
  public function order_minimum_amount() {
144
 
145
  $minimum = get_option( 'wcj_order_minimum_amount' );
175
  wp_safe_redirect( $woocommerce->cart->get_cart_url() );
176
  }
177
 
178
+ /**
179
+ * Add settings arrays to Jetpack Settings.
180
+ */
181
+ function get_settings() {
182
 
183
+ $settings = array(
184
 
185
+ array( 'title' => __( 'Order Minimum Amount', 'woocommerce-jetpack' ), 'type' => 'title', 'desc' => __( 'This section lets you set minimum order amount.', 'woocommerce-jetpack' ), 'id' => 'wcj_order_minimum_amount_options' ),
186
 
187
+ array(
188
+ 'title' => __( 'Amount', 'woocommerce-jetpack' ),
189
+ 'desc' => __( 'Minimum order amount. Set to 0 to disable.', 'woocommerce-jetpack' ),
190
+ 'id' => 'wcj_order_minimum_amount',
191
+ 'default' => 0,
192
+ 'type' => 'number',
193
  'custom_attributes' => array(
194
  'step' => '0.0001',
195
  'min' => '0',
196
  ),
197
+ ),
198
 
199
+ array(
200
+ 'title' => __( 'Error message', 'woocommerce-jetpack' ),
201
  'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
202
+ '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' ),
203
+ 'id' => 'wcj_order_minimum_amount_error_message',
204
+ 'default' => 'You must have an order with a minimum of %s to place your order, your current order total is %s.',
205
+ 'type' => 'textarea',
206
  'custom_attributes'
207
  => apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ),
208
  'css' => 'width:50%;min-width:300px;',
209
+ ),
210
+
211
+ array(
212
+ 'title' => __( 'Add notice to cart page also', 'woocommerce-jetpack' ),
213
+ 'desc' => __( 'Add', 'woocommerce-jetpack' ),
214
+ 'id' => 'wcj_order_minimum_amount_cart_notice_enabled',
215
+ 'default' => 'no',
216
+ 'type' => 'checkbox',
217
+ ),
218
+
219
+ array(
220
+ 'title' => __( 'Message on cart page', 'woocommerce-jetpack' ),
221
  'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
222
+ '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' ),
223
+ 'id' => 'wcj_order_minimum_amount_cart_notice_message',
224
+ 'default' => 'You must have an order with a minimum of %s to place your order, your current order total is %s.',
225
+ 'type' => 'textarea',
226
  'custom_attributes'
227
  => apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ),
228
  'css' => 'width:50%;min-width:300px;',
229
+ ),
230
 
231
+ array(
232
+ 'title' => __( 'Stop customer from seeing the Checkout page if minimum amount not reached.', 'woocommerce-jetpack' ),
233
+ 'desc' => __( 'Redirect back to Cart page', 'woocommerce-jetpack' ),
234
+ 'id' => 'wcj_order_minimum_amount_stop_from_seeing_checkout',
235
+ 'default' => 'no',
236
+ 'type' => 'checkbox',
237
+ ),
238
 
239
+ array( 'type' => 'sectionend', 'id' => 'wcj_order_minimum_amount_options' ),
240
 
241
  array( 'title' => __( 'Orders Auto-Complete', 'woocommerce-jetpack' ), 'type' => 'title', 'desc' => __( 'This section lets you enable orders auto-complete function.', 'woocommerce-jetpack' ), 'id' => 'wcj_order_auto_complete_options' ),
242
 
243
+ array(
244
+ 'title' => __( 'Auto-complete all WooCommerce orders', 'woocommerce-jetpack' ),
245
+ 'desc' => __( 'Enable', 'woocommerce-jetpack' ),
246
+ 'desc_tip' => __( 'E.g. if you sell digital products then you are not shipping anything and you may want auto-complete all your orders.', 'woocommerce-jetpack' ),
247
+ 'id' => 'wcj_order_auto_complete_enabled',
248
+ 'default' => 'no',
249
+ 'type' => 'checkbox',
250
+ ),
251
 
252
  array( 'type' => 'sectionend', 'id' => 'wcj_order_auto_complete_options' ),
253
 
258
  'id' => 'wcj_orders_list_custom_columns_options',
259
  ),
260
 
261
+ array(
262
+ 'title' => __( 'Country', 'woocommerce-jetpack' ),
263
+ 'desc' => __( 'Add', 'woocommerce-jetpack' ),
264
+ 'id' => 'wcj_orders_list_custom_columns_country',
265
+ 'default' => 'no',
266
+ 'type' => 'checkbox',
267
+ ),
268
 
269
  array(
270
  'type' => 'sectionend',
271
  'id' => 'wcj_orders_list_custom_columns_options',
272
  ),
273
 
274
+ );
275
 
276
+ return $this->add_enable_module_setting( $settings );
277
  }
278
  }
279
 
includes/class-wcj-payment-gateways-icons.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * The WooCommerce Jetpack Payment Gateways Icons class.
6
  *
7
- * @version 2.3.0
8
  * @since 2.2.2
9
  * @author Algoritmika Ltd.
10
  */
@@ -13,86 +13,124 @@ if ( ! defined( 'ABSPATH' ) ) exit;
13
 
14
  if ( ! class_exists( 'WCJ_Payment_Gateways_Icons' ) ) :
15
 
 
 
 
 
16
  class WCJ_Payment_Gateways_Icons extends WCJ_Module {
17
 
18
  /**
19
  * Constructor.
20
  *
21
- * @version 2.3.0
22
  */
23
  function __construct() {
24
 
25
  $this->id = 'payment_gateways_icons';
26
  $this->short_desc = __( 'Gateways Icons', 'woocommerce-jetpack' );
27
- $this->desc = __( 'Change icons (images) for all default WooCommerce payment gateways.', 'woocommerce-jetpack' );
28
  parent::__construct();
29
 
 
 
30
  if ( $this->is_enabled() ) {
31
- $woocommerce_icon_filters = $this->get_woocommerce_icon_filters();
32
- foreach ( $woocommerce_icon_filters as $filter_name => $filter_title ) {
33
- add_filter( $filter_name, array( $this, 'set_icon' ) );
 
 
 
 
 
 
 
34
  }
35
  }
36
  }
37
 
38
  /**
39
- * get_woocommerce_icon_filters
 
 
40
  */
41
- function get_woocommerce_icon_filters() {
42
- return array(
43
- 'woocommerce_cod_icon' => 'COD',
44
- 'woocommerce_cheque_icon' => 'Cheque',
45
- 'woocommerce_bacs_icon' => 'BACS',
46
- 'woocommerce_mijireh_checkout_icon' => 'Mijireh Checkout', //depreciated?
47
- 'woocommerce_paypal_icon' => 'PayPal',
48
- // 'woocommerce_wcj_custom_icon' => 'WooJetpack Custom',
49
- );
50
  }
51
 
52
  /**
53
- * set_icon
 
 
 
54
  */
55
- function set_icon( $value ) {
56
- $icon_url = get_option( 'wcj_payment_gateways_icons_' . current_filter(), '' );
57
- if ( '' === $icon_url ) {
58
- return $value;
59
- }
60
- return $icon_url;
61
  }
62
 
63
  /**
64
- * get_settings.
 
 
65
  */
66
- function get_settings() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
67
 
68
  $settings = array();
69
 
70
  $settings[] = array(
71
- 'title' => __( 'Default WooCommerce Payment Gateways Icons', 'woocommerce-jetpack' ),
72
  'type' => 'title',
73
  'desc' => __( 'If you want to show an image next to the gateway\'s name on the frontend, enter a URL to an image.', 'woocommerce-jetpack' ),
74
  'id' => 'wcj_payment_gateways_icons_options'
75
  );
76
 
77
- $woocommerce_icon_filters = $this->get_woocommerce_icon_filters();
78
- foreach ( $woocommerce_icon_filters as $filter_name => $filter_title ) {
79
-
80
- $desc = '';
81
- $icon_url = apply_filters( $filter_name, '' );
82
- if ( '' != $icon_url )
83
- $desc = '<img src="' . $icon_url . '" alt="' . $filter_title . '" title="' . $filter_title . '" />';
84
- // $desc = __( 'Current Icon: ', 'woocommerce-jetpack' ) . '<img src="' . $icon_url . '" alt="' . $filter_title . '" title="' . $filter_title . '" />';
85
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
86
  $settings[] = array(
87
- 'title' => $filter_title,
88
- // 'title' => sprintf( __( 'Icon for %s payment gateway', 'woocommerce-jetpack' ), $filter_title ),
89
- 'desc' => $desc,
90
- // 'desc_tip' => $filter_name,
91
- 'id' => 'wcj_payment_gateways_icons_' . $filter_name,
92
- 'default' => '',
93
- 'type' => 'text',
94
- 'css' => 'min-width:300px;width:50%;',
95
- );
96
  }
97
 
98
  $settings[] = array(
@@ -100,7 +138,7 @@ class WCJ_Payment_Gateways_Icons extends WCJ_Module {
100
  'id' => 'wcj_payment_gateways_icons_options'
101
  );
102
 
103
- return $this->add_enable_module_setting( $settings );
104
  }
105
  }
106
 
4
  *
5
  * The WooCommerce Jetpack Payment Gateways Icons class.
6
  *
7
+ * @version 2.3.1
8
  * @since 2.2.2
9
  * @author Algoritmika Ltd.
10
  */
13
 
14
  if ( ! class_exists( 'WCJ_Payment_Gateways_Icons' ) ) :
15
 
16
+ /**
17
+ * WCJ_Payment_Gateways_Icons Class.
18
+ */
19
+
20
  class WCJ_Payment_Gateways_Icons extends WCJ_Module {
21
 
22
  /**
23
  * Constructor.
24
  *
25
+ * @version 2.3.1
26
  */
27
  function __construct() {
28
 
29
  $this->id = 'payment_gateways_icons';
30
  $this->short_desc = __( 'Gateways Icons', 'woocommerce-jetpack' );
31
+ $this->desc = __( 'Change or completely remove icons (images) for any (default or custom) WooCommerce payment gateway.', 'woocommerce-jetpack' );
32
  parent::__construct();
33
 
34
+ add_filter( 'init', array( $this, 'add_hooks' ) );
35
+
36
  if ( $this->is_enabled() ) {
37
+ add_filter( 'woocommerce_gateway_icon', array( $this, 'set_icon' ), PHP_INT_MAX, 2 );
38
+
39
+ // compatibility with 2.3.0 or below
40
+ $default_gateways = array( 'cod', 'cheque', 'bacs', 'mijireh_checkout', 'paypal' );
41
+ foreach ( $default_gateways as $key ) {
42
+ $depreciated_option = get_option( 'wcj_payment_gateways_icons_' . 'woocommerce_' . $key . '_icon', '' );
43
+ if ( '' != $depreciated_option ) {
44
+ update_option( 'wcj_gateways_icons_' . $key . '_icon', $depreciated_option );
45
+ delete_option( 'wcj_payment_gateways_icons_' . 'woocommerce_' . $key . '_icon' );
46
+ }
47
  }
48
  }
49
  }
50
 
51
  /**
52
+ * get_settings.
53
+ *
54
+ * @version 2.3.1
55
  */
56
+ function get_settings() {
57
+ $settings = array();
58
+ $settings = apply_filters( 'wcj_payment_gateways_icons_settings', $settings );
59
+ return $this->add_enable_module_setting( $settings );
 
 
 
 
 
60
  }
61
 
62
  /**
63
+ * add_hooks.
64
+ *
65
+ * @version 2.3.1
66
+ * @since 2.3.1
67
  */
68
+ function add_hooks() {
69
+ add_filter( 'wcj_payment_gateways_icons_settings', array( $this, 'add_icons_settings' ) );
 
 
 
 
70
  }
71
 
72
  /**
73
+ * set_icon.
74
+ *
75
+ * @version 2.3.1
76
  */
77
+ function set_icon( $icon, $key ) {
78
+ $default_gateways = apply_filters( 'wcj_get_option_filter', array( 'cod', 'cheque', 'bacs', 'mijireh_checkout', 'paypal' ), array() );
79
+ if ( ! empty( $default_gateways ) && ! in_array( $key, $default_gateways ) ) return $icon;
80
+ if ( 'yes' === get_option( 'wcj_gateways_icons_' . $key . '_icon_remove', 'no' ) ) return '';
81
+ $custom_icon_url = get_option( 'wcj_gateways_icons_' . $key . '_icon', '' );
82
+ return ( '' == $custom_icon_url ) ? $icon : '<img src="' . $custom_icon_url . '" alt="' . $key . '" />';
83
+ }
84
+
85
+ /**
86
+ * add_icons_settings.
87
+ *
88
+ * @version 2.3.1
89
+ * @since 2.3.1
90
+ */
91
+ function add_icons_settings( $settings ) {
92
 
93
  $settings = array();
94
 
95
  $settings[] = array(
96
+ 'title' => __( 'Options', 'woocommerce-jetpack' ),
97
  'type' => 'title',
98
  'desc' => __( 'If you want to show an image next to the gateway\'s name on the frontend, enter a URL to an image.', 'woocommerce-jetpack' ),
99
  'id' => 'wcj_payment_gateways_icons_options'
100
  );
101
 
102
+ $available_gateways = WC()->payment_gateways->payment_gateways();
103
+ foreach ( $available_gateways as $key => $gateway ) {
 
 
 
 
 
 
104
 
105
+ $default_gateways = array( 'cod', 'cheque', 'bacs', 'mijireh_checkout', 'paypal' );
106
+ if ( ! empty( $default_gateways ) && ! in_array( $key, $default_gateways ) ) {
107
+ $custom_attributes = apply_filters( 'get_wc_jetpack_plus_message', '', 'disabled' );
108
+ $desc_tip = apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' );
109
+ } else {
110
+ $custom_attributes = array();
111
+ $desc_tip = '';
112
+ }
113
+ $current_icon_url = get_option( 'wcj_gateways_icons_' . $key . '_icon', '' );
114
+ $desc = ( '' != $current_icon_url ) ? '<img width="16" src="' . $current_icon_url . '" alt="' . $gateway->title . '" title="' . $gateway->title . '" />' : '';
115
+ $settings[] = array(
116
+ 'title' => $gateway->title,
117
+ 'desc_tip' => __( 'Leave blank to set WooCommerce default value', 'woocommerce-jetpack' ),
118
+ 'desc' => ( '' != $desc_tip ) ? $desc_tip : $desc,
119
+ 'id' => 'wcj_gateways_icons_' . $key . '_icon',
120
+ 'default' => '',
121
+ 'type' => 'text',
122
+ 'css' => 'min-width:300px;width:50%;',
123
+ 'custom_attributes' => $custom_attributes,
124
+ );
125
  $settings[] = array(
126
+ 'title' => '',
127
+ 'desc_tip' => $desc_tip,
128
+ 'desc' => __( 'Remove Icon', 'woocommerce-jetpack' ),
129
+ 'id' => 'wcj_gateways_icons_' . $key . '_icon_remove',
130
+ 'default' => 'no',
131
+ 'type' => 'checkbox',
132
+ 'custom_attributes' => $custom_attributes,
133
+ );
 
134
  }
135
 
136
  $settings[] = array(
138
  'id' => 'wcj_payment_gateways_icons_options'
139
  );
140
 
141
+ return $settings;
142
  }
143
  }
144
 
includes/class-wcj-pdf-invoices.php CHANGED
@@ -24,10 +24,10 @@ class WCJ_PDF_Invoices {
24
  .pdf_invoice_totals_table_wcj th { width: 80%; text-align: right; }
25
  .pdf_invoice_totals_table_wcj td { width: 20%; text-align: right; border: 1px solid #F0F0F0; }';
26
 
27
- /**
28
- * Constructor.
29
- */
30
- public function __construct() {
31
 
32
  //add_shortcode( 'wcj_order_date', array( $this, 'shortcode_pdf_invoices_order_date' ) );
33
  //add_shortcode( 'wcj_order_billing_address', array( $this, 'shortcode_pdf_invoices_billing_address' ) );
@@ -35,8 +35,8 @@ class WCJ_PDF_Invoices {
35
  //add_shortcode( 'wcj_items_total_quantity', array( $this, 'shortcode_pdf_invoices_items_total_quantity' ) );
36
  //add_shortcode( 'wcj_items_total_number', array( $this, 'shortcode_pdf_invoices_items_total_number' ) );
37
 
38
- // Main hooks
39
- if ( get_option( 'wcj_pdf_invoices_enabled' ) == 'yes' ) {
40
 
41
  add_filter( 'woocommerce_admin_order_actions', array( $this, 'add_pdf_invoices_link_to_order_list' ), 100, 2 );
42
 
@@ -51,19 +51,19 @@ class WCJ_PDF_Invoices {
51
  add_filter( 'woocommerce_email_attachments', array( $this, 'add_pdf_invoice_email_attachment' ), 100, 3 );
52
 
53
  add_filter( 'woocommerce_payment_gateways_settings', array( $this, 'add_attach_invoice_settings' ), 100 );
54
- }
55
 
56
- // Settings hooks
57
- add_filter( 'wcj_settings_sections', array( $this, 'settings_section' ) );
58
- add_filter( 'wcj_settings_pdf_invoices', array( $this, 'get_settings' ), 100 );
59
- add_filter( 'wcj_features_status', array( $this, 'add_enabled_option' ), 100 );
60
- }
61
 
62
- /**
63
- * add_attach_invoice_settings.
64
- */
65
  function add_attach_invoice_settings( $settings ) {
66
- $settings[] = array( 'title' => __( 'Payment Gateways Attach PDF Invoice V1 Options', 'woocommerce-jetpack' ), 'type' => 'title', 'desc' => __( 'This section lets you choose when to attach PDF invoice to customers emails.', 'woocommerce-jetpack' ), 'id' => 'wcj_gateways_attach_invoice_options' );
67
  global $woocommerce;
68
  $available_gateways = $woocommerce->payment_gateways->payment_gateways();
69
  foreach ( $available_gateways as $key => $gateway ) {
@@ -81,9 +81,9 @@ class WCJ_PDF_Invoices {
81
 
82
 
83
  ) );
84
- }
85
 
86
- $settings[] = array( 'type' => 'sectionend', 'id' => 'wcj_gateways_attach_invoice_options' );
87
 
88
  return $settings;
89
  }
@@ -178,17 +178,17 @@ class WCJ_PDF_Invoices {
178
  return $this->get_shortcode( '%items_total_quantity%', $atts );
179
  }
180
 
181
- /**
182
- * do_attach_for_payment_method.
183
- */
184
- public function do_attach_for_payment_method( $payment_method ) {
185
  return ( 'no' === get_option( 'wcj_gateways_attach_invoice_' . $payment_method, 'yes' ) ) ? false : true;
186
  }
187
 
188
- /**
189
- * add_pdf_invoice_email_attachment.
190
- */
191
- public function add_pdf_invoice_email_attachment( $attachments, $status, $order ) {
192
  if ( isset( $status ) && 'customer_completed_order' === $status && isset( $order ) && true === $this->do_attach_for_payment_method( $order->payment_method ) ) {
193
  $file_name = sys_get_temp_dir() . '/invoice-' . $order->id . '.pdf';
194
  $result = file_put_contents( $file_name, $this->generate_pdf( $order->id ) );
@@ -197,10 +197,10 @@ class WCJ_PDF_Invoices {
197
  return $attachments;
198
  }
199
 
200
- /**
201
- * Unlocks - PDF Invoices - add_pdf_invoices_link_to_my_account.
202
- */
203
- public function add_pdf_invoices_link_to_my_account( $actions, $the_order ) {
204
 
205
  if ( 'no' === get_option( 'wcj_pdf_invoices_save_as_enabled' ) )
206
  $actions['pdf_invoice'] = array(
@@ -214,21 +214,21 @@ class WCJ_PDF_Invoices {
214
  );
215
 
216
  return $actions;
217
- }
218
 
219
- /**
220
- * add_pdf_invoice_icon_css.
221
- */
222
  function add_pdf_invoice_icon_css() {
223
 
224
  echo '<style> a.button.tips.view.pdf_invoice:after { content: "\e028" !important; } </style>';
225
  echo '<style> a.button.tips.view.save_pdf_invoice:after { content: "\e028" !important; } </style>';
226
  }
227
 
228
- /**
229
- * generate_pdf.
230
- */
231
- public function generate_pdf( $get_by_order_id = 0 ) {
232
 
233
  if ( ! isset( $_GET['pdf_invoice'] ) && 0 == $get_by_order_id ) return;
234
 
@@ -402,9 +402,9 @@ class WCJ_PDF_Invoices {
402
  }
403
 
404
 
405
- /**
406
- * add_custom_checkout_fields_to_pdf.
407
- */
408
  public function add_custom_checkout_fields_to_pdf( $order_id, $section ) {
409
 
410
  $result = '';
@@ -425,10 +425,10 @@ class WCJ_PDF_Invoices {
425
  return $result;
426
  }
427
 
428
- /**
429
- * get_columns.
430
- */
431
- public function get_columns() {
432
 
433
  // Count optional columns number for column width calculation
434
  $total_optional_columns = 0;
@@ -517,10 +517,10 @@ class WCJ_PDF_Invoices {
517
  );
518
  }
519
 
520
- /**
521
- * get_header.
522
- */
523
- public function get_header( $the_order ) {
524
  // Starting output
525
  // Css
526
  $html = '<style>' . apply_filters( 'wcj_get_option_filter', $this->default_css, get_option( 'wcj_pdf_invoices_general_css' ) ) . '</style>';
@@ -561,10 +561,10 @@ class WCJ_PDF_Invoices {
561
  return $html;
562
  }
563
 
564
- /**
565
- * get_items_table.
566
- */
567
- public function get_items_table( $the_order ) {
568
 
569
  $html = '';
570
 
@@ -714,9 +714,9 @@ class WCJ_PDF_Invoices {
714
  }
715
 
716
 
717
- /**
718
- * wcj_order_get_cart_discount_tax.
719
- */
720
  function wcj_order_get_cart_discount_tax( $the_order ) {
721
 
722
  $the_cart_discount = $the_order->get_cart_discount();
@@ -763,10 +763,10 @@ class WCJ_PDF_Invoices {
763
  return false;
764
  }
765
 
766
- /**
767
- * get_footer.
768
- */
769
- public function get_footer( $the_order ) {
770
 
771
  // ORDER TOTALS //
772
 
@@ -846,10 +846,10 @@ class WCJ_PDF_Invoices {
846
  return $html;
847
  }
848
 
849
- /**
850
- * get_invoice_html.
851
- */
852
- public function get_invoice_html( $order_id ) {
853
 
854
  // PREPARING DATA //
855
  // General
@@ -881,10 +881,10 @@ class WCJ_PDF_Invoices {
881
  return $html;
882
  }
883
 
884
- /**
885
- * add_pdf_invoices_link_to_order_list.
886
- */
887
- public function add_pdf_invoices_link_to_order_list( $actions, $the_order ) {
888
  if ( 'no' === get_option( 'wcj_pdf_invoices_save_as_enabled' ) )
889
  $actions['pdf_invoice'] = array(
890
  'url' => basename( $_SERVER['REQUEST_URI'] ) . '&pdf_invoice=' . $the_order->id,
@@ -898,212 +898,212 @@ class WCJ_PDF_Invoices {
898
  'action' => "view save_pdf_invoice"
899
  );
900
 
901
- return $actions;
902
- }
903
 
904
- /**
905
- * add_enabled_option.
906
- */
907
- public function add_enabled_option( $settings ) {
908
 
909
- $all_settings = $this->get_settings();
910
- $settings[] = $all_settings[1];
911
 
912
- return $settings;
913
- }
914
 
915
- /**
916
- * get_settings.
917
- */
918
- function get_settings() {
919
 
920
- $settings = array(
921
 
922
- array( 'title' => __( 'PDF Invoices Options', 'woocommerce-jetpack' ), 'type' => 'title', 'desc' => __( '', 'woocommerce-jetpack' ), 'id' => 'wcj_pdf_invoices_options' ),
923
 
924
- array(
925
- 'title' => __( 'PDF Invoices', 'woocommerce-jetpack' ) . ' V1 - ' . __( 'depreciated', 'woocommerce-jetpack' ),
926
- 'desc' => '<strong>' . __( 'Enable Module', 'woocommerce-jetpack' ) . '</strong>',
927
- 'desc_tip' => __( 'Add PDF invoices for the WooCommerce store owners and for the customers.', 'woocommerce-jetpack' ),
928
- 'id' => 'wcj_pdf_invoices_enabled',
929
- 'default' => 'no',
930
- 'type' => 'checkbox',
931
- ),
932
 
933
  array( 'type' => 'sectionend', 'id' => 'wcj_pdf_invoices_options' ),
934
 
935
  array( 'title' => __( 'Invoice Header', 'woocommerce-jetpack' ), 'type' => 'title', 'desc' => __( 'This section lets you set texts for required invoice number and date, and optional logo, header text, invoice due and fulfillment dates.', 'woocommerce-jetpack' ), 'id' => 'wcj_pdf_invoices_header_options' ),
936
 
937
- array(
938
- 'title' => __( 'Your Logo URL', 'woocommerce-jetpack' ),
939
- 'desc' => __( 'Enter a URL to an image you want to show in the invoice\'s header. Upload your image using the <a href="/wp-admin/media-new.php">media uploader</a>.', 'woocommerce-jetpack' ),
940
- 'desc_tip' => __( 'Leave blank to disable', 'woocommerce-jetpack' ),
941
- 'id' => 'wcj_pdf_invoices_seller_logo_url',
942
- 'default' => '',
943
- 'type' => 'text',
944
  'css' => 'width:33%;min-width:300px;',
945
- ),
946
 
947
- array(
948
- 'title' => __( 'Header Text', 'woocommerce-jetpack' ),
949
- 'desc_tip' => __( 'Leave blank to disable', 'woocommerce-jetpack' ),
950
  'desc' => __( 'Default: INVOICE', 'woocommerce-jetpack' ),
951
- 'id' => 'wcj_pdf_invoices_header_text',
952
- 'default' => __( 'INVOICE', 'woocommerce-jetpack' ),
953
- 'type' => 'text',
954
  'css' => 'width:33%;min-width:300px;',
955
- ),
956
-
957
- array(
958
- 'title' => __( 'Invoice Number', 'woocommerce-jetpack' ),
959
- 'desc' => __( 'Default: Invoice number', 'woocommerce-jetpack' ),
960
- 'id' => 'wcj_pdf_invoices_invoice_number_text',
961
- 'default' => __( 'Invoice number', 'woocommerce-jetpack' ),
962
- 'type' => 'text',
963
  'css' => 'width:33%;min-width:300px;',
964
- ),
965
 
966
- array(
967
- 'title' => __( 'Order Date', 'woocommerce-jetpack' ),
968
- 'desc' => __( 'Default: Order date', 'woocommerce-jetpack' ),
969
  'desc_tip' => __( 'Leave blank to disable', 'woocommerce-jetpack' ),
970
- 'id' => 'wcj_pdf_invoices_order_date_text',
971
- 'default' => __( 'Order date', 'woocommerce-jetpack' ),
972
- 'type' => 'text',
973
  'css' => 'width:33%;min-width:300px;',
974
- ),
975
 
976
- array(
977
- 'title' => __( 'Order Time', 'woocommerce-jetpack' ),
978
- 'desc' => __( 'Default: Order time', 'woocommerce-jetpack' ),
979
  'desc_tip' => __( 'Leave blank to disable', 'woocommerce-jetpack' ),
980
- 'id' => 'wcj_pdf_invoices_order_time_text',
981
- 'default' => __( 'Order time', 'woocommerce-jetpack' ),
982
- 'type' => 'text',
983
  'css' => 'width:33%;min-width:300px;',
984
- ),
985
-
986
- array(
987
- 'title' => __( 'Invoice Date', 'woocommerce-jetpack' ),
988
- 'desc' => __( 'Default: Invoice date', 'woocommerce-jetpack' ),
989
- 'id' => 'wcj_pdf_invoices_invoice_date_text',
990
- 'default' => __( 'Invoice date', 'woocommerce-jetpack' ),
991
- 'type' => 'text',
992
  'css' => 'width:33%;min-width:300px;',
993
- ),
994
 
995
  array(
996
- 'title' => 'Invoice Due Date',
997
- 'desc' => __( 'Default: Invoice due date', 'woocommerce-jetpack' ),
998
  'desc_tip' => __( 'Leave blank to disable', 'woocommerce-jetpack' ),
999
- 'id' => 'wcj_pdf_invoices_invoice_due_date_text',
1000
- 'default' => __( 'Invoice due date', 'woocommerce-jetpack' ),
1001
- 'type' => 'text',
1002
  'css' => 'width:33%;min-width:300px;',
1003
- ),
1004
 
1005
  array(
1006
- 'title' => '',
1007
- 'desc' => __( 'days', 'woocommerce-jetpack' ),
1008
  //'desc_tip' => __( 'Set to 0 to disable', 'woocommerce-jetpack' ),
1009
- 'id' => 'wcj_pdf_invoices_invoice_due_date_days',
1010
- 'default' => 0,
1011
- 'type' => 'number',
1012
  'css' => 'width:33%;min-width:300px;',
1013
- ),
1014
 
1015
  array(
1016
- 'title' => 'Invoice Fulfillment Date',
1017
- 'desc' => __( 'Default: Invoice fulfillment date', 'woocommerce-jetpack' ),
1018
  'desc_tip' => __( 'Leave blank to disable', 'woocommerce-jetpack' ),
1019
- 'id' => 'wcj_pdf_invoices_invoice_fulfillment_date_text',
1020
- 'default' => __( 'Invoice fulfillment date', 'woocommerce-jetpack' ),
1021
- 'type' => 'text',
1022
  'css' => 'width:33%;min-width:300px;',
1023
- ),
1024
 
1025
  array(
1026
- 'title' => '',
1027
- 'desc' => __( 'days', 'woocommerce-jetpack' ),
1028
  //'desc_tip' => __( 'Set to 0 to disable', 'woocommerce-jetpack' ),
1029
- 'id' => 'wcj_pdf_invoices_invoice_fulfillment_date_days',
1030
- 'default' => 0,
1031
- 'type' => 'number',
1032
  'css' => 'width:33%;min-width:300px;',
1033
- ),
1034
 
1035
  array(
1036
- 'title' => __( 'Additional Header', 'woocommerce-jetpack' ),
1037
- 'desc_tip' => __( 'Additional header - will be displayed above all data on invoice. You can use html and/or shortcodes here.', 'woocommerce-jetpack' ),
1038
- 'id' => 'wcj_pdf_invoices_additional_header_text',
1039
- 'default' => '',
1040
- 'type' => 'textarea',
1041
  'css' => 'width:33%;min-width:300px;min-height:300px;',
1042
- ),
1043
 
1044
  array( 'type' => 'sectionend', 'id' => 'wcj_pdf_invoices_header_options' ),
1045
 
1046
  array( 'title' => __( 'Seller and Buyer Info', 'woocommerce-jetpack' ), 'type' => 'title', 'desc' => __( '', 'woocommerce-jetpack' ), 'id' => 'wcj_pdf_invoices_seller_and_buyer_options' ),
1047
 
1048
- array(
1049
- 'title' => __( 'Seller', 'woocommerce-jetpack' ),
1050
- //'desc_tip' => __( 'Seller text', 'woocommerce-jetpack' ),
1051
- 'id' => 'wcj_pdf_invoices_seller_text',
1052
- 'default' => __( 'Seller', 'woocommerce-jetpack' ),
1053
- 'type' => 'text',
1054
  'css' => 'width:33%;min-width:300px;',
1055
- ),
1056
 
1057
- array(
1058
- 'title' => __( 'Your business information', 'woocommerce-jetpack' ),
1059
- //'desc_tip' => __( 'Seller information', 'woocommerce-jetpack' ),
1060
  'desc' => __( 'New lines are added automatically.', 'woocommerce-jetpack' ),
1061
- 'id' => 'wcj_pdf_invoices_seller_info',
1062
- 'default' => __( '<strong>Company Name</strong>', 'woocommerce-jetpack' ),
1063
  'type' => 'textarea',
1064
  'css' => 'width:33%;min-width:300px;min-height:300px;',
1065
- ),
1066
-
1067
- array(
1068
- 'title' => __( 'Buyer', 'woocommerce-jetpack' ),
1069
- //'desc_tip' => __( 'Buyer text', 'woocommerce-jetpack' ),
1070
- 'id' => 'wcj_pdf_invoices_buyer_text',
1071
- 'default' => __( 'Buyer', 'woocommerce-jetpack' ),
1072
- 'type' => 'text',
1073
  'css' => 'width:33%;min-width:300px;',
1074
- ),
1075
 
1076
  array( 'type' => 'sectionend', 'id' => 'wcj_pdf_invoices_seller_and_buyer_options' ),
1077
 
1078
  array( 'title' => __( 'Items', 'woocommerce-jetpack' ), 'type' => 'title', 'desc' => __( '', 'woocommerce-jetpack' ), 'id' => 'wcj_pdf_invoices_items_options' ),
1079
 
1080
- array(
1081
- 'title' => __( 'Items Table Heading Text', 'woocommerce-jetpack' ),
1082
- //'desc_tip' => __( 'Items text', 'woocommerce-jetpack' ),
1083
- 'id' => 'wcj_pdf_invoices_items_text',
1084
- 'default' => __( 'Items', 'woocommerce-jetpack' ),
1085
- 'type' => 'text',
1086
  'css' => 'width:33%;min-width:300px;',
1087
- ),
1088
 
1089
- array(
1090
- 'title' => __( 'Shipping as Item', 'woocommerce-jetpack' ),
1091
  'desc_tip' => __( 'Leave blank to disable', 'woocommerce-jetpack' ),
1092
- 'desc' => __( 'Display shipping as item', 'woocommerce-jetpack' ),
1093
  //'desc_tip' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
1094
- 'id' => 'wcj_pdf_invoices_display_shipping_as_item_text',
1095
- 'default' => '',
1096
- 'type' => 'text',
1097
  //'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'disabled' ),
1098
- ),
1099
 
1100
- /*array(
1101
- 'title' => '',
1102
- 'desc' => __( 'Add shipping method info', 'woocommerce-jetpack' ),
1103
- 'id' => 'wcj_pdf_invoices_display_shipping_as_item_method_enabled',
1104
- 'default' => 'yes',
1105
- 'type' => 'checkbox',
1106
- ),*/
1107
 
1108
  array(
1109
  'title' => '',
@@ -1122,118 +1122,118 @@ class WCJ_PDF_Invoices {
1122
  ),
1123
 
1124
  array(
1125
- 'title' => __( 'Discount as Item', 'woocommerce-jetpack' ),
1126
  'desc_tip' => __( 'Leave blank to disable', 'woocommerce-jetpack' ),
1127
- 'desc' => __( 'Display discount as item', 'woocommerce-jetpack' ),
1128
  //'desc_tip' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
1129
- 'id' => 'wcj_pdf_invoices_display_discount_as_item_text',
1130
- 'default' => '',
1131
- 'type' => 'text',
1132
  //'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'disabled' ),
1133
- ),
1134
 
1135
  array( 'type' => 'sectionend', 'id' => 'wcj_pdf_invoices_items_options' ),
1136
 
1137
  array( 'title' => __( 'Items Columns', 'woocommerce-jetpack' ), 'type' => 'title', 'desc' => __( 'This section lets you set column names in invoice items table. You can disable some columns by leaving blank column name.', 'woocommerce-jetpack' ), 'id' => 'wcj_pdf_invoices_items_columns_options' ),
1138
 
1139
- array(
1140
- 'title' => __( 'Nr.', 'woocommerce-jetpack' ),
1141
- //'desc_tip' => __( 'Nr. text', 'woocommerce-jetpack' ),
1142
- 'id' => 'wcj_pdf_invoices_column_nr_text',
1143
- 'default' => __( 'Nr.', 'woocommerce-jetpack' ),
1144
- 'type' => 'text',
1145
  'css' => 'width:33%;min-width:300px;',
1146
- ),
1147
-
1148
- array(
1149
- 'title' => __( 'Item Name', 'woocommerce-jetpack' ),
1150
- //'desc_tip' => __( 'Item name text', 'woocommerce-jetpack' ),
1151
- 'id' => 'wcj_pdf_invoices_column_item_name_text',
1152
- 'default' => __( 'Item Name', 'woocommerce-jetpack' ),
1153
- 'type' => 'text',
1154
  'css' => 'width:33%;min-width:300px;',
1155
- ),
1156
 
1157
- array(
1158
- 'title' => __( 'Item Name Additional Info', 'woocommerce-jetpack' ),
1159
  'desc_tip' => __( 'Here you can add more info to item\'s name column (e.g. sku). Default is (SKU: %sku%)', 'woocommerce-jetpack' ),
1160
- 'id' => 'wcj_pdf_invoices_column_item_name_additional_text',
1161
- 'default' => __( '(SKU: %sku%)', 'woocommerce-jetpack' ),
1162
- 'type' => 'textarea',
1163
  'css' => 'width:33%;min-width:300px;',
1164
- ),
1165
-
1166
- array(
1167
- 'title' => __( 'Qty', 'woocommerce-jetpack' ),
1168
- //'desc_tip' => __( 'Qty text', 'woocommerce-jetpack' ),
1169
- 'id' => 'wcj_pdf_invoices_column_qty_text',
1170
- 'default' => __( 'Qty', 'woocommerce-jetpack' ),
1171
- 'type' => 'text',
1172
  'css' => 'width:33%;min-width:300px;',
1173
- ),
1174
 
1175
  array(
1176
- 'title' => __( 'Single Item Price (TAX excl.)', 'woocommerce-jetpack' ),
1177
- 'desc_tip' => __( 'Leave blank to disable', 'woocommerce-jetpack' ),
1178
- 'id' => 'wcj_pdf_invoices_column_single_price_tax_excl_text',
1179
- 'default' => __( 'Price (TAX excl.)', 'woocommerce-jetpack' ),
1180
- 'type' => 'text',
1181
  'css' => 'width:33%;min-width:300px;',
1182
- ),
1183
 
1184
  array(
1185
- 'title' => __( 'Single Item TAX', 'woocommerce-jetpack' ),
1186
- 'desc_tip' => __( 'Leave blank to disable', 'woocommerce-jetpack' ),
1187
- 'id' => 'wcj_pdf_invoices_column_single_price_tax_text',
1188
- 'default' => __( 'TAX', 'woocommerce-jetpack' ),
1189
- 'type' => 'text',
1190
  'css' => 'width:33%;min-width:300px;',
1191
- ),
1192
 
1193
  array(
1194
- 'title' => __( 'Single Item Price (TAX incl.)', 'woocommerce-jetpack' ),
1195
- 'desc_tip' => __( 'Leave blank to disable', 'woocommerce-jetpack' ),
1196
- 'id' => 'wcj_pdf_invoices_column_single_price_tax_incl_text',
1197
- 'default' => __( 'Price (TAX incl.)', 'woocommerce-jetpack' ),
1198
- 'type' => 'text',
1199
  'css' => 'width:33%;min-width:300px;',
1200
- ),
1201
 
1202
  array(
1203
- 'title' => __( 'Sum (TAX excl.)', 'woocommerce-jetpack' ),
1204
- 'desc_tip' => __( 'Leave blank to disable', 'woocommerce-jetpack' ),
1205
- 'id' => 'wcj_pdf_invoices_column_price_tax_excl_text',
1206
- 'default' => __( 'Sum (TAX excl.)', 'woocommerce-jetpack' ),
1207
- 'type' => 'text',
1208
  'css' => 'width:33%;min-width:300px;',
1209
- ),
1210
 
1211
  array(
1212
- 'title' => __( 'Tax Percent', 'woocommerce-jetpack' ),
1213
- 'desc_tip' => __( 'Leave blank to disable', 'woocommerce-jetpack' ),
1214
- 'id' => 'wcj_pdf_invoices_column_price_tax_percent',
1215
- 'default' => __( 'Taxes %', 'woocommerce-jetpack' ),
1216
- 'type' => 'text',
1217
  'css' => 'width:33%;min-width:300px;',
1218
- ),
1219
 
1220
  array(
1221
- 'title' => __( 'Taxes', 'woocommerce-jetpack' ),
1222
- 'desc_tip' => __( 'Leave blank to disable', 'woocommerce-jetpack' ),
1223
- 'id' => 'wcj_pdf_invoices_column_price_tax_text',
1224
- 'default' => __( 'Taxes', 'woocommerce-jetpack' ),
1225
- 'type' => 'text',
1226
  'css' => 'width:33%;min-width:300px;',
1227
- ),
1228
 
1229
  array(
1230
- 'title' => __( 'Sum (TAX incl.)', 'woocommerce-jetpack' ),
1231
- //'desc_tip' => __( 'Price text', 'woocommerce-jetpack' ),
1232
- 'id' => 'wcj_pdf_invoices_column_price_text',
1233
- 'default' => __( 'Sum (TAX incl.)', 'woocommerce-jetpack' ),
1234
- 'type' => 'text',
1235
  'css' => 'width:33%;min-width:300px;',
1236
- ),
1237
 
1238
  array( 'type' => 'sectionend', 'id' => 'wcj_pdf_invoices_items_columns_options' ),
1239
 
@@ -1298,52 +1298,52 @@ class WCJ_PDF_Invoices {
1298
  array( 'title' => __( 'Footer', 'woocommerce-jetpack' ), 'type' => 'title', 'desc' => __( '', 'woocommerce-jetpack' ), 'id' => 'wcj_pdf_invoices_footer_options' ),
1299
 
1300
  array(
1301
- 'title' => __( 'Payment Method', 'woocommerce-jetpack' ),
1302
- 'desc_tip' => __( 'Leave blank to disable', 'woocommerce-jetpack' ),
1303
- 'id' => 'wcj_pdf_invoices_order_payment_method_text',
1304
- 'default' => __( 'Payment Method', 'woocommerce-jetpack' ),
1305
- 'type' => 'text',
1306
  'css' => 'width:33%;min-width:300px;',
1307
- ),
1308
 
1309
  array(
1310
- 'title' => __( 'Shipping Method', 'woocommerce-jetpack' ),
1311
- 'desc_tip' => __( 'Leave blank to disable', 'woocommerce-jetpack' ),
1312
- 'id' => 'wcj_pdf_invoices_order_shipping_method_text',
1313
- 'default' => __( 'Shipping Method', 'woocommerce-jetpack' ),
1314
- 'type' => 'text',
1315
  'css' => 'width:33%;min-width:300px;',
1316
- ),
1317
 
1318
  array(
1319
- 'title' => __( 'Shipping Address', 'woocommerce-jetpack' ),
1320
- 'desc_tip' => __( 'Will be displayed only if customer\'s shipping address differs from billing address. Leave blank to disable', 'woocommerce-jetpack' ),
1321
- 'id' => 'wcj_pdf_invoices_order_shipping_address_text',
1322
- 'default' => __( 'Shipping Address', 'woocommerce-jetpack' ),
1323
- 'type' => 'text',
1324
  'css' => 'width:33%;min-width:300px;',
1325
- ),
1326
 
1327
  array(
1328
- 'title' => __( 'Additional Footer', 'woocommerce-jetpack' ),
1329
- 'desc_tip' => __( 'Additional footer - will be displayed below all other data on invoice. You can use html and/or shortcodes here.', 'woocommerce-jetpack' ),
1330
- 'id' => 'wcj_pdf_invoices_footer_text',
1331
- 'default' => '',
1332
- 'type' => 'textarea',
1333
  'css' => 'width:33%;min-width:300px;min-height:300px;',
1334
- ),
1335
 
1336
  array( 'type' => 'sectionend', 'id' => 'wcj_pdf_invoices_footer_options' ),
1337
 
1338
- array( 'title' => __( 'General Options', 'woocommerce-jetpack' ), 'type' => 'title', 'desc' => __( '', 'woocommerce-jetpack' ), 'id' => 'wcj_pdf_invoices_general_options' ),
1339
 
1340
- array(
1341
- 'title' => __( 'Font Family', 'woocommerce-jetpack' ),
1342
- //'desc' => __( 'Default: dejavusans', 'woocommerce-jetpack' ),
1343
  'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
1344
- 'id' => 'wcj_pdf_invoices_general_font_family',
1345
- 'default' => 'dejavusans',
1346
- 'type' => 'select',
1347
  'options' => array(
1348
  'dejavusans' => 'DejaVu Sans',
1349
  'courier' => 'Courier',
@@ -1351,92 +1351,92 @@ class WCJ_PDF_Invoices {
1351
  'times' => 'Times',
1352
  ),
1353
  'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'disabled' ),
1354
- ),
1355
-
1356
- array(
1357
- 'title' => __( 'Font Size', 'woocommerce-jetpack' ),
1358
- 'desc' => __( 'Default: 8', 'woocommerce-jetpack' ),
1359
- 'id' => 'wcj_pdf_invoices_general_font_size',
1360
- 'default' => 8,
1361
- 'type' => 'number',
1362
- ),
1363
-
1364
- array(
1365
- 'title' => __( 'Make Font Shadowed', 'woocommerce-jetpack' ),
1366
- 'desc' => __( 'Default: Yes', 'woocommerce-jetpack' ),
1367
- 'id' => 'wcj_pdf_invoices_general_font_shadowed',
1368
- 'default' => 'yes',
1369
- 'type' => 'checkbox',
1370
- ),
1371
-
1372
- array(
1373
- 'title' => __( 'CSS', 'woocommerce-jetpack' ),
1374
- 'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
1375
- 'id' => 'wcj_pdf_invoices_general_css',
1376
- 'default' => $this->default_css,
1377
- 'type' => 'textarea',
1378
  'css' => 'width:66%;min-width:300px;min-height:300px;',
1379
  'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ),
1380
- ),
1381
 
1382
  //array( 'type' => 'sectionend', 'id' => 'wcj_pdf_invoices_general_options' ),
1383
 
1384
  //array( 'title' => __( 'More Options', 'woocommerce-jetpack' ), 'type' => 'title', 'desc' => __( '', 'woocommerce-jetpack' ), 'id' => 'wcj_pdf_invoices_more_options' ),
1385
 
1386
- array(
1387
- 'title' => __( 'PDF Invoices for Customers (in My Account)', 'woocommerce-jetpack' ),
1388
- 'desc' => __( 'Enable the PDF Invoices in customers account', 'woocommerce-jetpack' ),
1389
  'desc_tip' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
1390
- 'id' => 'wcj_pdf_invoices_enabled_for_customers',
1391
- 'default' => 'no',
1392
- 'type' => 'checkbox',
1393
  'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'disabled' ),
1394
- ),
1395
 
1396
- array(
1397
- 'title' => __( 'PDF Invoices for Customers (Email attachment)', 'woocommerce-jetpack' ),
1398
- 'desc' => __( 'Enable the PDF Invoices attachment files in customers email on order completed', 'woocommerce-jetpack' ),
1399
  'desc_tip' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
1400
- 'id' => 'wcj_pdf_invoices_attach_to_email_enabled',
1401
- 'default' => 'no',
1402
- 'type' => 'checkbox',
1403
  'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'disabled' ),
1404
- ),
1405
 
1406
- /* array(
1407
- 'title' => __( '', 'woocommerce-jetpack' ),
1408
- 'desc' => __( 'Attach PDF invoice only on customer\'s request', 'woocommerce-jetpack' ),
1409
  'desc_tip' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
1410
- 'id' => 'wcj_pdf_invoices_attach_to_email_on_request_only',
1411
- 'default' => 'no',
1412
- 'type' => 'checkbox',
1413
  'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'disabled' ),
1414
- ), */
1415
 
1416
- array(
1417
- 'title' => __( 'Enable Save as', 'woocommerce-jetpack' ),
1418
- 'desc' => __( 'Enable save as pdf instead of view pdf', 'woocommerce-jetpack' ),
1419
  //'desc_tip' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
1420
- 'id' => 'wcj_pdf_invoices_save_as_enabled',
1421
- 'default' => 'yes',
1422
- 'type' => 'checkbox',
1423
  //'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'disabled' ),
1424
- ),
1425
 
1426
- //array( 'type' => 'sectionend', 'id' => 'wcj_pdf_invoices_more_options' ),
1427
  array( 'type' => 'sectionend', 'id' => 'wcj_pdf_invoices_general_options' ),
1428
- );
1429
-
1430
- return $settings;
1431
- }
1432
-
1433
- /**
1434
- * settings_section.
1435
- */
1436
- function settings_section( $sections ) {
1437
- $sections['pdf_invoices'] = __( 'PDF Invoices', 'woocommerce-jetpack' );
1438
- return $sections;
1439
- }
1440
  }
1441
 
1442
  endif;
24
  .pdf_invoice_totals_table_wcj th { width: 80%; text-align: right; }
25
  .pdf_invoice_totals_table_wcj td { width: 20%; text-align: right; border: 1px solid #F0F0F0; }';
26
 
27
+ /**
28
+ * Constructor.
29
+ */
30
+ public function __construct() {
31
 
32
  //add_shortcode( 'wcj_order_date', array( $this, 'shortcode_pdf_invoices_order_date' ) );
33
  //add_shortcode( 'wcj_order_billing_address', array( $this, 'shortcode_pdf_invoices_billing_address' ) );
35
  //add_shortcode( 'wcj_items_total_quantity', array( $this, 'shortcode_pdf_invoices_items_total_quantity' ) );
36
  //add_shortcode( 'wcj_items_total_number', array( $this, 'shortcode_pdf_invoices_items_total_number' ) );
37
 
38
+ // Main hooks
39
+ if ( get_option( 'wcj_pdf_invoices_enabled' ) == 'yes' ) {
40
 
41
  add_filter( 'woocommerce_admin_order_actions', array( $this, 'add_pdf_invoices_link_to_order_list' ), 100, 2 );
42
 
51
  add_filter( 'woocommerce_email_attachments', array( $this, 'add_pdf_invoice_email_attachment' ), 100, 3 );
52
 
53
  add_filter( 'woocommerce_payment_gateways_settings', array( $this, 'add_attach_invoice_settings' ), 100 );
54
+ }
55
 
56
+ // Settings hooks
57
+ add_filter( 'wcj_settings_sections', array( $this, 'settings_section' ) );
58
+ add_filter( 'wcj_settings_pdf_invoices', array( $this, 'get_settings' ), 100 );
59
+ add_filter( 'wcj_features_status', array( $this, 'add_enabled_option' ), 100 );
60
+ }
61
 
62
+ /**
63
+ * add_attach_invoice_settings.
64
+ */
65
  function add_attach_invoice_settings( $settings ) {
66
+ $settings[] = array( 'title' => __( 'Payment Gateways Attach PDF Invoice V1 Options', 'woocommerce-jetpack' ), 'type' => 'title', 'desc' => __( 'This section lets you choose when to attach PDF invoice to customers emails.', 'woocommerce-jetpack' ), 'id' => 'wcj_gateways_attach_invoice_options' );
67
  global $woocommerce;
68
  $available_gateways = $woocommerce->payment_gateways->payment_gateways();
69
  foreach ( $available_gateways as $key => $gateway ) {
81
 
82
 
83
  ) );
84
+ }
85
 
86
+ $settings[] = array( 'type' => 'sectionend', 'id' => 'wcj_gateways_attach_invoice_options' );
87
 
88
  return $settings;
89
  }
178
  return $this->get_shortcode( '%items_total_quantity%', $atts );
179
  }
180
 
181
+ /**
182
+ * do_attach_for_payment_method.
183
+ */
184
+ public function do_attach_for_payment_method( $payment_method ) {
185
  return ( 'no' === get_option( 'wcj_gateways_attach_invoice_' . $payment_method, 'yes' ) ) ? false : true;
186
  }
187
 
188
+ /**
189
+ * add_pdf_invoice_email_attachment.
190
+ */
191
+ public function add_pdf_invoice_email_attachment( $attachments, $status, $order ) {
192
  if ( isset( $status ) && 'customer_completed_order' === $status && isset( $order ) && true === $this->do_attach_for_payment_method( $order->payment_method ) ) {
193
  $file_name = sys_get_temp_dir() . '/invoice-' . $order->id . '.pdf';
194
  $result = file_put_contents( $file_name, $this->generate_pdf( $order->id ) );
197
  return $attachments;
198
  }
199
 
200
+ /**
201
+ * Unlocks - PDF Invoices - add_pdf_invoices_link_to_my_account.
202
+ */
203
+ public function add_pdf_invoices_link_to_my_account( $actions, $the_order ) {
204
 
205
  if ( 'no' === get_option( 'wcj_pdf_invoices_save_as_enabled' ) )
206
  $actions['pdf_invoice'] = array(
214
  );
215
 
216
  return $actions;
217
+ }
218
 
219
+ /**
220
+ * add_pdf_invoice_icon_css.
221
+ */
222
  function add_pdf_invoice_icon_css() {
223
 
224
  echo '<style> a.button.tips.view.pdf_invoice:after { content: "\e028" !important; } </style>';
225
  echo '<style> a.button.tips.view.save_pdf_invoice:after { content: "\e028" !important; } </style>';
226
  }
227
 
228
+ /**
229
+ * generate_pdf.
230
+ */
231
+ public function generate_pdf( $get_by_order_id = 0 ) {
232
 
233
  if ( ! isset( $_GET['pdf_invoice'] ) && 0 == $get_by_order_id ) return;
234
 
402
  }
403
 
404
 
405
+ /**
406
+ * add_custom_checkout_fields_to_pdf.
407
+ */
408
  public function add_custom_checkout_fields_to_pdf( $order_id, $section ) {
409
 
410
  $result = '';
425
  return $result;
426
  }
427
 
428
+ /**
429
+ * get_columns.
430
+ */
431
+ public function get_columns() {
432
 
433
  // Count optional columns number for column width calculation
434
  $total_optional_columns = 0;
517
  );
518
  }
519
 
520
+ /**
521
+ * get_header.
522
+ */
523
+ public function get_header( $the_order ) {
524
  // Starting output
525
  // Css
526
  $html = '<style>' . apply_filters( 'wcj_get_option_filter', $this->default_css, get_option( 'wcj_pdf_invoices_general_css' ) ) . '</style>';
561
  return $html;
562
  }
563
 
564
+ /**
565
+ * get_items_table.
566
+ */
567
+ public function get_items_table( $the_order ) {
568
 
569
  $html = '';
570
 
714
  }
715
 
716
 
717
+ /**
718
+ * wcj_order_get_cart_discount_tax.
719
+ */
720
  function wcj_order_get_cart_discount_tax( $the_order ) {
721
 
722
  $the_cart_discount = $the_order->get_cart_discount();
763
  return false;
764
  }
765
 
766
+ /**
767
+ * get_footer.
768
+ */
769
+ public function get_footer( $the_order ) {
770
 
771
  // ORDER TOTALS //
772
 
846
  return $html;
847
  }
848
 
849
+ /**
850
+ * get_invoice_html.
851
+ */
852
+ public function get_invoice_html( $order_id ) {
853
 
854
  // PREPARING DATA //
855
  // General
881
  return $html;
882
  }
883
 
884
+ /**
885
+ * add_pdf_invoices_link_to_order_list.
886
+ */
887
+ public function add_pdf_invoices_link_to_order_list( $actions, $the_order ) {
888
  if ( 'no' === get_option( 'wcj_pdf_invoices_save_as_enabled' ) )
889
  $actions['pdf_invoice'] = array(
890
  'url' => basename( $_SERVER['REQUEST_URI'] ) . '&pdf_invoice=' . $the_order->id,
898
  'action' => "view save_pdf_invoice"
899
  );
900
 
901
+ return $actions;
902
+ }
903
 
904
+ /**
905
+ * add_enabled_option.
906
+ */
907
+ public function add_enabled_option( $settings ) {
908
 
909
+ $all_settings = $this->get_settings();
910
+ $settings[] = $all_settings[1];
911
 
912
+ return $settings;
913
+ }
914
 
915
+ /**
916
+ * get_settings.
917
+ */
918
+ function get_settings() {
919
 
920
+ $settings = array(
921
 
922
+ array( 'title' => __( 'PDF Invoices Options', 'woocommerce-jetpack' ), 'type' => 'title', 'desc' => __( '', 'woocommerce-jetpack' ), 'id' => 'wcj_pdf_invoices_options' ),
923
 
924
+ array(
925
+ 'title' => __( 'PDF Invoices', 'woocommerce-jetpack' ) . ' V1 - ' . __( 'depreciated', 'woocommerce-jetpack' ),
926
+ 'desc' => '<strong>' . __( 'Enable Module', 'woocommerce-jetpack' ) . '</strong>',
927
+ 'desc_tip' => __( 'Add PDF invoices for the WooCommerce store owners and for the customers.', 'woocommerce-jetpack' ),
928
+ 'id' => 'wcj_pdf_invoices_enabled',
929
+ 'default' => 'no',
930
+ 'type' => 'checkbox',
931
+ ),
932
 
933
  array( 'type' => 'sectionend', 'id' => 'wcj_pdf_invoices_options' ),
934
 
935
  array( 'title' => __( 'Invoice Header', 'woocommerce-jetpack' ), 'type' => 'title', 'desc' => __( 'This section lets you set texts for required invoice number and date, and optional logo, header text, invoice due and fulfillment dates.', 'woocommerce-jetpack' ), 'id' => 'wcj_pdf_invoices_header_options' ),
936
 
937
+ array(
938
+ 'title' => __( 'Your Logo URL', 'woocommerce-jetpack' ),
939
+ 'desc' => __( 'Enter a URL to an image you want to show in the invoice\'s header. Upload your image using the <a href="/wp-admin/media-new.php">media uploader</a>.', 'woocommerce-jetpack' ),
940
+ 'desc_tip' => __( 'Leave blank to disable', 'woocommerce-jetpack' ),
941
+ 'id' => 'wcj_pdf_invoices_seller_logo_url',
942
+ 'default' => '',
943
+ 'type' => 'text',
944
  'css' => 'width:33%;min-width:300px;',
945
+ ),
946
 
947
+ array(
948
+ 'title' => __( 'Header Text', 'woocommerce-jetpack' ),
949
+ 'desc_tip' => __( 'Leave blank to disable', 'woocommerce-jetpack' ),
950
  'desc' => __( 'Default: INVOICE', 'woocommerce-jetpack' ),
951
+ 'id' => 'wcj_pdf_invoices_header_text',
952
+ 'default' => __( 'INVOICE', 'woocommerce-jetpack' ),
953
+ 'type' => 'text',
954
  'css' => 'width:33%;min-width:300px;',
955
+ ),
956
+
957
+ array(
958
+ 'title' => __( 'Invoice Number', 'woocommerce-jetpack' ),
959
+ 'desc' => __( 'Default: Invoice number', 'woocommerce-jetpack' ),
960
+ 'id' => 'wcj_pdf_invoices_invoice_number_text',
961
+ 'default' => __( 'Invoice number', 'woocommerce-jetpack' ),
962
+ 'type' => 'text',
963
  'css' => 'width:33%;min-width:300px;',
964
+ ),
965
 
966
+ array(
967
+ 'title' => __( 'Order Date', 'woocommerce-jetpack' ),
968
+ 'desc' => __( 'Default: Order date', 'woocommerce-jetpack' ),
969
  'desc_tip' => __( 'Leave blank to disable', 'woocommerce-jetpack' ),
970
+ 'id' => 'wcj_pdf_invoices_order_date_text',
971
+ 'default' => __( 'Order date', 'woocommerce-jetpack' ),
972
+ 'type' => 'text',
973
  'css' => 'width:33%;min-width:300px;',
974
+ ),
975
 
976
+ array(
977
+ 'title' => __( 'Order Time', 'woocommerce-jetpack' ),
978
+ 'desc' => __( 'Default: Order time', 'woocommerce-jetpack' ),
979
  'desc_tip' => __( 'Leave blank to disable', 'woocommerce-jetpack' ),
980
+ 'id' => 'wcj_pdf_invoices_order_time_text',
981
+ 'default' => __( 'Order time', 'woocommerce-jetpack' ),
982
+ 'type' => 'text',
983
  'css' => 'width:33%;min-width:300px;',
984
+ ),
985
+
986
+ array(
987
+ 'title' => __( 'Invoice Date', 'woocommerce-jetpack' ),
988
+ 'desc' => __( 'Default: Invoice date', 'woocommerce-jetpack' ),
989
+ 'id' => 'wcj_pdf_invoices_invoice_date_text',
990
+ 'default' => __( 'Invoice date', 'woocommerce-jetpack' ),
991
+ 'type' => 'text',
992
  'css' => 'width:33%;min-width:300px;',
993
+ ),
994
 
995
  array(
996
+ 'title' => 'Invoice Due Date',
997
+ 'desc' => __( 'Default: Invoice due date', 'woocommerce-jetpack' ),
998
  'desc_tip' => __( 'Leave blank to disable', 'woocommerce-jetpack' ),
999
+ 'id' => 'wcj_pdf_invoices_invoice_due_date_text',
1000
+ 'default' => __( 'Invoice due date', 'woocommerce-jetpack' ),
1001
+ 'type' => 'text',
1002
  'css' => 'width:33%;min-width:300px;',
1003
+ ),
1004
 
1005
  array(
1006
+ 'title' => '',
1007
+ 'desc' => __( 'days', 'woocommerce-jetpack' ),
1008
  //'desc_tip' => __( 'Set to 0 to disable', 'woocommerce-jetpack' ),
1009
+ 'id' => 'wcj_pdf_invoices_invoice_due_date_days',
1010
+ 'default' => 0,
1011
+ 'type' => 'number',
1012
  'css' => 'width:33%;min-width:300px;',
1013
+ ),
1014
 
1015
  array(
1016
+ 'title' => 'Invoice Fulfillment Date',
1017
+ 'desc' => __( 'Default: Invoice fulfillment date', 'woocommerce-jetpack' ),
1018
  'desc_tip' => __( 'Leave blank to disable', 'woocommerce-jetpack' ),
1019
+ 'id' => 'wcj_pdf_invoices_invoice_fulfillment_date_text',
1020
+ 'default' => __( 'Invoice fulfillment date', 'woocommerce-jetpack' ),
1021
+ 'type' => 'text',
1022
  'css' => 'width:33%;min-width:300px;',
1023
+ ),
1024
 
1025
  array(
1026
+ 'title' => '',
1027
+ 'desc' => __( 'days', 'woocommerce-jetpack' ),
1028
  //'desc_tip' => __( 'Set to 0 to disable', 'woocommerce-jetpack' ),
1029
+ 'id' => 'wcj_pdf_invoices_invoice_fulfillment_date_days',
1030
+ 'default' => 0,
1031
+ 'type' => 'number',
1032
  'css' => 'width:33%;min-width:300px;',
1033
+ ),
1034
 
1035
  array(
1036
+ 'title' => __( 'Additional Header', 'woocommerce-jetpack' ),
1037
+ 'desc_tip' => __( 'Additional header - will be displayed above all data on invoice. You can use html and/or shortcodes here.', 'woocommerce-jetpack' ),
1038
+ 'id' => 'wcj_pdf_invoices_additional_header_text',
1039
+ 'default' => '',
1040
+ 'type' => 'textarea',
1041
  'css' => 'width:33%;min-width:300px;min-height:300px;',
1042
+ ),
1043
 
1044
  array( 'type' => 'sectionend', 'id' => 'wcj_pdf_invoices_header_options' ),
1045
 
1046
  array( 'title' => __( 'Seller and Buyer Info', 'woocommerce-jetpack' ), 'type' => 'title', 'desc' => __( '', 'woocommerce-jetpack' ), 'id' => 'wcj_pdf_invoices_seller_and_buyer_options' ),
1047
 
1048
+ array(
1049
+ 'title' => __( 'Seller', 'woocommerce-jetpack' ),
1050
+ //'desc_tip' => __( 'Seller text', 'woocommerce-jetpack' ),
1051
+ 'id' => 'wcj_pdf_invoices_seller_text',
1052
+ 'default' => __( 'Seller', 'woocommerce-jetpack' ),
1053
+ 'type' => 'text',
1054
  'css' => 'width:33%;min-width:300px;',
1055
+ ),
1056
 
1057
+ array(
1058
+ 'title' => __( 'Your business information', 'woocommerce-jetpack' ),
1059
+ //'desc_tip' => __( 'Seller information', 'woocommerce-jetpack' ),
1060
  'desc' => __( 'New lines are added automatically.', 'woocommerce-jetpack' ),
1061
+ 'id' => 'wcj_pdf_invoices_seller_info',
1062
+ 'default' => __( '<strong>Company Name</strong>', 'woocommerce-jetpack' ),
1063
  'type' => 'textarea',
1064
  'css' => 'width:33%;min-width:300px;min-height:300px;',
1065
+ ),
1066
+
1067
+ array(
1068
+ 'title' => __( 'Buyer', 'woocommerce-jetpack' ),
1069
+ //'desc_tip' => __( 'Buyer text', 'woocommerce-jetpack' ),
1070
+ 'id' => 'wcj_pdf_invoices_buyer_text',
1071
+ 'default' => __( 'Buyer', 'woocommerce-jetpack' ),
1072
+ 'type' => 'text',
1073
  'css' => 'width:33%;min-width:300px;',
1074
+ ),
1075
 
1076
  array( 'type' => 'sectionend', 'id' => 'wcj_pdf_invoices_seller_and_buyer_options' ),
1077
 
1078
  array( 'title' => __( 'Items', 'woocommerce-jetpack' ), 'type' => 'title', 'desc' => __( '', 'woocommerce-jetpack' ), 'id' => 'wcj_pdf_invoices_items_options' ),
1079
 
1080
+ array(
1081
+ 'title' => __( 'Items Table Heading Text', 'woocommerce-jetpack' ),
1082
+ //'desc_tip' => __( 'Items text', 'woocommerce-jetpack' ),
1083
+ 'id' => 'wcj_pdf_invoices_items_text',
1084
+ 'default' => __( 'Items', 'woocommerce-jetpack' ),
1085
+ 'type' => 'text',
1086
  'css' => 'width:33%;min-width:300px;',
1087
+ ),
1088
 
1089
+ array(
1090
+ 'title' => __( 'Shipping as Item', 'woocommerce-jetpack' ),
1091
  'desc_tip' => __( 'Leave blank to disable', 'woocommerce-jetpack' ),
1092
+ 'desc' => __( 'Display shipping as item', 'woocommerce-jetpack' ),
1093
  //'desc_tip' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
1094
+ 'id' => 'wcj_pdf_invoices_display_shipping_as_item_text',
1095
+ 'default' => '',
1096
+ 'type' => 'text',
1097
  //'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'disabled' ),
1098
+ ),
1099
 
1100
+ /*array(
1101
+ 'title' => '',
1102
+ 'desc' => __( 'Add shipping method info', 'woocommerce-jetpack' ),
1103
+ 'id' => 'wcj_pdf_invoices_display_shipping_as_item_method_enabled',
1104
+ 'default' => 'yes',
1105
+ 'type' => 'checkbox',
1106
+ ),*/
1107
 
1108
  array(
1109
  'title' => '',
1122
  ),
1123
 
1124
  array(
1125
+ 'title' => __( 'Discount as Item', 'woocommerce-jetpack' ),
1126
  'desc_tip' => __( 'Leave blank to disable', 'woocommerce-jetpack' ),
1127
+ 'desc' => __( 'Display discount as item', 'woocommerce-jetpack' ),
1128
  //'desc_tip' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
1129
+ 'id' => 'wcj_pdf_invoices_display_discount_as_item_text',
1130
+ 'default' => '',
1131
+ 'type' => 'text',
1132
  //'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'disabled' ),
1133
+ ),
1134
 
1135
  array( 'type' => 'sectionend', 'id' => 'wcj_pdf_invoices_items_options' ),
1136
 
1137
  array( 'title' => __( 'Items Columns', 'woocommerce-jetpack' ), 'type' => 'title', 'desc' => __( 'This section lets you set column names in invoice items table. You can disable some columns by leaving blank column name.', 'woocommerce-jetpack' ), 'id' => 'wcj_pdf_invoices_items_columns_options' ),
1138
 
1139
+ array(
1140
+ 'title' => __( 'Nr.', 'woocommerce-jetpack' ),
1141
+ //'desc_tip' => __( 'Nr. text', 'woocommerce-jetpack' ),
1142
+ 'id' => 'wcj_pdf_invoices_column_nr_text',
1143
+ 'default' => __( 'Nr.', 'woocommerce-jetpack' ),
1144
+ 'type' => 'text',
1145
  'css' => 'width:33%;min-width:300px;',
1146
+ ),
1147
+
1148
+ array(
1149
+ 'title' => __( 'Item Name', 'woocommerce-jetpack' ),
1150
+ //'desc_tip' => __( 'Item name text', 'woocommerce-jetpack' ),
1151
+ 'id' => 'wcj_pdf_invoices_column_item_name_text',
1152
+ 'default' => __( 'Item Name', 'woocommerce-jetpack' ),
1153
+ 'type' => 'text',
1154
  'css' => 'width:33%;min-width:300px;',
1155
+ ),
1156
 
1157
+ array(
1158
+ 'title' => __( 'Item Name Additional Info', 'woocommerce-jetpack' ),
1159
  'desc_tip' => __( 'Here you can add more info to item\'s name column (e.g. sku). Default is (SKU: %sku%)', 'woocommerce-jetpack' ),
1160
+ 'id' => 'wcj_pdf_invoices_column_item_name_additional_text',
1161
+ 'default' => __( '(SKU: %sku%)', 'woocommerce-jetpack' ),
1162
+ 'type' => 'textarea',
1163
  'css' => 'width:33%;min-width:300px;',
1164
+ ),
1165
+
1166
+ array(
1167
+ 'title' => __( 'Qty', 'woocommerce-jetpack' ),
1168
+ //'desc_tip' => __( 'Qty text', 'woocommerce-jetpack' ),
1169
+ 'id' => 'wcj_pdf_invoices_column_qty_text',
1170
+ 'default' => __( 'Qty', 'woocommerce-jetpack' ),
1171
+ 'type' => 'text',
1172
  'css' => 'width:33%;min-width:300px;',
1173
+ ),
1174
 
1175
  array(
1176
+ 'title' => __( 'Single Item Price (TAX excl.)', 'woocommerce-jetpack' ),
1177
+ 'desc_tip' => __( 'Leave blank to disable', 'woocommerce-jetpack' ),
1178
+ 'id' => 'wcj_pdf_invoices_column_single_price_tax_excl_text',
1179
+ 'default' => __( 'Price (TAX excl.)', 'woocommerce-jetpack' ),
1180
+ 'type' => 'text',
1181
  'css' => 'width:33%;min-width:300px;',
1182
+ ),
1183
 
1184
  array(
1185
+ 'title' => __( 'Single Item TAX', 'woocommerce-jetpack' ),
1186
+ 'desc_tip' => __( 'Leave blank to disable', 'woocommerce-jetpack' ),
1187
+ 'id' => 'wcj_pdf_invoices_column_single_price_tax_text',
1188
+ 'default' => __( 'TAX', 'woocommerce-jetpack' ),
1189
+ 'type' => 'text',
1190
  'css' => 'width:33%;min-width:300px;',
1191
+ ),
1192
 
1193
  array(
1194
+ 'title' => __( 'Single Item Price (TAX incl.)', 'woocommerce-jetpack' ),
1195
+ 'desc_tip' => __( 'Leave blank to disable', 'woocommerce-jetpack' ),
1196
+ 'id' => 'wcj_pdf_invoices_column_single_price_tax_incl_text',
1197
+ 'default' => __( 'Price (TAX incl.)', 'woocommerce-jetpack' ),
1198
+ 'type' => 'text',
1199
  'css' => 'width:33%;min-width:300px;',
1200
+ ),
1201
 
1202
  array(
1203
+ 'title' => __( 'Sum (TAX excl.)', 'woocommerce-jetpack' ),
1204
+ 'desc_tip' => __( 'Leave blank to disable', 'woocommerce-jetpack' ),
1205
+ 'id' => 'wcj_pdf_invoices_column_price_tax_excl_text',
1206
+ 'default' => __( 'Sum (TAX excl.)', 'woocommerce-jetpack' ),
1207
+ 'type' => 'text',
1208
  'css' => 'width:33%;min-width:300px;',
1209
+ ),
1210
 
1211
  array(
1212
+ 'title' => __( 'Tax Percent', 'woocommerce-jetpack' ),
1213
+ 'desc_tip' => __( 'Leave blank to disable', 'woocommerce-jetpack' ),
1214
+ 'id' => 'wcj_pdf_invoices_column_price_tax_percent',
1215
+ 'default' => __( 'Taxes %', 'woocommerce-jetpack' ),
1216
+ 'type' => 'text',
1217
  'css' => 'width:33%;min-width:300px;',
1218
+ ),
1219
 
1220
  array(
1221
+ 'title' => __( 'Taxes', 'woocommerce-jetpack' ),
1222
+ 'desc_tip' => __( 'Leave blank to disable', 'woocommerce-jetpack' ),
1223
+ 'id' => 'wcj_pdf_invoices_column_price_tax_text',
1224
+ 'default' => __( 'Taxes', 'woocommerce-jetpack' ),
1225
+ 'type' => 'text',
1226
  'css' => 'width:33%;min-width:300px;',
1227
+ ),
1228
 
1229
  array(
1230
+ 'title' => __( 'Sum (TAX incl.)', 'woocommerce-jetpack' ),
1231
+ //'desc_tip' => __( 'Price text', 'woocommerce-jetpack' ),
1232
+ 'id' => 'wcj_pdf_invoices_column_price_text',
1233
+ 'default' => __( 'Sum (TAX incl.)', 'woocommerce-jetpack' ),
1234
+ 'type' => 'text',
1235
  'css' => 'width:33%;min-width:300px;',
1236
+ ),
1237
 
1238
  array( 'type' => 'sectionend', 'id' => 'wcj_pdf_invoices_items_columns_options' ),
1239
 
1298
  array( 'title' => __( 'Footer', 'woocommerce-jetpack' ), 'type' => 'title', 'desc' => __( '', 'woocommerce-jetpack' ), 'id' => 'wcj_pdf_invoices_footer_options' ),
1299
 
1300
  array(
1301
+ 'title' => __( 'Payment Method', 'woocommerce-jetpack' ),
1302
+ 'desc_tip' => __( 'Leave blank to disable', 'woocommerce-jetpack' ),
1303
+ 'id' => 'wcj_pdf_invoices_order_payment_method_text',
1304
+ 'default' => __( 'Payment Method', 'woocommerce-jetpack' ),
1305
+ 'type' => 'text',
1306
  'css' => 'width:33%;min-width:300px;',
1307
+ ),
1308
 
1309
  array(
1310
+ 'title' => __( 'Shipping Method', 'woocommerce-jetpack' ),
1311
+ 'desc_tip' => __( 'Leave blank to disable', 'woocommerce-jetpack' ),
1312
+ 'id' => 'wcj_pdf_invoices_order_shipping_method_text',
1313
+ 'default' => __( 'Shipping Method', 'woocommerce-jetpack' ),
1314
+ 'type' => 'text',
1315
  'css' => 'width:33%;min-width:300px;',
1316
+ ),
1317
 
1318
  array(
1319
+ 'title' => __( 'Shipping Address', 'woocommerce-jetpack' ),
1320
+ 'desc_tip' => __( 'Will be displayed only if customer\'s shipping address differs from billing address. Leave blank to disable', 'woocommerce-jetpack' ),
1321
+ 'id' => 'wcj_pdf_invoices_order_shipping_address_text',
1322
+ 'default' => __( 'Shipping Address', 'woocommerce-jetpack' ),
1323
+ 'type' => 'text',
1324
  'css' => 'width:33%;min-width:300px;',
1325
+ ),
1326
 
1327
  array(
1328
+ 'title' => __( 'Additional Footer', 'woocommerce-jetpack' ),
1329
+ 'desc_tip' => __( 'Additional footer - will be displayed below all other data on invoice. You can use html and/or shortcodes here.', 'woocommerce-jetpack' ),
1330
+ 'id' => 'wcj_pdf_invoices_footer_text',
1331
+ 'default' => '',
1332
+ 'type' => 'textarea',
1333
  'css' => 'width:33%;min-width:300px;min-height:300px;',
1334
+ ),
1335
 
1336
  array( 'type' => 'sectionend', 'id' => 'wcj_pdf_invoices_footer_options' ),
1337
 
1338
+ array( 'title' => __( 'General Options', 'woocommerce-jetpack' ), 'type' => 'title', 'desc' => __( '', 'woocommerce-jetpack' ), 'id' => 'wcj_pdf_invoices_general_options' ),
1339
 
1340
+ array(
1341
+ 'title' => __( 'Font Family', 'woocommerce-jetpack' ),
1342
+ //'desc' => __( 'Default: dejavusans', 'woocommerce-jetpack' ),
1343
  'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
1344
+ 'id' => 'wcj_pdf_invoices_general_font_family',
1345
+ 'default' => 'dejavusans',
1346
+ 'type' => 'select',
1347
  'options' => array(
1348
  'dejavusans' => 'DejaVu Sans',
1349
  'courier' => 'Courier',
1351
  'times' => 'Times',
1352
  ),
1353
  'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'disabled' ),
1354
+ ),
1355
+
1356
+ array(
1357
+ 'title' => __( 'Font Size', 'woocommerce-jetpack' ),
1358
+ 'desc' => __( 'Default: 8', 'woocommerce-jetpack' ),
1359
+ 'id' => 'wcj_pdf_invoices_general_font_size',
1360
+ 'default' => 8,
1361
+ 'type' => 'number',
1362
+ ),
1363
+
1364
+ array(
1365
+ 'title' => __( 'Make Font Shadowed', 'woocommerce-jetpack' ),
1366
+ 'desc' => __( 'Default: Yes', 'woocommerce-jetpack' ),
1367
+ 'id' => 'wcj_pdf_invoices_general_font_shadowed',
1368
+ 'default' => 'yes',
1369
+ 'type' => 'checkbox',
1370
+ ),
1371
+
1372
+ array(
1373
+ 'title' => __( 'CSS', 'woocommerce-jetpack' ),
1374
+ 'desc' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
1375
+ 'id' => 'wcj_pdf_invoices_general_css',
1376
+ 'default' => $this->default_css,
1377
+ 'type' => 'textarea',
1378
  'css' => 'width:66%;min-width:300px;min-height:300px;',
1379
  'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'readonly' ),
1380
+ ),
1381
 
1382
  //array( 'type' => 'sectionend', 'id' => 'wcj_pdf_invoices_general_options' ),
1383
 
1384
  //array( 'title' => __( 'More Options', 'woocommerce-jetpack' ), 'type' => 'title', 'desc' => __( '', 'woocommerce-jetpack' ), 'id' => 'wcj_pdf_invoices_more_options' ),
1385
 
1386
+ array(
1387
+ 'title' => __( 'PDF Invoices for Customers (in My Account)', 'woocommerce-jetpack' ),
1388
+ 'desc' => __( 'Enable the PDF Invoices in customers account', 'woocommerce-jetpack' ),
1389
  'desc_tip' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
1390
+ 'id' => 'wcj_pdf_invoices_enabled_for_customers',
1391
+ 'default' => 'no',
1392
+ 'type' => 'checkbox',
1393
  'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'disabled' ),
1394
+ ),
1395
 
1396
+ array(
1397
+ 'title' => __( 'PDF Invoices for Customers (Email attachment)', 'woocommerce-jetpack' ),
1398
+ 'desc' => __( 'Enable the PDF Invoices attachment files in customers email on order completed', 'woocommerce-jetpack' ),
1399
  'desc_tip' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
1400
+ 'id' => 'wcj_pdf_invoices_attach_to_email_enabled',
1401
+ 'default' => 'no',
1402
+ 'type' => 'checkbox',
1403
  'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'disabled' ),
1404
+ ),
1405
 
1406
+ /* array(
1407
+ 'title' => __( '', 'woocommerce-jetpack' ),
1408
+ 'desc' => __( 'Attach PDF invoice only on customer\'s request', 'woocommerce-jetpack' ),
1409
  'desc_tip' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
1410
+ 'id' => 'wcj_pdf_invoices_attach_to_email_on_request_only',
1411
+ 'default' => 'no',
1412
+ 'type' => 'checkbox',
1413
  'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'disabled' ),
1414
+ ), */
1415
 
1416
+ array(
1417
+ 'title' => __( 'Enable Save as', 'woocommerce-jetpack' ),
1418
+ 'desc' => __( 'Enable save as pdf instead of view pdf', 'woocommerce-jetpack' ),
1419
  //'desc_tip' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
1420
+ 'id' => 'wcj_pdf_invoices_save_as_enabled',
1421
+ 'default' => 'yes',
1422
+ 'type' => 'checkbox',
1423
  //'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'disabled' ),
1424
+ ),
1425
 
1426
+ //array( 'type' => 'sectionend', 'id' => 'wcj_pdf_invoices_more_options' ),
1427
  array( 'type' => 'sectionend', 'id' => 'wcj_pdf_invoices_general_options' ),
1428
+ );
1429
+
1430
+ return $settings;
1431
+ }
1432
+
1433
+ /**
1434
+ * settings_section.
1435
+ */
1436
+ function settings_section( $sections ) {
1437
+ $sections['pdf_invoices'] = __( 'PDF Invoices', 'woocommerce-jetpack' );
1438
+ return $sections;
1439
+ }
1440
  }
1441
 
1442
  endif;
includes/class-wcj-pdf-invoicing.php CHANGED
@@ -166,7 +166,7 @@ class WCJ_PDF_Invoicing extends WCJ_Module {
166
  *
167
  * @version 2.3.0
168
  */
169
- function catch_args() {
170
  $this->order_id = ( isset( $_GET['order_id'] ) ) ? $_GET['order_id'] : 0;
171
  $this->invoice_type_id = ( isset( $_GET['invoice_type_id'] ) ) ? $_GET['invoice_type_id'] : '';
172
  $this->save_as_pdf = ( isset( $_GET['save_pdf_invoice'] ) && '1' == $_GET['save_pdf_invoice'] ) ? true : false;
166
  *
167
  * @version 2.3.0
168
  */
169
+ function catch_args() {
170
  $this->order_id = ( isset( $_GET['order_id'] ) ) ? $_GET['order_id'] : 0;
171
  $this->invoice_type_id = ( isset( $_GET['invoice_type_id'] ) ) ? $_GET['invoice_type_id'] : '';
172
  $this->save_as_pdf = ( isset( $_GET['save_pdf_invoice'] ) && '1' == $_GET['save_pdf_invoice'] ) ? true : false;
includes/class-wcj-product-add-to-cart.php CHANGED
@@ -15,10 +15,10 @@ if ( ! class_exists( 'WCJ_Product_Add_To_Cart' ) ) :
15
 
16
  class WCJ_Product_Add_To_Cart extends WCJ_Module {
17
 
18
- /**
19
- * Constructor.
20
- */
21
- public function __construct() {
22
 
23
  $this->id = 'product_add_to_cart';
24
  $this->short_desc = __( 'Product Add to Cart', 'woocommerce-jetpack' );
@@ -34,15 +34,15 @@ class WCJ_Product_Add_To_Cart extends WCJ_Module {
34
  if ( 'yes' === get_option( 'wcj_add_to_cart_on_visit_enabled' ) ) {
35
  add_action( 'woocommerce_before_single_product', array( $this, 'add_to_cart_on_visit' ), 100 );
36
  }
37
- }
38
- }
39
 
40
- /**
41
- * get_settings.
42
- */
43
- function get_settings() {
44
 
45
- $settings = array(
46
 
47
  array(
48
  'title' => __( 'Add to Cart Local Redirect Options', 'woocommerce-jetpack' ),
@@ -71,7 +71,7 @@ class WCJ_Product_Add_To_Cart extends WCJ_Module {
71
 
72
  array( 'type' => 'sectionend', 'id' => 'wcj_add_to_cart_redirect_options' ),
73
 
74
- array( 'title' => __( 'Add to Cart on Visit', 'woocommerce-jetpack' ), 'type' => 'title', 'desc' => __( 'This section lets you enable automatically adding product to cart on visiting the product page. Product is only added once, so if it is already in cart - duplicate product is not added. ', 'woocommerce-jetpack' ), 'id' => 'wcj_add_to_cart_on_visit_options' ),
75
 
76
  array(
77
  'title' => __( 'Add to Cart on Visit', 'woocommerce-jetpack' ),
@@ -81,11 +81,11 @@ class WCJ_Product_Add_To_Cart extends WCJ_Module {
81
  'type' => 'checkbox',
82
  ),
83
 
84
- array( 'type' => 'sectionend', 'id' => 'wcj_add_to_cart_on_visit_options' ),
85
- );
86
 
87
- return $this->add_enable_module_setting( $settings );
88
- }
89
 
90
  /*
91
  * redirect_to_url.
15
 
16
  class WCJ_Product_Add_To_Cart extends WCJ_Module {
17
 
18
+ /**
19
+ * Constructor.
20
+ */
21
+ public function __construct() {
22
 
23
  $this->id = 'product_add_to_cart';
24
  $this->short_desc = __( 'Product Add to Cart', 'woocommerce-jetpack' );
34
  if ( 'yes' === get_option( 'wcj_add_to_cart_on_visit_enabled' ) ) {
35
  add_action( 'woocommerce_before_single_product', array( $this, 'add_to_cart_on_visit' ), 100 );
36
  }
37
+ }
38
+ }
39
 
40
+ /**
41
+ * get_settings.
42
+ */
43
+ function get_settings() {
44
 
45
+ $settings = array(
46
 
47
  array(
48
  'title' => __( 'Add to Cart Local Redirect Options', 'woocommerce-jetpack' ),
71
 
72
  array( 'type' => 'sectionend', 'id' => 'wcj_add_to_cart_redirect_options' ),
73
 
74
+ array( 'title' => __( 'Add to Cart on Visit', 'woocommerce-jetpack' ), 'type' => 'title', 'desc' => __( 'This section lets you enable automatically adding product to cart on visiting the product page. Product is only added once, so if it is already in cart - duplicate product is not added. ', 'woocommerce-jetpack' ), 'id' => 'wcj_add_to_cart_on_visit_options' ),
75
 
76
  array(
77
  'title' => __( 'Add to Cart on Visit', 'woocommerce-jetpack' ),
81
  'type' => 'checkbox',
82
  ),
83
 
84
+ array( 'type' => 'sectionend', 'id' => 'wcj_add_to_cart_on_visit_options' ),
85
+ );
86
 
87
+ return $this->add_enable_module_setting( $settings );
88
+ }
89
 
90
  /*
91
  * redirect_to_url.
includes/class-wcj-product-listings.php CHANGED
@@ -16,11 +16,11 @@ if ( ! class_exists( 'WCJ_Product_Listings' ) ) :
16
 
17
  class WCJ_Product_Listings {
18
 
19
- /**
20
- * Constructor.
21
- */
22
- public function __construct() {
23
- // Main hooks
24
  if ( 'yes' === get_option( 'wcj_product_listings_enabled' ) ) {
25
  // Exclude and Hide Empty
26
  add_filter( 'woocommerce_product_subcategories_args', array( $this, 'filter_subcategories' ), 100 );
@@ -31,67 +31,67 @@ class WCJ_Product_Listings {
31
  // Settings to "WooCommerce > Settings > Products > Product Listings"
32
  add_filter( 'woocommerce_product_settings', array( $this, 'add_fields_to_woocommerce_settings' ), 100 );
33
  }
34
- // Settings hooks
35
- add_filter( 'wcj_settings_sections', array( $this, 'settings_section' ) );
36
- add_filter( 'wcj_settings_product_listings', array( $this, 'get_settings' ), 100 );
37
- add_filter( 'wcj_features_status', array( $this, 'add_enabled_option' ), 100 );
38
- }
39
-
40
- /**
41
- * add_enabled_option.
42
- */
43
- public function add_enabled_option( $settings ) {
44
- $all_settings = $this->get_settings();
45
- $settings[] = $all_settings[1];
46
- return $settings;
47
- }
48
-
49
- /**
50
- * get_settings.
51
- */
52
- function get_settings() {
53
-
54
- $settings = array(
55
-
56
- array( 'title' => __( 'Product Listings Options', 'woocommerce-jetpack' ), 'type' => 'title', 'desc' => __( '', 'woocommerce-jetpack' ), 'id' => 'wcj_product_listings_options' ),
57
-
58
- array(
59
- 'title' => __( 'Product Listings', 'woocommerce-jetpack' ),
60
- 'desc' => '<strong>' . __( 'Enable Module', 'woocommerce-jetpack' ) . '</strong>',
61
- 'desc_tip' => __( 'Change WooCommerce display options for shop and category pages: show/hide categories count, exclude categories, show/hide empty categories.', 'woocommerce-jetpack' ),
62
- 'id' => 'wcj_product_listings_enabled',
63
- 'default' => 'no',
64
- 'type' => 'checkbox',
65
- ),
66
-
67
- array( 'type' => 'sectionend', 'id' => 'wcj_product_listings_options' ),
68
 
69
  array( 'title' => __( 'Shop Page Display Options', 'woocommerce-jetpack' ), 'type' => 'title', 'desc' => __( 'This will work only when "Shop Page Display" in "WooCommerce > Settings > Products > Product Listings" is set to "Show subcategories" or "Show both".', 'woocommerce-jetpack' ), 'id' => 'wcj_product_listings_shop_page_options' ),
70
 
71
  array(
72
- 'title' => __( 'Categories Count', 'woocommerce-jetpack' ),
73
  'desc' => __( 'Hide categories count on shop page', 'woocommerce-jetpack' ),
74
- 'id' => 'wcj_product_listings_hide_cats_count_on_shop',
75
- 'default' => 'no',
76
- 'type' => 'checkbox',
77
- ),
78
 
79
- array(
80
  'title' => __( 'Exclude Categories', 'woocommerce-jetpack' ),
81
  'desc_tip' => __(' Excludes one or more categories from the shop page. This parameter takes a comma-separated list of categories by unique ID, in ascending order. Leave blank to disable.', 'woocommerce-jetpack' ),
82
- 'id' => 'wcj_product_listings_exclude_cats_on_shop',
83
- 'default' => '',
84
- 'type' => 'text',
85
  'css' => 'width:50%;min-width:300px;',
86
- ),
87
 
88
- array(
89
- 'title' => __( 'Hide Empty', 'woocommerce-jetpack' ),
90
  'desc' => __( 'Hide empty categories on shop page', 'woocommerce-jetpack' ),
91
- 'id' => 'wcj_product_listings_hide_empty_cats_on_shop',
92
- 'default' => 'yes',
93
- 'type' => 'checkbox',
94
- ),
95
 
96
  array(
97
  'title' => __( 'Show Products', 'woocommerce-jetpack' ),
@@ -106,31 +106,31 @@ class WCJ_Product_Listings {
106
  array( 'title' => __( 'Category Display Options', 'woocommerce-jetpack' ), 'type' => 'title', 'desc' => __( 'This will work only when "Default Category Display" in "WooCommerce > Settings > Products > Product Listings" is set to "Show subcategories" or "Show both".', 'woocommerce-jetpack' ), 'id' => 'wcj_product_listings_archive_pages_options' ),
107
 
108
  array(
109
- 'title' => __( 'Subcategories Count', 'woocommerce-jetpack' ),
110
  'desc' => __( 'Hide subcategories count on category pages', 'woocommerce-jetpack' ),
111
- 'id' => 'wcj_product_listings_hide_cats_count_on_archive',
112
- 'default' => 'no',
113
- 'type' => 'checkbox',
114
  'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'disabled' ),
115
  'desc_tip' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
116
- ),
117
 
118
- array(
119
- 'title' => __( 'Exclude Subcategories', 'woocommerce-jetpack' ),
120
  'desc_tip' => __(' Excludes one or more categories from the category (archive) pages. This parameter takes a comma-separated list of categories by unique ID, in ascending order. Leave blank to disable.', 'woocommerce-jetpack' ),
121
- 'id' => 'wcj_product_listings_exclude_cats_on_archives',
122
- 'default' => '',
123
- 'type' => 'text',
124
  'css' => 'width:50%;min-width:300px;',
125
- ),
126
 
127
- array(
128
- 'title' => __( 'Hide Empty', 'woocommerce-jetpack' ),
129
  'desc' => __( 'Hide empty subcategories on category pages', 'woocommerce-jetpack' ),
130
- 'id' => 'wcj_product_listings_hide_empty_cats_on_archives',
131
- 'default' => 'yes',
132
- 'type' => 'checkbox',
133
- ),
134
 
135
  array(
136
  'title' => __( 'Show Products', 'woocommerce-jetpack' ),
@@ -141,22 +141,22 @@ class WCJ_Product_Listings {
141
  ),
142
 
143
  array( 'type' => 'sectionend', 'id' => 'wcj_product_listings_archive_pages_options' ),
144
- );
145
-
146
- return $settings;
147
- }
148
-
149
- /**
150
- * settings_section.
151
- */
152
- function settings_section( $sections ) {
153
- $sections['product_listings'] = __( 'Product Listings', 'woocommerce-jetpack' );
154
- return $sections;
155
- }
156
-
157
- /**
158
- * add_fields_to_woocommerce_settings.
159
- */
160
  function add_fields_to_woocommerce_settings( $settings ) {
161
 
162
  $updated_settings = array();
@@ -243,20 +243,20 @@ class WCJ_Product_Listings {
243
  return $updated_settings;
244
  }
245
 
246
- /**
247
- * remove_subcategory_count.
248
- */
249
- public function remove_subcategory_count( $count_html ) {
250
  if ( ( is_shop() && 'yes' === get_option( 'wcj_product_listings_hide_cats_count_on_shop' ) ) ||
251
  ( ! is_shop() && 'yes' === apply_filters( 'wcj_get_option_filter', 'wcj', get_option( 'wcj_product_listings_hide_cats_count_on_archive' ) ) ) )
252
  return '';
253
  return $count_html;
254
- }
255
 
256
- /**
257
- * filter_subcategories.
258
- */
259
- public function filter_subcategories( $args ) {
260
  if ( is_shop() ) {
261
  $args['exclude'] = get_option( 'wcj_product_listings_exclude_cats_on_shop' );
262
  $args['hide_empty'] = ( 'yes' === get_option( 'wcj_product_listings_hide_empty_cats_on_shop' ) ) ? 1 : 0; // depreciated?
@@ -266,12 +266,12 @@ class WCJ_Product_Listings {
266
  $args['hide_empty'] = ( 'yes' === get_option( 'wcj_product_listings_hide_empty_cats_on_archives' ) ) ? 1 : 0; // depreciated?
267
  }
268
  return $args;
269
- }
270
 
271
- /**
272
- * hide_products_by_disabling_loop.
273
- */
274
- public function hide_products_by_disabling_loop() {
275
  // If we are hiding products disable the loop and pagination
276
  global $wp_query;
277
  if ( is_product_category() &&
@@ -288,10 +288,10 @@ class WCJ_Product_Listings {
288
  }
289
  }
290
 
291
- /**
292
- * filter_subcategories_show_empty.
293
- */
294
- public function filter_subcategories_show_empty() {
295
 
296
  // Not the best solution, but it's the only place I found to put it...
297
  $this->hide_products_by_disabling_loop();
@@ -303,7 +303,7 @@ class WCJ_Product_Listings {
303
  $show_empty = ( 'yes' === get_option( 'wcj_product_listings_hide_empty_cats_on_archives' ) ) ? false : true;
304
 
305
  return $show_empty;
306
- }
307
  }
308
 
309
  endif;
16
 
17
  class WCJ_Product_Listings {
18
 
19
+ /**
20
+ * Constructor.
21
+ */
22
+ public function __construct() {
23
+ // Main hooks
24
  if ( 'yes' === get_option( 'wcj_product_listings_enabled' ) ) {
25
  // Exclude and Hide Empty
26
  add_filter( 'woocommerce_product_subcategories_args', array( $this, 'filter_subcategories' ), 100 );
31
  // Settings to "WooCommerce > Settings > Products > Product Listings"
32
  add_filter( 'woocommerce_product_settings', array( $this, 'add_fields_to_woocommerce_settings' ), 100 );
33
  }
34
+ // Settings hooks
35
+ add_filter( 'wcj_settings_sections', array( $this, 'settings_section' ) );
36
+ add_filter( 'wcj_settings_product_listings', array( $this, 'get_settings' ), 100 );
37
+ add_filter( 'wcj_features_status', array( $this, 'add_enabled_option' ), 100 );
38
+ }
39
+
40
+ /**
41
+ * add_enabled_option.
42
+ */
43
+ public function add_enabled_option( $settings ) {
44
+ $all_settings = $this->get_settings();
45
+ $settings[] = $all_settings[1];
46
+ return $settings;
47
+ }
48
+
49
+ /**
50
+ * get_settings.
51
+ */
52
+ function get_settings() {
53
+
54
+ $settings = array(
55
+
56
+ array( 'title' => __( 'Product Listings Options', 'woocommerce-jetpack' ), 'type' => 'title', 'desc' => __( '', 'woocommerce-jetpack' ), 'id' => 'wcj_product_listings_options' ),
57
+
58
+ array(
59
+ 'title' => __( 'Product Listings', 'woocommerce-jetpack' ),
60
+ 'desc' => '<strong>' . __( 'Enable Module', 'woocommerce-jetpack' ) . '</strong>',
61
+ 'desc_tip' => __( 'Change WooCommerce display options for shop and category pages: show/hide categories count, exclude categories, show/hide empty categories.', 'woocommerce-jetpack' ),
62
+ 'id' => 'wcj_product_listings_enabled',
63
+ 'default' => 'no',
64
+ 'type' => 'checkbox',
65
+ ),
66
+
67
+ array( 'type' => 'sectionend', 'id' => 'wcj_product_listings_options' ),
68
 
69
  array( 'title' => __( 'Shop Page Display Options', 'woocommerce-jetpack' ), 'type' => 'title', 'desc' => __( 'This will work only when "Shop Page Display" in "WooCommerce > Settings > Products > Product Listings" is set to "Show subcategories" or "Show both".', 'woocommerce-jetpack' ), 'id' => 'wcj_product_listings_shop_page_options' ),
70
 
71
  array(
72
+ 'title' => __( 'Categories Count', 'woocommerce-jetpack' ),
73
  'desc' => __( 'Hide categories count on shop page', 'woocommerce-jetpack' ),
74
+ 'id' => 'wcj_product_listings_hide_cats_count_on_shop',
75
+ 'default' => 'no',
76
+ 'type' => 'checkbox',
77
+ ),
78
 
79
+ array(
80
  'title' => __( 'Exclude Categories', 'woocommerce-jetpack' ),
81
  'desc_tip' => __(' Excludes one or more categories from the shop page. This parameter takes a comma-separated list of categories by unique ID, in ascending order. Leave blank to disable.', 'woocommerce-jetpack' ),
82
+ 'id' => 'wcj_product_listings_exclude_cats_on_shop',
83
+ 'default' => '',
84
+ 'type' => 'text',
85
  'css' => 'width:50%;min-width:300px;',
86
+ ),
87
 
88
+ array(
89
+ 'title' => __( 'Hide Empty', 'woocommerce-jetpack' ),
90
  'desc' => __( 'Hide empty categories on shop page', 'woocommerce-jetpack' ),
91
+ 'id' => 'wcj_product_listings_hide_empty_cats_on_shop',
92
+ 'default' => 'yes',
93
+ 'type' => 'checkbox',
94
+ ),
95
 
96
  array(
97
  'title' => __( 'Show Products', 'woocommerce-jetpack' ),
106
  array( 'title' => __( 'Category Display Options', 'woocommerce-jetpack' ), 'type' => 'title', 'desc' => __( 'This will work only when "Default Category Display" in "WooCommerce > Settings > Products > Product Listings" is set to "Show subcategories" or "Show both".', 'woocommerce-jetpack' ), 'id' => 'wcj_product_listings_archive_pages_options' ),
107
 
108
  array(
109
+ 'title' => __( 'Subcategories Count', 'woocommerce-jetpack' ),
110
  'desc' => __( 'Hide subcategories count on category pages', 'woocommerce-jetpack' ),
111
+ 'id' => 'wcj_product_listings_hide_cats_count_on_archive',
112
+ 'default' => 'no',
113
+ 'type' => 'checkbox',
114
  'custom_attributes' => apply_filters( 'get_wc_jetpack_plus_message', '', 'disabled' ),
115
  'desc_tip' => apply_filters( 'get_wc_jetpack_plus_message', '', 'desc' ),
116
+ ),
117
 
118
+ array(
119
+ 'title' => __( 'Exclude Subcategories', 'woocommerce-jetpack' ),
120
  'desc_tip' => __(' Excludes one or more categories from the category (archive) pages. This parameter takes a comma-separated list of categories by unique ID, in ascending order. Leave blank to disable.', 'woocommerce-jetpack' ),
121
+ 'id' => 'wcj_product_listings_exclude_cats_on_archives',
122
+ 'default' => '',
123
+ 'type' => 'text',
124
  'css' => 'width:50%;min-width:300px;',
125
+ ),
126
 
127
+ array(
128
+ 'title' => __( 'Hide Empty', 'woocommerce-jetpack' ),
129
  'desc' => __( 'Hide empty subcategories on category pages', 'woocommerce-jetpack' ),
130
+ 'id' => 'wcj_product_listings_hide_empty_cats_on_archives',
131
+ 'default' => 'yes',
132
+ 'type' => 'checkbox',
133
+ ),
134
 
135
  array(
136
  'title' => __( 'Show Products', 'woocommerce-jetpack' ),
141
  ),
142
 
143
  array( 'type' => 'sectionend', 'id' => 'wcj_product_listings_archive_pages_options' ),
144
+ );
145
+
146
+ return $settings;
147
+ }
148
+
149
+ /**
150
+ * settings_section.
151
+ */
152
+ function settings_section( $sections ) {
153
+ $sections['product_listings'] = __( 'Product Listings', 'woocommerce-jetpack' );
154
+ return $sections;
155
+ }
156
+
157
+ /**
158
+ * add_fields_to_woocommerce_settings.
159
+ */
160
  function add_fields_to_woocommerce_settings( $settings ) {
161
 
162
  $updated_settings = array();
243
  return $updated_settings;
244
  }
245
 
246
+ /**
247
+ * remove_subcategory_count.
248
+ */
249
+ public function remove_subcategory_count( $count_html ) {
250
  if ( ( is_shop() && 'yes' === get_option( 'wcj_product_listings_hide_cats_count_on_shop' ) ) ||
251
  ( ! is_shop() && 'yes' === apply_filters( 'wcj_get_option_filter', 'wcj', get_option( 'wcj_product_listings_hide_cats_count_on_archive' ) ) ) )
252
  return '';
253
  return $count_html;
254
+ }
255
 
256
+ /**
257
+ * filter_subcategories.
258
+ */
259
+ public function filter_subcategories( $args ) {
260
  if ( is_shop() ) {
261
  $args['exclude'] = get_option( 'wcj_product_listings_exclude_cats_on_shop' );
262
  $args['hide_empty'] = ( 'yes' === get_option( 'wcj_product_listings_hide_empty_cats_on_shop' ) ) ? 1 : 0; // depreciated?
266
  $args['hide_empty'] = ( 'yes' === get_option( 'wcj_product_listings_hide_empty_cats_on_archives' ) ) ? 1 : 0; // depreciated?
267
  }
268
  return $args;
269
+ }
270
 
271
+ /**
272
+ * hide_products_by_disabling_loop.
273
+ */
274
+ public function hide_products_by_disabling_loop() {
275
  // If we are hiding products disable the loop and pagination
276
  global $wp_query;
277
  if ( is_product_category() &&
288
  }
289
  }
290
 
291
+ /**
292
+ * filter_subcategories_show_empty.
293
+ */
294
+ public function filter_subcategories_show_empty() {
295
 
296
  // Not the best solution, but it's the only place I found to put it...
297
  $this->hide_products_by_disabling_loop();
303
  $show_empty = ( 'yes' === get_option( 'wcj_product_listings_hide_empty_cats_on_archives' ) ) ? false : true;
304
 
305
  return $show_empty;
306
+ }
307
  }
308
 
309
  endif;
includes/class-wcj-shipping-calculator.php CHANGED
@@ -15,30 +15,30 @@ if ( ! defined( 'ABSPATH' ) ) exit;
15
  if ( ! class_exists( 'WCJ_Shipping_Calculator' ) ) :
16
 
17
  class WCJ_Shipping_Calculator {
18
-
19
- /**
20
- * Constructor.
21
- */
22
- public function __construct() {
23
 
24
- // Main hooks
25
- if ( 'yes' === get_option( 'wcj_shipping_calculator_enabled' ) ) {
26
  add_filter( 'woocommerce_shipping_calculator_enable_city' , array( $this, 'enable_city' ) );
27
  add_filter( 'woocommerce_shipping_calculator_enable_postcode', array( $this, 'enable_postcode' ) );
28
  add_action( 'wp_head', array( $this, 'add_custom_styles' ) );
29
  //add_filter( 'gettext', array( $this, 'change_labels' ), 20, 3 );
30
- }
31
-
32
- // Settings hooks
33
- add_filter( 'wcj_settings_sections', array( $this, 'settings_section' ) );
34
- add_filter( 'wcj_settings_shipping_calculator', array( $this, 'get_settings' ), 100 );
35
- add_filter( 'wcj_features_status', array( $this, 'add_enabled_option' ), 100 );
36
- }
37
 
38
- /**
39
- * change_labels.
40
- *
41
- public function change_labels( $translated_text, $text, $domain ) {
42
 
43
  if ( ! function_exists( 'is_cart' ) || ! is_cart() )
44
  return $translated_text;
@@ -57,10 +57,10 @@ class WCJ_Shipping_Calculator {
57
  return $translated_text;
58
  }
59
 
60
- /**
61
- * add_custom_styles.
62
- */
63
- public function add_custom_styles() {
64
 
65
  $html = '<style type="text/css">';
66
 
@@ -81,121 +81,121 @@ class WCJ_Shipping_Calculator {
81
  $html .= '</style>';
82
 
83
  echo $html;
84
- }
85
 
86
  /**
87
- * enable_city.
88
- */
89
- public function enable_city() {
90
  return ( 'yes' === get_option( 'wcj_shipping_calculator_enable_city' ) ) ? true : false;
91
- }
92
 
93
- /**
94
- * enable_postcode.
95
- */
96
- public function enable_postcode() {
97
  return ( 'yes' === get_option( 'wcj_shipping_calculator_enable_postcode' ) ) ? true : false;
98
- }
99
-
100
- /**
101
- * add_enabled_option.
102
- */
103
- public function add_enabled_option( $settings ) {
104
- $all_settings = $this->get_settings();
105
- $settings[] = $all_settings[1];
106
- return $settings;
107
- }
108
-
109
- /**
110
- * get_settings.
111
- */
112
- function get_settings() {
113
 
114
- $settings = array(
115
 
116
- array( 'title' => __( 'Shipping Calculator Options', 'woocommerce-jetpack' ), 'type' => 'title', 'desc' => '', 'id' => 'wcj_shipping_calculator_options' ),
117
-
118
- array(
119
- 'title' => __( 'Shipping Calculator', 'woocommerce-jetpack' ),
120
- 'desc' => '<strong>' . __( 'Enable Module', 'woocommerce-jetpack' ) . '</strong>',
121
- 'desc_tip' => __( 'Customize WooCommerce shipping calculator on cart page.', 'woocommerce-jetpack' ),
122
- 'id' => 'wcj_shipping_calculator_enabled',
123
- 'default' => 'no',
124
- 'type' => 'checkbox',
125
- ),
126
 
127
- array(
128
- 'title' => __( 'Enable City', 'woocommerce-jetpack' ),
129
  'desc' => __( 'Enable', 'woocommerce-jetpack' ),
130
- 'id' => 'wcj_shipping_calculator_enable_city',
131
- 'default' => 'no',
132
- 'type' => 'checkbox',
133
- ),
134
 
135
- array(
136
- 'title' => __( 'Enable Postcode', 'woocommerce-jetpack' ),
137
  'desc' => __( 'Enable', 'woocommerce-jetpack' ),
138
- 'id' => 'wcj_shipping_calculator_enable_postcode',
139
- 'default' => 'yes',
140
- 'type' => 'checkbox',
141
- ),
142
 
143
- array(
144
- 'title' => __( 'Enable State', 'woocommerce-jetpack' ),
145
  'desc' => __( 'Enable', 'woocommerce-jetpack' ),
146
- 'id' => 'wcj_shipping_calculator_enable_state',
147
- 'default' => 'yes',
148
- 'type' => 'checkbox',
149
- ),
150
 
151
  array(
152
- 'title' => __( 'Force Block Open', 'woocommerce-jetpack' ),
153
  'desc' => __( 'Enable', 'woocommerce-jetpack' ),
154
- 'id' => 'wcj_shipping_calculator_enable_force_block_open',
155
- 'default' => 'no',
156
- 'type' => 'checkbox',
157
- ),
158
 
159
  array(
160
- 'title' => __( '', 'woocommerce-jetpack' ),
161
  'desc' => __( 'Calculate Shipping button', 'woocommerce-jetpack' ),
162
  'desc_tip' => __( 'When "Force Block Open" options is enabled, set Calculate Shipping button options.', 'woocommerce-jetpack' ),
163
- 'id' => 'wcj_shipping_calculator_enable_force_block_open_button',
164
- 'default' => 'hide',
165
- 'type' => 'select',
166
- 'options' => array(
167
  'hide' => __( 'Hide', 'woocommerce-jetpack' ),
168
  'noclick' => __( 'Make non clickable', 'woocommerce-jetpack' ),
169
  ),
170
- ),
171
 
172
  /*array(
173
- 'title' => __( 'Label for Calculate Shipping', 'woocommerce-jetpack' ),
174
- 'id' => 'wcj_shipping_calculator_label_calculate_shipping',
175
- 'default' => '',
176
- 'type' => 'text',
177
- ),
178
 
179
  array(
180
- 'title' => __( 'Label for Update Totals', 'woocommerce-jetpack' ),
181
- 'id' => 'wcj_shipping_calculator_label_update_totals',
182
- 'default' => '',
183
- 'type' => 'text',
184
- ),*/
185
-
186
- array( 'type' => 'sectionend', 'id' => 'wcj_shipping_calculator_options' ),
187
- );
188
-
189
- return $settings;
190
- }
191
 
192
- /**
193
- * settings_section.
194
- */
195
- function settings_section( $sections ) {
196
- $sections['shipping_calculator'] = __( 'Shipping Calculator', 'woocommerce-jetpack' );
197
- return $sections;
198
- }
199
  }
200
 
201
  endif;
15
  if ( ! class_exists( 'WCJ_Shipping_Calculator' ) ) :
16
 
17
  class WCJ_Shipping_Calculator {
18
+
19
+ /**
20
+ * Constructor.
21
+ */
22
+ public function __construct() {
23
 
24
+ // Main hooks
25
+ if ( 'yes' === get_option( 'wcj_shipping_calculator_enabled' ) ) {
26
  add_filter( 'woocommerce_shipping_calculator_enable_city' , array( $this, 'enable_city' ) );
27
  add_filter( 'woocommerce_shipping_calculator_enable_postcode', array( $this, 'enable_postcode' ) );
28
  add_action( 'wp_head', array( $this, 'add_custom_styles' ) );
29
  //add_filter( 'gettext', array( $this, 'change_labels' ), 20, 3 );
30
+ }
31
+
32
+ // Settings hooks
33
+ add_filter( 'wcj_settings_sections', array( $this, 'settings_section' ) );
34
+ add_filter( 'wcj_settings_shipping_calculator', array( $this, 'get_settings' ), 100 );
35
+ add_filter( 'wcj_features_status', array( $this, 'add_enabled_option' ), 100 );
36
+ }
37
 
38
+ /**
39
+ * change_labels.
40
+ *
41
+ public function change_labels( $translated_text, $text, $domain ) {
42
 
43
  if ( ! function_exists( 'is_cart' ) || ! is_cart() )
44
  return $translated_text;
57
  return $translated_text;
58
  }
59
 
60
+ /**
61
+ * add_custom_styles.
62
+ */
63
+ public function add_custom_styles() {
64
 
65
  $html = '<style type="text/css">';
66
 
81
  $html .= '</style>';
82
 
83
  echo $html;
84
+ }
85
 
86
  /**
87
+ * enable_city.
88
+ */
89
+ public function enable_city() {
90
  return ( 'yes' === get_option( 'wcj_shipping_calculator_enable_city' ) ) ? true : false;
91
+ }
92
 
93
+ /**
94
+ * enable_postcode.
95
+ */
96
+ public function enable_postcode() {
97
  return ( 'yes' === get_option( 'wcj_shipping_calculator_enable_postcode' ) ) ? true : false;
98
+ }
99
+
100
+ /**
101
+ * add_enabled_option.
102
+ */
103
+ public function add_enabled_option( $settings ) {
104
+ $all_settings = $this->get_settings();
105
+ $settings[] = $all_settings[1];
106
+ return $settings;
107
+ }
108
+
109
+ /**
110
+ * get_settings.
111
+ */
112
+ function get_settings() {
113
 
114
+ $settings = array(
115
 
116
+ array( 'title' => __( 'Shipping Calculator Options', 'woocommerce-jetpack' ), 'type' => 'title', 'desc' => '', 'id' => 'wcj_shipping_calculator_options' ),
117
+
118
+ array(
119
+ 'title' => __( 'Shipping Calculator', 'woocommerce-jetpack' ),
120
+ 'desc' => '<strong>' . __( 'Enable Module', 'woocommerce-jetpack' ) . '</strong>',
121
+ 'desc_tip' => __( 'Customize WooCommerce shipping calculator on cart page.', 'woocommerce-jetpack' ),
122
+ 'id' => 'wcj_shipping_calculator_enabled',
123
+ 'default' => 'no',
124
+ 'type' => 'checkbox',
125
+ ),
126
 
127
+ array(
128
+ 'title' => __( 'Enable City', 'woocommerce-jetpack' ),
129
  'desc' => __( 'Enable', 'woocommerce-jetpack' ),
130
+ 'id' => 'wcj_shipping_calculator_enable_city',
131
+ 'default' => 'no',
132
+ 'type' => 'checkbox',
133
+ ),
134
 
135
+ array(
136
+ 'title' => __( 'Enable Postcode', 'woocommerce-jetpack' ),
137
  'desc' => __( 'Enable', 'woocommerce-jetpack' ),
138
+ 'id' => 'wcj_shipping_calculator_enable_postcode',
139
+ 'default' => 'yes',
140
+ 'type' => 'checkbox',
141
+ ),
142
 
143
+ array(
144
+ 'title' => __( 'Enable State', 'woocommerce-jetpack' ),
145
  'desc' => __( 'Enable', 'woocommerce-jetpack' ),
146
+ 'id' => 'wcj_shipping_calculator_enable_state',
147
+ 'default' => 'yes',
148
+ 'type' => 'checkbox',
149
+ ),
150
 
151
  array(
152
+ 'title' => __( 'Force Block Open', 'woocommerce-jetpack' ),
153
  'desc' => __( 'Enable', 'woocommerce-jetpack' ),
154
+ 'id' => 'wcj_shipping_calculator_enable_force_block_open',
155
+ 'default' => 'no',
156
+ 'type' => 'checkbox',
157
+ ),
158
 
159
  array(
160
+ 'title' => __( '', 'woocommerce-jetpack' ),
161
  'desc' => __( 'Calculate Shipping button', 'woocommerce-jetpack' ),
162
  'desc_tip' => __( 'When "Force Block Open" options is enabled, set Calculate Shipping button options.', 'woocommerce-jetpack' ),
163
+ 'id' => 'wcj_shipping_calculator_enable_force_block_open_button',
164
+ 'default' => 'hide',
165
+ 'type' => 'select',
166
+ 'options' => array(
167
  'hide' => __( 'Hide', 'woocommerce-jetpack' ),
168
  'noclick' => __( 'Make non clickable', 'woocommerce-jetpack' ),
169
  ),
170
+ ),
171
 
172
  /*array(
173
+ 'title' => __( 'Label for Calculate Shipping', 'woocommerce-jetpack' ),
174
+ 'id' => 'wcj_shipping_calculator_label_calculate_shipping',
175
+ 'default' => '',
176
+ 'type' => 'text',
177
+ ),
178
 
179
  array(
180
+ 'title' => __( 'Label for Update Totals', 'woocommerce-jetpack' ),
181
+ 'id' => 'wcj_shipping_calculator_label_update_totals',
182
+ 'default' => '',
183
+ 'type' => 'text',
184
+ ),*/
185
+
186
+ array( 'type' => 'sectionend', 'id' => 'wcj_shipping_calculator_options' ),
187
+ );
188
+
189
+ return $settings;
190
+ }
191
 
192
+ /**
193
+ * settings_section.
194
+ */
195
+ function settings_section( $sections ) {
196
+ $sections['shipping_calculator'] = __( 'Shipping Calculator', 'woocommerce-jetpack' );
197
+ return $sections;
198
+ }
199
  }
200
 
201
  endif;
includes/class-wcj-shipping.php CHANGED
@@ -15,12 +15,12 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
15
  if ( ! class_exists( 'WCJ_Shipping' ) ) :
16
 
17
  class WCJ_Shipping {
18
-
19
- /**
20
- * Constructor.
21
- */
22
- public function __construct() {
23
- if ( get_option( 'wcj_shipping_enabled' ) == 'yes' ) {
24
  // Include custom shipping method
25
  //include_once( 'shipping/class-wc-shipping-wcj-custom.php' );
26
  // Main hooks
@@ -28,23 +28,23 @@ class WCJ_Shipping {
28
  add_filter( 'woocommerce_package_rates', array( $this, 'hide_shipping_when_free_is_available' ), 10, 2 );
29
  // Settings
30
  add_filter( 'woocommerce_shipping_settings', array( $this, 'add_hide_shipping_if_free_available_fields' ), 100 );
31
- }
32
- // Settings hooks
33
- add_filter( 'wcj_settings_sections', array( $this, 'settings_section' ) );
34
- add_filter( 'wcj_settings_shipping', array( $this, 'get_settings' ), 100 );
35
- add_filter( 'wcj_features_status', array( $this, 'add_enabled_option' ), 100 );
36
- }
37
-
38
- /**
39
- * add_enabled_option.
40
- */
41
- public function add_enabled_option( $settings ) {
42
-
43
- $all_settings = $this->get_settings();
44
- $settings[] = $all_settings[1];
45
-
46
- return $settings;
47
- }
48
 
49
  function add_hide_shipping_if_free_available_fields( $settings ) {
50
 
@@ -141,66 +141,66 @@ class WCJ_Shipping {
141
 
142
  return $available_methods;
143
  }
144
-
145
- /**
146
- * get_settings.
147
- */
148
- function get_settings() {
149
 
150
- $settings = array(
151
 
152
- array( 'title' => __( 'Shipping Options', 'woocommerce-jetpack' ), 'type' => 'title', 'desc' => __( '', 'woocommerce-jetpack' ), 'id' => 'wcj_shipping_options' ),
153
-
154
- array(
155
- 'title' => __( 'Shipping', 'woocommerce-jetpack' ),
156
- 'desc' => '<strong>' . __( 'Enable Module', 'woocommerce-jetpack' ) . '</strong>',
157
- 'desc_tip' => __( 'Hide WooCommerce shipping when free is available.', 'woocommerce-jetpack' ),
158
- 'id' => 'wcj_shipping_enabled',
159
- 'default' => 'no',
160
- 'type' => 'checkbox',
161
- ),
162
-
163
- array( 'type' => 'sectionend', 'id' => 'wcj_shipping_options' ),
164
 
165
  array( 'title' => __( 'Hide if free is available', 'woocommerce-jetpack' ), 'type' => 'title', 'desc' => __( 'This section lets you hide other shipping options when free shipping is available on shop frontend.', 'woocommerce-jetpack' ), 'id' => 'wcj_shipping_hide_if_free_available_options' ),
166
 
167
- array(
168
- //'title' => __( 'Hide local delivery', 'woocommerce-jetpack' ),
169
  'title' => __( 'Hide shipping', 'woocommerce-jetpack' ),
170
- 'desc' => __( 'Hide local delivery when free is available', 'woocommerce-jetpack' ),
171
- 'desc_tip' => __( '', 'woocommerce-jetpack' ),
172
- 'id' => 'wcj_shipping_hide_if_free_available_local_delivery',
173
- 'default' => 'no',
174
- 'type' => 'checkbox',
175
  'checkboxgroup' => 'start',
176
- ),
177
 
178
  array(
179
- //'title' => __( 'Hide all', 'woocommerce-jetpack' ),
180
- 'desc' => __( 'Hide all when free is available', 'woocommerce-jetpack' ),
181
- 'desc_tip' => __( '', 'woocommerce-jetpack' ),
182
- 'id' => 'wcj_shipping_hide_if_free_available_all',
183
- 'default' => 'no',
184
- 'type' => 'checkbox',
185
  'checkboxgroup' => 'end',
186
- ),
187
 
188
  array( 'type' => 'sectionend', 'id' => 'wcj_shipping_hide_if_free_available_options' ),
189
 
190
- );
191
-
192
- return $settings;
193
- }
194
 
195
- /**
196
- * settings_section.
197
- */
198
- function settings_section( $sections ) {
199
-
200
- $sections['shipping'] = __( 'Shipping', 'woocommerce-jetpack' );
201
-
202
- return $sections;
203
- }
204
  }
205
 
206
  endif;
15
  if ( ! class_exists( 'WCJ_Shipping' ) ) :
16
 
17
  class WCJ_Shipping {
18
+
19
+ /**
20
+ * Constructor.
21
+ */
22
+ public function __construct() {
23
+ if ( get_option( 'wcj_shipping_enabled' ) == 'yes' ) {
24
  // Include custom shipping method
25
  //include_once( 'shipping/class-wc-shipping-wcj-custom.php' );
26
  // Main hooks
28
  add_filter( 'woocommerce_package_rates', array( $this, 'hide_shipping_when_free_is_available' ), 10, 2 );
29
  // Settings
30
  add_filter( 'woocommerce_shipping_settings', array( $this, 'add_hide_shipping_if_free_available_fields' ), 100 );
31
+ }
32
+ // Settings hooks
33
+ add_filter( 'wcj_settings_sections', array( $this, 'settings_section' ) );
34
+ add_filter( 'wcj_settings_shipping', array( $this, 'get_settings' ), 100 );
35
+ add_filter( 'wcj_features_status', array( $this, 'add_enabled_option' ), 100 );
36
+ }
37
+
38
+ /**
39
+ * add_enabled_option.
40
+ */
41
+ public function add_enabled_option( $settings ) {
42
+
43
+ $all_settings = $this->get_settings();
44
+ $settings[] = $all_settings[1];
45
+
46
+ return $settings;
47
+ }
48
 
49
  function add_hide_shipping_if_free_available_fields( $settings ) {
50
 
141
 
142
  return $available_methods;
143
  }
144
+
145
+ /**
146
+ * get_settings.
147
+ */
148
+ function get_settings() {
149
 
150
+ $settings = array(
151
 
152
+ array( 'title' => __( 'Shipping Options', 'woocommerce-jetpack' ), 'type' => 'title', 'desc' => __( '', 'woocommerce-jetpack' ), 'id' => 'wcj_shipping_options' ),
153
+
154
+ array(
155
+ 'title' => __( 'Shipping', 'woocommerce-jetpack' ),
156
+ 'desc' => '<strong>' . __( 'Enable Module', 'woocommerce-jetpack' ) . '</strong>',
157
+ 'desc_tip' => __( 'Hide WooCommerce shipping when free is available.', 'woocommerce-jetpack' ),
158
+ 'id' => 'wcj_shipping_enabled',
159
+ 'default' => 'no',
160
+ 'type' => 'checkbox',
161
+ ),
162
+
163
+ array( 'type' => 'sectionend', 'id' => 'wcj_shipping_options' ),
164
 
165
  array( 'title' => __( 'Hide if free is available', 'woocommerce-jetpack' ), 'type' => 'title', 'desc' => __( 'This section lets you hide other shipping options when free shipping is available on shop frontend.', 'woocommerce-jetpack' ), 'id' => 'wcj_shipping_hide_if_free_available_options' ),
166
 
167
+ array(
168
+ //'title' => __( 'Hide local delivery', 'woocommerce-jetpack' ),
169
  'title' => __( 'Hide shipping', 'woocommerce-jetpack' ),
170
+ 'desc' => __( 'Hide local delivery when free is available', 'woocommerce-jetpack' ),
171
+ 'desc_tip' => __( '', 'woocommerce-jetpack' ),
172
+ 'id' => 'wcj_shipping_hide_if_free_available_local_delivery',
173
+ 'default' => 'no',
174
+ 'type' => 'checkbox',
175
  'checkboxgroup' => 'start',
176
+ ),
177
 
178
  array(
179
+ //'title' => __( 'Hide all', 'woocommerce-jetpack' ),
180
+ 'desc' => __( 'Hide all when free is available', 'woocommerce-jetpack' ),
181
+ 'desc_tip' => __( '', 'woocommerce-jetpack' ),
182
+ 'id' => 'wcj_shipping_hide_if_free_available_all',
183
+ 'default' => 'no',
184
+ 'type' => 'checkbox',
185
  'checkboxgroup' => 'end',
186
+ ),
187
 
188
  array( 'type' => 'sectionend', 'id' => 'wcj_shipping_hide_if_free_available_options' ),
189
 
190
+ );
191
+
192
+ return $settings;
193
+ }
194
 
195
+ /**
196
+ * settings_section.
197
+ */
198
+ function settings_section( $sections ) {
199
+
200
+ $sections['shipping'] = __( 'Shipping', 'woocommerce-jetpack' );
201
+
202
+ return $sections;
203
+ }
204
  }
205
 
206
  endif;
includes/class-wcj-shortcodes.php CHANGED
@@ -15,73 +15,73 @@ if ( ! defined( 'ABSPATH' ) ) exit;
15
  if ( ! class_exists( 'WCJ_Shortcodes' ) ) :
16
 
17
  class WCJ_Shortcodes {
18
-
19
- /**
20
- * Constructor.
21
- */
22
- public function __construct() {
23
 
24
- // Main hooks
25
- //if ( 'yes' === get_option( 'wcj_shortcodes_enabled' ) ) {
26
  //add_shortcode( 'wcj_sku', array( 'WCJ_Product_Info', 'shortcode_product_info_sku' ) );
27
  //add_shortcode( 'wcj_sku', array( &WCJ_Product_Info, 'shortcode_product_info_sku' ) );
28
- //}
29
-
30
- // Settings hooks
31
- //add_filter( 'wcj_settings_sections', array( $this, 'settings_section' ) );
32
- //add_filter( 'wcj_settings_shortcodes', array( $this, 'get_settings' ), 100 );
33
- //add_filter( 'wcj_features_status', array( $this, 'add_enabled_option' ), 100 );
34
- }
 
35
 
36
 
37
-
38
- /**
39
- * add_enabled_option.
40
- *
41
- public function shortcode_product_info_sku( $atts ) {
42
  return 'ttt';
43
- }
 
 
 
 
 
 
 
 
 
44
 
45
  /**
46
- * add_enabled_option.
47
- */
48
- public function add_enabled_option( $settings ) {
49
- $all_settings = $this->get_settings();
50
- $settings[] = $all_settings[1];
51
- return $settings;
52
- }
53
-
54
- /**
55
- * get_settings.
56
- */
57
- function get_settings() {
58
 
59
- $settings = array(
60
 
61
- array( 'title' => __( 'Shortcodes Options', 'woocommerce-jetpack' ), 'type' => 'title', 'desc' => __( 'Shortcodes.', 'woocommerce-jetpack' ), 'id' => 'wcj_shortcodes_options' ),
62
-
63
- array(
64
- 'title' => __( 'Shortcodes', 'woocommerce-jetpack' ),
65
- 'desc' => __( 'Enable the Shortcodes feature', 'woocommerce-jetpack' ),
66
- 'desc_tip' => __( 'Shortcodes.', 'woocommerce-jetpack' ),
67
- 'id' => 'wcj_shortcodes_enabled',
68
- 'default' => 'yes',
69
- 'type' => 'checkbox',
70
- ),
71
-
72
- array( 'type' => 'sectionend', 'id' => 'wcj_shortcodes_options' ),
73
- );
74
-
75
- return $settings;
76
- }
77
 
78
- /**
79
- * settings_section.
80
- */
81
- function settings_section( $sections ) {
82
- $sections['shortcodes'] = __( 'Shortcodes', 'woocommerce-jetpack' );
83
- return $sections;
84
- }
85
  }
86
 
87
  endif;
15
  if ( ! class_exists( 'WCJ_Shortcodes' ) ) :
16
 
17
  class WCJ_Shortcodes {
18
+
19
+ /**
20
+ * Constructor.
21
+ */
22
+ public function __construct() {
23
 
24
+ // Main hooks
25
+ //if ( 'yes' === get_option( 'wcj_shortcodes_enabled' ) ) {
26
  //add_shortcode( 'wcj_sku', array( 'WCJ_Product_Info', 'shortcode_product_info_sku' ) );
27
  //add_shortcode( 'wcj_sku', array( &WCJ_Product_Info, 'shortcode_product_info_sku' ) );
28
+ //}
29
+
30
+ // Settings hooks
31
+ //add_filter( 'wcj_settings_sections', array( $this, 'settings_section' ) );
32
+ //add_filter( 'wcj_settings_shortcodes', array( $this, 'get_settings' ), 100 );
33
+ //add_filter( 'wcj_features_status', array( $this, 'add_enabled_option' ), 100 );
34
+ }
35
+
36
 
37
 
38
+ /**
39
+ * add_enabled_option.
40
+ *
41
+ public function shortcode_product_info_sku( $atts ) {
 
42
  return 'ttt';
43
+ }
44
+
45
+ /**
46
+ * add_enabled_option.
47
+ */
48
+ public function add_enabled_option( $settings ) {
49
+ $all_settings = $this->get_settings();
50
+ $settings[] = $all_settings[1];
51
+ return $settings;
52
+ }
53
 
54
  /**
55
+ * get_settings.
56
+ */
57
+ function get_settings() {
 
 
 
 
 
 
 
 
 
58
 
59
+ $settings = array(
60
 
61
+ array( 'title' => __( 'Shortcodes Options', 'woocommerce-jetpack' ), 'type' => 'title', 'desc' => __( 'Shortcodes.', 'woocommerce-jetpack' ), 'id' => 'wcj_shortcodes_options' ),
62
+
63
+ array(
64
+ 'title' => __( 'Shortcodes', 'woocommerce-jetpack' ),
65
+ 'desc' => __( 'Enable the Shortcodes feature', 'woocommerce-jetpack' ),
66
+ 'desc_tip' => __( 'Shortcodes.', 'woocommerce-jetpack' ),
67
+ 'id' => 'wcj_shortcodes_enabled',
68
+ 'default' => 'yes',
69
+ 'type' => 'checkbox',
70
+ ),
71
+
72
+ array( 'type' => 'sectionend', 'id' => 'wcj_shortcodes_options' ),
73
+ );
74
+
75
+ return $settings;
76
+ }
77
 
78
+ /**
79
+ * settings_section.
80
+ */
81
+ function settings_section( $sections ) {
82
+ $sections['shortcodes'] = __( 'Shortcodes', 'woocommerce-jetpack' );
83
+ return $sections;
84
+ }
85
  }
86
 
87
  endif;
includes/class-wcj-sorting.php CHANGED
@@ -47,7 +47,7 @@ class WCJ_Sorting extends WCJ_Module {
47
  }
48
 
49
  /**
50
- * Unlocks - Sorting - remove_sorting.
51
  *
52
  * @version 2.2.9
53
  */
47
  }
48
 
49
  /**
50
+ * remove_sorting.
51
  *
52
  * @version 2.2.9
53
  */
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://algoritmika.com/donate/
4
  Tags: woocommerce,booster for woocommerce,woocommerce jetpack,custom price labels,call for price,currency symbol,remove sorting,remove old product slugs,add to cart text,order number,sequential order numbering,email pdf invoice,pdf invoice,pdf invoices,already in cart,empty cart,redirect to checkout,minimum order amount,customize checkout fields,checkout fields,email,customize product tabs,product tabs,related products number,empty cart,redirect add to cart,redirect to checkout,product already in cart,custom payment gateway,payment gateway icon,auto-complete all orders,custom order statuses,custom order status,remove text from price,custom css,hide categories count,hide subcategories count,hide category count,hide subcategory count,display total sales,custom product tabs,remove product tab,payment gateway fee,
5
  Requires at least: 3.8
6
  Tested up to: 4.3
7
- Stable tag: 2.3.0
8
  License: GNU General Public License v3.0
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -60,7 +60,7 @@ Booster for WooCommerce is a WordPress plugin that supercharges your site with a
60
  * *Custom Payment Gateways* - Add multiple custom payment gateways to WooCommerce.
61
  * *Payment Gateways Currency* - Currency per WooCommerce payment gateway.
62
  * *Payment Gateways Fees* - Enable extra fees for WooCommerce payment gateways.
63
- * *Payment Gateways Icons* - Change icons (images) for all default WooCommerce payment gateways.
64
  * *Payment Gateways per Category* - Show gateway only if there is product of selected category in WooCommerce cart.
65
 
66
  **Shipping & Orders**
@@ -116,6 +116,10 @@ To unlock all Booster for WooCommerce features, please install additional <a hre
116
 
117
  == Changelog ==
118
 
 
 
 
 
119
  = 2.3.0 - 01/10/2015 =
120
  * Fix - `time` function calls replaced with `current_time` in: crowdfunding module and shortcode, invoicing, stock report.
121
  * Dev - `WCJ_Module` code refactoring.
4
  Tags: woocommerce,booster for woocommerce,woocommerce jetpack,custom price labels,call for price,currency symbol,remove sorting,remove old product slugs,add to cart text,order number,sequential order numbering,email pdf invoice,pdf invoice,pdf invoices,already in cart,empty cart,redirect to checkout,minimum order amount,customize checkout fields,checkout fields,email,customize product tabs,product tabs,related products number,empty cart,redirect add to cart,redirect to checkout,product already in cart,custom payment gateway,payment gateway icon,auto-complete all orders,custom order statuses,custom order status,remove text from price,custom css,hide categories count,hide subcategories count,hide category count,hide subcategory count,display total sales,custom product tabs,remove product tab,payment gateway fee,
5
  Requires at least: 3.8
6
  Tested up to: 4.3
7
+ Stable tag: 2.3.1
8
  License: GNU General Public License v3.0
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
60
  * *Custom Payment Gateways* - Add multiple custom payment gateways to WooCommerce.
61
  * *Payment Gateways Currency* - Currency per WooCommerce payment gateway.
62
  * *Payment Gateways Fees* - Enable extra fees for WooCommerce payment gateways.
63
+ * *Payment Gateways Icons* - Change or completely remove icons (images) for any (default or custom) WooCommerce payment gateway.
64
  * *Payment Gateways per Category* - Show gateway only if there is product of selected category in WooCommerce cart.
65
 
66
  **Shipping & Orders**
116
 
117
  == Changelog ==
118
 
119
+ = 2.3.1 - 02/10/2015 =
120
+ * Dev - PAYMENT GATEWAYS - Gateways Icons - Remove Icon option added.
121
+ * Dev - PAYMENT GATEWAYS - Gateways Icons - Module extended to include all payment gateways (including custom, created with other plugins).
122
+
123
  = 2.3.0 - 01/10/2015 =
124
  * Fix - `time` function calls replaced with `current_time` in: crowdfunding module and shortcode, invoicing, stock report.
125
  * Dev - `WCJ_Module` code refactoring.
woocommerce-jetpack.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Booster for WooCommerce
4
  Plugin URI: http://BoostWoo.com
5
  Description: Supercharge your WooCommerce site with these awesome powerful features.
6
- Version: 2.3.0
7
  Author: Algoritmika Ltd
8
  Author URI: http://www.algoritmika.com
9
  Copyright: © 2015 Algoritmika Ltd.
@@ -70,6 +70,8 @@ final class WC_Jetpack {
70
  /* echo 'Constructor Start: memory_get_usage( false )' . number_format( memory_get_usage( false ), 0, '.', ',' );
71
  echo 'Constructor Start: memory_get_usage( true )' . number_format( memory_get_usage( true ), 0, '.', ',' ); */
72
 
 
 
73
  // Include required files
74
  $this->includes();
75
 
3
  Plugin Name: Booster for WooCommerce
4
  Plugin URI: http://BoostWoo.com
5
  Description: Supercharge your WooCommerce site with these awesome powerful features.
6
+ Version: 2.3.1
7
  Author: Algoritmika Ltd
8
  Author URI: http://www.algoritmika.com
9
  Copyright: © 2015 Algoritmika Ltd.
70
  /* echo 'Constructor Start: memory_get_usage( false )' . number_format( memory_get_usage( false ), 0, '.', ',' );
71
  echo 'Constructor Start: memory_get_usage( true )' . number_format( memory_get_usage( true ), 0, '.', ',' ); */
72
 
73
+ //require_once( WP_PLUGIN_DIR . '/woocommerce/woocommerce.php' );
74
+
75
  // Include required files
76
  $this->includes();
77