How to Show Identical Prices for WooCommerce Variations

Ever noticed WooCommerce hiding variation prices when they’re all the same? It’s a default feature aimed at simplicity, but what if you want those prices visible? Good news! There’s a quick fix using a filter hook in WooCommerce. Here’s how:

Step-by-Step Guide:


1. Go to Your WordPress Theme’s Files

  • Log in to WordPress and head to “Appearance” > “Theme Editor”.
  • Find and click on the functions.php file of your active theme.

2. Add a Filter Hook

  • Copy and paste the code snippet at the bottom of the functions.php file:

3. Save Changes

  • Click “Update File” to save the changes.
				
					add_filter('woocommerce_show_variation_price', function() {
return true;
});
				
			

What the Code Does:

The code uses woocommerce_show_variation_price to force showing all variation prices, even if they’re the same.

Wrapping Up:

Customizing WooCommerce to fit your needs can improve the shopping experience. This simple tweak ensures transparent pricing for all variations, aiding customers in their decisions.

Remember, make changes in a child theme or through a custom plugin to avoid losing modifications during theme updates.

Ready to try it out? Share your WooCommerce tweaks or questions in the comments!

Share:

More Posts