mkdsgns
Forum Replies Created
-
Forum: Plugins
In reply to: [WooCommerce Square] “There was an error processing your order.”I asked chatgpt, and tested on staging and also on live site and it seems to be working. Please see below for anyone that may be encountering this issue…
🔍 Summary of the Error
Your WordPress site is encountering a critical error caused by the WooCommerce Square plugin. The issue is:
TypeError: Unsupported operand types: string + string
File:/woocommerce-square/includes/Gateway/API/Requests/Orders.php
Line 292This error means the code is attempting to use the
+operator on two string values, which is not valid in PHP. In PHP, string concatenation should use the.(dot) operator, not+. 🧱 Root CauseThe offending file is part of the Square plugin (
woocommerce-square) and specifically within this method call stack:Orders->get_api_line_items(...)Orders->set_order_data(...)API->create_order(...)Payment_Gateway_Direct->process_payment(...)
So when an order is placed (likely during checkout), the plugin tries to construct line items or order data but incorrectly adds two string variables using
+. 🔁 RepetitionThis error happens multiple times (09:16, 13:26, 13:28, 13:30), suggesting:
- It’s affecting multiple customers
- It hasn’t been resolved between those attempts
- Likely triggered during every checkout that uses Square
🛠️ Recommended Fix
- Temporary workaround (if urgent):
- Disable the Square for WooCommerce plugin to restore checkout functionality.
- Switch to an alternate payment method temporarily.
- Permanent fix:
- Edit
/woocommerce-square/includes/Gateway/API/Requests/Orders.php - Locate line 292 and replace the
+with a.if the intent was string concatenation. - Example: phpCopyEdit
// Incorrect: $string = $value1 + $value2; // Correct: $string = $value1 . $value2;
- Edit
- Better long-term approach:
- Update the WooCommerce Square plugin to the latest version (if available).
- If you’re already on the latest version, report the bug to the plugin developers.
🧪 How to Investigate Further
- Open the file at
/plugins/woocommerce-square/includes/Gateway/API/Requests/Orders.php - Navigate to line 292
- Inspect the surrounding code to verify what variables are being combined
If you’d like, I can help write a corrected version of the problematic line if you paste that part of the code here.
Forum: Plugins
In reply to: [WooCommerce Square] “There was an error processing your order.”Hello,
Unable to set Square into test mode currently as I am unable to get access to the clients account. However I switched to storefront and deactivated every plugin apart from Woocommerce and Square, and now met with: “There has been a critical error on this website.”
As it stands the client has been unable to take orders for 48hrs and about to go into a busy weekend with no website.
Do you need to see the fatal error logs?
Forum: Plugins
In reply to: [WooCommerce Square] Move WooCommerce Square wallet buttons on checkout page@andyj2021 where abouts did you replace that code? I’ve tried looking but I can’t find the wallets.php file. I tried using the snippets plugin to add your code but it broke the site.
Also using Woocommerce Square plugin and trying to move the digital wallets to just before the payment buttons.
Hi Predrag,
This has fixed everything, thank you so much! Great plugin, great support!
Kind Regards,
Mike.
Hi Kris,
This seems to be working now. I cleared and re-started the settings. I believe it was because I was manually typing {email-1}, rather than using the ‘+’ button to select it.
You can close this thread. Thanks for your assistance!
Mike.
Hi Kris,
Yes the admin receives the emails.
There isn’t an SMTP plugin on the website currently. Is this the only fix available to this? My experience configuring these plugins is very limited.
Kind Regards,
Mike.
Hi Patrick,
Sorry, I was unavailable to respond last week.
Here is the link: https://bar-eivissa.co.uk/premier-league-pass/
The price text is white, and should be black and the button should match the styling of the website. If you could help I would appreciate it.
Kind Regards,
Mike.