Home Contact Us Payments SC Commerce SC Commerce Docs SC Commerce Snippets

Simply Computing

We make websites. Simple.

Add custom prefix to prices

You can add a prefix to all prices with this code. For example, you could add “Only” before the price.

 * Add prefix to prices

add_filter('woocommerce_get_price_html', 'cc_add_price_prefix', 99, 2);

function cc_add_price_prefix($price, $product) {

  $price = 'Only ' . $price;
  return $price;

   View Raw Code ID: 9915