• Resolved lhornaday

    (@lhornaday)


    I’m having the same issue as others with the credit card form missing or, rather, disabled/uneditable. I have discovered that it is only disabled if I have not recently logged into the admin account. It works every time if I am logged in. It is very strange and hard to debug. Nothing is in the PHP error log. I began receiving emails about the issue about a month ago.

    It would help to have a list of things to check. Thank you.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Support omarfpg a11n

    (@omarfpg)

    Hi @lhornaday,

    Thank you for reaching out to us. I understand you’re having issues with your credit card form not showing up. That’s unusual and it may mean something is interfering with your install. I’d like to understand your site properly. Please share with us the necessary information below for us to investigate the issue further:

    • System Status Report which you can find via WooCommerce > Status > Get system report > Copy for support.
    • Fatal error logs (if any) under WooCommerce > Status > Logs.

    You could copy and paste your reply here or paste it via https://gist.github.com/ and send the link here.

    Once we have more information, we’ll be able to assist you further.

    Thanks!
    -OP

    Thread Starter lhornaday

    (@lhornaday)

    I just noticed a JS error when the form doesn’t load properly. This is from within a private Firefox window and not logged in.

    Uncaught (in promise) SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
    
    wp-content/plugins/woocommerce-payments/dist/checkout.js?ver=7.4.0:1

    If I view the form in another browser session while logged in, there is no error. Then I return to the private window and the error is removed and the form loads properly.


    I will report back after doing a fresh install and tranisitiong over to using blocks instead of shortcodes for the checkout process.

    • This reply was modified 7 months, 3 weeks ago by lhornaday.
    Plugin Support Shameem R. a11n

    (@shameemreza)

    Hi @lhornaday,

    Since you’ve mentioned that the error doesn’t occur while you’re logged in, it could be a session or caching issue. It might also be due to a conflict with another plugin or your theme.

    To isolate the issue, you could try the following steps:

    1. Clear your browser cache and cookies.
    2. Deactivate all other plugins except for WooCommerce and WooCommerce Payments to see if the issue persists.
    3. Switch to a default WordPress theme like Storefront to rule out any theme conflicts. You can find a more detailed explanation on how to do a conflict test here.

    Additionally, head over to WooCommerce → Status → Tools, and do the following:

    • WooCommerce transients – Clear
    • Expired transients – Clear
    • Clear template cache – Clear
    • Capabilities – Reset Capabilities
    • Clear customer sessions -Clear

    Next, please clear your browser cache and then check again.

    If this makes no difference, please share a copy of the following:

    • System Status Report: Navigate to WooCommerce → Status. Select Get System Report and then Download for Support.
    • Fatal Error log: Share a copy of any fatal error log found under WooCommerce → Status → Logs.

    You could copy and paste your reply or share it via Mozilla Community Pastebin and share the link here.

    Please keep us updated on your progress. We’re here to help you resolve this issue.

    Thread Starter lhornaday

    (@lhornaday)

    Thank you both. I’ve completed the cache-clearing steps, as well as a complete plugin removal and fresh download and install. It seems to be working; however, it is usually 12-24 hours before the form ceases to load.

    I would highly appreciate the info if there is a specific cache that could be cleared to speed up debugging. I’ll provide a full list of steps completed once it is confirmed to be working.

    Plugin Support ckadenge (woo-hc)

    (@ckadenge)

    Hi @lhornaday,

    I appreciate your efforts in troubleshooting the issue by clearing the cache and reinstalling the plugin. It’s great to know that it seems to be working now.

    I would suggest monitoring the form’s performance closely for the next 12–24 hours for any unusual occurrences. This information can be very helpful in diagnosing the problem.

    You can also find steps on how to configure caching plugins for WooCommerce here.

    Let us know how it goes.

    Thread Starter lhornaday

    (@lhornaday)

    This issue has been resolved. The fix is described below and may be helpful to plugin developers.

    I reluctantly admit the problem was my own creation. I didn’t see my plugin as an issue because it has been in use for years and it threw no errors or warnings. The problem only occurred with asynchronous loading, such as with JSON data.

    I had to change the way I check if WooCommerce is active. I now use this to ensure the WooCommerce instance is not null. Checking the existence of the class is no longer enough.

    // Bail if WooCommerce is not enabled.
    if ( ! class_exists( 'WooCommerce' ) || ! function_exists( 'WC' ) ) {
     return false;
    }	
    
    // Get the WooCommerce instance.
    $woocommerce = WC();
    
    // Bail if WooCommerce instance is null.
    if ( is_null( $woocommerce ) ) {
     return false;
    }

    Additionally, I had to remove some custom usage related to the woocommerce_prevent_admin_access filter. Something in the asynchronous processes requires access to load the payment form.

    The biggest breakthrough was tracking down the transient that controls the form loading (_transient_timeout_wcpay_locale_info). Removing the timestamp helped me recreate the problem instantly instead of waiting 24 hours. That’s why it would work correctly for everyone if I had recently loaded the form.

    Thanks so much for the assistance, Luke.

    Plugin Support Shameem R. a11n

    (@shameemreza)

    Hi @lhornaday,

    I’m glad you were able to find a solution to your inquiry here and thanks for sharing it with the community too! ??

    Should you have further inquiries, kindly create a new topic here.

    Thanks!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Credit card form missing’ is closed to new replies.