Abstraction of product price prefix

How to Customize WooCommerce Price Prefixes for Better Clarity and Conversions

Sometimes the way WooCommerce displays product pricing doesn’t quite match your store’s messaging or design needs—especially when working with variable or grouped products. By default, WooCommerce shows price ranges like $1 – $99, which can be confusing or even off-putting to customers looking for the best deal.

What if you could show something clearer and more inviting—like “As low as: $1”? Or even something simple like “Price: $25” across your shop? In this post, we’ll walk through how to take full control of the product price prefix on your WooCommerce store.

After following the steps outlined here, you’ll be able to:

Add custom text before your product prices.
Modify how variable products display pricing on both archive and single product pages.
Prevent WooCommerce from showing price ranges if all variations cost the same.
Ensure compatibility with product variation plugins for a seamless user experience.

Adding a Price Prefix to Simple Products

The first enhancement is focused specifically on simple products. It adds a static prefix—such as “Price:” —in front of the displayed price. This is achieved by hooking into the woocommerce_get_price_html filter, which WooCommerce uses when rendering price information for individual products.

It’s important to note that this function does not affect variable or grouped product pricing. Those types display their prices using different filters, which we’ll address in the next sections. However, this function can impact variations shown on archive pages, depending on whether a plugin like Iconic Show Single Variations is being used. The code includes a placeholder for handling that specific compatibility scenario, allowing you to customize how variation prices appear when treated like simple products.

This function is ideal for adding clarity or branding to basic product listings, but you’ll need additional logic for full control over more complex product types.

/**
 * Adds prefix to WooCommerce prices
 */
add_filter( 'woocommerce_get_price_html', 'simple_price_prefix', 99, 2 );
function simple_price_prefix( $price, $product ){
	$prefix = "Price:";
	$price = '<span class="price-prefix">' . $prefix . '</span>' . ' ' . '<span>' . $price . '</span>';

	// ⚠️ BONUS: Iconic Show Single Variations compatibility
	if( $product->is_type( 'simple' ) || ( is_archive() && $product->is_type( 'variation' ) ) ){ 
		// Add the $prefix and $price lines here instead. 🌟
	}

	return $price;
}

Tailoring Price Prefixes for Variable Products

Variable products require more thoughtful logic. Customers often see a price range (e.g., “$12 – $49”) when viewing products with variations like size or color. But in many cases, you may want to show only the minimum price—especially if you’re positioning your product as affordable or entry-level.

This function dynamically calculates the minimum and maximum prices of a variable product. If they differ, it prepends a phrase like “From:” or “As low as:” to the minimum price. If all variations share the same price, it defaults to something simpler, like “Price:”.

This nuanced display not only looks cleaner but also aligns better with how people actually shop. When your customer lands on a product with multiple variations, their first impression won’t be a potentially off-putting price range—it’ll be a value-forward message that encourages clicks.

/**
 * Variable Product Price Range Prefix
 */
add_filter( 'woocommerce_variable_price_html', 'variation_price_prefix', 99, 2 );
function variation_price_prefix( $price, $product ) {
	// Get both prefixes depending on equality of min-max
	$prefix = "As low as:";
	$simple_prefix = "Price:";

	// Unlike a group product, a variable product requires you get the active variations.
	$prices = $product->get_variation_prices( true );

	$min_price = current( $prices['price'] );
	$max_price = end( $prices['price'] );

	// If prices are equal, return simple prefix
	// If prices are not equal, return range prefix
	$price = $min_price !== $max_price ? 
	'<span class="price-prefix">' . $prefix . '</span>' . ' ' . wc_price( $min_price ) : 
	'<span class="price-prefix">' . $simple_prefix . '</span>' . ' ' . wc_price( $price );

	return $price;
}

Bonus: Dynamically Update the Prefix When Selecting Variations

One clever addition to this setup is ensuring that the price prefix updates in real-time as a customer selects different product variations on the single product page. By default, WooCommerce only updates the raw price dynamically—but without this adjustment, your custom prefix might not follow.

This bonus section uses a bit of JavaScript and jQuery to hide the default variation price element and replace it with your own prefixed version. When a customer selects a variation (say, choosing a different color or size), the script injects your custom prefix (e.g., “Your price:”) in front of the dynamically loaded price. It also restores the original pricing display if no variation is selected.

This subtle enhancement improves consistency and keeps your branding or messaging intact even when product options are changed on the fly.

/**
 * BONUS SECTION. Show the selected prefix on the product page.
 * Change the variant price on selection
 * @link https://stackoverflow.com/a/50707820
 */
add_action( 'woocommerce_before_add_to_cart_form', 'selected_variation_price_replace_variable_price');
function selected_variation_price_replace_variable_price(){
	global $product;

	if( $product->is_type('variable') ){
	?>
	<style> .woocommerce-variation-price {display:none;} </style>
		<?php
		?>
		<script>
			jQuery(function ($) {
				var p = 'p.price'
				q = $(p).html();

				$('form.cart').on('show_variation', function (event, data) {
					if (data.price_html) {
						$(p).html('<span class="price-prefix">Price: </span>' + '<span>' + data.price_html + '</span>');
					}
				}).on('hide_variation', function (event) {
					$(p).html(q);
				});
			});
			</script>
			<?php
	}
}

Customizing Grouped Product Price Prefixes

Grouped products in WooCommerce present their own challenges. They don’t use variation logic, but instead display a range based on the prices of all the grouped items.

This section of the code analyzes the minimum and maximum prices from the child products within the group. If the prices are different, it shows something like “As low as: $19.99”. If all grouped items are priced the same, it simplifies to “Price: $19.99”.

Since grouped products are often used for bundles or related sets, being clear about the lowest available price can nudge customers toward exploring individual items within the group—especially when price is a key decision factor.

/**
 * Grouped Product Price Range Prefix
 */
add_filter( 'woocommerce_grouped_price_html', 'grouped_price_prefix', 99, 3 );
function grouped_price_prefix( $price, $product, $child_prices ) {
	// Get both prefixes depending on equality of min-max
	$prefix = "As low as:";
	$simple_prefix = "Price:";

	// Unlike a variable product, a grouped product gives you the array.
	$prices = array( min( $child_prices ), max( $child_prices ) );

	// If prices are equal, return simple prefix
	// If prices are not equal, return range prefix
	$price = $prices[0] !== $prices[1] ? 
	'<span class="price-prefix">' . $simple_prefix . '</span>' . ' ' . wc_price( $prices[0] ) : 
	'<span class="price-prefix">' . $prefix . '</span>' . ' ' . wc_price( $prices[0] );

	return $price;
}

Wrapping Up

Together, these enhancements provide a consistent and user-friendly pricing display across all product types in WooCommerce:

Simple Products show a static prefix.
Variable Products intelligently toggle between “As low as:” and “Price:” based on actual price range.
Grouped Products follow a similar logic, tuned for their unique structure.
The Bonus JavaScript keeps your custom prefix intact during dynamic variation selections.

By offering customers a cleaner, more transparent price presentation, you not only improve user experience but also support stronger conversions and a more polished brand feel.

Try these enhancements out, and don’t be afraid to customize the prefixes to suit your brand voice. Whether it’s “Only:”, “From:”, or “As low as:”, the right wording can help guide buyers toward a purchase with greater confidence.

Scroll to Top