# "Was / Now" Sale Price Format

> Replaces the crossed-out sale price layout with clear "Now 20.00, was 25.00" wording that reads better and works with screen readers.

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

## Code

```php
$wpide_was_now = array(
    'now' => 'Now',
    'was' => 'was',
);

add_filter( 'woocommerce_format_sale_price', function ( $html, $regular, $sale ) use ( $wpide_was_now ) {
    $regular = is_numeric( $regular ) ? wc_price( $regular ) : $regular;
    $sale    = is_numeric( $sale ) ? wc_price( $sale ) : $sale;

    return sprintf(
        '<span class="wpide-now">%1$s %2$s</span> <span class="wpide-was">%3$s <del>%4$s</del></span>',
        esc_html( $wpide_was_now['now'] ),
        wp_kses_post( $sale ),
        esc_html( $wpide_was_now['was'] ),
        wp_kses_post( $regular )
    );
}, 10, 3 );
```

## Notes

Change the words in $wpide_was_now to match your tone.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find ""Was / Now" Sale Price Format" 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/
