Home>Support>Bad Request when updating product pages

Bad Request when updating product pages

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!

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 4 months, 2 days ago Andrew Misplon
    Hi, I Work Here

    Hi, thanks for posting your question.

    What version of Vantage are you using?

  2. 4 months, 2 days ago a7xfanben

    Andrew,

    Vantage version 1.15.3.

    Thanks!

  3. 4 months, 2 days ago Andrew Misplon
    Hi, I Work Here

    Thanks. The current version is 1.20.21. Have you customized the parent theme? The contents of line 767 as mentioned in your post isn’t present in Vantage.

  4. 4 months, 2 days ago a7xfanben

    I believe I have; it’s been a while since I worked on the child theme process and I think I’ll do a refresher this week to fully understand what I have and if I should do a dual update to the current Vantage and a new child theme for it.

  5. 4 months, 2 days ago Andrew Misplon
    Hi, I Work Here

    Thanks for the update.

    Here is how to migrate the Customizer settings: Post: Migrating Parent to Child Theme Customizer Settings.
    Here is a child theme for Vantage: Page: Child Theme.

    All the best.

  6. 3 months, 29 days ago a7xfanben

    Thank you! I successfully implemented a child theme with the parent as Vantage 1.20.21.

    I’m still getting a Bad Request error, specifically when I try to delete spam users. I am able to delete them one at a time, but when I try to do a bulk delete, it gives me a Bad Request page instead. (the WooCommerce error with new product images seems to be fixed)

  7. 3 months, 29 days ago Andrew Misplon
    Hi, I Work Here

    Hi, thanks for the update. I’m glad to hear your child theme is up and running; that’s good news! Unfortunately, I’m not sure why you’re encountering an error when deleting users. You can perhaps try the deletion with all plugins deactivated and a default theme like Twenty Nineteen activated. That’ll rule out a plugin or theme conflict.

Replies on this thread are closed. Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More