• Resolved hypostatic

    (@hypostatic)


    In orders page when printing packing slips there appears green “ok” mark in pdf to indicate it’s printed. It would be really nice if mark is bigger. Or maybe background could be green?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor alexmigf

    (@alexmigf)

    Hello @hypostatic

    Could you try adding the code snippet below?

    add_action( 'wpo_wcpdf_before_document', function( $document_type, $order ) {
    	$order->update_meta_data( "wpo_wcpdf_{$document_type}_last_printed", date_i18n( 'Y-m-d H:i:s' ) );
    	$order->save_meta_data();
    }, 10, 2 );
    
    add_filter( 'wpo_wcpdf_action_button_class', function( $class, $document ) {
    	if ( $order = $document->order ) {
    		$document_type = $document->get_type();
    		$printed = $order->get_meta( "wpo_wcpdf_{$document_type}_last_printed" );
    		if ( !empty( $printed ) ) {
    			$class .= " printed";
    		}
    	}
    	return $class;
    }, 10, 2 );
    
    add_action('admin_enqueue_scripts', function(){
    	wp_add_inline_style( 'wpo-wcpdf-order-styles', '.wpo_wcpdf.button.exists:not(.printed):after { color: grey !important; }' );
    }, 99999 );

    It should display a grey checkmark for created documents and a green checkmark for printed ones:

    If you never worked with actions/filters please read the documentation page: How to use filters

    • This reply was modified 3 years, 6 months ago by alexmigf.
    Thread Starter hypostatic

    (@hypostatic)

    There is green check mark already. It’s too tiny.

    Plugin Contributor alexmigf

    (@alexmigf)

    Hi @hypostatic

    Sorry, I have updated my comment above.

    Thread Starter hypostatic

    (@hypostatic)

    Thanks. Now it’s different color. Still same tiny check mark.

    Plugin Contributor alexmigf

    (@alexmigf)

    Hi @hypostatic

    Please add the code snippet below too:

    add_action( 'admin_head', function() {
    	?>
    	<style>
    		.wc_actions a.wpo_wcpdf::after {
    			font-size: 30px !important;
    			left: 0 !important;
    			top: -10px !important;
    		}
    	</style>
    	<?php
    } );
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Show printed pdfs more clearly’ is closed to new replies.