hope somebody could help me. I have bought one plugin. But I need to change the function of the plugin in my child template functions.php Here is the classes and functions of the plugin. I need to change the function "get_product_price" with my value.
class TOP_Woo {
public function __construct() {
..
..
$this->init_hook();
}
public function init_hook() {
add_filter( 'woocommerce_product_class', array( $this, 'my_product_class' ), 10, 4 );
}
public function my_product_class( $classname, $product_type, $post_type, $product_id) {
$classname = 'SUB_WC_Product';
return $classname;
}
public function load() {
TOP_Woo::instance();
}
public static function instance() {
if ( ! self::$_instance ) {
self::$_instance = new self();
}
return self::$_instance;
}
}
add_action( 'plugins_loaded', array( 'TOP_Woo', 'load' ) );
global $woocommerce;
class SUB_WC_Product extends WC_Product_Simple {
public function __construct ( $product = 0 ) {
$this->post = get_post( $this->id );
}
public function get_product_price( $context = 'view' ) {
return "XY";
}
}
Thank you! :)