You're probably using the wc_price()
function inside of your theme code where the dropdown is being created, which is what is creating the extra <span>
tags. Try this instead:
$price = '56.15';
echo get_woocommerce_currency_symbol() . number_format_i18n( $price );
This actually is how WooCommerce formats the price in the wc_price()
function, minus the span tag. If you prefer something a bit more concise, you could also do this:
$price = '56.15';
echo wc_clean( wc_price( $price ) );
The wc_clean()
function strips HTML tags and removes line breaks, tabs, and extra spaces, among other things, so it should remove the <span>
tags before outputting the price.
If your theme isn't creating the dropdown HTML then that makes things a bit more complicated; I'd have to know more about your setup before I could even venture a guess as to where you should start looking. For example, which theme you're using, which plugins are installed and active, the versions of WordPress and WooCommerce you have installed, etc.