Skip to content

Commit c4ff326

Browse files
committed
Remove blan line printing when Ttitle is empty.
Set version to 2.0.1 ready to publish
1 parent 3162111 commit c4ff326

File tree

3 files changed

+19
-14
lines changed

3 files changed

+19
-14
lines changed

order-handler.php

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ function star_cloudprnt_print_additional_order_info(&$printer, &$selectedPrinter
131131
if(! $is_printed)
132132
{
133133
$is_printed = true;
134+
$printer->add_text_line("");
134135
$printer->set_text_emphasized();
135136
$printer->add_text_line("Additional Order Information");
136137
$printer->cancel_text_emphasized();
@@ -143,7 +144,7 @@ function star_cloudprnt_print_additional_order_info(&$printer, &$selectedPrinter
143144
$printer->add_text_line(star_cloudprnt_filter_html($formatted_key) . ": " . star_cloudprnt_filter_html($item_data["value"]));
144145
}
145146

146-
if($is_printed) $printer->add_text_line("");
147+
//if($is_printed) $printer->add_text_line("");
147148
}
148149

149150
// Print the address secion - currently this prints the shipping address if present, otherwise
@@ -213,21 +214,25 @@ function star_cloudprnt_print_receipt_header(&$printer, &$selectedPrinter, &$ord
213214
// Top of page Title
214215
$title_text = get_option('star-cloudprnt-print-header-title');
215216

216-
// Set formatting for title
217-
$printer->set_text_emphasized();
218-
$printer->set_text_center_align();
219-
$printer->set_font_magnification(2, 2);
217+
if(!empty($title_text))
218+
{
219+
// Set formatting for title
220+
$printer->set_text_emphasized();
221+
$printer->set_text_center_align();
222+
$printer->set_font_magnification(2, 2);
220223

221-
// Printthe title - word wrapped (NOTE - php wordwrap() is not multi-byte aware, and definitely not half/full width character aware)
222-
$printer->add_text_line(wordwrap($title_text, $selectedPrinter['columns']/2, "\n", true)); // Columns are divided by 2 because we are using double width characters.
224+
// Printthe title - word wrapped (NOTE - php wordwrap() is not multi-byte aware, and definitely not half/full width character aware)
225+
$printer->add_text_line(wordwrap($title_text, $selectedPrinter['columns']/2, "\n", true)); // Columns are divided by 2 because we are using double width characters.
223226

224-
// Reset text formatting
225-
$printer->set_text_left_align();
226-
$printer->cancel_text_emphasized();
227-
$printer->set_font_magnification(1, 1);
227+
// Reset text formatting
228+
$printer->set_text_left_align();
229+
$printer->cancel_text_emphasized();
230+
$printer->set_font_magnification(1, 1);
231+
232+
$printer->add_new_line(1);
233+
}
228234

229235
// Print sub-header
230-
$printer->add_new_line(1);
231236
$printer->add_text_line(star_cloudprnt_get_column_separated_data(
232237
array(
233238
"Order #".$order_number,

readme.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ This means that you printer is unable to connect with your server, and can have
111111
== Changelog ==
112112

113113
= 2.0.1 =
114-
* Do not print any blank lines if the items footer text is empty
114+
* Do not print any blank lines when the title, or item footer text is empty
115115
* Add some mailchimp metadata key names to the defailt exclusions list
116116
* Change the timing for registering settings, to avoid reported issue with accessing settings with their default value.
117117
* Remove all settings when uninstalled

star-cloudprnt-for-woocommerce.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Plugin Name: Star CloudPRNT for WooCommerce
44
* Plugin URI: http://www.star-emea.com
55
* Description: Star CloudPRNT for WooCommerce enables cloud printing technology with your Star Receipt printer.
6-
* Version: 2.0.1 beta 01
6+
* Version: 2.0.1
77
* Author: lawrenceowen, athompson1, gcubero, fmahmood
88
* Author URI: http://www.star-emea.com/support
99
* Requires at least: 5.0

0 commit comments

Comments
 (0)