Is there a way to refresh checkout without Javascript?
-
Hello – We are using a code snippet to add a credit card fee to a particular payment method and it is dependent on Javascript being enabled. Is there an alternative method of updating the checkout without using Javascript? Here is the code snippet we currently use for refreshing checkout.
add_action( 'woocommerce_review_order_before_payment', 'bt_refresh_payment_method' ); function bt_refresh_payment_method(){ // jQuery ?> <script type="text/javascript"> (function($){ $( 'form.checkout' ).on( 'change', 'input[name^="payment_method"]', function() { $('body').trigger('update_checkout'); }); })(jQuery); </script> <?php }
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Is there a way to refresh checkout without Javascript?’ is closed to new replies.