Answer the question
In order to leave comments, you need to log in
How to redefine the data output sequence of a function?
Hello! There is a store on wordpress + woocommerce, in the file of which there is a standard function
public function get_price_html_from_to( $from, $to ) {
$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, $from, $to, $this );
}
<div class="price"><del><span class="amount">20.170 <ruble title="руб.">руб</ruble></span></del>
<ins><span class="amount">19.162 <ruble title="руб.">руб</ruble></span></ins></div>
add_filter( 'woocommerce_get_price_html', 'custom_price_html', 100, 2 );
function custom_price_html( $price, $product ){
...
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question