Skip Navigation

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.

Sun Mon Tue Wed Thu Fri Sat
- 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 -
- 12:00 – 16:00 12:00 – 16:00 12:00 – 16:00 12:00 – 16:00 12:00 – 16:00 -

Supporter timezone: Europe/Zagreb (GMT+01:00)

This topic contains 15 replies, has 0 voices.

Last updated by Dražen 1 day, 23 hours ago.

Assisted by: Dražen.

Author Posts
January 24, 2025 at 12:25 pm #16631293

Dražen
Supporter

Languages: English (English )

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

Hello,

please try next workaround
Open the /wp-content/plugins/kadence-blocks-pro/includes/query/query-indexer-woo.php file

Look for line 74

Replace:

	if ( ! empty( $attribute_values ) ) {
					$attribute_values_array = explode( ',', $attribute_values );
					foreach ( $attribute_values_array as $facet_name ) {
						$facet_name = trim( $facet_name );
						$term = get_term_by('name', $facet_name, $tax_name);

						if ($term) {
							$term_id = $term->term_id;
						}

						$rows[] = array(
							'facet_value' => isset( $term_id ) ? $term_id : 0,
							'facet_name'  => $facet_name,
							'facet_id'    => isset( $term_id ) ? $term_id : 0
						);
					}

					return $rows;
				}

With:

if ( ! empty( $attribute_values ) ) {
					$attribute_values_array = explode( ',', $attribute_values );
					foreach ( $attribute_values_array as $facet_name ) {
						$facet_name = trim( $facet_name );
						$term = get_term_by('name', $facet_name, $tax_name);

						if ($term) {
							$term_id = $term->term_id;
						}
						//WPML workaround for compsupp-7812
						$languages = apply_filters( 'wpml_active_languages', NULL);
    					if ( !empty( $languages ) ) {
							foreach( $languages as $language ){
								$term_id = apply_filters( 'wpml_object_id', $term_id, $tax_name, TRUE, $language['language_code'] );

								$rows[] = array(
									'facet_value' => isset( $term_id ) ? $term_id : 0,
									'facet_name'  => $facet_name,
									'facet_id'    => isset( $term_id ) ? $term_id : 0
								);
							}
						}
					}

					return $rows;
				}

- Go to your default language product and click update, just so re-index is created for loop

Regards,
Drazen