# "Call for Price" on Products Without a Price

> Shows a "Call for price" link instead of a blank space when a product has no price set, so shoppers know how to get a quote.

- Type: PHP
- Runs: Run everywhere
- Category: [WooCommerce](https://wpide.com/library/category/woocommerce/)
- Requires: WooCommerce
- Tags: woocommerce, price, quote, b2b
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/woo-call-for-price/

## Code

```php
add_filter( 'woocommerce_empty_price_html', function ( $html, $product ) {
    $label = 'Call for price';   // Link text.
    $phone = '+1 555 010 0000';  // Your phone number.

    return sprintf( '<a class="wpide-call-for-price" href="%s">%s</a>', esc_url( 'tel:' . preg_replace( '/[^0-9+]/', '', $phone ) ), esc_html( $label ) );
}, 10, 2 );
```

## Notes

Set $phone to your number, or change the link to a contact page URL.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find ""Call for Price" on Products Without a Price" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
