SyntaxError: JSON.parse Error: Invalid character at position:1
-
Hi,
I am setting up a site that uses Stripe. In testing all is fine until I test purchase a Voucher Product (WooCommerce PDF Product Vouchers). The voucher PDF is generated, email with Voucher attached sent to customer and the sale is recorded as a WC order. However on the Checkout Page where it is supposed to give a confirmation message, I get the error “SyntaxError: JSON.parse Error: Invalid character at position:1” and the cart is still populated with the selected product.
I looked in the WC logs and found this “CRITICAL Call to a member function get_name() on null”
I did a search on get_name() and found 3 instances in the file class-wc-stripe-payment-request.php.
My hosting co were kind enough to investigate this for me to rule out anything their end and this is what they have to say…
“Looking at the script that the “Unable to fix malformed JSON” console message comes from, the JSON apparently is supposed to be displayed right after that message in the console, but it isn’t, so presumably there isn’t any there. There’s no sign of any more errors on the server itself, and the “Call to a
member function get_name() on null” errors seem to be a result of this rather than the cause.Both WooCommerce and the Stripe payment gateway plugin itself are directly supported by WooCommerce. I’d recommend you get in touch with them and see if they can suggest what the problem might be.
They do recommend switching to a default WordPress theme and disabling all unrelated plugins to check for conflicts first, though. Have you tried that yet?”
In answer to the Theme & Plugins, yes, I have tested using StoreFront theme and disabled the non Woo plugins – error was the same.
Can you suggest how to fix the situation?
Thanking you in advance, J
The topic ‘SyntaxError: JSON.parse Error: Invalid character at position:1’ is closed to new replies.