So I’m working on a store in woocommerce and we want the variation price (that displays just above the add cart button) to be the only one on the page, and we’ve discovered if a variable product has the same price for all variations it won’t show the price down there, does anyone have a solution for this?
Leave a Reply
You must be logged in to post a comment.
I know this question was asked almost a year ago, but this has been a “problem” in WooCommerce for much longer, so I’m posting this answer for reference.
In actual fact this is meant to be a performance/memory enhancement feature to avoid rendering and processing duplicated variation data in the HTML data attribute. But it ends up causing issues because it results in the HTML output of variations not being consistent from product to product. Really this whole issue is due to bad practices being used by WooCommerce to render the dynamic content for the variations, but what can you do…
This! (in PHP 5.3+, which you really should be using these days)
For those who don’t know, you simply need to add this to your theme’s
functions.php
file, or any other PHP file that loads before the template files.