How to edit the get_price_html in WooCommerce

Posted by Prem Tiwari | Updated on

How to edit the get_price_html in WooCommerce?

Core and plugin files should never be edited directly, as any updates could overwrite your changes. If you look in WooCommerce source at the get_price_html method, there are a number of filters available to modify the output of the function.

See add_filter in Codex for more info on adding filters to apply_filters calls.

From get_price_html in class-wc-product:

So to add your own filter:

If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@] Your question and answer will appear on and help other developers.

Related Questions & Answers