Skip Navigation

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

Problem:
The client reported two issues on their production site: URLs for French and Spanish product sub-menus were in English, and the French translation of some product or product category pages caused the search bar to disappear and display odd icons.
Solution:
We suggested the client to record a screen capture using Loom to better illustrate the issue. It was identified that the code blocks for the French header were broken, which likely caused the display issues. We recommended replicating the issue on a sandbox site for further debugging without affecting the production site. The client was also advised to create a separate staging environment with minimal plugins to isolate the problem. After navigating to specific admin pages and completing the translation, the header issue was resolved.

Please note that this solution might be outdated or not applicable to your specific case. 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. If the issue persists, 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.

This topic contains 5 replies, has 0 voices.

Last updated by sandraF-13 1 week, 5 days ago.

Assisted by: Kor.

Author Posts
January 9, 2025 at 6:42 am #16576025

sandraF-13

Hi Kor,
There are two issues pertaining where am unable to detect at the moment why it is so:
- French and Spanish Product sub-menus are having english URL
- On French translation of some product or product category pages Search bar is not only disappearing but also showing odd icons.

As this is on production site and would stand as bad impression to our visitors, please find some solution to it, its being cause by inappropriate string translation or so ? I do not understand!

Thanks

January 9, 2025 at 6:44 am #16576027

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your patience. I'm not so sure about the search issue that you mentioned.

Could you record a short screen recording showing this issue? You can use this free tool hidden link for your recording.

January 9, 2025 at 10:55 am #16577165

sandraF-13

Hi Kor,
Here is the loom (no-audio)
hidden link

Explanation of video :
- On translating any of the sub-menu options (product/product catg. both) to French, the search bar from above is disappearing leaving few odd symbols.

- As you can see in the video, this behavior of search bar is found only with FR and not ES translations, they are working fine.

What I suspect - I have put the Search bar string for translation and it seems to stuck in processing so far. [In SS] Can you please take a look and resolve asap.

Thanks

screencapture-unitedabrasives-wp-admin-admin-php-2025-01-09-16_24_42.png
January 9, 2025 at 11:05 am #16577196

sandraF-13

Oh ! Please see the video link here, loom somehow didn't recorder properly..

New Link (explanation is same)

hidden link

January 9, 2025 at 12:11 pm #16577563

sandraF-13

Any observations or suggestions here please ??

January 9, 2025 at 3:19 pm #16578654

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your reply.

It looks like the code blocks for the French header here hidden link is broken hence showing the icons as shown in the attached screenshot.

May I know how did you create those shortcodes?

Screenshot_175.jpg
January 9, 2025 at 4:56 pm #16579046

sandraF-13

Searchbox is coded in the functions.php
below is the code, But your point here does not make great sense that it is broke,
cuz the search bar is working completely fine for Spanish language

Also, search bar was appearing perfectly fine for French also, but I have noticed this distorted behavior of search box only after I have created the menu for French language for mobile and desktop, It was after the time - (When I was asking you how to create FR and ES menu for Product menu option which is built in avada.)

// Display the search box with category dropdown

function searchbox_cate_dropdown($atts) {
// Set default attributes
$atts = shortcode_atts(array(
'mobile' => false,
), $atts);

ob_start();

// Get selected category ID from query parameters
$selected_id = isset($_GET['cat']) ? intval($_GET['cat']) : 0;

// Create the dropdown for categories
$select = wp_dropdown_categories(array(
'show_option_all' => 'Entire Site',
'show_option_none' => '',
'orderby' => 'ID',
'order' => 'ASC',
'show_count' => 0,
'hide_empty' => 0,
'child_of' => 0,
'exclude' => 1,
'echo' => 0,
'selected' => $selected_id,
'hierarchical' => 1,
'name' => 'cat',
'class' => 'form-no-clear',
'depth' => 0,
'tab_index' => 0,
'taxonomy' => 'category',
'hide_if_empty' => true
));

// Generate the search box ID based on mobile attribute
$searchBoxId = "headerSearchBox" . ($atts['mobile'] ? "Mobile" : "");

// Output the search form
?>
<div id="<?php echo esc_attr($searchBoxId); ?>">
<div class="search-box header">
<form role="search" method="get" class="search-form" action="<?php echo esc_url(home_url('/')); ?>">
<?php echo $select; ?>
<input type="text" value="<?php echo esc_attr(isset($_GET['s']) ? $_GET['s'] : ''); ?>"
title="Enter Your Search Term" class="form-control" name="s" id="s"
placeholder="Search">
<button class="btn btn-primary" type="submit">
<span class="fa fa-search"></span> Submit
</button>
</form>
</div>
</div>
<?php

return ob_get_clean();
}

add_shortcode('searchbox', 'searchbox_cate_dropdown');

January 10, 2025 at 6:10 am #16580296

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your reply.

Looks like this requires further debugging and could you please replicate the issue on our sandbox site here hidden link ? You can install the theme and plugins that are required to replicate the issue. Please do not import the entire site into this sandbox site.

Once you've replicated there, I will escalate this further for debugging.

January 10, 2025 at 9:42 am #16581173

sandraF-13

Oh mhan, this is a blank sandbox, In order to replicate the issue, It will again take ages for me to setup everything, this is not a good way at all, by this way we are getting away from resolving it asap.

Please don't ask such things,,... this just seems like stretching the resolution session day-by-day and seems irritating.

Let me see, If I can create a separate staging env for you. A complete replica of the issue.

Meanwhile, please try to look into the issue on production only. Just try avoiding any critical changes.

January 10, 2025 at 9:58 am #16581189

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thank you for your response.

I’m sorry to hear about your frustration and completely understand the time-consuming nature of replicating the issue. As these features are custom-coded, resolving the problem will likely require additional debugging and custom programming, which falls outside the scope of our support. However, I’d still like to explore if there’s anything we can do without involving complex customizations.

If possible, could you create a separate staging environment with only minimal plugins installed? I would like to avoid troubleshooting this directly on your production site. Also, it is not possible to create a duplicator package on your Website due to server restrictions.

January 10, 2025 at 12:11 pm #16581956

sandraF-13

I already have got one staging environment do you wanna use that ?
You can do whatever you want on that ? Have shared the credentials
Just that environment is not yet completely translated.

With free credits you can just translate the menus, I will create the structure and layout of menu. Basically as I mentioned earlier Search bar was appearing completely fine before I did created a french menu.

The spanish version has no such issues. Its working fine, SO I am sure there is NO CODE ERROR causing this.

Sounds GOOD to you ??

January 10, 2025 at 12:12 pm #16581957

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

ok sure. I've enabled the private reply option. please share your credentials over there. Please backup so that you can revert if I break anything.

January 13, 2025 at 6:03 am #16586674

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your reply.

The staging site is not the exact clone of the production site. Also, I can see the custom search is working here hidden link . Are you able to clone the entire production site so that I can recheck?

January 13, 2025 at 9:04 am #16587112

sandraF-13

Hi Kor,

Until yesterday, Dev env was not ready, now I have got an exact replica of the production site ready for you, can you please share the private window so that I can share the credentials. Thanks

January 13, 2025 at 3:17 pm #16589288

sandraF-13

Need you attention here as well, thanks