When I try to update a WooCommerce product page, I often get an immediate “Bad Request” error. Via the log feature in the WooCommerce plugin, it seems to be a syntax error on line 767 of my functions.php file.
Here is the error log information:
2024-05-27T14:17:32+00:00Critical syntax error, unexpected ‘}’, expecting end of file Additional context{ “error”: { “type”: 4, “file”: “/var/www/volumes/xvdh/vhosts/pirateswithben.com/httpdocs/wp-content/themes/vantage.1.15.3/vantage/functions.php”, “line”: 767 }, “backtrace”: [ { “file”: “/var/www/volumes/xvdh/vhosts/pirateswithben.com/httpdocs/wp-content/plugins/woocommerce/includes/class-woocommerce.php”, “line”: 348, “function”: “critical”, “class”: “WC_Logger”, “type”: “->” }, { “function”: “log_errors”, “class”: “WooCommerce”, “type”: “->” } ] }
I checked line 767 of the functions.php file and it has this:
add_action(‘init’, ‘admin_bar’ );
I’ve tried deleting the } bracket from lines near the end of the document and adding it to the end of line 767 (and after it), but it always throws up a syntax error. There’s no syntax error (on the backend of the site) with the functions.php file intact when the WooCommerce issue occurs.
Here is the full thread at WooCommerce support where they directed me to ask the theme provider.
Thanks for any assistance!
The post Bad Request when updating product pages appeared first on SiteOrigin.