Skip to content

Commit

Permalink
Tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
alexmigf committed Sep 22, 2023
1 parent 7e0ccae commit 3201cd8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion assets/js/debug-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ jQuery( function( $ ) {
$( document.body ).on( 'click', '#wpo-wcpdf-settings a.number-search-button', function( e ) {
e.preventDefault();

let search_val = $( this ).closest( 'div' ).find( ':input' ).val();
let search_val = $( this ).closest( 'div' ).find( ':input[name="number_search_input"]' ).val();
window.location.href = window.location.href + '&s=' + search_val;
} );

Expand Down
9 changes: 7 additions & 2 deletions includes/settings/class-wcpdf-settings-debug.php
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,13 @@ public function display_numbers() {
</p>
<p><?php _e( 'Numbers may have been assigned to orders before this.', 'woocommerce-pdf-invoices-packing-slips' ); ?></p>
<div class="number-search" style="text-align:right;">
<input type="search" id="number_search" name="s" value="">
<a href="#" class="button number-search-button"><?php _e( 'Search number', 'woocommerce-pdf-invoices-packing-slips' ); ?></a>
<input type="search" id="number_search_input" name="number_search_input" value="<?php echo isset( $_REQUEST['s'] ) ? esc_attr( $_REQUEST['s'] ) : ''; ?>">
<a href="#" class="button button-primary number-search-button"><?php _e( 'Search number', 'woocommerce-pdf-invoices-packing-slips' ); ?></a>
<?php if( isset( $_REQUEST['s'] ) && ! empty( $_REQUEST['s'] ) ) : ?>
<a href="<?php echo esc_url( remove_query_arg( 's' ) ); ?>" class="button button-secondary"><?php _e( 'Reset', 'woocommerce-pdf-invoices-packing-slips' ); ?></a>
<?php else : ?>
<a href="#" class="button button-secondary" disabled><?php _e( 'Reset', 'woocommerce-pdf-invoices-packing-slips' ); ?></a>
<?php endif; ?>
</div>
<?php $list_table->display(); ?>
<?php else : ?>
Expand Down

0 comments on commit 3201cd8

Please sign in to comment.