When a variable product has the same price for all variations, a unique price is shown to website users i.e. the one at the top of the page. However, this behaves differently when each variation has its own unique price – in this case the single variation price shows after a variation is selected.
Now, this can be good or this can be bad – it depends. So in this snippet we’ll see a quick fix to make this behavior consistent i.e. showing the variation price after selection every time, no matter the conditions.
Thankfully, it’s literally one line of PHP. Enjoy!
Snippet (PHP): Always Display Single Variation Price @ WooCommerce Single Product Page
/** * @snippet Always Show Variation Price @ WooCommerce Single Product * @how-to Watch tutorial @ https://businessbloomer.com/?p=19055 * @sourcecode https://businessbloomer.com/?p=101266 * @author Rodolfo Melogli * @compatible WooCommerce 3.5.3 * @donate $9 https://businessbloomer.com/bloomer-armada/ */ add_filter( 'woocommerce_show_variation_price', '__return_true' );