[Solved | Solution: PHP 7.4] Woo Checkout Editor: JSON Parse error when 'Curaçao' is selected during checkout

Hi there,

I found a bug in the Woo Checkout Editor. When the country ‘Curaçao’ is selected during checkout it will throw a SyntaxError: JSON Parse error: Unexpected EOF.

I’m not sure if other countries will throw this error but ‘Netherlands’ is working fine.

Things I did to make sure it is really Woo Checkout Editor:

  • Deactivated all plugins except Woocommerce → No problem
  • Deactivated all plugins except Woocommerce and Woo Checkout Editor → Problem with Curaçao (Internal Server Error), no problem with the Netherlands
  • Switched to default twentytwentyone theme → Same results as above
  • Pro enabled and all other plugins except Woo Checkout Editr → No problem

Can you try to reproduce this error?

Many thanks!

Hi Dagaloni,

Thanks for reaching out.
I have checked your checkout by selecting the specified country but it didn’t show the issue you described. I would suggest you explain the steps to replicate it, and any screens capturing video will help us to recognize the problem.

Thanks

  1. Add a virtual product to your cart (for example: https://blendit.nu/product/binding-bij-blended-onderwijs/)
  2. Go to checkout and select ‘Curacao’
  3. Click on ‘Bestelling plaatsen’ (Dutch for place order)
  4. The error appears.

Here’s the screenrecording: https://youtu.be/fb59n8t_BrI

Hello @Dagaloni,

I am another staff checking in. I cannot replicate the issue as well.

Check out the video in the secure note below.

Whenever I select a bank it just goes to the Banks payment processing page. Please use private browsing mode or temporarily deactivate your browser extensions. It is also best that you test on different browsers.

Best Regards.

I checked the video, but you didn’t enable Woo Checkout Editor. The plugin was inactivated. Please follow the steps again but this time with the plugin activated.

Hey @Dagaloni,

I tested the Woo Checkout Editor and it works in my test site selecting Curacao as the Country. This means that the issue is only happening in your site.

There could be a server and/or database setting that is causing the issue or conflict with the Woo Checkout Editor. You have 2 options how you wish to proceed.

  1. (Fast solution) Test out other WooCommerce checkout editor 3rd party plugins. Just note that we do not support 3rd party plugins. With that said, if the issue still persists, you need to edit the checkout page by hiring a developer to do custom coding.
  2. If you want us to continue investigating, finding the root cause, please copy your live site to a staging server and give us cPanel or FTP access to the staging server. Also, provide the staging URL and ensure login credentials are the same.

Just note that we are not guaranteeing to make the Woo Checkout Editor to work on your site as there might be an unresolvable conflict.

Thanks.

I tried to clone the site to a staging environment. But because the website is hosted elsewhere and only 1 database is allowed, I cloned it to my server. (Un)fortunately the website worked fine on my environment.

It indeed looks like there is an conflict with the server environment. I’ll check with the hosting company first and see if they can do something about it. I’ll keep you updated.

Great News! Please let us know how it goes with your hosting provider then.

Update: this appeared in the logs.

 FastCGI: server "/var/run/php80-cgi/php-cgi" stderr: sage:

PHP Warning: Undefined array key "shipping_country" in 
/www/wp-content/plugins/tco-woo-checkout-editor/includes/tco_woo_checkout.woo.hooks.php
 on line 597PHP message: PHP Warning: Undefined array key "conditional_value" in 
/www/wp-content/plugins/tco-woo-checkout-editor/includes/tco_woo_checkout.woo.hooks.php
on line 597PHP message: PHP Warning: Undefined array key "shipping_address_1" in 
/www/wp-content/plugins/tco-woo-checkout-editor/includes/tco_woo_checkout.woo.hooks.php
 on line 597PHP message: PHP Warning: Undefined array key "conditional_value" in 
/www/wp-content/plugins/tco-woo-checkout-editor/includes/tco_woo_checkout.woo.hooks.php
on line 597PHP message: PHP Warning: Undefined array key "shipping_address_2" in 
/www/wp-content/plugins/tco-woo-checkout-editor/includes/tco_woo_checkout.woo.hooks.php
on line 597PHP message: PHP Warning: Undefined array key "conditional_value" in 
/www/wp-content/plugins/tco-woo-checkout-editor/includes/tco_woo_checkout.woo.hooks.php
on line 597PHP message: PH, referer: https://blendit.nu/afrekenen/

I tried to reinstall the plugin but the same problem appeared. Do you have a clue what the problem could be?

Hey @Dagaloni,

It looks like you’re using PHP 8. Please contact your web host to downgrade to PHP 7.4 then test if the issue persists.

Thanks.

That was it! I downgrade to PHP 7.4 and it works now.

But that resulted in a different problem. Curaçao doesn’t require a zip code, but other countries do. The zip code field is therefor set to ‘mandatory’. When Curaçao is selected the zip code field is hidden (by Woocommerce I think) but when checking out I get the error that a zip code is still required.

The zip code should be mandatory if visible. When it’s hidden it should not be mandatory / completely disabled.

What would be the best solution?

Hi Christian/Ruenel,

I have had similar problems with my Woocommerce cart down to the checkout editor falling over when I moved my site from PHP7.4 to PHP 8. Is X Pro fully compatible with PHP8 or should we still be on 7.4 for now? In any event, seems to be a number of probs with the the x checkout editor and php8.0

Hey @Dagaloni,

The issue happens only if Shipping is enabled. That is because Postcode is Mandatory in the Woo Checkout Editor setting.

@rickyabache,

I will post the Woo Checkout Editor compatibility issue with PHP 8 in our issue tracker so it will be queued to be investigated by our development team. For now, please stay with PHP 7.4.

Thanks.

Thanks for the suggestion, but unfortunately that is not a desired solution as it is a requirement for many countries. For those countries I do not want the options for customers to checkout leaving this field empty. Would you add this to the issue tracker as well?

Many thanks!

Hey @Dagaloni,

It’s not an issue but rather a feature that is not offered in Woo Checkout Editor. What you’d need is a checkout editor that can edit a field into a conditional field.

With that said, you’d need to have a developer to install a plugin or create the condition for you. If you want us to create the function, you can reach out our Elite service here https://theme.co/elite.

I’ll also post your concern as a feature request so maybe our development team will add that in a future version of the Woo Checkout Editor extension.

Thanks.

Thanks! :smiley:

Hi @Dagaloni,

You’re welcome! If you have any other concerns or clarifications regarding our theme features, feel free to open up a new thread.

Thank you.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.