Vertiges
Forum Replies Created
-
Hello Jignesh,
I would like to confirm that we have now completed full end-to-end testing in both languages.
After testing in sandbox mode with the latest patched version, I can confirm the following:
- PayPal button payments (FR and EN)
- Checkout validation messages display in the correct language
- Order-received page redirects to the correct language
- Confirmation emails are fully localized (including month names)
- Direct credit card payments (Advanced Card Payments, FR and EN)
- Checkout validation messages display in the correct language
- Order-received page redirects to the correct language
- Confirmation emails are fully localized (including month names)
All flows now behave correctly from checkout through email notification.
We also identified a ModSecurity false positive on our hosting environment (rule 340162) blocking the /wc-api/ endpoint used during card processing. After whitelisting that rule, the card flow worked as expected. This appears to be infrastructure-related rather than plugin-related, but I am mentioning it in case it helps other users encountering similar 403 errors.
At this point, we have removed our temporary locale workaround code, and everything continues to function properly.
Thank you again for the excellent support and for addressing the Polylang compatibility issues so quickly.
Best regards,
Hello Jignesh,
Thank you very much for the quick turnaround and for providing the patched version.
I have tested a new order in English, and I can confirm that the month in the confirmation email is now correctly displayed in English. The localization issue appears to be resolved on our side.
The next step for us will be to test the direct credit card payment flow. I will clone the site and run tests in sandbox mode to verify that the order-received redirect and email localization also behave correctly in that scenario.
We really appreciate your responsiveness and the effort you put into addressing this.
Best regards,
Thank you for the suggestion.
In our testing,
pll_current_language()returns an empty value in the/wc-api/context, which is essentially the root of the issue. At that point Polylang has not fully bootstrapped the language, so the Polylang API is not reliable there and can’t be used as a sole source of truth for locale switching.Regarding cookies being disabled: Polylang’s front-end language selection relies on its language cookie. If that cookie is absent, the bilingual site behavior becomes inconsistent anyway (e.g., language context can’t be persisted across requests). In practice, the cookie is therefore a safe and reliable signal specifically for these technical endpoint requests.
That said, I agree that the most compatible approach would be:
- Try
pll_current_language('slug')first when it returns a valid value, - and fall back to the Polylang cookie (and/or a language parameter in the return URL) when it does not.
We have not yet tested whether the direct credit card flow behaves differently for the order-received redirect and notification emails. If you have tested that flow, I’d be very interested to know whether it reproduces the same behavior in your setup.
Hello Jignesh,
Thank you so much for the incredibly fast turnaround — a fix in less than 24 hours for a free plugin is truly exceptional. We really appreciate it.
After testing version 9.0.57.1, here are the results:
✅ Order-received page now redirects to the correct language
✅ Order confirmation email is now sent in the correct languageOne small remaining issue:
The order date in the confirmation email still appears in the site default language (French) instead of the customer’s language. For example, an English customer receives: [Order #26598] (février, 27 2026) — the month name is in French.Separate issue — validation error messages:
When a customer clicks the PayPal button without filling in the required billing fields, the validation error messages appear in the wrong language (French instead of English). This happens because the PayPal button triggers a /wc-api/ request where Polylang does not apply its language detection.We were able to work around this with the following code, which may be useful for your Polylang compatibility implementation:
add_filter( 'determine_locale', function( $locale ) {
if ( is_admin() ) {
return $locale;
}
$uri = $_SERVER['REQUEST_URI'] ?? '';
$is_wc_ajax = ! empty( $_REQUEST['wc-ajax'] );
$is_wc_api = ( strpos( $uri, '/wc-api/' ) !== false );
if ( ! $is_wc_ajax && ! $is_wc_api ) {
return $locale;
}
$pll_slug = isset( $_COOKIE['pll_language'] )
? sanitize_key( $_COOKIE['pll_language'] )
: '';
if ( $pll_slug === 'en' ) return 'en_US';
if ( $pll_slug === 'fr' ) return 'fr_CA';
return $locale;
}, 0 );Note: the locale mapping (en → en_US, fr → fr_CA) is specific to our site. A more generic implementation could read the locale directly from Polylang’s language model.
Thank you again for your responsiveness and dedication to this plugin.
Best regardsHi @jigneshmpatel
Thank you so much for your quick and effective support!Apologies for the initial confusion about Braintree — I really appreciate the time you took to investigate despite the misunderstanding. Your responsiveness and the speed at which you resolved the issue were truly impressive.
The temporary fixed version you provided worked perfectly, and I’ve just updated to the latest official release — everything is functioning exactly as expected now.
Thanks again for your great work and support!
Best regards and have a great day!
Hi,
Thanks for your response. After thorough testing, it appears that the issue is specifically tied to the credit card payment method using Hosted Fields (
payment_method_wpg_paypal_checkout_cc) in your plugin.When submitting the checkout form with required fields missing (e.g., first name), instead of triggering WooCommerce’s native validation, the submission is interrupted and an “Unknown error occurred” message is displayed.
This issue does not occur with the standard PayPal payment button, which correctly allows WooCommerce validation to run before proceeding.
In your script ppcp-paypal-checkout-for-woocommerce-public.js, the following line appears to override the default behavior:
$('form.checkout').on('checkout_place_order_wpg_paypal_checkout_cc', (event) => {
event.preventDefault();
return this.handleCheckoutSubmit(event);
});
This effectively bypasses WooCommerce’s validation logic. SincehandleCheckoutSubmitdoesn’t replicate that logic on its own, users can click “Place Order” with missing or invalid data and get a generic error instead of proper field-level messages.It would be great to adjust this logic to allow WooCommerce’s native validation to complete before
handleCheckoutSubmit()is triggered — or, alternatively, explicitly perform equivalent validation within your handler.Let me know if you’d like help testing a fix.
Best regards
Thank you @xue28
@xue28 Thank you. I’m testing it… So far, so good.
Following
Forum: Plugins
In reply to: [WooCommerce] Error about mercadopago within woocommerce logs..Same here…
Any updates concerning this problem?
I would be great to have access to both Wooocommerce orders and LearPress orders from the Orders Tab in the Profile Page.
Regards
@paul-m-uk, Thank you so much, you saved my day! I’ve been searching for hours.
Hi,
I got the same problem. It seems that the following is missing from the learnpress-woo-payment.pot
#: learnpress-woo-payment/templates/add-course-to-cart.php:35
msgid “Add to cart”
msgstr “”Best regards
Content que ce soit réglé!
Salut Rashel, as-tu sélectionné une page d’accueil statique dans Apparence ==> Personnaliser ==> Réglages de la page d’accueil ==> …
- PayPal button payments (FR and EN)