neilgee
11/22/2014 - 6:00 AM

WooCommerce Text After Price

WooCommerce Text After Price

<?php
//don't copy above opening tag if pasting into functions.php

//Add in text after price to certain products
function themeprefix_custom_price_message( $price ) { 
	
	global $post;
		
	$product_id = $post->ID;
	$my_product_array = array( 799,796,792 );//add in product IDs
	if ( in_array( $product_id, $my_product_array )) {
		$textafter = '( Upfront Paid in Full Price )'; //add your text
		return $price . '<br /><span class="price-description">' . $textafter . '</span>';
	}
	 
	else { 
		return $price; 
	} 
}
add_filter( 'woocommerce_get_price_html', 'themeprefix_custom_price_message' );