plugin updates

This commit is contained in:
Tony Volpe
2024-09-17 10:43:54 -04:00
parent 44b413346f
commit b7c8882c8c
1359 changed files with 58219 additions and 11364 deletions

View File

@@ -157,10 +157,10 @@ jQuery( function( $ ) {
wc_checkout_form.reset_update_checkout_timer();
wc_checkout_form.updateTimer = setTimeout( wc_checkout_form.maybe_update_checkout, '1000' );
},
trigger_update_checkout: function() {
trigger_update_checkout: function( event ) {
wc_checkout_form.reset_update_checkout_timer();
wc_checkout_form.dirtyInput = false;
$( document.body ).trigger( 'update_checkout' );
$( document.body ).trigger( 'update_checkout', { current_target: event ? event.currentTarget : null } );
},
maybe_update_checkout: function() {
var update_totals = true;
@@ -425,6 +425,16 @@ jQuery( function( $ ) {
// Re-init methods
wc_checkout_form.init_payment_methods();
// If there is no errors and the checkout update was triggered by changing the shipping method, focus its radio input.
if (
data &&
'success' === data.result &&
args.current_target &&
args.current_target.id.indexOf( 'shipping_method' ) !== -1
) {
document.getElementById( args.current_target.id ).focus();
}
// Fire updated_checkout event.
$( document.body ).trigger( 'updated_checkout', [ data ] );
}