wpovernight / woocommerce-pdf-invoices-packing-slips

Create, print & automatically email PDF invoices & packing slips for WooCommerce orders.
https://wordpress.org/plugins/woocommerce-pdf-invoices-packing-slips/
Other
99 stars 45 forks source link

Display and updated in process documents in PDF document data metabox #782

Open MohamadNateqi opened 2 months ago

MohamadNateqi commented 2 months ago

close https://github.com/wpovernight/woocommerce-pdf-invoices-packing-slips/issues/756

This PR improves the way document data are displayed in the metabox. It includes a check for pending jobs and displays a message if the document is still in the queue. It also adds an AJAX request that refreshes document data, eliminating the need to refresh the page.

Note: For the Pro extension compatibility, this branch should be used: https://github.com/wpovernight/woocommerce-pdf-ips-pro/pull/407


For test purposes, the below snippet can be used to stop the queue from running jobs:

function wpo_disable_default_runner() {
    if ( class_exists( 'ActionScheduler' ) ) {
        remove_action( 'action_scheduler_run_queue', array( ActionScheduler::runner(), 'run' ) );
    }
}

add_action( 'init', 'wpo_disable_default_runner', 10 );

Then, the job can be manually run to test the AJAX update.

alexmigf commented 13 minutes ago

@MohamadNateqi can you fix the conflicts?