Created
May 25, 2017 02:59
-
-
Save juliaamosova/e9339658a4442f911383eb092c2c292a to your computer and use it in GitHub Desktop.
Display a short description of Mix & Match Product contents
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 the following line to the 'wc-mnm-template-hooks.php' file */ | |
add_action( 'woocommerce_mnm_row_item_description', 'woocommerce_template_mnm_product_description' ); | |
*********************************** | |
/** Add the following function to the 'wc-mnm-template-functions.php' file */ | |
if ( ! function_exists( 'woocommerce_template_mnm_product_description' ) ) { | |
/** | |
* Get the MNM item product description | |
* | |
* @access public | |
* @return void | |
*/ | |
function woocommerce_template_mnm_product_description( $mnm_product ) { | |
wc_get_template( | |
'single-product/mnm/mnm-product-description.php', | |
array( | |
'mnm_product' => $mnm_product, | |
), | |
'', | |
WC_Mix_and_Match()->plugin_path() . '/templates/' | |
); | |
} | |
} | |
*************************************** | |
/** Create a new file called 'mnm-product-description.php' | |
* and place it in the following directory | |
* 'single-product/mnm/mnm-product-description.php' */ | |
<?php | |
/** | |
* MNM Item Product Description | |
* @version 1.0.0 | |
*/ | |
if ( ! defined( 'ABSPATH' ) ){ | |
exit; // Exit if accessed directly | |
} | |
?> | |
<div class="mnm_product"> | |
<?php echo $mnm_product->get_short_description();?> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment