Skip to content

Commit

Permalink
Tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
alexmigf committed Dec 12, 2024
1 parent a44e710 commit 7ea026a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
5 changes: 5 additions & 0 deletions assets/js/order-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ jQuery( function( $ ) {
let parts = action.split( '_' );
documentType = parts[0];
outputFormat = parts[1];

// Check if outputFormat is in wpo_wcpdf_ajax.xml_formats
if ( ! wpo_wcpdf_ajax.xml_formats.includes( outputFormat ) ) {
outputFormat = 'pdf';
}
}

$( 'tbody th.check-column input[type="checkbox"]:checked' ).each(
Expand Down
11 changes: 6 additions & 5 deletions includes/Assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,12 @@ public function backend_scripts_styles ( $hook ) {
'wpo-wcpdf',
'wpo_wcpdf_ajax',
array(
'ajaxurl' => admin_url( 'admin-ajax.php' ), // URL to WordPress ajax handling page
'nonce' => wp_create_nonce( 'generate_wpo_wcpdf' ),
'bulk_actions' => array_keys( wcpdf_get_bulk_actions() ),
'select_orders' => __( 'You have to select order(s) first!', 'woocommerce-pdf-invoices-packing-slips'),
'confirm_delete' => __( 'Are you sure you want to delete this document? This cannot be undone.', 'woocommerce-pdf-invoices-packing-slips'),
'ajaxurl' => admin_url( 'admin-ajax.php' ), // URL to WordPress ajax handling page
'nonce' => wp_create_nonce( 'generate_wpo_wcpdf' ),
'bulk_actions' => array_keys( wcpdf_get_bulk_actions() ),
'xml_formats' => apply_filters( 'wpo_wcpdf_xml_formats', array( 'ubl' ) ),
'select_orders' => __( 'You have to select order(s) first!', 'woocommerce-pdf-invoices-packing-slips'),
'confirm_delete' => __( 'Are you sure you want to delete this document? This cannot be undone.', 'woocommerce-pdf-invoices-packing-slips'),
'confirm_regenerate' => __( 'Are you sure you want to regenerate this document? This will make the document reflect the most current settings (such as footer text, document name, etc.) rather than using historical settings.', 'woocommerce-pdf-invoices-packing-slips'),
'sticky_document_data_metabox' => apply_filters( 'wpo_wcpdf_sticky_document_data_metabox', true ),
)
Expand Down

0 comments on commit 7ea026a

Please sign in to comment.