Skip to content

woo emails don't work #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
vonsch76 opened this issue Dec 10, 2015 · 3 comments
Open

woo emails don't work #23

vonsch76 opened this issue Dec 10, 2015 · 3 comments

Comments

@vonsch76
Copy link

Guys, sorry to be the bad guy - again. Anyway I need to report you that woo emails are not working with woocommerce-qtranslate-x.

Here is the database entry for the order

image

as you can see it is English. The communication for the same order is fully Hungarian though

image

The only exception is the 3rd email that I send separate (even from a separate address). That also uses _user_language entry of the database, sets q_config language to that and uses qtranxf_useCurrentLanguageIfNotFoundUseDefaultLanguage()

Naturally the English strings are also in WooCommerce, but does not use.

WP 4.2.4
Woo 2.3.13
Woo & qTx 1.3
qTx 3.4.6.4

@tkp-universe
Copy link

I too was having some issues with getting Woocommerce to send order confirmation emails in the right language. But I got it working, and wanted to share my findings...

I found that a few things need to be checked - or they could interfer with woocommerce order-confirmation email languages:

  1. check that the language set on your own wordpress user account is set to 'website default'. If it is set to a specific language it may interfer with your own testing of used languages on woo-orders in the woocommerce backend.

  2. check your woocommerce credit-card-payment plugin. I found that some credit-card-payment plugins may have issues with call-backs from the card acquirer not containing language info. As such this may confuse woo as to what language should be used for the order-confirmation email. Do your testing with STRIPE it works !

@vonsch76
Copy link
Author

vonsch76 commented Mar 3, 2017

Unfortunately the issue is still present a not solved. It seems that if there is further processing of an item - within WooCommerce-, then admin language is inherited and not the stored user language.

@vonsch76
Copy link
Author

vonsch76 commented Mar 3, 2017

The problem is not Qtranslate-X rather WooCommerce.

As you want the Woo to send messages in the order language, maybe different than your admin language. Setting WP language on the fly is not easy. Naturally setlocale(LC_ALL, ) does not work - has no effect, as changing the local via add_filter.

Maybe switch_to_locale( $locale ) changes also this, but haven't upgraded to that so far.

Found a bush fix / ugly, works. The trick is to use the filters provided earlier, unload WooCommerce's textdomain and force WooCommerce to load the .mo files with load_textdomain().

#12

Naturally you need to create a .mo files for English as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants