Booster for WooCommerce - Version 1.6.0

Version Description

  • 22/09/2014 =
  • Fix - PDF Invoices - Wrong headers for PDF sent, fixed. This was previously causing a bug when .html file extension was wrongly added to PDF. Suggested by Pete (reported from Safari, Mac).
  • Feature Upgraded - Custom Price Labels - Labels for Item price on Cart page included. Idea by Stephanie.
  • Feature Upgraded - Custom Price Labels - Labels for Composite products included. Idea by Pete.
  • Dev - Custom Price Labels - All price filters added to prices_filters array.
Download this release

Release Info

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

Code changes from version 1.5.3 to 1.6.0

includes/class-wcj-pdf-invoices.php CHANGED
@@ -5,7 +5,7 @@
5
  * The WooCommerce Jetpack PDF Invoices class.
6
  *
7
  * @class WCJ_PDF_Invoices
8
- * @version 1.4.0
9
  * @category Class
10
  * @author Algoritmika Ltd.
11
  */
@@ -124,7 +124,8 @@ class WCJ_PDF_Invoices {
124
  $pdf->SetKeywords( 'invoice, PDF' );
125
 
126
  // set default header data
127
- //$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 001', PDF_HEADER_STRING, array(0,64,255), array(0,64,128));
 
128
  //$pdf->SetHeaderData( get_option( 'wcj_pdf_invoices_seller_logo_url' ), 30, get_option( 'wcj_pdf_invoices_header_title' ), get_option( 'wcj_pdf_invoices_header_string' ), array(0,64,255), array(0,64,128));
129
  $pdf->SetPrintHeader(false);
130
  $pdf->setFooterData(array(0,64,0), array(0,64,128));
@@ -185,6 +186,66 @@ class WCJ_PDF_Invoices {
185
  // This method has several options, check the source code documentation for more information.
186
  // $the_order = new WC_Order( $order_id );
187
  // $order_number = $the_order->get_order_number();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
188
 
189
  if ( $get_by_order_id > 0 )
190
  return $pdf->Output('invoice-' . $order_id . '.pdf', 'S');
@@ -192,6 +253,15 @@ class WCJ_PDF_Invoices {
192
  $pdf->Output('invoice-' . $order_id . '.pdf', 'D');
193
  else
194
  $pdf->Output('invoice-' . $order_id . '.pdf', 'I');
 
 
 
 
 
 
 
 
 
195
  }
196
 
197
  /**
5
  * The WooCommerce Jetpack PDF Invoices class.
6
  *
7
  * @class WCJ_PDF_Invoices
8
+ * @version 1.5.0
9
  * @category Class
10
  * @author Algoritmika Ltd.
11
  */
124
  $pdf->SetKeywords( 'invoice, PDF' );
125
 
126
  // set default header data
127
+ // TODO 2014.09.21
128
+ // $pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 001', PDF_HEADER_STRING, array(0,64,255), array(0,64,128));
129
  //$pdf->SetHeaderData( get_option( 'wcj_pdf_invoices_seller_logo_url' ), 30, get_option( 'wcj_pdf_invoices_header_title' ), get_option( 'wcj_pdf_invoices_header_string' ), array(0,64,255), array(0,64,128));
130
  $pdf->SetPrintHeader(false);
131
  $pdf->setFooterData(array(0,64,0), array(0,64,128));
186
  // This method has several options, check the source code documentation for more information.
187
  // $the_order = new WC_Order( $order_id );
188
  // $order_number = $the_order->get_order_number();
189
+
190
+
191
+
192
+
193
+
194
+
195
+ /**/
196
+
197
+ if ( $get_by_order_id > 0 )
198
+ return $pdf->Output('invoice-' . $order_id . '.pdf', 'S');
199
+ else
200
+ {
201
+ $file_name = 'invoice-' . $order_id . '.pdf';
202
+ $file_path = sys_get_temp_dir() . '/' . $file_name;
203
+ $result = file_put_contents( $file_path, $pdf->Output( '', 'S' ) );
204
+ //echo $pdf->Output( '', 'S' );
205
+
206
+ if ( isset( $_GET['save_pdf_invoice'] ) && '1' == $_GET['save_pdf_invoice'] ) {
207
+ //$pdf->Output('invoice-' . $order_id . '.pdf', 'D');
208
+
209
+ header("Content-Type: application/octet-stream");
210
+
211
+ //$file = $file_name;//$_GET["file"] .".pdf";
212
+ header("Content-Disposition: attachment; filename=" . urlencode($file_name));
213
+ header("Content-Type: application/octet-stream");
214
+ header("Content-Type: application/download");
215
+ header("Content-Description: File Transfer");
216
+
217
+ }
218
+ else {
219
+ //$pdf->Output('invoice-' . $order_id . '.pdf', 'I');
220
+
221
+ header("Content-type: application/pdf");
222
+ header("Content-Disposition: inline; filename=" . urlencode($file_name));
223
+ }
224
+
225
+ header("Content-Length: " . filesize($file_path));
226
+ flush(); // this doesn't really matter.
227
+ $fp = fopen($file_path, "r");
228
+ while (!feof($fp))
229
+ {
230
+ echo fread($fp, 65536);
231
+ flush(); // this is essential for large downloads
232
+ }
233
+ fclose($fp);
234
+
235
+
236
+ }
237
+
238
+
239
+
240
+
241
+ /**/
242
+
243
+
244
+
245
+
246
+
247
+ /**
248
+
249
 
250
  if ( $get_by_order_id > 0 )
251
  return $pdf->Output('invoice-' . $order_id . '.pdf', 'S');
253
  $pdf->Output('invoice-' . $order_id . '.pdf', 'D');
254
  else
255
  $pdf->Output('invoice-' . $order_id . '.pdf', 'I');
256
+
257
+ /**/
258
+
259
+
260
+
261
+
262
+
263
+
264
+
265
  }
266
 
267
  /**
includes/class-wcj-price-labels.php CHANGED
@@ -5,7 +5,7 @@
5
  * The WooCommerce Jetpack Price Labels class.
6
  *
7
  * @class WCJ_Price_Labels
8
- * @version 1.0.3
9
  * @category Class
10
  * @author Algoritmika Ltd.
11
  */
@@ -46,57 +46,47 @@ class WCJ_Price_Labels {
46
 
47
  // HOOKS
48
  // Main hooks
49
- if ( get_option( 'wcj_price_labels_enabled' ) == 'yes' ) {
50
 
51
- // Custom Price Labels hooks
52
- add_action( 'add_meta_boxes', array( $this, 'add_price_label_meta_box' ) );
53
-
54
- //////////////////////////////////////////////////////////////////////////////////////////////////////////////
55
- // Custom Price Labels - cart item price hooks
56
- //add_filter( 'woocommerce_cart_item_price_html', array( $this, 'custom_price' ), 999, 2 ); // depreciated?
57
- //add_filter( 'woocommerce_cart_item_price', array( $this, 'custom_price' ), 999, 2 );
58
-
59
- add_filter( 'woocommerce_get_price_html', array( $this, 'custom_price' ), 100, 2 );
60
-
61
- //if ( $labels_array[ 'variation_simple' ] == 'off' ) {
62
-
63
- // Custom Price Labels - price hooks
64
- add_filter( 'woocommerce_empty_price_html', array( $this, 'custom_price' ), 100, 2 );
65
- add_filter( 'woocommerce_free_price_html', array( $this, 'custom_price' ), 100, 2 );
66
- add_filter( 'woocommerce_free_sale_price_html', array( $this, 'custom_price' ), 100, 2 );
67
- add_filter( 'woocommerce_price_html', array( $this, 'custom_price' ), 100, 2 );
68
- add_filter( 'woocommerce_sale_price_html', array( $this, 'custom_price' ), 100, 2 );
69
- //}
70
-
71
- //if ( $labels_array[ 'variation_grouped' ] == 'off' ) {
72
-
73
- // Custom Price Labels - price hooks
74
- add_filter( 'woocommerce_grouped_price_html', array( $this, 'custom_price' ), 100, 2 );
75
- //}
76
-
77
- //if ( $labels_array[ 'variation_variable' ] == 'off' ) {
78
-
79
- // Custom Price Labels - price hooks
80
- add_filter( 'woocommerce_variable_empty_price_html', array( $this, 'custom_price' ), 100, 2 );
81
- add_filter( 'woocommerce_variable_free_price_html', array( $this, 'custom_price' ), 100, 2 );
82
- add_filter( 'woocommerce_variable_free_sale_price_html', array( $this, 'custom_price' ), 100, 2 );
83
- add_filter( 'woocommerce_variable_price_html', array( $this, 'custom_price' ), 100, 2 );
84
- add_filter( 'woocommerce_variable_sale_price_html', array( $this, 'custom_price' ), 100, 2 );
85
- //}
86
-
87
- //if ( $labels_array[ 'variation_variation' ] == 'off' ) {
88
-
89
- // Custom Price Labels - price hooks
90
- add_filter( 'woocommerce_variation_empty_price_html', array( $this, 'custom_price' ), 100, 2 );
91
- add_filter( 'woocommerce_variation_free_price_html', array( $this, 'custom_price' ), 100, 2 );
92
- //woocommerce_variation_option_name
93
- add_filter( 'woocommerce_variation_price_html', array( $this, 'custom_price' ), 100, 2 );
94
- add_filter( 'woocommerce_variation_sale_price_html', array( $this, 'custom_price' ), 100, 2 );
95
- //}
96
- //////////////////////////////////////////////////////////////////////////////////////////////////////////////
97
-
98
- // Custom Price Labels - save post hook
99
  add_action( 'save_post', array( $this, 'save_custom_price_labels' ), 999, 2 );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
100
  }
101
 
102
  // Settings hooks
@@ -232,11 +222,14 @@ class WCJ_Price_Labels {
232
  * front end
233
  */
234
  public function custom_price( $price, $product ) {
235
-
236
  $current_filter_name = current_filter();
237
 
238
  if ( ( 'woocommerce_get_price_html' === $current_filter_name ) && ( 'booking' !== $product->product_type ) )
239
  return $price;
 
 
 
240
 
241
  foreach ( $this->custom_tab_sections as $custom_tab_section ) {
242
 
@@ -266,8 +259,8 @@ class WCJ_Price_Labels {
266
  $text_to_remove = get_option( 'wcj_global_price_labels_remove_text' );
267
  if ( '' != $text_to_remove )
268
  $price = str_replace( $text_to_remove, '', $price );
269
-
270
- if ( $labels_array[ 'variation_enabled' ] == 'on' ) {
271
 
272
  if (
273
  ( ( $labels_array['variation_home'] == 'off' ) && ( is_front_page() ) ) ||
5
  * The WooCommerce Jetpack Price Labels class.
6
  *
7
  * @class WCJ_Price_Labels
8
+ * @version 1.3.0
9
  * @category Class
10
  * @author Algoritmika Ltd.
11
  */
46
 
47
  // HOOKS
48
  // Main hooks
49
+ if ( 'yes' === get_option( 'wcj_price_labels_enabled' ) ) {
50
 
51
+ // Add meta box
52
+ add_action( 'add_meta_boxes', array( $this, 'add_price_label_meta_box' ) );
53
+ // Save Post
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
  add_action( 'save_post', array( $this, 'save_custom_price_labels' ), 999, 2 );
55
+
56
+ // Prices Hooks
57
+ $this->prices_filters = array(
58
+ // Cart
59
+ 'woocommerce_cart_item_price',
60
+ // Composite Products
61
+ 'woocommerce_composite_sale_price_html',
62
+ 'woocommerce_composite_price_html',
63
+ 'woocommerce_composite_empty_price_html',
64
+ 'woocommerce_composite_free_sale_price_html',
65
+ 'woocommerce_composite_free_price_html',
66
+ // Booking Products
67
+ 'woocommerce_get_price_html',
68
+ // Simple Products
69
+ 'woocommerce_empty_price_html',
70
+ 'woocommerce_free_price_html',
71
+ 'woocommerce_free_sale_price_html',
72
+ 'woocommerce_price_html',
73
+ 'woocommerce_sale_price_html',
74
+ // Grouped Products
75
+ 'woocommerce_grouped_price_html',
76
+ // Variable Products
77
+ 'woocommerce_variable_empty_price_html',
78
+ 'woocommerce_variable_free_price_html',
79
+ 'woocommerce_variable_free_sale_price_html',
80
+ 'woocommerce_variable_price_html',
81
+ 'woocommerce_variable_sale_price_html',
82
+ // Variable Products - Variations
83
+ 'woocommerce_variation_empty_price_html',
84
+ 'woocommerce_variation_free_price_html',
85
+ 'woocommerce_variation_price_html',
86
+ 'woocommerce_variation_sale_price_html',
87
+ );
88
+ foreach ( $this->prices_filters as $the_filter )
89
+ add_filter( $the_filter, array( $this, 'custom_price' ), 100, 2 );
90
  }
91
 
92
  // Settings hooks
222
  * front end
223
  */
224
  public function custom_price( $price, $product ) {
225
+
226
  $current_filter_name = current_filter();
227
 
228
  if ( ( 'woocommerce_get_price_html' === $current_filter_name ) && ( 'booking' !== $product->product_type ) )
229
  return $price;
230
+
231
+ if ( 'woocommerce_cart_item_price' === $current_filter_name )
232
+ $product = $product['data'];
233
 
234
  foreach ( $this->custom_tab_sections as $custom_tab_section ) {
235
 
259
  $text_to_remove = get_option( 'wcj_global_price_labels_remove_text' );
260
  if ( '' != $text_to_remove )
261
  $price = str_replace( $text_to_remove, '', $price );
262
+
263
+ if ( $labels_array[ 'variation_enabled' ] == 'on' ) {
264
 
265
  if (
266
  ( ( $labels_array['variation_home'] == 'off' ) && ( is_front_page() ) ) ||
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://algoritmika.com/donate/
4
  Tags: 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
5
  Requires at least: 3.9.1
6
  Tested up to: 4.0
7
- Stable tag: 1.5.3
8
  License: GNU General Public License v3.0
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -63,26 +63,24 @@ Please let us know if you want anything added to list by <a href="http://woojetp
63
 
64
  If you wish that some task would go up the queue to make it faster, please contact us by <a href="http://woojetpack.com/contact-us/">filling this form</a>. We are listening carefully to our users!
65
 
66
- = 1.6.0 - 22/09/2014 =
67
- * New Feature - Smart Reports - Various reports based on products prices, sales, stock.
68
  * Fix - Payment Gateways - Instructions are not showing. Suggested by Jen.
 
 
 
69
  * Upgrade Feature - Shipping - Advance free shipping - Free shipping for multiple country/places. Each country/places different prices. Idea by LQTOYS.
70
- * Dev - Custom Price Labels - Rearrange settings in product edit (something like `postbox`es).
71
  * Upgrade Feature - Custom Price Labels - Add price countdown.
72
- * Upgrade Feature - Custom Price Labels - Add labels to `cart` and `checkout` pages. Idea by Stephanie.
73
  * Upgrade Feature - Orders - Minimum order amount - Stop customer from seeing the checkout page if below minimum order amount. Idea by Augen.
74
- * Dev - Custom CSS - Need to add custom CSS option (problem with color of price matching the background in mimum order amount message; suggested by Augen).
75
-
76
- = 1.7.0 - 01/10/2014 =
77
  * Upgrade Feature - Custom Price Labels - Add "global labels".
78
  * Upgrade Feature - Shipping - Add "Custom Shipping Method".
79
  * Upgrade Feature - Product Info - Add "total sales" and "time since last sale" info.
80
  * Upgrade Feature - Product Info - Add widget.
81
  * Upgrade Feature - Orders - Custom Order Statuses - Add options for selecting icons and color.
82
- * New Feature - Add second currency to the price.
83
- * Dev - PDF Invoices - Separate numbering for invoices option, then can add `add_order_number_to_invoice` option.
84
  * Upgrade Feature - PDF Invoices - Make emailing PDF as attachment option available for certain payment methods only (user selection). Idea by Jen.
85
  * Upgrade Feature - PDF Invoices - Sending invoice on customer's request. Idea by Jen.
 
 
 
86
 
87
  = 1.8.0 - 07/10/2014 =
88
  * New Feature - Products per Page - Add "products per page" option for customers (i.e. front end).
@@ -108,6 +106,13 @@ If you wish that some task would go up the queue to make it faster, please conta
108
 
109
  == Changelog ==
110
 
 
 
 
 
 
 
 
111
  = 1.5.3 - 20/09/2014 =
112
  * Fix - Smart Reports beta version enabled too soon, fixed.
113
 
4
  Tags: 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
5
  Requires at least: 3.9.1
6
  Tested up to: 4.0
7
+ Stable tag: 1.6.0
8
  License: GNU General Public License v3.0
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
63
 
64
  If you wish that some task would go up the queue to make it faster, please contact us by <a href="http://woojetpack.com/contact-us/">filling this form</a>. We are listening carefully to our users!
65
 
66
+ = 1.7.0 - 01/10/2014 =
 
67
  * Fix - Payment Gateways - Instructions are not showing. Suggested by Jen.
68
+ * New Feature - General - Another Custom CSS tool.
69
+ * New Feature - Smart Reports - Various reports based on products prices, sales, stock.
70
+ * New Feature - Add second currency to the price.
71
  * Upgrade Feature - Shipping - Advance free shipping - Free shipping for multiple country/places. Each country/places different prices. Idea by LQTOYS.
 
72
  * Upgrade Feature - Custom Price Labels - Add price countdown.
 
73
  * Upgrade Feature - Orders - Minimum order amount - Stop customer from seeing the checkout page if below minimum order amount. Idea by Augen.
 
 
 
74
  * Upgrade Feature - Custom Price Labels - Add "global labels".
75
  * Upgrade Feature - Shipping - Add "Custom Shipping Method".
76
  * Upgrade Feature - Product Info - Add "total sales" and "time since last sale" info.
77
  * Upgrade Feature - Product Info - Add widget.
78
  * Upgrade Feature - Orders - Custom Order Statuses - Add options for selecting icons and color.
 
 
79
  * Upgrade Feature - PDF Invoices - Make emailing PDF as attachment option available for certain payment methods only (user selection). Idea by Jen.
80
  * Upgrade Feature - PDF Invoices - Sending invoice on customer's request. Idea by Jen.
81
+ * Upgrade Feature - PDF Invoices - Separate numbering for invoices option, then can add `add_order_number_to_invoice` option.
82
+ * Upgrade Feature - Custom CSS - Need to add custom CSS option (problem with color of price matching the background in minimum order amount message; suggested by Augen).
83
+ * Dev - Custom Price Labels - Rearrange settings in product edit (something like `postbox`es).
84
 
85
  = 1.8.0 - 07/10/2014 =
86
  * New Feature - Products per Page - Add "products per page" option for customers (i.e. front end).
106
 
107
  == Changelog ==
108
 
109
+ = 1.6.0 - 22/09/2014 =
110
+ * Fix - PDF Invoices - Wrong headers for PDF sent, fixed.
111
+ This was previously causing a bug when `.html` file extension was wrongly added to PDF. Suggested by Pete (reported from Safari, Mac).
112
+ * Feature Upgraded - Custom Price Labels - Labels for Item price on Cart page included. Idea by Stephanie.
113
+ * Feature Upgraded - Custom Price Labels - Labels for Composite products included. Idea by Pete.
114
+ * Dev - Custom Price Labels - All price filters added to `prices_filters` array.
115
+
116
  = 1.5.3 - 20/09/2014 =
117
  * Fix - Smart Reports beta version enabled too soon, fixed.
118
 
woocommerce-jetpack.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: WooCommerce Jetpack
4
  Plugin URI: http://woojetpack.com
5
  Description: Supercharge your WooCommerce site with these awesome powerful features.
6
- Version: 1.5.3
7
  Author: Algoritmika Ltd
8
  Author URI: http://www.algoritmika.com
9
  Copyright: © 2014 Algoritmika Ltd.
3
  Plugin Name: WooCommerce Jetpack
4
  Plugin URI: http://woojetpack.com
5
  Description: Supercharge your WooCommerce site with these awesome powerful features.
6
+ Version: 1.6.0
7
  Author: Algoritmika Ltd
8
  Author URI: http://www.algoritmika.com
9
  Copyright: © 2014 Algoritmika Ltd.