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.