Add Text After the Price in a WooCommerce Product

You can add a bit of static text after the price in a WooCommerce Product by using a woocommerce filter woocommerce_get_price_html.


For the above product I want to add some text just after the price to a certain range of products. Here below is the code to do that:

So I have set my target products in an array and the additional product text as a variable $textafter, if the product is part of that array it will return the prices and also the additional text which also has a CSS class applied for styling. If the product is not part of that array it will just return the price.

This will occur in the listing and detailed view product pages as the $post->ID is also included in the conditional code.