Snippets

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

Created by Michael Visser

File functions.php Added

  • Ignore whitespace
  • Hide word diff
+<?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 );
+?>
HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.