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
- 12:00 – 14:00 12:00 – 14:00 12:00 – 14:00 12:00 – 14:00 12:00 – 14:00 -
- 17:00 – 21:00 17:00 – 21:00 17:00 – 21:00 17:00 – 21:00 17:00 – 21:00 -

Supporter timezone: Europe/Vienna (GMT+02:00)

This topic contains 11 replies, has 4 voices.

Last updated by mortenV-2 2 years, 11 months ago.

Assisted by: Bigul.

Author Posts
December 3, 2021 at 12:47 pm #10121579

mortenV-2

I am trying to: sell downloadable products in two languages.

Link to a page where the issue can be seen: we have currently implemented a temporary fix.

I expected to see: download links on the Thank You page and in customer emails after purchasing a downloadable product.

Instead, I got: no links on the Thank You page or in customer emails. They are however visible on the My Account page, and on the WooCommerce order itself.

Additional information:
I read another thread about what seems to be the same issue (post #9097641). That thread was closed because you were unable to consistently replicate it. We have therefore been trying to replicate and debug the issue ourselves, and we have found what seems to be the cause, at least in our case.

In the filter_downloadable_product_items() function of the WooCommerce Multilingual plugin, the following line of code is executed:

$translated_product_id = apply_filters( 'translate_object_id', $item->get_product_id(), 'product', false, $order_language );

By printing the order language of orders with missing links, we found that the $order_language variable was set to "en" (English). The default language of the site is "no" (Norwegian), and as such, the original products are added in Norwegian, and the download permissions are granted to the Norwegian product ID, regardless of the value of $order_language. See uploads for images with $order_language = "no" and $order_language = "en".

When the $order_language is set to "no", the $translated_product_id of the previously pasted code becomes the product ID of the Norwegian product, and the links are displayed. However, when $order_language is set to "en", the $translated_product_id remain the English one, and no links are displayed. This is because the download permissions are given to the Norwegian product, as mentioned earlier, so the query to check for permissions will return empty when looking up the English product IDs.

We are having issues with this on a daily basis, so what we've done to temporarily fix it is to hardcode filter_downloadable_product_items() to always use "no" instead of $order_language:

$translated_product_id = apply_filters( 'translate_object_id', $item->get_product_id(), 'product', false, 'no' );

The WooCommerce Multilingual setting "Products Download Files" is set to "Use the same files for translations", and the products are not variable.

Hopefully, this will allow you to escalate the issue. Thanks in advance!

order-language-no.png
order-language-en.png
December 7, 2021 at 9:23 am #10138359

Bigul
WPML Supporter since 01/2013

Languages: English (English )

Timezone: Europe/Vienna (GMT+02:00)

Hello,

Welcome to the WPML support forum. I will do my best to help you to resolve the issue. Sorry for the delay happened because of the weekend. It is not normal here.

I have a couple of requests for tracking this bug. Please share the following details.

a) Please create a staging site(clone copy of live site) for our testing. So we can troubleshoot the issue without affecting the live site. I am enabling the private option for the next reply. Please refer to the following links for more details about our private information sharing policies.

https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/

hidden link

b) Please let us know the exact steps to reproduce the issue exactly

--
Thanks!

Bigul

December 9, 2021 at 10:40 am #10153285

Bigul
WPML Supporter since 01/2013

Languages: English (English )

Timezone: Europe/Vienna (GMT+02:00)

Hello,

Thank you for the details and staging site. We will do more testing on this and get back to you as soon as possible. Please wait.

--
Thanks!

Bigul

December 10, 2021 at 4:44 pm #10163733

Bigul
WPML Supporter since 01/2013

Languages: English (English )

Timezone: Europe/Vienna (GMT+02:00)

Hello,

We are still working on this issue. But unable to reproduce the issue exactly with the products having the issue on the staging site & my local copy. We have tried with WPML 4.5.2 & WooCommerce Multilingual 4.12.3(the latest version). Please check the attached images.

Therefore one request. Please check the bug is reproducible in the staging site now.

--
Thanks!

Bigul

2021-12-10_21-56-00.png
2021-12-10_21-55-20.png
2021-12-10_21-54-44.png
December 14, 2021 at 2:42 pm #10183709

mortenV-2

Hi again!

As mentioned, we're not sure exactly how to reproduce it, and we were hoping now that we've laid down the ground work, you would be better able to find this out. We have updated to the latest versions of WPML and WCML on the livesite, and asked the client to let us know if the error still occurs after the fact.

By the way, in case the issue persists, you can use this test card in Klarna Checkout, which will make the order go through automatically:

Credit card number: 4111 1111 1111 1111
CVV: 123
Exp: 12/25 (Or any other valid date in the future)

As it seems the orders you've placed so far are given the status "On hold", using this card would simulate the real orders more accurately.

December 16, 2021 at 11:08 am #10197329

Bigul
WPML Supporter since 01/2013

Languages: English (English )

Timezone: Europe/Vienna (GMT+02:00)

Hello,

Thank you for the updates. I was able to reproduce with the following order after making a few orders. So consulting with our team for the expert opinion. We will get back to you soon. Please wait.

hidden link

--
Thanks!

Bigul

January 13, 2022 at 12:57 pm #10343867

Bigul
WPML Supporter since 01/2013

Languages: English (English )

Timezone: Europe/Vienna (GMT+02:00)

Hello,

Sorry for the late response due to the holidays. The bug is escalated to our developers for fixing. We will get back to you soon when we have an update from our developers on this. Please wait.

--
Thanks!

Bigul

February 16, 2022 at 7:24 pm #10597221

xavierC-10

Hi,

Same issue here, three languages, first one (english) is ok, FR & IS are now working on email downloable links.

Any update ?

Thanks

May 16, 2022 at 8:03 am #11227025

mortenV-2

Hi!

Any update on this issue would be very much appreciated!

May 16, 2022 at 1:41 pm #11230295

Bigul
WPML Supporter since 01/2013

Languages: English (English )

Timezone: Europe/Vienna (GMT+02:00)

Hello,

Our developers are still working on this fix. We will contact you soon when we have feedback from our developers on this. Please wait. Thank you for your patience.

--
Thanks!

Bigul

August 3, 2022 at 9:46 am #11792041

guntherW-2

Any updates on this?
We have the exact same problem here. On a 2 language install (English/German) the German users sometimes (!) don't get the download links in the emails. This problem exists since months and should really be fixed. I think morten has given enough information.
Please share the status of this bug.

September 29, 2022 at 3:13 pm #12151109

mortenV-2

Hi!

Are you still working to resolve this issue? Any update would be highly appreciated!