Snippets

Visser Labs Return the highest Variation Price as Variable Price in Product exports

Created by Michael Visser
<?php
function custom_woo_ce_product_variation_pricing( $product, $pricing_args ) {

if( $pricing_args['min_price'] <> $pricing_args['max_price'] ) {
$product->price = woo_ce_format_price( $pricing_args['max_price'] ); 
$product->sale_price = woo_ce_format_price( $pricing_args['max_sale_price'] ); 
} 
return $product;

} 
add_filter( 'woo_ce_product_variation_pricing', 'custom_woo_ce_product_variation_pricing', 10, 2 );
?>

Comments (0)