Skip to content
Advertisement

Variation Product Shows Price Twice | WordPress WooCommerce

In wordpress WooCommerce, when i add a Variation Product, variation is set only by Two colors,

Starwhite = 9000 Ivory = 15000

On the Single Product page, I get to see price mentioned twice, as shown in screenshots.

I want to retain the price defined in variation. Remove the other one.

The price which is not required is showing up under the div below

JavaScript

But when i mark it has display none or visibility hidden, the price from variation is also gone..

enter image description here

1st Color Variation settings: enter image description here

2nd Color Variation settings: enter image description here

Also, there are times when i use Simple Product on the website, so any changes suggested should not impact simple product settings.

If i have to make any changes in the code, what should be the code and under which php files should it be changes.

Advertisement

Answer

I believe the file you need to edit is “/single-product/price.php”, you should have a copy of that file in your theme folder (/your-theme/woocommerce/single-product/price.php), if not you can copy it there from /wp-content/plugins/woocommerce/templates/

Change:

JavaScript

To:

JavaScript

That will make it only display the price for Simple Products. The other price display that changes when you select a different variation is set in /single-product/add-to-cart/variable.php so that will be unaffected.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement