F
F
falwxey2018-09-03 12:20:53
WordPress
falwxey, 2018-09-03 12:20:53

Issue with price display in woocommerce 3.0?

Hello. Problem with displaying prices after updating woocommerce
Appears both in the admin panel and on the site.
5b8cfb9f194eb165810461.jpeg
error text

Notice: Функция woocommerce_get_price с версии 3.0.0 считается устаревшей! Используйте woocommerce_product_get_price. in /home/o/opushnei/opushnei.beget.tech/public_html/wp-includes/functions.php on line 4104 Notice: Функция woocommerce_get_price с версии 3.0.0 считается устаревшей! Используйте woocommerce_product_get_price. in /home/o/opushnei/opushnei.beget.tech/public_html/wp-includes/functions.php on line 4104

Along this path is a hook that displays errors, if I understood correctly
function _deprecated_hook( $hook, $version, $replacement = null, $message = null ) {
  /**
   * Fires when a deprecated hook is called.
   *
   * @since 4.6.0
   *
   * @param string $hook        The hook that was called.
   * @param string $replacement The hook that should be used as a replacement.
   * @param string $version     The version of WordPress that deprecated the argument used.
   * @param string $message     A message regarding the change.
   */
  do_action( 'deprecated_hook_run', $hook, $replacement, $version, $message );

  /**
   * Filters whether to trigger deprecated hook errors.
   *
   * @since 4.6.0
   *
   * @param bool $trigger Whether to trigger deprecated hook errors. Requires
   *                      `WP_DEBUG` to be defined true.
   */
  if ( WP_DEBUG && apply_filters( 'deprecated_hook_trigger_error', true ) ) {
    $message = empty( $message ) ? '' : ' ' . $message;
    if ( ! is_null( $replacement ) ) {
      /* translators: 1: WordPress hook name, 2: version number, 3: alternative hook name */
      trigger_error( sprintf( __( '%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.' ), $hook, $version, $replacement ) . $message );
    } else {
      /* translators: 1: WordPress hook name, 2: version number */
      trigger_error( sprintf( __( '%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.' ), $hook, $version ) . $message );
    }
  }
}

I googled it and realized that the hook is dynamic and it didn’t make me happy at all...
I understand that the answer is here https://wordpress.stackexchange.com/questions/2960...
but I can’t find where and what to replace.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
W
Way, 2018-09-03
@wayheming

Search by theme or plugin using any text editor that has the ability to search by folder (VSCode / Sublime Text 3)
and change all found matches to

woocommerce_product_get_price

F
falwxey, 2018-09-03
@falwxey

Searched, found nothing.
woocommerce_get_price
and so also tried
woocommerce_get

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question