Merge pull request #6455 from paulwilde/from-to-filters

Introduce filters to get_price_html_from_text() and get_price_html_from_to()
This commit is contained in:
Mike Jolley 2014-10-17 16:25:16 +01:00
commit 2668f0b8dd
1 changed files with 6 additions and 2 deletions

View File

@ -906,7 +906,9 @@ class WC_Product {
* @return string
*/
public function get_price_html_from_text() {
return '<span class="from">' . _x( 'From:', 'min_price', 'woocommerce' ) . ' </span>';
$from = '<span class="from">' . _x( 'From:', 'min_price', 'woocommerce' ) . ' </span>';
return apply_filters( 'woocommerce_get_price_html_from_text', $from, $this );
}
/**
@ -917,7 +919,9 @@ class WC_Product {
* @return string
*/
public function get_price_html_from_to( $from, $to ) {
return '<del>' . ( ( is_numeric( $from ) ) ? wc_price( $from ) : $from ) . '</del> <ins>' . ( ( is_numeric( $to ) ) ? wc_price( $to ) : $to ) . '</ins>';
$price = '<del>' . ( ( is_numeric( $from ) ) ? wc_price( $from ) : $from ) . '</del> <ins>' . ( ( is_numeric( $to ) ) ? wc_price( $to ) : $to ) . '</ins>';
return apply_filters( 'woocommerce_get_price_html_from_to', $price, $this );
}
/**