Skip to content Skip to sidebar

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

Problem:
The client is experiencing an issue with the Houzez theme where the property counter on the search results page is not working correctly. The counter is including properties from all languages, not just the current language, leading to incorrect counts displayed in the autocomplete search results.

Solution:
We have identified a problem in the Houzez theme code and are providing a hotfix. We also recommend contacting the theme author to ensure the fix is included in the next theme update. Here are the steps to apply the hotfix:

1. Open the file

wp-content/themes/houzez/framework/functions/property_functions.php

.

2. Before the line

foreach ( $data as $post ) {

, add the following line:

$new_data = array();

3. After the code snippet:

if ($post_language !== $current_language) continue;

Add the following line:

$new_data[] = $post;

4. In the line that outputs the count:

echo '<span class="auto-complete-count"><i class="houzez-icon icon-pin mr-1"></i> ' . sizeof( $data ) . ' '.$houzez_local['listins_found'].'</span>';

Replace

$data

with

$new_data

so it becomes:

echo '<span class="auto-complete-count"><i class="houzez-icon icon-pin mr-1"></i> ' . sizeof( $new_data ) . ' '.$houzez_local['listins_found'].'</span>';

If this solution does not seem relevant to your issue, please open a new support ticket with us.

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 17 replies, has 2 voices.

Last updated by Dražen 4 years, 7 months ago.

Assisted by: Dražen.

Author Posts
May 7, 2021 at 2:32 pm #8715107

Dražen
Supporter

Languages: English (English )

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

Hello Waldemar,

thanks for the reply.

Actually, you are very correct and we will be checking and reviewing Houzez theme compatibility status.

Let us know how it goes and if you still have issues.

Kind regards,
Drazen

May 10, 2021 at 12:58 pm #8729165

waldemarK

Hi Drazen, now I've intereted the code and it works! Thank you for the help. Houzez author Favethemes should resolve this bug and avoid us to be the beta tester.
The strange thing is that I had to replace that file in the themes folder. It does not work if I put in the same folder structure of my child theme.

May 10, 2021 at 2:22 pm #8730483

Dražen
Supporter

Languages: English (English )

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

Hello,

thanks for getting back and confirming the fix, glad to hear it works.

Theme authors have replied and will probably include the fix in one of the next versions.

Kind regards,
Drazen