[Resolved] URGENT - WooCommerce Multilingual breaks Stripe Gateway in WooCommerce
This thread is resolved. Here is a description of the problem and solution.
Problem:
When I enable WooCommerce Stripe Gateway, there are no Stripe settings. I can’t change anything in the settings, I always get the “Error Saving settings”.
Solution:
Go to wp-content/plugins/woocommerce-multilingual/classes/Rest and edit the Functions.php file. Here, just change this line:
My Stripe Gateway worked fine for several years, until a few days ago. Today I found my plugin disabled and when I enabled it, there were no Stripe settings. I can’t change anything in the settings, I always get the “Error Saving settings”.
I narrowed it down to one plugin: WooCommerce Multilingual. When I disable it, my Stripe Gateway settings work. When I enable it, it breaks.
When I go to the settings page of the plugin I immediately get 3 error messages at the bottom, then they disappear:
I just installed the WooCommerce Stripe Payment Gateway plugin on my website and when I go to the WooCommerce → Settings → Payments → Settings tab, I don't get any error message, even if the WooCommerce Multilingual is active.
I tried to enable and disable the Enable Stripe option but the error messages don't appear. However, once I try to add the keys, I get this message Error retrieving account keys. I tried to deactivate all the WPML plugins and I still get the same message.
Looks like I was able to save the keys after I deactivated and activated back WooCommerce Stripe Gateway, then go back to the plugin settings page. This time, the keys were saved correctly.
Once I activated back the WPML plugins too and tried again to save the keys, the issue was gone. I was able to save the keys, without deactivating WPML.
I'm not sure why was this needed but this did the trick for me. Can you give this a try on your website too and tell me if it makes the issue go away, please?
This doesn't work for me. My setup is different, the plugin actually already has settings. And as long as WooCommerce Multilingual is activated, just opening the settings page shows errors (it can't retrieve any). Deactivating WooCommerce Multilingual allows for settings to be loaded and edited.
I can give you access to my staging site where you can see this for yourself and play with it. I need a quick fix to be able to put this back in production on my live site. Right now, I just don't have a credit card payment option and that can't be good for sales as you can imagine.
I totally agree that not having one of the payment methods is not a good idea.
The next reply is set to be private so you can safely send me the credentials to the staging website so I can have a look.
I updated the password to make it match with the one I gave you. It works now, I tested it. Sorry for the delay.
By the way, here is what the WooCommerce team wrote on my ticket with them:
From the conflict test, we found that the issue is due to the WooCommerce Multilingual: by OnTheGoSystems plugin so we won't be making any further changes to the site.
I just logged into your site to see if there are any related errors on the logs and I couldn't find any. So it seems that WooCommerce Multilingual support will be in the best place to support this issue since they will be familiar with the features of their plugin.
Thank you for changing the password for the account you created for me.
I was able to check this one out and see why is this happening. The good news is that this can be temporarily fixed by going to WPML → Languages → Language URL format and unchecking the Use directory for default language option.
The bad news is that this is the only fix I can suggest for now. It seems that when the directory for default language is enabled, the request made by the Stripe Gateway plugin is done to this route: hidden link
while the route should be without the /fr/ part. You can check the staging website where I made this change, the settings page is loading fine now.
I asked my colleagues to have a look at this to see if there's any other workaround that can be applied for now, before escalating this to the compatibility team for a closer look.
I'll give you an update about this as soon as one of my colleagues is having a look.
Thanks for looking into it. Unfortunately I can't do your quick fix on the live site, all my pages are indexed with the /fr directory for French (which is the main language), I have google ads and all sorts of links pointing to the products in the store with /fr. So it's really not a good idea to change that as a temporary fix.
Can you look into maybe a piece of code to put in functions.php to go around whatever issue is happening until it gets properly fixed?
I understand that disabling this option is not a good idea (that's the reason why I said that this is the bad news) but for now, there's no other change I can suggest as a temporary fix.
I escalated this issue to the 2nd tier support and connected our internal thread to this ticket so I can keep you updated about the progress we're making on this.
I read your last message but I don't have any code for making this kind of change. For now, we can only wait for the 2nd tier to check this out and see what needs to be changed.
I did look for this kind of redirect after you asked if a redirect of a route can be done but I didn't find anything about this. I don't think that the routes work like simple page links and that's why I didn't suggest this kind of redirect through the .htaccess file.