plugin updates
This commit is contained in:
@@ -22,10 +22,11 @@
|
||||
self.$form.off( '.wc-variation-form' );
|
||||
|
||||
// Methods.
|
||||
self.getChosenAttributes = self.getChosenAttributes.bind( self );
|
||||
self.findMatchingVariations = self.findMatchingVariations.bind( self );
|
||||
self.isMatch = self.isMatch.bind( self );
|
||||
self.toggleResetLink = self.toggleResetLink.bind( self );
|
||||
self.getChosenAttributes = self.getChosenAttributes.bind( self );
|
||||
self.findMatchingVariations = self.findMatchingVariations.bind( self );
|
||||
self.isMatch = self.isMatch.bind( self );
|
||||
self.toggleResetLink = self.toggleResetLink.bind( self );
|
||||
self.showNoMatchingVariationsMsg = self.showNoMatchingVariationsMsg.bind( self );
|
||||
|
||||
// Events.
|
||||
$form.on( 'click.wc-variation-form', '.reset_variations', { variationForm: self }, self.onReset );
|
||||
@@ -185,14 +186,7 @@
|
||||
attributes.chosenCount = 0;
|
||||
|
||||
if ( ! form.loading ) {
|
||||
form.$form
|
||||
.find( '.single_variation' )
|
||||
.after(
|
||||
'<p class="wc-no-matching-variations woocommerce-info">' +
|
||||
wc_add_to_cart_variation_params.i18n_no_matching_variations_text +
|
||||
'</p>'
|
||||
);
|
||||
form.$form.find( '.wc-no-matching-variations' ).slideDown( 200 );
|
||||
form.showNoMatchingVariationsMsg();
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -213,14 +207,7 @@
|
||||
attributes.chosenCount = 0;
|
||||
|
||||
if ( ! form.loading ) {
|
||||
form.$form
|
||||
.find( '.single_variation' )
|
||||
.after(
|
||||
'<p class="wc-no-matching-variations woocommerce-info">' +
|
||||
wc_add_to_cart_variation_params.i18n_no_matching_variations_text +
|
||||
'</p>'
|
||||
);
|
||||
form.$form.find( '.wc-no-matching-variations' ).slideDown( 200 );
|
||||
form.showNoMatchingVariationsMsg();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -328,7 +315,7 @@
|
||||
var form = event.data.variationForm;
|
||||
|
||||
form.$form.find( 'input[name="variation_id"], input.variation_id' ).val( '' ).trigger( 'change' );
|
||||
form.$form.find( '.wc-no-matching-variations' ).remove();
|
||||
form.$form.find( '.wc-no-matching-variations' ).parent().remove();
|
||||
|
||||
if ( form.useAjax ) {
|
||||
form.$form.trigger( 'check_variations' );
|
||||
@@ -569,6 +556,24 @@
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Show no matching variation message.
|
||||
*/
|
||||
VariationForm.prototype.showNoMatchingVariationsMsg = function() {
|
||||
this.$form
|
||||
.find( '.single_variation' )
|
||||
.after(
|
||||
'<div role="alert">' +
|
||||
'<p class="wc-no-matching-variations woocommerce-info">' +
|
||||
wc_add_to_cart_variation_params.i18n_no_matching_variations_text +
|
||||
'</p>' +
|
||||
'</div>'
|
||||
)
|
||||
.next( 'div' )
|
||||
.find( '.wc-no-matching-variations' )
|
||||
.slideDown( 200 );
|
||||
};
|
||||
|
||||
/**
|
||||
* Function to call wc_variation_form on jquery selector.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user