woocommerce_get_price_html_from_to

The WooCommerce woocommerce get price html from to hook.

Description

apply_filters( 'woocommerce_get_price_html_from_to', (string) $wc_format_sale_price, (unknown) $from, (unknown) $to, (unknown) $instance ); 

Parameters (4)

0. $wc_format_sale_price (string) => wc_format_sale_price( $from, $to )
The wc format sale price.
1. $from (unknown)
The from.
2. $to (unknown)
The to.
3. $instance (unknown)
The instance.

Usage

To run the hook, copy the example below.
  1. $wc_format_sale_price = apply_filters( 'woocommerce_get_price_html_from_to', $wc_format_sale_price, $from, $to, $instance ); 
  2.  
  3. if ( !empty( $wc_format_sale_price ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the woocommerce_get_price_html_from_to callback 
  2. function filter_woocommerce_get_price_html_from_to( $wc_format_sale_price, $from, $to, $instance ) { 
  3. // make filter magic happen here... 
  4. return $wc_format_sale_price
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'woocommerce_get_price_html_from_to', 'filter_woocommerce_get_price_html_from_to', 10, 4 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'woocommerce_get_price_html_from_to', 'filter_woocommerce_get_price_html_from_to', 10, 4 ); 

Defined (1)

The filter is defined in the following location(s).

/includes/legacy/abstract-wc-legacy-product.php  
  1. return apply_filters( 'woocommerce_get_price_html_from_to', wc_format_sale_price( $from, $to ), $from, $to, $this );