Created
April 7, 2019 18:05
-
-
Save Ephemerich/cd4c8ec76844ea1126cfbf4c2ec0ae4f to your computer and use it in GitHub Desktop.
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
| <?php | |
| add_action('wp_footer', function(){ | |
| if(!function_exists('is_checkout') || !is_checkout()) { | |
| return; | |
| } | |
| ?> | |
| <script> | |
| (function($){ | |
| var $doc = $(document); | |
| var $body = $('body'); | |
| $doc.ready(function(){ | |
| function updateBillingPostCode(e){ | |
| var $this = $(this); | |
| var value = $this.val(); | |
| // console.log(value); | |
| var $target = $('#billing_postcode'); | |
| if($target.length > 0) { | |
| $target.val(value); | |
| $body.trigger('update_checkout'); | |
| } | |
| } | |
| $doc.on('change', '#billing_address_type', updateBillingPostCode); | |
| }); | |
| })(jQuery); | |
| </script> | |
| <?php | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment