• Resolved dynamiccorvettes

    (@dynamiccorvettes)


    ok so, we are currently on
    – wordpress 6.8.2
    – woocommerce 10.1.1

    we migrated our site and ever since we have had issues with a plugin (clover-payments-for-woocommerce). it would give us a white screen whenever logged in as admin. but that’s not what I’m posting about.

    That being said, i disabled the plugin as we don’t take online payment anyway. We have always had cash on delivery as our primary payment method under “take offline payments”. Ever since we disabled the plugin, we get an error when trying to check out.

    “There was an error processing your order. Please check for any charges in your payment method and review your order history before placing the order again”

    i have in every single way tried to direct the site to use the offline payment as default, and it shows up in the [woocommerce_checkout] as the only option. However when i go to place the order i get the previously mentioned error. I’m at my wits end trying to find a solution and am hoping i can get help here. or at least pointed in the right direction.

    Your help and time is appreciated

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Stef

    (@serafinnyc)

    Hey @dynamiccorvettes

    It sounds like checkout is still trying to run Clover logic even though the gateway is disabled. That’s common after a migration because sessions, transients, or a leftover hook can keep pointing to the old gateway.

    Start by looking at the real error. In wp admin go to WooCommerce then Status then Logs and open the newest fatal errors log. If you see Clover in the stack, it confirms a leftover hook or file is still loading.

    Clear anything that could be “remembering” the Clover gateway. In wp admin go to WooCommerce then Status then Tools and run Clear Customer Sessions and Clear Transients. If you know how to use WP-CLI, this is safe to run wp transient delete –all

    Make sure Cash on delivery is truly the only active gateway. Go to WooCommerce then Settings then Payments. Disable everything except Cash on delivery. Open the Cash on delivery settings and check the enable for shipping methods section. If you limited COD to specific shipping methods and the cart’s current shipping method doesn’t match, Woo will show COD in the form but fail at place order. Temporarily remove all restrictions and save.

    Force the default gateway to COD so nothing tries to choose a missing Clover method from an old session. Drop this in a small site plugin or your theme’s functions.php and test:

    add_filter(‘woocommerce_default_gateway’, function($default){ return ‘cod’; }, 99);

    Check for lingering Clover code. Look in wp-content/mu-plugins, wp-content/plugins, and any “code snippets” plugin for anything referencing Clover or clover-payments. A single add_action on woocommerce_checkout_process can throw that generic “error processing your order” even if the gateway is disabled.

    Rule out theme or other plugins. Do a quick conflict test by switching to Storefront and leaving only WooCommerce active. If checkout works, re-enable your theme and plugins gradually until the failure returns.

    If it still fails, enable debug logging, reproduce the error once, and read wp-content/debug.log. Add this to wp-config.php above the “That’s all, stop editing” line:

    define(‘WP_DEBUG’, true);
    define(‘WP_DEBUG_LOG’, true);
    define(‘WP_DEBUG_DISPLAY’, false);

    If you share the exact fatal error or stack from the Woo fatal log or debug.log, we can point to the specific line that’s blocking checkout. Most of the time the fix is either clearing sessions so the old clover gateway id isn’t selected, removing one leftover Clover hook, or loosening the COD shipping restriction so the selected rate matches.

    Thread Starter dynamiccorvettes

    (@dynamiccorvettes)

    hey there, sorry for the late reply. I actually have done most of that prior to posting here. I was getting stuck and thats what led me to post here.

    I ended up getting it taken care of.

    The issue ended up being a line in the FileController.php

    Its a temporary fix but we’re up and stable now.

    gjz001

    (@gjz001)

    i have more or less the same problem. I also get the
    “There was an error processing your order. Please check for any charges in your payment method and review your order history before placing the order again” notice on COD. Can you tell me how you solved it with the Filecontroller.php file? COD doesn’t work, but paying by cheque is no problem. So i renamed that in the meantime and i can accept new orders.

    • This reply was modified 7 months ago by gjz001.
    • This reply was modified 7 months ago by gjz001.
    Plugin Support shahzeen(woo-hc)

    (@shahzeenfarooq)

    Hi @dynamiccorvettes

    I’m glad to hear you were able to get things working again by making changes to the FileController.php file. Could you share what exact changes you applied so we can better understand the fix?

    If you’d like, we can also help you troubleshoot further to resolve the root cause and get a more permanent solution in place. Just let us know.

    Hi @gjz001

    I understand that you have a somewhat similar problem.

    However, per forum best practices shown here, it is advised that you create a new thread so that we can address your issue(s) separately.

    You can create a new thread here: https://wordpress.org/support/plugin/woocommerce/#new-topic-0 and make sure to include as much information as you can.

    Thanks for understanding!

    Thread Starter dynamiccorvettes

    (@dynamiccorvettes)

    @gjz001 I’m not sure if it will work for you but it’s worth a shot.
    @shahzeenfarooq of course

    changed lines 677-679 in
    /home/dynami16/dynamiccorvettes.com/wp-content/plugins/woocommerce/src/Internal/Admin/Logging/FileV2/FileController.php

    old

    public function invalidate_cache(): bool {
    return WC_Cache_Helper::invalidate_cache_group( self::CACHE_GROUP );
    }

    new
    public function invalidate_cache(): bool {
    $result = WC_Cache_Helper::invalidate_cache_group( self::CACHE_GROUP );
    return $result === true;
    }

    It’s kind of a brute force method as it was expecting a Boolean and not a string. so i just forced it to return a boolean.

    It may not be the prettiest fix, but it works.

    Hi @dynamiccorvettes,

    Thank you for sharing the fix you applied. I understand this is more of a temporary workaround, since any WooCommerce update will likely overwrite it.

    If you’re open to running a more thorough test, please let us know or consider performing a conflict test on a staging environment. To do this, activate the Storefront theme, deactivate all plugins except WooCommerce, and then share the link to the staging site so we can test and observe the behavior on our end.

    Plugin Support Chris Moreira – a11n

    (@chrism245)

    We haven’t heard back from you in a while, so I’m going to mark this as resolved – we’ll be here if and/or when you are ready to continue.

    If you have a few minutes, we’d love if you could leave us a review: https://wordpress.org/support/plugin/woocommerce/reviews/

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘issue with offline payment’ is closed to new replies.