Created
April 8, 2026 09:09
-
-
Save xlplugins/b39a490bfbe248a2a9b2d2ef691fe688 to your computer and use it in GitHub Desktop.
Shipping Insurance Manager for WooCommerce running shimmer on change
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_action( | |
| 'wp_enqueue_scripts', | |
| static function (): void { | |
| if ( ! wp_script_is( 'wfacp_checkout_js', 'enqueued' ) ) { | |
| return; | |
| } | |
| wp_add_inline_script( | |
| 'wfacp_checkout_js', | |
| <<<'JS' | |
| jQuery(function ($) { | |
| $(window).on('bwf_checkout_load', function () { | |
| window.refresh_page_data_load_trigger = true; | |
| }); | |
| $(document.body).on('change', 'input[name^="shipping_method"]', function () { | |
| window.refresh_page_data_load_trigger = true; | |
| }); | |
| $(document.body).on('click change', 'input[name="shipping_insurance_package"]', function () { | |
| window.refresh_page_data_load_trigger = true; | |
| $('.shipping-insurance').addClass('shimmer-effect'); | |
| setTimeout(function () { | |
| $('.shipping-insurance').removeClass('shimmer-effect'); | |
| }, 1500); | |
| }); | |
| }); | |
| JS | |
| , | |
| 'after' | |
| ); | |
| }, | |
| 110 | |
| ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment