-
-
Save hirejordansmith/9dd2d539fe2a449d6152db9edd2c4b9b to your computer and use it in GitHub Desktop.
How to Move WooCommerce Single Product Variation Description to Product Description Tab
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
<?php | |
// Move Variation Description to Product Description Tab | |
add_action( 'wp_footer', 'ec_child_modify_wc_variation_desc_position' ); | |
function ec_child_modify_wc_variation_desc_position() { ?> | |
<script> | |
(function($) { | |
$(document).on( 'found_variation', function() { | |
var desc = $( '.woocommerce-variation.single_variation' ).find( '.woocommerce-variation-description' ).html(); | |
var $entry_summary = $( '#tab-description' ), $wc_var_desc = $entry_summary.find( '.woocommerce-variation-description' ); | |
if ( $wc_var_desc.length == 0 ) { | |
$entry_summary.append( '<div class="woocommerce-variation-description"></div>' ); | |
} | |
$entry_summary.find( '.woocommerce-variation-description' ).html( desc ); | |
}); | |
})( jQuery ); | |
</script> | |
<style> | |
form.variations_form .woocommerce-variation-description { | |
display: none; | |
} | |
</style> | |
<?php } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment