Skip Navigation

[Resolved] Forms Commerce not working anymore

This thread is resolved. Here is a description of the problem and solution.

Problem: I have configured a Form for Forms Commerce, and I've found that the post created by the Form is published if the User abandons their payment without processing. This post should be in Draft state during the Payment Processing step.

Solution: In the main Form settings, check the publish status of the post. It should be Draft to handle the case where a User abandons before payment processing.

This support ticket is created 4 years ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Author
Posts
#1578277

Hi,

I'm using a user form with Forms Commerce on hidden link. It was working fine, but today - seemingly all of a sudden - it is not working anymore.

When the user fills out the form and clicks on "Send", they are taken to the shopping cart page where a message is displayed that the cart is empty and that they should purchase a product (in the settings, I have set it so they should go to the checkout page).

The content of the form they filled out ís published on the site (in the settings, I have set Purchase processing to Draft).
There is no order generated in WooCommerce.

Again, up until this morning there were no problems using Form Commerce on this page. What could be happening here?

#1578687

Hi, I'll be glad to take a closer look.
- Is the Form configured to always purchase the same product, or is the product variable based on a field in the form?
- Is the product in stock and available in the store?
- Are your plugins all up-to-date? Is your WordPress installation up-to-date?

#1579861

Hi Christian,

Thanks for your help, I greatly appreciate it!

- The Form is configured to always purchase the same product.
-The product in stock and available in the store (it's a virtual product)
- My plugins all up-to-date? My WordPress version is 5.4.

Regards, Paul

#1583073

Okay thank you. Please run a test for me and let me know the results:
- If you want to activate a Maintenance Mode plugin during testing, that is okay
- Temporarily deactivate all plugins except Toolset (Types, Views or Blocks, WooCommerce Views, Forms, Forms Commerce) and the basic WooCommerce plugin.
- Temporarily deactivate all custom code in Toolset > Settings > Custom Code
- Temporarily switch to a default theme like Twenty Twenty
- Test again.
- If the problem is resolved, reactivate your theme and other plugins one by one until the problem returns
- If the problem is not resolved, please turn on server logs and run the test one more time. If you are not familiar with server logs, I can show you how to temporarily activate them. Go in your wp-config.php file and look for

define('WP_DEBUG', false);

Change it to:

define('WP_DEBUG', true);

Then add these lines, just after the WP_DEBUG line:

define('WP_DEBUG_LOG', dirname(__FILE__) . '/error_log.txt');
define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );
define('WP_DISABLE_FATAL_ERROR_HANDLER',true);

Run the test once again. If any server-side errors are triggered during this process, it will create an error_log.txt file in your site's root directory. Use FTP to look for this file in the same directory as wp-content, wp-admin, and wp-config.php. You may need to click "Refresh" in your FTP browser to see a new file appear. Please download this file to your computer, open it in any text editing software, and send me its contents. Once that is done, you can revert the changes you made to wp-config.php and delete the log file.

#1586277

Thanks for your help Christian. I'm a little overwhelmed by other things, it will take a little time before I can try your solution. I'll get back to you when I've done so.
Regards, Paul

#1587017

Hi Christian,

I followed the steps you have outlined. I deactivated all plugins, except the ones you mention. I have made the changes to the wp-config.php file, but there is no error_log.txt file in my file structure (not in wp-content, wp-admin, or wp-config.php). So I'm afraid I cannot share the error log (if any) with you.

The following scenario's apply with the plugins deactivated or activated, it makes no difference.

What happens now is:
Scenario (1): I fill out Form, click SEND, but abort payment:
"payment is not possible while cart is empty"
"your cart is currently empty"
No order received in WooCommerce
However: the article ís published on the frontend (!)

Scenario (2): Trying the same thing, AFTER clicking F5 (clear browser cache)
Fill out Form, click SEND, I am taken to the checkout form, but I abort the payment process:
No order received in WooCommerce
However: the article ís published on the frontend (!)

Scenario (3): I fill out the Form, click SEND, I am taken to the checkout form ánd I finish the payment process:
Article is saved as Draft.
Order is received in WooCommerce.
Changing the order status to "Complete" in WooCommerce:
Article status is updated to Published by Toolset,
Article is published on the frontend.
So in scenario (3), everything is working correctly as it should.

When the same customer goes back to enter another article through the form: no problem (i.e. scenario (1) does not occur, scenario (2) still applies, though). So I am not sure what causes the users to sometimes experience scenario (1).

Regardless if scenario (1) occurs, scenario (2) is a huge problem, because it lets visitors publish content to the frontend immediately and without making a payment.

I hope you can help me with this.
Regards,
Paul

#1587541
Screen Shot 2020-04-15 at 5.41.40 PM.png

Okay thanks for the rundown. I can see a log has been generated here: hidden link
However, it doesn't indicate any major failures that would contribute to the behavior you described as far as I can tell. It probably was created after your tests for some unrelated reason. Whatever that may be, feel free to delete it and update your config file to turn off logs.

One more thing to check - in the Form settings, what post status is chosen? Not in the Forms Commerce settings, but in the main Form settings (see screenshot here). If that is "Draft", then I'll need to take a closer look and see what's going on. Please provide login credentials in the private fields here, so I can create a clone of your site with the Duplicator plugin and run some tests locally.

#1587859

Hi Christian,
The status in the in the main Form settings is Published. I see how that could be the culprit :-). I'll check what happens if I change this to Draft or to Waiting for Payment.
Thanks so far, I greatly appreciate your help!
Regards,
Paul

#1588497

Okay great, I'll stand by for your update. Hopefully this is not a sign of a more systemic issue.

#1589519

Hi Christian,

Changing the status in the in the main Form settings to Draft did indeed solve the issue. When I fill out the form, but abandon the payment process, the article is added on the backend, but not published on the frontend. Should the user not conclude the payment later on, I can just remove the article.
So problem solved!
Thanks for all your help.
Regards,
Paul

#1589525

My issue is resolved now. Thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.