Skip to content Skip to sidebar

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

Problem:
If you're experiencing issues where the content of a category disappears when switching languages in your store, it might be related to a theme conflict.
Solution:
We recommend trying the following steps to isolate the issue:
1. Switch to a default WordPress theme.
2. Keep only WPML/WCML Plugins and essential plugins active.
3. Disable all other plugins.
Please ensure you have a full backup of your files and database before making these changes. If reverting to a standard theme resolves the problem, it indicates a theme issue. In such cases, contacting the theme developers is advisable.

If this solution does not apply to your case, or if it seems outdated, we highly recommend 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. Should you need further assistance, please open a new support ticket at 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.

Tagged: 

This topic contains 8 replies, has 3 voices.

Last updated by Marcel 1 year, 7 months ago.

Assisted by: Marcel.

Author Posts
August 23, 2024 at 11:20 am #16098346

adzhmalM

<b>Background of the issue: </b>
I've completely filled the store with products, but I'm having a lot of problems with the links. I don't understand how to solve them. I will be glad if you can help me. Here is the link to the video: hidden link

<b>Symptoms: </b>
When you switch the language, the content of the category disappears

<b>Questions: </b>
How can I solve the link issues in my store?

August 23, 2024 at 12:04 pm #16098441

Marsel Nikolli

Hi,

Thank you for contacting WPML Support, I will gladly help you.

When switching to the German version I notice that there is an error notification showing. Can you please share with us the WordPress debug.log content(not WPML debug information) to collect more details on this?

To enable the WordPress debug-log, open your wp-config.php file of site root and look for define('WP_DEBUG', false);. Change it to:

// Enable WP_DEBUG mode
define( 'WP_DEBUG', true );
 
// Enable Debug logging to the /wp-content/debug.log file
define( 'WP_DEBUG_LOG', true );
 
// Disable display of errors and warnings 
define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );

After, go to the shop page and switch language, the errors will be saved to a debug.log log file inside the */wp-content/* directory. Please check if you are getting any errors or warnings related to WPML in the log file.

Please share the debug.log file content by copying/pasting it on the pastebin.com page and share the Pastebin link with me (you can use text document and share it on Google Drive if you prefer).

Looking forward to your reply,
Marsel

August 23, 2024 at 2:37 pm #16098889

adzhmalM

Fatal error: Uncaught ValueError: Unknown format specifier "K" in /home/vicfont/public_html/moissanit.eu/wp-content/themes/alukas/woocommerce/loop/result-count.php:30 Stack trace: #0 /home/vicfont/public_html/moissanit.eu/wp-content/themes/alukas/woocommerce/loop/result-count.php(30): printf('% Keine Produkt...', 4) #1 /home/vicfont/public_html/moissanit.eu/wp-content/plugins/woocommerce/includes/wc-core-functions.php(345): include('/home/vicfont/p...') #2 /home/vicfont/public_html/moissanit.eu/wp-content/plugins/woocommerce/includes/wc-template-functions.php(1485): wc_get_template('loop/result-cou...', Array) #3 /home/vicfont/public_html/moissanit.eu/wp-includes/class-wp-hook.php(324): woocommerce_result_count('') #4 /home/vicfont/public_html/moissanit.eu/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array) #5 /home/vicfont/public_html/moissanit.eu/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #6 /home/vicfont/public_html/moissanit.eu/wp-content/themes/alukas/inc/integrations/woocommerce/wc-template-functions.php(487): do_action('pls_woocommerce...') #7 /home/vicfont/public_html/moissanit.eu/wp-includes/class-wp-hook.php(324): pls_woocommerce_before_shop_loop('') #8 /home/vicfont/public_html/moissanit.eu/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array) #9 /home/vicfont/public_html/moissanit.eu/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #10 /home/vicfont/public_html/moissanit.eu/wp-content/plugins/woocommerce/templates/archive-product.php(49): do_action('woocommerce_bef...') #11 /home/vicfont/public_html/moissanit.eu/wp-content/plugins/woocommerce/includes/wc-core-functions.php(345): include('/home/vicfont/p...') #12 /home/vicfont/public_html/moissanit.eu/wp-content/plugins/woocommerce/templates/taxonomy-product-cat.php(22): wc_get_template('archive-product...') #13 /home/vicfont/public_html/moissanit.eu/wp-includes/template-loader.php(106): include('/home/vicfont/p...') #14 /home/vicfont/public_html/moissanit.eu/wp-blog-header.php(19): require_once('/home/vicfont/p...') #15 /home/vicfont/public_html/moissanit.eu/index.php(17): require('/home/vicfont/p...') #16 {main} thrown in /home/vicfont/public_html/moissanit.eu/wp-content/themes/alukas/woocommerce/loop/result-count.php on line 30

August 23, 2024 at 3:10 pm #16099007

Marsel Nikolli

Hi,

Thank you for the debug information.

It seems that there is an issue with one of the Woocommerce template files from the theme.

I would need temporary access to your website to investigate this issue and understand it better.

Please fully back up your site (files and database) and confirm it in your next reply.

I would need to access your site's WP-admin.
Your next reply is set to private so you can provide the username and password details.

Thanks,
Marsel

August 27, 2024 at 12:47 pm #16110004

Marsel Nikolli

Hi,

Thank you for the access, as I am not able to access the theme files could you please:

- Navigate to the file path /home/vicfont/public_html/moissanit.eu/wp-content/themes/alukas/woocommerce/loop/result-count.php.

-go to line 30 in the file. You will likely see a printf() function call that looks something like this:

printf('% Keine Produkte gefunden', $number_of_products);

- If %K is being used as a placeholder, change it to a proper specifier that matches the data type you are outputting. Common specifiers include:
%s for strings
%d for integers
%f for floating-point numbers

For example, if you are printing an integer value, it should look like this:

printf('%d Keine Produkte gefunden', $number_of_products);

If it's a string, you might use:

printf('%s Keine Produkte gefunden', $number_of_products);

After making the changes, save the file and check if the issue persists.

* Note: Please make sure you have a full backup of your website before making any updates/changes to your website.

Let me know how it goes,
Marsel

August 28, 2024 at 5:35 pm #16116480

adzhmalM

Hi,

This variable is already an integer. Please see the screenshot. Do you have any other ides about the root cause?

Bildschirmfoto_28-8-2024_193430_cvps173830114556.hostwindsdns.com.jpeg
August 29, 2024 at 10:11 am #16119293

Marsel Nikolli

Hi,

Thank you for the update.

Would it be possible to check if the issue happens in a minimal setup, meaning:

- switch to a default WP theme
- keep active only WPML/WCML Plugins and must-have plugins
- disable all other plugins

After, check if the issue is still happening.

Note: Please make sure you have a full backup (files & database) before trying anything on your website.

Let me know how it goes,
Marsel

September 3, 2024 at 10:52 am #16135064

adzhmalM

Reverting to a standard theme resolves the problem. It is therefore a theme issue. We'll get in touch with the theme developers for now.

September 3, 2024 at 2:09 pm #16136129

Marcel
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

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

Hi,

I'm Marcel, and I'll be taking over your ticket.

Thank you for your feedback. I'll go ahead and mark this case as resolved. If you need any further assistance, please don't hesitate to open a new case and reference this one.

Best regards,
Marcel