73
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!
PHP Snippet: Always Display Single Variation Price @ WooCommerce Single Product Page
/**
* @snippet Always Show Variation Price @ WooCommerce Single Product
* @how-to Get tutoraspire.com FREE
* @author Tutor Aspire
* @compatible WooCommerce 3.8
* @donate $9 https://tutoraspire.com
*/
add_filter( 'woocommerce_show_variation_price', '__return_true' );