Skip to content
This repository has been archived by the owner on Mar 17, 2022. It is now read-only.

Wocoommerce automatic emails sent in English #321

Closed
innovanity opened this issue Apr 5, 2018 · 11 comments
Closed

Wocoommerce automatic emails sent in English #321

innovanity opened this issue Apr 5, 2018 · 11 comments

Comments

@innovanity
Copy link

Hello,
We have installed your plugin in a multilanguage site in Spanish, English and German.
We have done several orders, with the site in Spanish (including Cart and Checkout pages in Spanish), but the Wocoommerce emails are sent in English.

Can you reproduce this issue on default Wordpress theme (eg Storefront)?

Can you reproduce this issue when all other plugins are disabled except WooCommerce, Polylang and Hyyan WooCommerce Polylang Integration?

What product versions and settings are you using when this issue occurs?

  • PHP: 5.6.35
  • WordPress: 4.9.4
  • WooCommerce: 3.3.4 (we have also downgraded to 3.2.6, as jonmoore said us is not tested for 3.3.x)
  • Polylang: 2.3.4
  • Hyyan WooCommerce Polylang Integration: 1.0.4 (we have marked every option)
  • Browser: -

Steps to Reproduce

It's just the automatic emails sent by Woocommerce after an order is done.

What I Expected

As I am making the order in Spanish, the emails should be sent in Spanish, but we receive it in English (eve the primary language in Polylang is Spanish). However, If I change afterwards the order status in the backend, those emails are sent in Spanish; but the automatic ones (like the “new order” email for customer and admin), always in English.

What Happened Instead

Automatic Woocommerce emails sent always in English.

Thanks in advance.

@innovanity
Copy link
Author

UPDATE: We have just realised it only happens with TPV payment; with bank transfer emails are sent in Spanish.
We have tried two different Redsys modules, and also with two different bank account gateways.
In all cases, the TPV payment returns Woocommerce emails in English...
Could it be a bug in your module?

@Jon007
Copy link
Contributor

Jon007 commented Apr 5, 2018

what is TPV payment ?
there is no standard payment gateway called TPV, have you added another plugin, which is not compatible with the language switching?
Note, when raising a ticket you are supposed to paste in WooCommerce\Status\Get System Report which would include this and other information.

@innovanity
Copy link
Author

I am sorry, I used the Spanish acronym (TPV). I meant POS Terminal (Point-of-Sale Terminal), by Redsys payment gateway, and we tried two different modules for this gateway, and with 2 different POS banks, to check if it was a problem of the bank gateway or the POS module.

I'm attaching now the System Report:
`

WordPress Environment

Home URL: https://burgosexperience.com
Site URL: https://burgosexperience.com
WC Version: 3.3.4
Log Directory Writable: ✔
WP Version: 4.9.4
WP Multisite: –
WP Memory Limit: 1 GB
WP Debug Mode: –
WP Cron: ✔
Language: es_ES

Server Environment

Server Info: Apache
PHP Version: 5.6.35
PHP Post Max Size: 120 MB
PHP Time Limit: 900
PHP Max Input Vars: 20000
cURL Version: 7.54.0
OpenSSL/1.0.2k

SUHOSIN Installed: ✔
Max Upload Size: 120 MB
Default Timezone is UTC: ✔
fsockopen/cURL: ✔
SoapClient: ✔
DOMDocument: ✔
GZip: ✔
Multibyte String: ✔
Remote Post: ✔
Remote Get: ✔

Database

WC Database Version: 3.2.6
WC Database Prefix: hyhbqn_
Tamaño total de la base de datos: 11.45MB
Tamaño de los datos de la base de datos: 10.15MB
Tamaño del índice de la base de datos: 1.30MB
hyhbqn_woocommerce_sessions: Datos: 0.01MB + Índice: 0.00MB
hyhbqn_woocommerce_api_keys: Datos: 0.00MB + Índice: 0.00MB
hyhbqn_woocommerce_attribute_taxonomies: Datos: 0.00MB + Índice: 0.01MB
hyhbqn_woocommerce_downloadable_product_permissions: Datos: 0.00MB + Índice: 0.00MB
hyhbqn_woocommerce_order_items: Datos: 0.00MB + Índice: 0.00MB
hyhbqn_woocommerce_order_itemmeta: Datos: 0.03MB + Índice: 0.03MB
hyhbqn_woocommerce_tax_rates: Datos: 0.00MB + Índice: 0.01MB
hyhbqn_woocommerce_tax_rate_locations: Datos: 0.00MB + Índice: 0.00MB
hyhbqn_woocommerce_shipping_zones: Datos: 0.00MB + Índice: 0.00MB
hyhbqn_woocommerce_shipping_zone_locations: Datos: 0.00MB + Índice: 0.00MB
hyhbqn_woocommerce_shipping_zone_methods: Datos: 0.00MB + Índice: 0.00MB
hyhbqn_woocommerce_payment_tokens: Datos: 0.00MB + Índice: 0.00MB
hyhbqn_woocommerce_payment_tokenmeta: Datos: 0.00MB + Índice: 0.00MB
hyhbqn_woocommerce_log: Datos: 0.00MB + Índice: 0.00MB
hyhbqn_cntctfrm_field: Datos: 0.02MB + Índice: 0.00MB
hyhbqn_commentmeta: Datos: 0.02MB + Índice: 0.03MB
hyhbqn_comments: Datos: 0.02MB + Índice: 0.09MB
hyhbqn_imgoptimizations: Datos: 0.00MB + Índice: 0.00MB
hyhbqn_imgoptimizeractions: Datos: 0.00MB + Índice: 0.00MB
hyhbqn_links: Datos: 0.02MB + Índice: 0.02MB
hyhbqn_media_file_manager_log: Datos: 0.02MB + Índice: 0.00MB
hyhbqn_options: Datos: 4.22MB + Índice: 0.06MB
hyhbqn_postmeta: Datos: 4.20MB + Índice: 0.63MB
hyhbqn_posts: Datos: 1.31MB + Índice: 0.20MB
hyhbqn_termmeta: Datos: 0.02MB + Índice: 0.03MB
hyhbqn_terms: Datos: 0.02MB + Índice: 0.03MB
hyhbqn_term_relationships: Datos: 0.05MB + Índice: 0.02MB
hyhbqn_term_taxonomy: Datos: 0.02MB + Índice: 0.03MB
hyhbqn_usermeta: Datos: 0.05MB + Índice: 0.03MB
hyhbqn_users: Datos: 0.02MB + Índice: 0.05MB
hyhbqn_wcpdf_invoice_number: Datos: 0.00MB + Índice: 0.00MB
hyhbqn_wc_download_log: Datos: 0.00MB + Índice: 0.00MB
hyhbqn_wc_webhooks: Datos: 0.00MB + Índice: 0.00MB
hyhbqn_woof_query_cache: Datos: 0.00MB + Índice: 0.00MB
hyhbqn_wplc_chat_msgs: Datos: 0.02MB + Índice: 0.00MB
hyhbqn_wplc_chat_sessions: Datos: 0.02MB + Índice: 0.00MB
hyhbqn_wplc_offline_messages: Datos: 0.02MB + Índice: 0.00MB
hyhbqn_yoast_seo_links: Datos: 0.02MB + Índice: 0.01MB
hyhbqn_yoast_seo_meta: Datos: 0.02MB + Índice: 0.02MB

Post Type Counts

attachment: 214
carousels: 2
custom_css: 1
customize_changeset: 13
fl-builder-template: 6
global_product_addon: 2
nav_menu_item: 22
oembed_cache: 3
page: 43
polylang_mo: 3
post: 12
product: 26
revision: 307
shop_order: 23
tribe_events: 65
tribe_organizer: 9
tribe_venue: 13
wpcf7_contact_form: 11

Security

Secure connection (HTTPS): ✔
Hide errors from visitors: ✔

Active Plugins (35)

Polylang: por Frédéric Demarle – 2.3.4
Add From Server: por Dion Hulse – 3.3.3
Botones de compartir de AddToAny: por AddToAny – 1.7.25
Adminimize: por Frank Bültge – 1.11.4
All 404 Redirect to Homepage: por Fakhri Alsadi – 1.10
Beaver Builder Plugin (Developer Version): por The Beaver Builder Team – 2.0.6.4
Carousel Slider: por Sayful Islam – 1.8.7
Contact Form 7 Multi-Step Forms: por Webhead LLC. – 3.0.3
Contact Form 7: por Takayuki Miyoshi – 5.0.1
Cookie Law Info: por Richard Ashby – 1.5.3
Custom Upload Dir: por Ulf Benjaminsson – 3.4.3.1
Duplicate Post: por Enrico Battocchi – 3.2.1
Easy Booking: Disable Dates: por @_Ashanna – 1.5.5 – No probado con la versión activa de WooCommerce
Easy FancyBox: por RavanH – 1.6.3
Inno-Functions: por Innovanity – 1.1
Intuitive Custom Post Order: por hijiri – 3.1.1
Members: por Justin Tadlock – 2.0.2
Quantities and Units for WooCommerce: por Nicholas Verwymeren – 1.0.13 – No probado con la versión activa de WooCommerce
Referrer Input for Contact Form 7: por Damià Rita – 1.0.1
Rich Text Tags, Categories, and Taxonomies: por Katz Web Services
Inc. – 1.8

Clean Filenames: por Samuel Aguilera – 1.1.1
Tawk.to Live Chat: por Tawkto – 0.3.4
The Events Calendar: por Modern Tribe
Inc. – 4.6.11.1

Title and Nofollow For Links: por Flector – 1.02
optimizador.io: por David Noguera (webempresa.com) – 1.0.21
Hyyan WooCommerce Polylang Integration: por Hyyan Abo Fakher – 1.0.4 – No probado con la versión activa de WooCommerce
Woocommerce Easy Booking: por @_Ashanna – 2.1.7 – No probado con la versión activa de WooCommerce
WooCommerce Extra Fee Option: por Terry Tsang – 1.0.7 – No probado con la versión activa de WooCommerce
Pasarela de pago para Redsýs (modulosdepago.es): por Mikel Martin (ZhenIt Software) – 3.5.3 – No probado con la versión activa de WooCommerce
WooCommerce PDF Invoices & Packing Slips: por Ewout Fernhout – 2.1.6
WooCommerce Product Add-ons: por WooThemes – 2.7.18 – 2.9.2 está disponible – No probado con la versión activa de WooCommerce
WooCommerce: por Automattic – 3.3.4
Yoast SEO: por Equipo Yoast – 7.2
Enlaces Personalizados a Galerías WP: por johnogg – 1.12
WP Super Cache: por Automattic – 1.5.9

Settings

API Enabled: ✔
Force SSL: –
Currency: EUR (€)
Currency Position: right
Thousand Separator: .
Decimal Separator: ,
Number of Decimals: 2
Taxonomies: Product Types: external (external)
grouped (grouped)
simple (simple)
variable (variable)

Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog)
exclude-from-search (exclude-from-search)
featured (featured)
outofstock (outofstock)
rated-1 (rated-1)
rated-2 (rated-2)
rated-3 (rated-3)
rated-4 (rated-4)
rated-5 (rated-5)

WC Pages

Base de la tienda: #1915 - /experiencias/
Carrito: #60 - /carrito/
Finalizar compra: #61 - /finalizar-comprar/
Mi cuenta: #62 - /mi-cuenta/
Términos y condiciones: #795 - /condiciones-de-la-web/

Theme

Name: Beaver Builder Child Theme
Version: 1.0
Author URL: http://www.fastlinemedia.com
Child Theme: ✔
Parent Theme Name: Beaver Builder Theme
Parent Theme Version: 1.6.4
Parent Theme Author URL: http://www.wpbeaverbuilder.com/?utm_medium=bb-pro&utm_source=bb-theme&utm_campaign=themes-admin-page
WooCommerce Support: ✔

Templates

Overrides: bb-theme-child/woocommerce/content-single-product.php
La version 2.5.0 de bb-theme-child/woocommerce/global/quantity-input.php está obsoleta. La versión del núcleo es la 3.3.0
bb-theme-child/woocommerce/single-product/price.php
bb-theme-child/woocommerce/single-product/tabs/description.php

@Jon007
Copy link
Contributor

Jon007 commented Apr 6, 2018

well, taking into account that:

  • the problem only occurs with this gateway Pasarela de pago para Redsýs
  • the gateway Pasarela de pago para Redsýs is "No probado con la versión activa de WooCommerce"
  • the gateway Pasarela de pago para Redsýs is a paid product and should have support available
  • this component is a free product only supported by volunteers in their spare time, who have no access to the code for Pasarela de pago para Redsýs

.. really you should raise a call with Pasarela de pago para Redsýs

@innovanity
Copy link
Author

Hello back Jon,
We have been doing some new tests, and we can confirm now that Redsýs (POS) is not the problem.
Using PayPal payment (just with the Woocommerce plugin) it happens the same: automatic sent emails after payment, admin-new-order.php & customer-completed-order.php, are both sent in English.

We even have even try adding inside those templates this code: echo get_locale(), and we get: [es_ES], but all strings in English (although translations are present, since you get Spanish mails if you change order status manually).

So, problem must be in the "trigger" of that automatic emails when the payment is done...
Any clue about that issue?
Thanks in advance.

@Jon007
Copy link
Contributor

Jon007 commented Apr 10, 2018

Thanks for investigating,
for info I haven't had time to look at this - actually I run Woo 3.1.2 though I hope to test upgrade to 3.3.4 soon.

I do remember there are two ways of triggering email in woocommerce, one is immediate and the other is with asynchronous with cron, there isn't an option for it in the user interface but you can turn the cron off by returning false on the filter woocommerce_defer_transactional_emails and then the email will be send from the UI in the correct language.

It may be that extra code is needed to force the language switch (reload the translation files) when in cron context - I thought something was already done for this, I'll check (but probably not this week), in the meantime please try the workaround with woocommerce_defer_transactional_emails

@Jon007
Copy link
Contributor

Jon007 commented Apr 10, 2018

for the record, I retested that this is working for me with woo 3.1.2
The site main language is English, secondary language is Spanish
I make an order in Spanish I get the customer email in Spanish.
I don't use woocommerce_defer_transactional_emails filter.

There is a setting to enable the email translation in Settings, WooPoly, Features - but I suppose you already have this.
And the language switching in the Email.php specifically gets order language and forces reload of the text domain for translation.

@Jon007
Copy link
Contributor

Jon007 commented Apr 21, 2018

for me, it's Fixed in #329
as per related discussion on #319
Note that as of writing this isn't merged yet, just pick up the replacement ajax file from the commit on #329 :
https://github.com/marian-kadanka/woo-poly-integration/blob/888df716c43c0191c32e2b8bfc11d7ea0a9ed055/src/Hyyan/WPI/Ajax.php
props @marian-kadanka

@hyyan
Copy link
Owner

hyyan commented Apr 30, 2018

Fixed in #329

@hyyan hyyan closed this as completed Apr 30, 2018
@mylzmylo
Copy link

mylzmylo commented Feb 9, 2022

Hello, something very similar happens to me, I have a site in French and English but Woocommerce only works in English when sending the email to the client. Is there a way for emails to be in the user's language?

@Jon007
Copy link
Contributor

Jon007 commented Feb 10, 2022

make sure you are using the latest from https://github.com/hyyan/woo-poly-integration/releases
I don't think it was released to wordpress.org

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

No branches or pull requests

4 participants