i need remove 1 specific variable price price filter , woocommerce order price.
i have 4 variable product, , don't want show 1 variable attribute contains price $495 products in price filter.
i want hide specific attribute not counted in price filter in wordpress order price.
thank you.
you need this:
add_filter( 'woocommerce_sale_price_html', 'custom_remove_price_html', 20, 2 ); add_filter( 'woocommerce_price_html', 'custom_remove_price_html', 20, 2 ); add_filter( 'woocommerce_empty_price_html', 'custom_remove_price_html', 20, 2 ); add_filter( 'woocommerce_variable_sale_price_html', 'custom_remove_price_html', 20, 2 ); add_filter( 'woocommerce_variable_price_html', 'custom_remove_price_html', 20, 2 ); add_filter( 'woocommerce_variable_empty_price_html', 'custom_remove_price_html', 20, 2 ); add_filter( 'woocommerce_variation_sale_price_html', 'custom_remove_price_html', 20, 2 ); add_filter( 'woocommerce_variation_price_html', 'custom_remove_price_html', 20, 2 ); function custom_remove_price_html( $price, $product ) { // if product variable product. if ( $product->is_type( 'variable' ) ) { // updated // $price = ''; return; } return $price; }
if doesn't work want, need fine tune conditionals inside function, feet needs.
you have add code snippet in functions.php
file of active theme (or better of active child theme).