Control categories export field based on export type
This commit is contained in:
parent
5724b65449
commit
08e9d0bdc9
|
@ -15,6 +15,7 @@
|
|||
|
||||
// Events.
|
||||
$form.on( 'submit', { productExportForm: this }, this.onSubmit );
|
||||
$form.find( '.woocommerce-exporter-types' ).on( 'change', { productExportForm: this }, this.exportTypeFields );
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -84,6 +85,20 @@
|
|||
} );
|
||||
};
|
||||
|
||||
/**
|
||||
* Handle fields per export type.
|
||||
*/
|
||||
productExportForm.prototype.exportTypeFields = function() {
|
||||
var exportCategory = $( '.woocommerce-exporter-category' );
|
||||
|
||||
if ( -1 !== $.inArray( 'variation', $( this ).val() ) ) {
|
||||
exportCategory.closest( 'tr' ).hide();
|
||||
exportCategory.val( '' ).change(); // Reset WooSelect selected value.
|
||||
} else {
|
||||
exportCategory.closest( 'tr' ).show();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Function to call productExportForm on jquery selector.
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue