Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can i disable extra information from being printed #30

Open
chetanhit opened this issue Jan 23, 2024 · 3 comments
Open

How can i disable extra information from being printed #30

chetanhit opened this issue Jan 23, 2024 · 3 comments

Comments

@chetanhit
Copy link

chetanhit commented Jan 23, 2024

Hi,
How can i disable extra information from being printed. I know there is an option to hide hidden fields on the plugin but when i choose this option it also hide pickup and delivery time on printout.

IMG-20240123-WA0009

@gfrino
Copy link

gfrino commented Jan 27, 2024

Fatal error: Uncaught TypeError: html_entity_decode(): Argument #1 ($string) must be of type string, array given in /var/www/webroot/ROOT/wp-content/plugins/star-cloudprnt-for-woocommerce/order-handler.inc.php:120 Stack trace: #0 /var/www/webroot/ROOT/wp-content/plugins/star-cloudprnt-for-woocommerce/order-handler.inc.php(120): html_entity_decode() #1 /var/www/webroot/ROOT/wp-content/plugins/star-cloudprnt-for-woocommerce/order-handler.php(158): star_cloudprnt_filter_html() #2 /var/www/webroot/ROOT/wp-content/plugins/star-cloudprnt-for-woocommerce/order-handler.php(384): star_cloudprnt_print_additional_order_info() #3 /var/www/webroot/ROOT/wp-content/plugins/star-cloudprnt-for-woocommerce/order-handler.inc.php(194): star_cloudprnt_print_order_summary() #4 /var/www/webroot/ROOT/wp-content/plugins/star-cloudprnt-for-woocommerce/order-handler.inc.php(209): star_cloudprnt_trigger_print() #5 /var/www/webroot/ROOT/wp-includes/class-wp-hook.php(324): star_cloudprnt_reprint() #6 /var/www/webroot/ROOT/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters() #7 /var/www/webroot/ROOT/wp-includes/plugin.php(517): WP_Hook->do_action() #8 /var/www/webroot/ROOT/wp-content/plugins/woocommerce/includes/admin/meta-boxes/class-wc-meta-box-order-actions.php(173): do_action() #9 /var/www/webroot/ROOT/wp-includes/class-wp-hook.php(324): WC_Meta_Box_Order_Actions::save() #10 /var/www/webroot/ROOT/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters() #11 /var/www/webroot/ROOT/wp-includes/plugin.php(517): WP_Hook->do_action() #12 /var/www/webroot/ROOT/wp-content/plugins/woocommerce/includes/admin/class-wc-admin-meta-boxes.php(263): do_action() #13 /var/www/webroot/ROOT/wp-includes/class-wp-hook.php(326): WC_Admin_Meta_Boxes->save_meta_boxes() #14 /var/www/webroot/ROOT/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters() #15 /var/www/webroot/ROOT/wp-includes/plugin.php(517): WP_Hook->do_action() #16 /var/www/webroot/ROOT/wp-includes/post.php(4760): do_action() #17 /var/www/webroot/ROOT/wp-includes/post.php(4862): wp_insert_post() #18 /var/www/webroot/ROOT/wp-admin/includes/post.php(453): wp_update_post() #19 /var/www/webroot/ROOT/wp-admin/post.php(227): edit_post() #20 {main} thrown in /var/www/webroot/ROOT/wp-content/plugins/star-cloudprnt-for-woocommerce/order-handler.inc.php on line 120

@chetanhit
Copy link
Author

Fatal error: Uncaught TypeError: html_entity_decode(): Argument #1 ($string) must be of type string, array given in /var/www/webroot/ROOT/wp-content/plugins/star-cloudprnt-for-woocommerce/order-handler.inc.php:120 Stack trace: #0 /var/www/webroot/ROOT/wp-content/plugins/star-cloudprnt-for-woocommerce/order-handler.inc.php(120): html_entity_decode() #1 /var/www/webroot/ROOT/wp-content/plugins/star-cloudprnt-for-woocommerce/order-handler.php(158): star_cloudprnt_filter_html() #2 /var/www/webroot/ROOT/wp-content/plugins/star-cloudprnt-for-woocommerce/order-handler.php(384): star_cloudprnt_print_additional_order_info() #3 /var/www/webroot/ROOT/wp-content/plugins/star-cloudprnt-for-woocommerce/order-handler.inc.php(194): star_cloudprnt_print_order_summary() #4 /var/www/webroot/ROOT/wp-content/plugins/star-cloudprnt-for-woocommerce/order-handler.inc.php(209): star_cloudprnt_trigger_print() #5 /var/www/webroot/ROOT/wp-includes/class-wp-hook.php(324): star_cloudprnt_reprint() #6 /var/www/webroot/ROOT/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters() #7 /var/www/webroot/ROOT/wp-includes/plugin.php(517): WP_Hook->do_action() #8 /var/www/webroot/ROOT/wp-content/plugins/woocommerce/includes/admin/meta-boxes/class-wc-meta-box-order-actions.php(173): do_action() #9 /var/www/webroot/ROOT/wp-includes/class-wp-hook.php(324): WC_Meta_Box_Order_Actions::save() #10 /var/www/webroot/ROOT/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters() #11 /var/www/webroot/ROOT/wp-includes/plugin.php(517): WP_Hook->do_action() #12 /var/www/webroot/ROOT/wp-content/plugins/woocommerce/includes/admin/class-wc-admin-meta-boxes.php(263): do_action() #13 /var/www/webroot/ROOT/wp-includes/class-wp-hook.php(326): WC_Admin_Meta_Boxes->save_meta_boxes() #14 /var/www/webroot/ROOT/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters() #15 /var/www/webroot/ROOT/wp-includes/plugin.php(517): WP_Hook->do_action() #16 /var/www/webroot/ROOT/wp-includes/post.php(4760): do_action() #17 /var/www/webroot/ROOT/wp-includes/post.php(4862): wp_insert_post() #18 /var/www/webroot/ROOT/wp-admin/includes/post.php(453): wp_update_post() #19 /var/www/webroot/ROOT/wp-admin/post.php(227): edit_post() #20 {main} thrown in /var/www/webroot/ROOT/wp-content/plugins/star-cloudprnt-for-woocommerce/order-handler.inc.php on line 120

Thankx for the reply... but I didn't understand... what is this?

@kjarret
Copy link

kjarret commented Mar 8, 2024

In order-handler.php, comment the following lines on star_cloudprnt_print_additional_order_info function:

	function star_cloudprnt_print_additional_order_info(&$printer, &$selectedPrinter, &$order, &$order_meta)
	{
		if(get_option('star-cloudprnt-print-order-meta-cb') != "on")
			return;
		
		$max_chars = $selectedPrinter['columns'];
		$meta_data = $order->get_meta_data();

		$is_printed = false;

		$print_hidden = get_option('star-cloudprnt-print-order-meta-hidden') == 'on';
		$excluded_keys = array_map('trim', explode(',', esc_attr(get_option('star-cloudprnt-print-order-meta-exclusions'))));

		foreach ($meta_data as $item_id => $meta_data_item)
		{
			$item_data = $meta_data_item->get_data();

			// Skip any keys in the exclusion list
			if(in_array($item_data["key"], $excluded_keys))
				continue;

			// Skip hidden fields (any field whose key begins with a "_", by convention)
			if(!$print_hidden && mb_substr($item_data["key"], 0, 1) == "_")
				continue;

/*			
			if(! $is_printed)
			{
				$is_printed = true;
				$printer->add_text_line("");
				$printer->set_text_emphasized();
				$printer->add_text_line("Additional Order Information");
				$printer->cancel_text_emphasized();
			}

			$formatted_key = $item_data["key"];
			if(get_option('star-cloudprnt-print-order-meta-reformat-keys') == 'on')
				$formatted_key = mb_convert_case(mb_ereg_replace("_", " ", $formatted_key), MB_CASE_TITLE);

			$printer->add_text_line(star_cloudprnt_filter_html($formatted_key) . ": " . star_cloudprnt_filter_html($item_data["value"]));
		}

		//if($is_printed)	$printer->add_text_line("");
	}
*/
		}
	}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants