• Resolved Tito Whisky

    (@titowhisky)


    This error appears several times in the php_errorlog: The WC_Product::get_price_excluding_tax function is deprecated since version 3.0. Replace with wc_get_price_excluding_tax.
    From what I read in this query:
    https://wordpress.org/support/topic/wc_productget_price_excluding_tax-function-is-deprecated/
    t would only be a warning, but I still did the search and found that this function is mentioned in the following files WC:

    The get_price_excluding_tax function is defined in wp-content/plugins/woocommerce/includes/legacy/abstract-wc-legacy-product.php and is where the error message is issued.

    But I can’t find where this function is executed from, so it is very strange that it gives the error, since in the other php in it is just a comment mentioning the mention and in
    wp-content/plugins/woocommerce/includes/wc-product-functions.php define the function: wc_get_price_excluding_tax.

    Very rare this.

    . Thank you.

    • This topic was modified 1 year, 3 months ago by Tito Whisky.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Mike Jolley (a11n)

    (@mikejolley)

    Hi Tito

    It’s true that this is just a warning and could be ignored (debug logging is optional). However, it would be good to find the culprit so the code can be updated just in case that deprecated function is ever removed.

    If you’d like to debug this, one tool that may help is Query Monitor: https://en-gb.wordpress.org/plugins/query-monitor/

    Used in conjunction with define( 'WP_DEBUG', true ); in your wp-config.php file, this tool will catch the error and lets you trace the location from where it was called. Presuming it is coming from an outdated extension or theme, you can then see if there is an update with a fix.

    If not, you could trace using trial and error; disable plugins, see if it the log entry continues to appear.

    Hope this helps get you started.

    Thread Starter Tito Whisky

    (@titowhisky)

    It seems that it is a scheduled task and the days that purchase orders entered, since the error did not appear on May 6 and there were no orders entered, but in the CRON history I do not see anything that has been executed at those times. I will see to install what is indicated.

    [03-May-2023 13:48:18 UTC] The WC_Product::get_price_excluding_tax function is deprecated since version 3.0. Replace with wc_get_price_excluding_tax.
    [03-May-2023 13:48:30 UTC] The WC_Product::get_price_excluding_tax function is deprecated since version 3.0. Replace with wc_get_price_excluding_tax.
    [04-May-2023 13:46:53 UTC] The WC_Product::get_price_excluding_tax function is deprecated since version 3.0. Replace with wc_get_price_excluding_tax.
    [04-May-2023 13:46:53 UTC] The WC_Product::get_price_excluding_tax function is deprecated since version 3.0. Replace with wc_get_price_excluding_tax.
    [04-May-2023 21:43:34 UTC] The WC_Product::get_price_excluding_tax function is deprecated since version 3.0. Replace with wc_get_price_excluding_tax.
    [04-May-2023 21:43:34 UTC] The WC_Product::get_price_excluding_tax function is deprecated since version 3.0. Replace with wc_get_price_excluding_tax.
    [05-May-2023 13:49:10 UTC] The WC_Product::get_price_excluding_tax function is deprecated since version 3.0. Replace with wc_get_price_excluding_tax.
    [07-May-2023 13:49:39 UTC] The WC_Product::get_price_excluding_tax function is deprecated since version 3.0. Replace with wc_get_price_excluding_tax.
    [07-May-2023 13:49:51 UTC] The WC_Product::get_price_excluding_tax function is deprecated since version 3.0. Replace with wc_get_price_excluding_tax.

    Hi @titowhisky

    Sounds like a plan. It’s good to know that you’ve somehow found a pattern on how the error is being generated. Please do update us once you found the culprit of your issue here.

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘The WC_Product::get_price_excluding_tax function is deprecated since version 3.0’ is closed to new replies.