<?php add_filter( 'woocommerce_get_price_html', 'growdev_custom_price_message', 30, 2 ); /** * Add string to * * @param $price HTML string * @param $product WC_Product object * @return string */ function growdev_custom_price_message( $price, $product ) { //error_log( "price: " . $price ); //error_log( "product: " . get_class($product) ); /* [11-Nov-2014 16:42:23 UTC] price: <span class="amount">$20.00</span> [11-Nov-2014 16:42:23 UTC] product: WC_Product_Simple */ if ( ! is_admin() ) { $s = 59; if ( (int) $product->get_regular_price() >= $s ) { $free_shipping_text = ' <h4>FREE SHIPPING!</h4>'; return $price . $free_shipping_text; } } return $price; }