Skip to content

Instantly share code, notes, and snippets.

@helgatheviking
Created October 7, 2016 00:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save helgatheviking/551e539412f6318b50fec11b18006cc6 to your computer and use it in GitHub Desktop.
Save helgatheviking/551e539412f6318b50fec11b18006cc6 to your computer and use it in GitHub Desktop.
Add short description after Mix and Match product title
/*
* Add product descriptions after product title
* fair warning: longer descriptions will be very cramped, this is just an example
* @param obj $mnm_product: the mix and matched product
* @param obk $product, the parent/container product
*/
function kia_add_descriptions_to_mnm( $mnm_product, $product ){
$short_description = $mnm_product->post->post_excerpt;
if ( ! $short_description ) {
return;
}
?>
<div itemprop="description">
<?php echo apply_filters( 'woocommerce_short_description', $short_description ) ?>
</div>
<?php
}
add_action( 'woocommerce_mnm_row_item_description', 'kia_add_descriptions_to_mnm', 30, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment