5
votes

I'm building a webshop, and I'm nearly finished, but now in my dropdown menu on a single product you can choose the amount you want, the price is also displayed in this li item.

But there is also " 100 (<span class="amount">€56.15)" visible.

a small team of 5 people has worked on this website, so there is a lot added by all. but I have no idea where to start to fix this.

See these links for the images

enter image description here enter image description here

I hope and think it is a small problem.

1
I'm having the same issue, although it is just doing it on one of the variations and not on the rest :s Do you use the Gravity Fields Product Addons plugin? I am starting to think It may be to do with that.Mat Taylor
No i am not using Gravity Fields Product, i have seen this question before, but also not answered. i think i will try to disable plugins one by one to see wich one causes thisArjen M

1 Answers

0
votes

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.