Created
December 4, 2023 17:59
-
-
Save braddalton/0e2827874da7c7b2e3a725d15c88cd0e to your computer and use it in GitHub Desktop.
Set Default Product Type to Variable in WooCommerce https://wpsites.net/?p=114472
This file contains 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
function set_default_product_type_variable() { | |
?> | |
<script type="text/javascript"> | |
jQuery(document).ready(function($) { | |
// Set the default product type to "variable" | |
$('#product-type').val('variable').change(); | |
}); | |
</script> | |
<?php | |
} | |
add_action('admin_footer', 'set_default_product_type_variable'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment