Skip Navigation

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

Problem:
The client is experiencing 404 errors when trying to access WooCommerce account pages such as 'View order' and 'Payment methods' in a secondary language. The issue occurs in a custom template that contains the

[woocommerce_my_account]

shortcode. Additionally, WooCommerce body classes are dropped when switching between languages, indicating that the pages might not be recognized as WooCommerce templates.
Solution:
We recommend installing the WooCommerce Multilingual plugin. You can download it from here. After downloading, please complete the installation wizard, which you can follow here.

If this solution doesn't look relevant, please open a new support ticket in the WPML 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.

This topic contains 2 replies, has 2 voices.

Last updated by Osama Mersal 1 year, 2 months ago.

Assisted by: Osama Mersal.

Author Posts
December 1, 2023 at 5:27 pm #14975069

David

Tell us what you are trying to do?

I have a custom template at /account-centre that acts as the WooCommerce my account page, and it contains the [woocommerce_my_account] shortcode. A problem we've encountered is that when we click on "View order" ( which would be the Woo template detected with is_wc_endpoint_url('view-order') ) while we have a language set, we get a 404.

For example, /account-centre/view-order/52804/ works fine, but /fr/account-centre/view-order/52804/ does not.

Other WooCommerce account pages that run through this page template have the same issue, such as /fr/account-centre/payment-methods/

I've also noticed that when switching between the English version of a page and the French version of a (non 404) page, the WooCommerce body classes get dropped, which might mean it's not being picked up as a WooCommerce template anymore? Screenshots attached

Is there any documentation that you are following?

https://wpml.org/documentation/related-projects/woocommerce-multilingual/ (Although we don't need that on this site as we don't use customer-facing product pages)

Is there a similar example that we can see?

https://wpml.org/forums/topic/wpml-woocommerce-single-product-pages-404/
https://wpml.org/forums/topic/404-error-when-on-wocommerce-store-and-cart-pages/

What is the link to your site?
N/A

Appreciate the help in advance!

Screenshot 2023-12-01 122342.png
Screenshot 2023-12-01 122230.png
December 3, 2023 at 11:23 am #14979965

Osama Mersal
Supporter

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+02:00)

Hi,

Thanks for contacting WPML forums support. I'll be glad to help you today.

1) First of all, sorry for the late reply; it was due to a higher workload. I would need to look closely at your site, so I would need to request temporary access (WP-Admin and FTP)
Preferably to a test site where the problem has been replicated.

Your answer will be private, meaning only you and I can access it.

❌ Please backup your database and website ❌

✙ I would need your permission to de-activate and re-activate the Plugins and the Theme and change configurations on the site. This is also a reason the backup is critical.

✙ I also need your permission to take a local copy of your site to debug the issue without affecting your live site.

2) It's unrelated to the issue, but according to your Debug.info, the WP memory limit needs to be increased. PHP memory is fine, but WordPress uses 40Mb as default. The minimum requirements for WPML are 128 MB. (Kindly check this page https://wpml.org/home/minimum-requirements/)

You can increase it by adding the following code in your wp-config.php file right before the /* That's all, stop editing! Happy publishing. */ line:

/* Memory Limit */
define('WP_MEMORY_LIMIT', '256M');
define( 'WP_MAX_MEMORY_LIMIT', '256M');

Best regards,
Osama

December 5, 2023 at 4:39 pm #15000989

Osama Mersal
Supporter

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+02:00)

Hi,

Thanks for the access details. Could you please install the WooCommerce Multilingual plugin? (https://wpml.org/download/woocommerce-multilingual-multicurrency/?section=changelog)

After uploading the plugin, please complete the installation wizard. (https://wpml.org/documentation/related-projects/woocommerce-multilingual/)

Best regards,
Osama

December 5, 2023 at 9:27 pm #15002901

David

Thanks so much, that looks to have resolved the issue 🙂 Have a great rest of your day!