Skip to content

Instantly share code, notes, and snippets.

@helgatheviking
Last active June 25, 2018 17:16
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/5fa546c2438c7701dc49534ff08e6fbb to your computer and use it in GitHub Desktop.
Save helgatheviking/5fa546c2438c7701dc49534ff08e6fbb to your computer and use it in GitHub Desktop.
Display individual MNM option prices
<?php
/**
* Display individual MNM option prices
*
* @param obj $mnm_item WC_Product of child item
* @param obj WC_Mix_and_Match $product the parent container
*/
function kia_add_individual_prices( $mnm_item, $parent_product ) {
if( $parent_product->is_priced_per_product() ) {
echo '<p class="price">' . $mnm_item->get_price_html() . '</p>';
}
}
add_action( 'woocommerce_mnm_child_item_details', 'kia_add_individual_prices', 65, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment