Allow extensions to hijack i18n_product_type_alert

This commit is contained in:
thenbrent 2014-08-20 15:46:30 -07:00 committed by Ninos Ego
parent e2aaafa599
commit ece4b83562
1 changed files with 6 additions and 4 deletions

View File

@ -91,10 +91,6 @@ jQuery( function( $ ){
// Get value
var select_val = $( this ).val();
if ( 'variable' !== select_val && 0 < $( '#variable_product_options input[name^=variable_sku]' ).length ) {
window.alert( woocommerce_admin_meta_boxes.i18n_product_type_alert );
}
if ( 'variable' === select_val ) {
$( 'input#_manage_stock' ).change();
$( 'input#_downloadable' ).prop( 'checked', false );
@ -115,6 +111,12 @@ jQuery( function( $ ){
}).change();
$( 'body' ).on( 'woocommerce-product-type-change', function( e, select_val ) {
if ( 'variable' !== select_val && 0 < $( '#variable_product_options input[name^=variable_sku]' ).length && $( 'body' ).triggerHandler( 'woocommerce-display-product-type-alert', select_val ) !== false ) {
window.alert( woocommerce_admin_meta_boxes.i18n_product_type_alert );
}
});
$('input#_downloadable, input#_virtual').change(function(){
show_and_hide_panels();
});