Select Page

woocommerce

I use WooCommerce for several sites I have built for myself and for customers. Everyone wants it to show things differently than the default it seems.

My latest request was for a large content learning site that has variable pricing for each course depending on when you take the course. The spread of the variance made the display of it ugly and confusing. So we decided to only show the Max possible price of the variable product. Here is how you can do that.

You will need to go into the folder of your theme and open the functions.php file and add the following code to the bottom of the file and save it.

addfilter('woocommerce_variable_pricehtml','custom_variation_price',10,2);
function custom_variation_price( $price,$product ) { $price = ''; $price .= woocommerce_price($product->max_variation_price);
return $price;
}

So there you have it. If you want to make the min price appear on your variations just change the max to min in the snippet above and that is it.

Facebook Comments

Related Post

App Store screenshots the easy way. After finishing up the code for the newest app “jutella”, I found a great resource to make submitting the app to the store even easier. LaunchKit ...
Alexa has a new skill – Celebration Bar Revi... Before even purchasing an Amazon Echo some thought had already begun way back when it was just a demo video of it's pending release. I wondere...
Icons for the rest of us. If you are like me (a crazy iOS and mobile developer that can't really draw), then you are either looking for someone to draw for you or buying things...
Parse Out As a long time developer of apps and using Parse to handle my data storage and my push notifications it really sucks that they are closing the...
Share This