How do I edit the string of a function in includes/abstracts directly?

admin

Administrator
Staff member
For example the function
Code:
get_price_html_from_to()
in file
Code:
plugins/woocommerce/includes/abstracts/abstract-wc-product.php

Code:
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>';
}

Without going into the file itself and changing it, how do I alter that string?

Is it possible to create my own
Code:
abstract-wc-product.php
file, and point wordpress/woo at the file instead of the original? or is there a way to simply remove & replace the function with one of my own? or just alter it's string before it gets used?