Title: Changing Deprecated Functions
Last modified: September 30, 2020

---

# Changing Deprecated Functions

 *  Resolved [emzdesign](https://wordpress.org/support/users/emzdesign/)
 * (@emzdesign)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/changing-deprecated-functions/)
 * I’m working on a website and in their functions file is a function to display
   prices excluding VAT.
 * A piece of code to display this is
 * `woocommerce_price($variation->get_price_excluding_tax())`
 * These have since been deprecated and I’ve tried to replace the code with this:
 * `wc_price($variation->wc_get_price_excluding_tax())`
 * But that doesn’t seem to work.
 * The output of the original code includes “WC_Product::” before “get_price_exluding_tax”
   and this still remains once I’ve changed the code, but I don’t think this is 
   needed anymore. Trouble is I’m not sure where this is coming from or how to replace
   it.
 * Any help is appreciated.

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Thread Starter [emzdesign](https://wordpress.org/support/users/emzdesign/)
 * (@emzdesign)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/changing-deprecated-functions/#post-13478842)
 * I’ve managed to change the code to the following, and it still shows the price
   correctly, but I’m still getting the Deprecated error.
 * `wc_get_price_excluding_tax($variation, array('price' => $variation->get_price_excluding_tax()))`
 * The error I get if I change the second instance of get_price_excluding tax to
   wc_get_price_excluding_tax I get the following error:
 * > Fatal error: Uncaught Error: Call to undefined method WC_Product_Variation::
   > wc_get_price_excluding_tax()
 * Any help would be appreciated.
 *  Plugin Support [mouli a11n](https://wordpress.org/support/users/mouli/)
 * (@mouli)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/changing-deprecated-functions/#post-13511415)
 * As you are comfortable with coding yourself and have questions, I would recommend
   that you join the WooCommerce Slack Community ([https://woocommerceslack.herokuapp.com](https://woocommerceslack.herokuapp.com)),
   or the Advanced WooCommerce Facebook group ([https://www.facebook.com/groups/advanced.woocommerce](https://www.facebook.com/groups/advanced.woocommerce)).
 * I hope that helps you to figure it out.
    Feel free to get back to us if you have
   further questions.
 *  Plugin Support [Thu P. a11n](https://wordpress.org/support/users/thup90/)
 * (@thup90)
 * [5 years, 7 months ago](https://wordpress.org/support/topic/changing-deprecated-functions/#post-13560425)
 * Hi there,
 * I hope you found the previous reply helpful. We haven’t heard back from you in
   a while, so I’m going to mark this as resolved – if you have any further questions,
   you can start a new thread.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Changing Deprecated Functions’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

## Tags

 * [functions](https://wordpress.org/support/topic-tag/functions/)
 * [PRICES](https://wordpress.org/support/topic-tag/prices/)

 * 3 replies
 * 3 participants
 * Last reply from: [Thu P. a11n](https://wordpress.org/support/users/thup90/)
 * Last activity: [5 years, 7 months ago](https://wordpress.org/support/topic/changing-deprecated-functions/#post-13560425)
 * Status: resolved