Created
August 26, 2020 12:56
-
-
Save hxii/42bcf21990eacb458d7f2b86d7fc0ee4 to your computer and use it in GitHub Desktop.
Update WooCommerce variation text 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
<?php | |
// Add from here | |
function ele_update_sku() { | |
?> | |
<script type="text/javascript"> | |
jQuery( document ).ready( function($) { | |
$( ".single_variation_wrap" ).on( "show_variation", function ( event, variation ) { | |
$( '#prod-sku' ).text( variation.sku ); | |
}); | |
}); | |
</script> | |
<?php | |
} | |
add_action( 'wp_head', 'ele_update_sku', 10 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment