Fix product attributes lookup data and filter by attribute widget with non-ASCII named attributes (#34432)
This only fixes the classic widget, not the equivalent block.
This commit is contained in:
parent
fee3e10445
commit
b7c5519b41
|
@ -0,0 +1,4 @@
|
|||
Significance: patch
|
||||
Type: fix
|
||||
|
||||
Fix handling of non-ASCII product attributes when the attributes lookup table is in use
|
|
@ -212,12 +212,13 @@ class Filterer {
|
|||
{$tax_query_sql['join']} {$meta_query_sql['join']}
|
||||
INNER JOIN {$wpdb->posts} ON {$wpdb->posts}.ID = {$this->lookup_table_name}.product_or_parent_id";
|
||||
|
||||
$term_ids_sql = $this->get_term_ids_sql( $term_ids );
|
||||
$query['where'] = "
|
||||
$encoded_taxonomy = sanitize_title( $taxonomy );
|
||||
$term_ids_sql = $this->get_term_ids_sql( $term_ids );
|
||||
$query['where'] = "
|
||||
WHERE {$wpdb->posts}.post_type IN ( 'product' )
|
||||
AND {$wpdb->posts}.post_status = 'publish'
|
||||
{$tax_query_sql['where']} {$meta_query_sql['where']}
|
||||
AND {$this->lookup_table_name}.taxonomy='{$taxonomy}'
|
||||
AND {$this->lookup_table_name}.taxonomy='{$encoded_taxonomy}'
|
||||
AND {$this->lookup_table_name}.term_id IN $term_ids_sql
|
||||
{$in_stock_clause}";
|
||||
|
||||
|
|
|
@ -433,7 +433,7 @@ class LookupDataStore {
|
|||
$terms = WC()->call_function(
|
||||
'get_terms',
|
||||
array(
|
||||
'taxonomy' => $taxonomy,
|
||||
'taxonomy' => wc_sanitize_taxonomy_name( $taxonomy ),
|
||||
'hide_empty' => false,
|
||||
'fields' => 'id=>slug',
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue