I am trying to display a suffix text for the price entered via a custom meta field and output via a shortcode.
Here is my code:
function prefix_suffix_price_html($price){
$shortcode = do_shortcode('[shortcode]') ;
$psPrice = '';
$psPrice .= $price;
$psPrice .= '<span class="suffix">'. $shortcode . '</span>';
return $psPrice;
}
add_filter('woocommerce_get_price_html', 'prefix_suffix_price_html');
add_filter( 'woocommerce_cart_item_price', 'prefix_suffix_price_html' );
This works fine on the product and archive pages.
However, it does not work for cart items. The an empty span tag is returned without the content of the shortcode.