$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>Fatal error: Call to undefined method WooCommerce::nonce_field()|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

Fatal error: Call to undefined method WooCommerce::nonce_field()

matteradmin9PV0评论

I am getting an error on the cart page "Call to undefined method WooCommerce::nonce_field()".

Fatal error: Call to undefined method WooCommerce::nonce_field() in C:\xampp\htdocs\stemorg\wp-content\themes\breeze-child\woocommerce\cart\cart.php on line 120

cart.php on line 120 here is the code: $woocommerce->nonce_field('cart');

I am very tired of this error. Please, anyone, help me how to fix this error. Thanks in advance

I am getting an error on the cart page "Call to undefined method WooCommerce::nonce_field()".

Fatal error: Call to undefined method WooCommerce::nonce_field() in C:\xampp\htdocs\stemorg\wp-content\themes\breeze-child\woocommerce\cart\cart.php on line 120

cart.php on line 120 here is the code: $woocommerce->nonce_field('cart');

I am very tired of this error. Please, anyone, help me how to fix this error. Thanks in advance

Share Improve this question asked Dec 22, 2018 at 7:20 Rakesh PatidarRakesh Patidar 433 bronze badges 1
  • change ” $woocommerce->nonce_field ” to “wp_nonce_field” – vikrant zilpe Commented Dec 22, 2018 at 7:55
Add a comment  | 

1 Answer 1

Reset to default 1

The Products section in wp-admin panel doesn’t depend on the theme. If you select default WordPress theme you’ll see the same issue. This is WordPress configuration. To fix the errors you need edit files via FTP, open the file wp-content/themes/your_theme/woocommerce/cart/shipping-calculator.php on line 67 and replace

$woocommerce->nonce_field

     with

  wp_nonce_field

and the file wp-content/themes/your_theme/woocommerce/checkout/form-checkout.php on line 3 and replace

 $woocommerce->show_messages();

      with

  wc_print_notices();
Post a comment

comment list (0)

  1. No comments so far