This WooCommerce filter customizes the currency symbol. When the active currency is USD, it overrides the default symbol with $ (or any symbol you set) and returns it.
add_filter( 'woocommerce_currency_symbol', function( $symbol, $currency ) {
if ( 'USD' === $currency ) {
$symbol = '$'; // Or any other symbol
}
return $symbol;
}, 10, 2 );
