Skip to content

Instantly share code, notes, and snippets.

@apisklov
Created August 10, 2018 06:48
Show Gist options
  • Save apisklov/fd99603afaac65a52efdfe7255da28b7 to your computer and use it in GitHub Desktop.
Save apisklov/fd99603afaac65a52efdfe7255da28b7 to your computer and use it in GitHub Desktop.
Move variation description woocommerce
// Move Variation Description
// Paste in functions.php
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 = $('.product_title'), $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