Skip to content Skip to sidebar

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 14:00 9:00 – 14:00 9:00 – 14:00 9:00 – 14:00 9:00 – 14:00 -
- 15:00 – 18:00 15:00 – 18:00 15:00 – 18:00 15:00 – 18:00 15:00 – 18:00 -

Supporter timezone: Asia/Dhaka (GMT+06:00)

This topic contains 7 replies, has 1 voice.

Last updated by Prosenjit Barman 7 months, 1 week ago.

Assisted by: Prosenjit Barman.

Author Posts
December 5, 2024 at 8:36 am #16479880

anthonyC-48

Background of the issue:
I am using the WooCommerce Stripe Gateway plugin with WooCommerce, set up English as the default language and French as the second language. I am trying to ensure that the checkout process works in both languages. The issue can be seen at hidden link.

Symptoms:
In the French language, the console shows a 404 error for hidden link on the cart page. On the checkout page, the cart items and payment section initially load, but then a loader runs indefinitely. The console shows 404 errors for both hidden link and hidden link. As a result, customers can't checkout in French.

Questions:
Why is there a 404 error for the Stripe cart details in French?
How can I resolve the loading issue on the checkout page in French?

December 5, 2024 at 8:44 am #16479964

anthonyC-48

Please check the issue asap as it is a live site ad customer facing the issue in French checkout.

December 6, 2024 at 8:53 am #16485053

anthonyC-48

Its been a day and still no reply. Can you please help me out as it is a live site and customers are facing the issue.

December 9, 2024 at 8:50 am #16491410

Prosenjit Barman
WPML Supporter since 03/2023

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hi There!
Thanks for contacting WPML Support. Sorry for the delay in responding due to the weekend!

I understand the issue you're having. The 404 error for wc-ajax endpoints in the WooCommerce Stripe Gateway on the French checkout page is likely caused by missing or improperly configured AJAX endpoints for other languages.

As a first step to debug the issue, could you please deactivate all plugins except for WPML, String Translation, WooCommerce, and WooCommerce Multilingual?

If the issue is resolved after doing this, start reactivating the plugins one by one. After activating each plugin, refresh the cart/checkout page and check if the issue reappears. This will help you identify which plugin is causing the problem.

Additionally, please also check what happens if you change the language URL format to "Language name added as a parameter" by going to "WPML > Languages"

Let me know how it goes. I will be happy to help if you need further assistance on this matter.

Best regards,
Prosenjit

December 9, 2024 at 12:48 pm #16492907

anthonyC-48

I have changed the language URL format to "Language name added as a parameter" and French checkout working fine. Now how to solve it with "Different languages in directories"?

December 10, 2024 at 5:16 am #16495825

Prosenjit Barman
WPML Supporter since 03/2023

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hi There,
Thank you for the update.

Since the issue is resolved by changing the URL format to "language as a parameter," it appears that the Stripe endpoint is configured to work only with the main domain, not with directory-based structures. This is likely because, in "different directory per language" mode, the language code is appended as a directory after the domain, which Stripe interprets as a directory, causing the issue.

However, could you please share the results after testing with all plugins disabled except for WPML, String Translation, WooCommerce, Stripe, and WooCommerce Multilingual?

I would also like to mention that we encountered a similar case previously, which we were able to resolve by making a small change in the WooCommerce Multilingual plugin code. If the issue persists with only the plugins I mentioned above active, could you please try the solution provided in the link below and check if it resolves the problem?

- https://wpml.org/forums/topic/urgent-woocommerce-multilingual-breaks-stripe-gateway-in-woocommerce/page/2/#post-10342619

Let me know the update. I'll be happy to help if you need further assistance in this matter.

Best regards,
Prosenjit

December 11, 2024 at 10:08 am #16502678

anthonyC-48

This is the live site and I can't disabled all the plugins or do testing here. If possible, can you please make a copy of the site and setup on your server for testing?

Also I didn't find the code mentioned here in wp-content/plugins/woocommerce-multilingual/classes/Rest/functions.php file.

December 12, 2024 at 3:26 am #16505914

Prosenjit Barman
WPML Supporter since 03/2023

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hi There!
Thank you for your response.

To ensure we resolve this issue without impacting your live site, I strongly recommend creating a development (staging) environment. This will allow us to replicate the issue, perform necessary tests, and troubleshoot without any risk to your live website's functionality or user experience.

Why is a Staging Environment Important?
- Risk-Free Testing: Changes, tests, or troubleshooting on the staging site do not affect your live site, ensuring visitors and customers have an uninterrupted experience.
- Accurate Diagnosis: By replicating the live site on a staging environment, we can pinpoint the root cause of the issue effectively and confirm a solution before applying it to the main site.
- Seamless Updates: Once a fix is confirmed on the staging site, it can be safely applied to the live site with confidence.

If your hosting provider supports it, you can easily create a staging site using their built-in tools, as many providers offer a "One-Click Staging" feature. If you're unsure where to find this option, I recommend reaching out to your hosting provider's support team—they should be able to assist you in setting up the staging site quickly.

Once the staging site is ready, I can replicate the issue, identify the cause, and test solutions without affecting your live site.

Additionally, regarding the missing code in wp-content/plugins/woocommerce-multilingual/classes/Rest/functions.php, it’s possible that this is due to a mismatch in plugin versions or customizations. Could you kindly search for keywords like "home_url" or any other terms mentioned in the code? This will help confirm whether the function exists elsewhere or has been modified in your setup.

Let me know the update. I'll be happy to help if you need further assistance in this matter.

Best regards,
Prosenjit

The topic ‘[Closed] Stripe checkout for second language’ is closed to new replies.