Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
When a registered user tries to access any page in the English version of a WooCommerce site translated from Italian, such as orders or downloads, the website crashes with a fatal error indicating a problem in the WooCommerce template functions.

Solution:
We resolved the issue by installing and activating the WCML plugin. This plugin is essential for managing a multilingual WooCommerce store, enabling language-based endpoints and the translation of products and related content. It also provides multicurrency support. Even if these features are not needed, it is crucial to use WCML with WooCommerce when using WPML.

If this solution does not resolve your issue, or if it seems outdated or irrelevant to your case, we recommend opening a new support ticket. We also advise checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. For further assistance, please visit our support forum.

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.

No supporters are available to work today on this forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

This topic contains 8 replies, has 2 voices.

Last updated by Waqas Bin Hasan 2 months ago.

Assisted by: Waqas Bin Hasan.

Author Posts
July 30, 2024 at 9:02 am #16019490

sandraM-15

Background of the issue:
When a registered user tries to look at any page contained in hidden link (orders, downloads, addresses etc..), the website crashes. This happens only on the English version of the pages. The website was translated from Italian to English. I tried clearing all the caches and applying various fixes from WPML's troubleshooting page but unfortunately it didn't work.

Symptoms:
Fatal error: Uncaught ValueError: Path cannot be empty in /home/artuonlu/public_html/wp-content/plugins/woocommerce/includes/wc-template-functions.php:53 Stack trace: #0 /home/artuonlu/public_html/wp-includes/class-wp-hook.php(324): wc_template_redirect() #1 /home/artuonlu/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters() #2 /home/artuonlu/public_html/wp-includes/plugin.php(517): WP_Hook->do_action() #3 /home/artuonlu/public_html/wp-includes/template-loader.php(13): do_action() #4 /home/artuonlu/public_html/wp-blog-header.php(19): require_once('/home/artuonlu/...') #5 /home/artuonlu/public_html/index.php(17): require('/home/artuonlu/...') #6 {main} thrown in /home/artuonlu/public_html/wp-content/plugins/woocommerce/includes/wc-template-functions.php on line 53. There has been a critical error on this website.

Questions:
Is there something I'm missing?
Maybe an incompatibility between plugin versions?

July 30, 2024 at 9:23 am #16019584

Waqas Bin Hasan
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

Reference to our recent chat, looks like you got disconnected and chat closed due to inactivity.

However, I've moved it here to this ticket for follow up.

Please let me know your findings after those steps and I'll try my best to help you further on the matter.

Regards.

July 30, 2024 at 11:22 am #16020137

sandraM-15

Yes, I did some testing and what I found is the behaviour. By disabling all plugins and using the default theme instead of hello elementor and then going to the account/my-orders page instead of giving a fatal error it gives a page not found error.

This makes me think the error is casued by the theme when it doesn't get the page it expects. Still, even without the error those pages still don't work, so it's not really a fix.

I tried recreating the page translation trough wpml but it looks like it only translates the account page and doesn't account for the child ones.
From what I understand those aren't pages per se but they are generated by woocommerce.

Does wpml officially support the woocommerce account widget?

July 30, 2024 at 12:38 pm #16020540

Waqas Bin Hasan
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for the updates.

Yes the account widget should be supported. However, I need to take a closer look at your site. So I request temporary access (WP-Admin and FTP), preferably to a test site where the problem has been replicated.

Your next answer will be private, to share this information safely.

Also provide detailed steps to reproduce the issue and links to pages in admin and on frontend.

IMPORTANT: Please take a complete backup of the site to avoid data loss. I may need to activate/deactivate plugins also.

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

July 31, 2024 at 7:26 am #16023196

Waqas Bin Hasan
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for the access, I am working on it and 'll get back to you accordingly.

July 31, 2024 at 9:22 am #16023836

sandraM-15

Thank you for the help!

July 31, 2024 at 12:43 pm #16025152

Waqas Bin Hasan
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for your patience and cooperation.

I am still working on this and have tried several fixes but this is really a strange one. But I am hopeful to find a solution, as well as, 'll discuss with my team.

Please allow me some more time and I'll get back to you tomorrow.

July 31, 2024 at 1:27 pm #16025498

sandraM-15

No problem, I hope the fix for this issue can also help others

August 1, 2024 at 12:15 pm #16029421

Waqas Bin Hasan
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for your patience and cooperation.

I was able to fix the issue by installing and activating WCML plugin (https://wpml.org/documentation/related-projects/woocommerce-multilingual/). This plugin is required for a Multilingual WooCommerce Store.

WCML helps enabling language based end points, as well as, products and related content translations. Additionally it also offers multicurrency support.

Even if you don't need these features, it is highly recommended to use WCML with WooCommerce, when you're using WPML. Although WCML can also work independent of the WPML for multicurrency support.

August 1, 2024 at 1:25 pm #16029769

sandraM-15

I didn't know a plugin was required... thanks for your patience in solving the issue. (maybe wpml could alert you if you have woocommerce installed but not this plugin)

sandraM-15 confirmed that the issue was resolved on 2024-08-01 13:25:50.
This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.