• Resolved jacquiescarlett1933

    (@jacquiescarlett1933)


    After updating to the new version, i ran an incognito test of ecommerce site and at the cart got the message “Deprecated: Function wc_enqueue_js is deprecated since version 10.4.0! Use wp_add_inline_script instead. in /www/xxxxxxx_839/public/wp-includes/functions.php on line 6131”. on the order page.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi @jacquiescarlett1933,

    Thanks for reporting this. What you’re seeing is a deprecated notice, not a fatal error.

    The function wc_enqueue_js() was deprecated in WooCommerce 10.4.0, so this message usually means that a plugin, theme, or custom code on the site is still calling that function. WooCommerce itself does not output deprecated notices unless they are triggered by third-party code.

    A few things to check:

    1. Confirm whether WP_DEBUG or WP_DEBUG_DISPLAY is enabled — deprecated notices should not normally appear on the frontend of a live site.
    2. Temporarily disable non-WooCommerce plugins and switch to a default theme to identify what’s calling wc_enqueue_js().
    3. Once identified, update that plugin/theme or contact its developer so they can replace wc_enqueue_js() with wp_add_inline_script().

    If this is happening on a production site and you need the notice hidden immediately, you can also disable debug output while investigating.

    Let us know what you find, and we’ll be happy to help you narrow it down further.

    @saivutukuru

    Hi

    So why is this function still used in the latest version of WooCommerce?
    wc-core-functions.php line 1022

    Hi @shimist,

    Thanks for pointing that out, and you’re right to question it.

    To clarify:
    wc_enqueue_js() is deprecated as of WooCommerce 10.4.0, but it still exists in core for backward compatibility. In some internal cases, WooCommerce continues to call it, and internally it proxies the logic to the newer approach (wp_add_inline_script) to avoid breaking existing extensions.

    The important part is that deprecated notices should not be displayed on the frontend of a live site by default. When you see messages like this publicly, it almost always means that WP_DEBUG and WP_DEBUG_DISPLAY (or similar server-level debug output) are enabled.

    So to summarize:

    • The function still exists in WooCommerce core for compatibility reasons.
    • It should not cause visible notices on production sites.
    • The notice itself is informational and does not indicate a runtime failure.
    • If it’s appearing publicly, disabling debug display is recommended while tracking down any third-party code still calling it directly.

    Sorry for the confusion earlier, and thanks for calling this out, it’s a good distinction to make.

    Plugin Support Kay U a11n

    (@kingsleyinfo)

    Since we haven’t received any updates from you, I’ll mark this as resolved for now. If you need further assistance, you’re welcome to start a new thread.

    We’d love your feedback – please leave us a review: https://ww.wp.xz.cn/support/plugin/woocommerce/reviews/

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

You must be logged in to reply to this topic.