 kostasT-3
|
Dear Andreas this is the Classic Search of the Theme, I fI could find this code, I would have solved my problems, since I would just paste it in a elementor widget.
The theme is no longer serving this search form because they have created two new from th eultra and modern that unfortuntelly are those that dont show the Additional Features
I created a ticket to the them for that but they cant assist either in giving me this forms code
|
 Andreas W.
WPML Supporter since 12/2018
Languages:
English (English )
German (Deutsch )
Timezone:
America/Lima (GMT-05:00)
|
On my test site, I had no issue with using the search form widget without using any template in the widget's settings. The features showed up and their translation worked as expected.
Could you please give this a try?
|
 kostasT-3
|
Can you please explain what do you mean?
My gols is to add in my landing pages a Search Form to help my visitors.
Currently I have these Search forms created with Elementor Widgets and the problem is that the Additional Features do not showing.
What do you propose in order to understand?
|
 Andreas W.
WPML Supporter since 12/2018
Languages:
English (English )
German (Deutsch )
Timezone:
America/Lima (GMT-05:00)
|
You can use a Search Form widget without a template.
Anyhow, on your site, this still does not solve the issue with the Features, as there are no translated properties.
If I adjust the file \wp-content\plugins\realhomes-elementor-addon\elementor\widgets\search\fields\property-features.php I can make the features appear in a second language, and recognize the count for each feature from the original properties.
I adapted the code this way:
<?php
/**
* Property Features Checkboxes (WPML-aware for fallback)
*/
global $settings, $the_widget_id;
if ( 'yes' === $settings['show_advance_features'] ) {
// Alle Features in der aktuellen Sprache holen (für Labels)
$all_features = get_terms( [
'taxonomy' => 'property-feature',
'hide_empty' => false,
] );
if ( ! empty( $all_features ) && ! is_wp_error( $all_features ) ) {
// Eingehende Query normalisieren auf Default-Language Slugs
$required_features_slugs = [];
if ( isset( $_GET['features'] ) && is_array( $_GET['features'] ) ) {
$default_lang = apply_filters( 'wpml_default_language', null );
foreach ( $_GET['features'] as $incoming ) {
$incoming_term = get_term_by( 'slug', $incoming, 'property-feature' );
if ( ! $incoming_term && is_numeric( $incoming ) ) {
$incoming_term = get_term( (int) $incoming, 'property-feature' );
}
if ( $incoming_term && ! is_wp_error( $incoming_term ) ) {
$default_id = apply_filters( 'wpml_object_id', $incoming_term->term_id, 'property-feature', true, $default_lang );
$default_term = $default_id ? get_term( $default_id, 'property-feature' ) : null;
if ( $default_term && ! is_wp_error( $default_term ) ) {
$required_features_slugs[] = $default_term->slug;
}
} else {
$required_features_slugs[] = sanitize_title( $incoming );
}
}
$required_features_slugs = array_values( array_unique( $required_features_slugs ) );
}
// Optional: Styles
$features_styles = '';
if ( isset( $settings['advance_features_styles'] ) && 'select' === $settings['advance_features_styles'] ) {
$features_styles = 'rhea-features-styles-2';
}
?>
<div class="rhea-more-options-mode-container <?php echo esc_attr( $features_styles ); ?>" id="rhea_features_<?php echo esc_attr( $the_widget_id ); ?>">
<div class="rhea-more-options-wrapper rhea-more-options-wrapper-mode clearfix <?php echo ( count( $required_features_slugs ) > 0 ) ? '' : 'collapsed'; ?>">
<?php
$default_lang = apply_filters( 'wpml_default_language', null );
foreach ( $all_features as $feature ) {
// Default-Term ermitteln
$default_id = apply_filters( 'wpml_object_id', $feature->term_id, 'property-feature', true, $default_lang );
$default_term = $default_id ? get_term( $default_id, 'property-feature' ) : null;
// Slug für Query (immer Default)
$slug_for_query = ( $default_term && ! is_wp_error( $default_term ) )
? $default_term->slug
: $feature->slug;
// Count über eigene Funktion berechnen
$count_for_label = ( $default_term && ! is_wp_error( $default_term ) )
? rhea_wpml_count_properties_for_feature( $default_term->term_id, $default_lang )
: 0;
$is_checked = in_array( $slug_for_query, $required_features_slugs, true );
?>
<div class="rhea-option-bar">
<input type="checkbox"
id="feature-<?php echo esc_attr( $the_widget_id . '-' . $slug_for_query ); ?>"
name="features[]"
value="<?php echo esc_attr( $slug_for_query ); ?>"
<?php checked( $is_checked ); ?> />
<label for="feature-<?php echo esc_attr( $the_widget_id . '-' . $slug_for_query ); ?>">
<?php echo esc_html( ucwords( $feature->name ) ); ?>
<small>(<?php echo esc_html( $count_for_label ); ?>)</small>
</label>
</div>
<?php
}
?>
</div>
<span class="rhea_open_more_features_outer">
<span class="rhea_open_more_features">
<span></span>
<?php
$inspiry_search_features_title = $settings['advance_features_text'];
if ( $inspiry_search_features_title ) {
echo esc_html( $inspiry_search_features_title );
} else {
esc_html_e( 'Looking for certain features?', RHEA_TEXT_DOMAIN );
}
?>
</span>
</span>
</div>
<?php
}
}
/**
* Count published properties attached to a default-language feature term.
*
* @param int $default_term_id The term_id in the default language.
* @param string $default_lang The default language code (e.g., 'en').
* @return int
*/
function rhea_wpml_count_properties_for_feature( $default_term_id, $default_lang ) {
if ( ! $default_term_id ) {
return 0;
}
$q = new WP_Query( [
'post_type' => 'property',
'post_status' => 'publish',
'posts_per_page' => 1,
'fields' => 'ids',
'no_found_rows' => false,
'suppress_filters' => false,
'tax_query' => [
[
'taxonomy' => 'property-feature',
'field' => 'term_id',
'terms' => [ (int) $default_term_id ],
],
],
'lang' => $default_lang,
] );
return (int) $q->found_posts;
}
At this point, I am not able to test if the search will work, as I am not able to set any theme options while the theme is not registered.
I could only offer to try to test this code on your production site.
|
 kostasT-3
|
I tested the code you provided, the problem wasnt solved
|
 Andreas W.
WPML Supporter since 12/2018
Languages:
English (English )
German (Deutsch )
Timezone:
America/Lima (GMT-05:00)
|
Can you set up a staging site for testing this?
Note that I can not suggest running any code changes and tests on the live site, as it could break the site and make it inaccessible for visitors and users.
If you can not provide a staging site or activate the RealHomes Theme on our test site, it might be advisable to report this issue directly to RealHomes.
|
 Andreas W.
WPML Supporter since 12/2018
Languages:
English (English )
German (Deutsch )
Timezone:
America/Lima (GMT-05:00)
|
Hello,
I wanted to remind you that I requested access to a staging site more than a week ago. See my prior comment.
If you still need assistance, please proceed by providing access to a staging site on which we can run tests without affecting the production site.
The private reply form is enabled again.
If you are unsure about how to create a staging site, please consult your hosting support team.
Also, please note my following prior commentary:
On my test site, I had no issue with using the search form widget without using any template in the widget's settings. The features showed up, and their translation worked as expected.
If this is not an acceptable workaround, it would be advisable to report the issue directly to the RealHomes Support Team, as this is a premium theme that requires registration for its usage, and we do not have access to such keys.
In case you do not need further assistance from our end, please mark this ticket as resolved.
Best regards
Andreas
|