Hide restock checkbox until qty is input Closes #6937
This commit is contained in:
parent
c4812461da
commit
5c86e962e8
|
@ -286,6 +286,18 @@ jQuery( function ( $ ) {
|
|||
}
|
||||
});
|
||||
|
||||
// Restock checkbox
|
||||
if ( refund_qty > 0 ) {
|
||||
$( '#restock_refunded_items' ).closest('tr').show();
|
||||
} else {
|
||||
$( '#restock_refunded_items' ).closest('tr').hide();
|
||||
$('.woocommerce_order_items input.refund_order_item_qty').each(function(){
|
||||
if ( $(this).val() > 0 ) {
|
||||
$( '#restock_refunded_items' ).closest('tr').show();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$( this ).trigger( 'refund_quantity_changed' );
|
||||
})
|
||||
.on( 'change', '.woocommerce_order_items .refund input', function() {
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -250,7 +250,7 @@ if ( wc_tax_enabled() ) {
|
|||
<?php if ( ( $order->get_total() - $order->get_total_refunded() ) > 0 ) : ?>
|
||||
<div class="wc-order-data-row wc-order-refund-items" style="display: none;">
|
||||
<table class="wc-order-totals">
|
||||
<tr>
|
||||
<tr style="display:none;">
|
||||
<td class="label"><label for="restock_refunded_items"><?php _e( 'Restock refunded items', 'woocommerce' ); ?>:</label></td>
|
||||
<td class="total"><input type="checkbox" id="restock_refunded_items" name="restock_refunded_items" checked="checked" /></td>
|
||||
</tr>
|
||||
|
|
Loading…
Reference in New Issue