Created
October 7, 2016 00:21
-
-
Save helgatheviking/551e539412f6318b50fec11b18006cc6 to your computer and use it in GitHub Desktop.
Add short description after Mix and Match product title
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
/* | |
* 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