Woo-poly-integration: Woocommerce checkout review order section remains untranslated.

Created on 29 Mar 2018  ·  19Comments  ·  Source: hyyan/woo-poly-integration

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

I can reproduce this issue on default Wordpress theme

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

Yes

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

  • PHP: 7.0
  • WordPress: 4.9.4
  • WooCommerce: 3.3.4
  • Polylang: [state if using Polylang PRO] 2.3.4
  • Hyyan WooCommerce Polylang Integration: 1.0.4
  • Browser: Chrome latest version, Edge

Steps to Reproduce

  1. Order any of the products https://noracles.com/bg/shop/
  2. Proceed to checkut

What I Expected

I expect to see all text translate to Bulgarian

What Happened Instead

Text is partially translated. The checkout review order section is in english. In fact, it is translated but then it automatically reverts to English.

WordPress Environment


`

WordPress Environment

Home URL: https://noracles.com
Site URL: https://noracles.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: en_GB

Server Environment

Server Info: Apache
PHP Version: 7.0.25
PHP Post Max Size: 256 MB
PHP Time Limit: 180
PHP Max Input Vars: 1000
cURL Version: 7.51.0
OpenSSL/1.0.2j

SUHOSIN Installed: –
MySQL Version: ❌ 5.5.54 - We recommend a minimum MySQL version of 5.6. See: WordPress requirements
Max Upload Size: 256 MB
Default Timezone is UTC: ✔
fsockopen/cURL: ✔
SoapClient: ✔
DOMDocument: ✔
GZip: ✔
Multibyte String: ✔
Remote Post: ✔
Remote Get: ✔

Database

WC Database Version: 3.3.4
WC Database Prefix: wp_
MaxMind GeoIP Database: ❌ The MaxMind GeoIP Database does not exist - Geolocation will not function. You can download and install it manually from http://dev.maxmind.com/geoip/legacy/geolite/ to the path: . Scroll down to "Downloads" and download the "Binary / gzip" file next to "GeoLite Country". Please remember to uncompress GeoIP.dat.gz and upload the GeoIP.dat file only.
Total Database Size: 7.21MB
Database Data Size: 5.48MB
Database Index Size: 1.73MB
wp_woocommerce_sessions: Data: 0.06MB + Index: 0.02MB
wp_woocommerce_api_keys: Data: 0.02MB + Index: 0.03MB
wp_woocommerce_attribute_taxonomies: Data: 0.02MB + Index: 0.02MB
wp_woocommerce_downloadable_product_permissions: Data: 0.02MB + Index: 0.05MB
wp_woocommerce_order_items: Data: 0.02MB + Index: 0.02MB
wp_woocommerce_order_itemmeta: Data: 0.02MB + Index: 0.03MB
wp_woocommerce_tax_rates: Data: 0.02MB + Index: 0.06MB
wp_woocommerce_tax_rate_locations: Data: 0.02MB + Index: 0.03MB
wp_woocommerce_shipping_zones: Data: 0.02MB + Index: 0.00MB
wp_woocommerce_shipping_zone_locations: Data: 0.02MB + Index: 0.03MB
wp_woocommerce_shipping_zone_methods: Data: 0.02MB + Index: 0.00MB
wp_woocommerce_payment_tokens: Data: 0.02MB + Index: 0.02MB
wp_woocommerce_payment_tokenmeta: Data: 0.02MB + Index: 0.03MB
wp_woocommerce_log: Data: 0.02MB + Index: 0.02MB
wp_carrental_booking: Data: 0.02MB + Index: 0.02MB
wp_carrental_booking_drivers: Data: 0.02MB + Index: 0.02MB
wp_carrental_booking_items: Data: 0.02MB + Index: 0.02MB
wp_carrental_booking_prices: Data: 0.02MB + Index: 0.02MB
wp_carrental_branches: Data: 0.02MB + Index: 0.02MB
wp_carrental_branches_hours: Data: 0.02MB + Index: 0.00MB
wp_carrental_extras: Data: 0.02MB + Index: 0.00MB
wp_carrental_extras_pricing: Data: 0.02MB + Index: 0.03MB
wp_carrental_fleet: Data: 0.02MB + Index: 0.03MB
wp_carrental_fleet_extras: Data: 0.02MB + Index: 0.02MB
wp_carrental_fleet_parameters: Data: 0.02MB + Index: 0.00MB
wp_carrental_fleet_parameters_values: Data: 0.02MB + Index: 0.00MB
wp_carrental_fleet_pricing: Data: 0.02MB + Index: 0.03MB
wp_carrental_pricing: Data: 0.02MB + Index: 0.00MB
wp_carrental_pricing_ranges: Data: 0.02MB + Index: 0.02MB
wp_carrental_translations: Data: 0.02MB + Index: 0.03MB
wp_carrental_vehicle_categories: Data: 0.02MB + Index: 0.02MB
wp_carrental_webhook_queue: Data: 0.02MB + Index: 0.00MB
wp_commentmeta: Data: 0.00MB + Index: 0.00MB
wp_comments: Data: 0.00MB + Index: 0.01MB
wp_give_donormeta: Data: 0.02MB + Index: 0.05MB
wp_give_donors: Data: 0.02MB + Index: 0.03MB
wp_give_formmeta: Data: 0.02MB + Index: 0.03MB
wp_give_logmeta: Data: 0.02MB + Index: 0.03MB
wp_give_logs: Data: 0.02MB + Index: 0.00MB
wp_give_paymentmeta: Data: 0.02MB + Index: 0.03MB
wp_links: Data: 0.00MB + Index: 0.00MB
wp_options: Data: 0.46MB + Index: 0.07MB
wp_postmeta: Data: 0.07MB + Index: 0.05MB
wp_posts: Data: 0.28MB + Index: 0.04MB
wp_rencato_connector_log: Data: 0.02MB + Index: 0.00MB
wp_termmeta: Data: 0.00MB + Index: 0.01MB
wp_terms: Data: 0.00MB + Index: 0.01MB
wp_term_relationships: Data: 0.00MB + Index: 0.01MB
wp_term_taxonomy: Data: 0.00MB + Index: 0.00MB
wp_usermeta: Data: 0.01MB + Index: 0.01MB
wp_users: Data: 0.00MB + Index: 0.01MB
wp_wc_download_log: Data: 0.02MB + Index: 0.03MB
wp_wc_webhooks: Data: 0.02MB + Index: 0.02MB
wp_wfBadLeechers: Data: 0.02MB + Index: 0.00MB
wp_wfBlockedCommentLog: Data: 0.02MB + Index: 0.00MB
wp_wfBlockedIPLog: Data: 0.02MB + Index: 0.00MB
wp_wfBlocks: Data: 0.02MB + Index: 0.02MB
wp_wfBlocks7: Data: 0.02MB + Index: 0.05MB
wp_wfBlocksAdv: Data: 0.02MB + Index: 0.00MB
wp_wfConfig: Data: 0.28MB + Index: 0.00MB
wp_wfCrawlers: Data: 0.02MB + Index: 0.00MB
wp_wfFileChanges: Data: 0.02MB + Index: 0.00MB
wp_wfFileMods: Data: 1.52MB + Index: 0.00MB
wp_wfHits: Data: 1.02MB + Index: 0.23MB
wp_wfHoover: Data: 0.02MB + Index: 0.02MB
wp_wfIssues: Data: 0.02MB + Index: 0.06MB
wp_wfKnownFileList: Data: 0.36MB + Index: 0.00MB
wp_wfLeechers: Data: 0.02MB + Index: 0.00MB
wp_wfLockedOut: Data: 0.02MB + Index: 0.00MB
wp_wfLocs: Data: 0.02MB + Index: 0.00MB
wp_wfLogins: Data: 0.06MB + Index: 0.03MB
wp_wfNet404s: Data: 0.02MB + Index: 0.02MB
wp_wfNotifications: Data: 0.02MB + Index: 0.00MB
wp_wfPendingIssues: Data: 0.02MB + Index: 0.06MB
wp_wfReverseCache: Data: 0.02MB + Index: 0.00MB
wp_wfScanners: Data: 0.02MB + Index: 0.00MB
wp_wfSNIPCache: Data: 0.02MB + Index: 0.05MB
wp_wfStatus: Data: 0.14MB + Index: 0.09MB
wp_wfThrottleLog: Data: 0.02MB + Index: 0.02MB
wp_wfVulnScanners: Data: 0.02MB + Index: 0.00MB

Post Type Counts

attachment: 8
custom_css: 1
customize_changeset: 11
give_forms: 2
give_payment: 8
nav_menu_item: 21
page: 29
polylang_mo: 2
post: 2
product: 7
revision: 167
shop_coupon: 3
shop_order: 7
wpcf7_contact_form: 2

Security

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

Active Plugins (8)

Polylang: by Frédéric Demarle – 2.3.4
Contact Form 7: by Takayuki Miyoshi – 5.0.1
Give - Donation Plugin: by WordImpress – 2.0.6
Woo Checkout Field Editor Pro: by ThemeHiGH – 1.2.6
Hyyan WooCommerce Polylang Integration: by Hyyan Abo Fakher – 1.0.4 – Not tested with the active version of WooCommerce
WooCommerce Currency Switcher: by realmag777 – 1.2.3
WooCommerce: by Automattic – 3.3.4
Wordfence Security: by Wordfence – 7.1.1

Settings

API Enabled: ✔
Force SSL: –
Currency: BGN (лв.)
Currency Position: left
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

Shop base: #223 - /shop/
Basket: #224 - /basket/
Checkout: #225 - /checkout/
My account: #226 - /my-account/
Terms and conditions: ❌ Page not set

Theme

Name: Storefront
Version: 2.2.8
Author URL: https://woocommerce.com/
Child Theme: ❌ – If you are modifying WooCommerce on a parent theme that you did not build
personally we recommend using a child theme. See: How to create a child theme

WooCommerce Support: ✔

Templates

Overrides: –

help wanted

Most helpful comment

didit solution will not be a solution: the language in the ajax calls is still wrong, didit solution is just hiding the problem a bit.

The solutions will be either:

  • fix the 3.2 solution provided by @marian-kadanka - I'm not quite clear how this worked or why it doesn't work now

    • filter as:

      add_filter('woocommerce_ajax_get_endpoint', 'pll_woocommerce_ajax_get_endpoint', 10, 2);

      and something like this:

    /*
     * fixes woo 3.3.x by restoring 3.1.2 behaviour
     * https://github.com/hyyan/woo-poly-integration/issues/319
     */    
    public function pll_woocommerce_ajax_get_endpoint($result, $request){
        return esc_url_raw( add_query_arg( 'wc-ajax', $request, remove_query_arg( array( 'remove_item', 'add-to-cart', 'added-to-cart' ) ) ) );        
    }

WooCommerce won't change their end and closed the issue I opened, since they say some of their changes fixed a potential security issue.

All 19 comments

Absolutely same issue here. Same settings.

Steps to Reproduce

  1. Order any of the products in Russian or Chinese languages (english is default) https://busancoupon.com/ru
  2. Proceed to cart or checkout.

What I Expected
I expect to see cart page in Russian or Chinese. Or checkout page fully translated in Russian or Chinese.

What Happened Instead

  1. The cart page is automatically redirected to default language(English).
  2. The checkout page is not redirected but only partially translated. The fill out section is translated but "place order" section is trying to translate but then reverts to English.

Note
When changing language from cart page itself, it actually goes to the right page and fully translated.

same issue

Anyone have a solution for this?

I have the exact same issue. The order review loads in the correct (translated) Language, but then refreshes and is set to the default Language.
I'm using

Hyyan WooCommerce Polylang Integration v1.0.4
Polylang v2.3.4
WooCommerce v3.3.4

I have seen this issue reported on different support sites with suggested solutions like disabling ajax or upgrading the plugins concerned, none of these work for me. I have seen the same issue reported on this site where it was closed with the mention that this is solved with Hyan WooCommerce Polylang Integration v1.0.4.

Can anyone help with this?

WordPress: 4.9.5.
WooCommerce: 3.3.4
Storefront (2.2.8) Child Theme
Polylang: 2.3.4
Hyyan WooCommerce Polylang Integration: 1.0.4

I have the exact same issue.

Can anyone help with this?

So no solution so far?? This is really bad... There is a new Woocommerce version now. Anyone tried to update?

Exact same issue here, I have the newest version of Woo and this plugin.

In the meantime I have updated Wordpress to version 4.9.5 and Woocommerce to version 3.3.5, but the issue remains.
I use theme InVogue version 1.0.3 by the way.

OK, perhaps not a solution but at least a workaround (it works for me):

  • Open file review-order.php (located in \wp-content\themes\\woocommerce\checkout in my case)
  • Change line

<table class="shop_table woocommerce-checkout-review-order-table">
to

class="shop_table">

  • Open file payment.php (located in \wp-content\plugins\woocommerce\templates\checkout)
  • Change line
    <div id="payment" class="woocommerce-checkout-payment"> to <divid="payment">`

Ddidit!

It fixed my problem with checkout page too! Thanks so much! 👍

But my cart button is still a problem.. whenever I click cart button it automatically redirects to default language... :(

Any idea how to workaround that? Maybe change some line in cart-errors.php??

I wish I could do some coding, but I'm absolutely zero in that.. there is cart.php and mini-cart.php. I'm sure it needs a tiny little fix there...

thanks for share solution!
its work fine

but
when change payment method from checkout page.
order review don't refresh. ajax is not working.

some payment methods has payment fee .
when change payment method . also change total amount.

sorry for my broken english

Hyyan 1.0.4 is a lot earlier than 3.3.5 and does not claim compatibility with 3.3.5.
Unfortunately WooCommerce frequently break compatibility in their updates.
I have this working fine in 3.1.2 and I can confirm and reproduce the functionality is broken in 3.3.5.
I haven't tested all the versions in between.

Most other plugins are also not updated for compatibility with woo 3.3.5 - it's not just this one - the best advice is not to upgrade WooCommerce until the plugins you use are upgraded, unless you have development capability and can contribute to fixes.

as a clue, woo seems to be calling:
/?wc-ajax=update_order_review
directly to the root of the website, instead of the current page as it used to do..
this means that the path information which would be used by Polylang to determine the language is lost..

This is reported to woocommerce as:
https://github.com/woocommerce/woocommerce/issues/19741

I have tested restoring the 3.1.2 version of the WC_AJAX->get_endpoint() function in woocommerce/class-wc-ajax.php
This solves this problem - and could also be applied by a filter - however until we know why this was changed it may not be the correct solution.

It looks like this was originally fixed for WooCommerce 3.2 by @marian-kadanka in:
https://github.com/hyyan/woo-poly-integration/pull/251/commits/9f9b7581260c87f84ce9f35100ecd872b974e58d
see numerous related issues at that time.

However later update to either WooCommerce or Polylang may be causing this fix not to work.
(I'm not clear about why this fix may have worked in woo 3.2.x and Polylang 2.2.7)

Hello, I do the same fixing as ddidit posted and it fixed the problem of payment gateway part! Nice work ddidit! Thanks a lot!
However after I click the place order button, it still goes to the main language ver, not the second language ver.
And the auto system emails after check out are also in main language, what we can do to fix this part?
Thank you!

didit solution will not be a solution: the language in the ajax calls is still wrong, didit solution is just hiding the problem a bit.

The solutions will be either:

  • fix the 3.2 solution provided by @marian-kadanka - I'm not quite clear how this worked or why it doesn't work now

    • filter as:

      add_filter('woocommerce_ajax_get_endpoint', 'pll_woocommerce_ajax_get_endpoint', 10, 2);

      and something like this:

    /*
     * fixes woo 3.3.x by restoring 3.1.2 behaviour
     * https://github.com/hyyan/woo-poly-integration/issues/319
     */    
    public function pll_woocommerce_ajax_get_endpoint($result, $request){
        return esc_url_raw( add_query_arg( 'wc-ajax', $request, remove_query_arg( array( 'remove_item', 'add-to-cart', 'added-to-cart' ) ) ) );        
    }

WooCommerce won't change their end and closed the issue I opened, since they say some of their changes fixed a potential security issue.

Fixed in #329

Was this page helpful?
0 / 5 - 0 ratings