v20.8 facets issue with classnames
-
HaikoGParticipant3 years, 9 months ago #15927
I updated to 20.8 today but had to revert back to my previous version, because the facets/filter broke.
The classnames of the facets (checkbox) no longer have spaces between them, resulting in them no longer being clickable and have no styling applied.So a facet now has the following class(es): wpsolr_facet_class_FAFC20D93D8FD5568D04E0C09B4EFF45wpsolr_facet_checkboxwpsolr_facet_skin_nonewpsolr_facet_product_cat_str wpsolr_facet_scroll
Previous version was:
wpsolr_facet_class_60131CD1E83FC40AD7EBA2C65A56E73D wpsolr_facet_checkbox wpsolr_facet_skin_none wpsolr_facet_pa_beeldschermdiagonaal_str wpsolr_facet_scrollwpsolrKeymaster3 years, 9 months ago #15928Here is an extract from facet class on https://www.wpsolr.com/wpsolr/search (WPSOLR 21.8):
wpsolr_facet_class_C17187274AFF0A39A144307C73F8805D wpsolr_facet_radiobox wpsolr_facet_skin_none wpsolr_facet_type wpsolr_facet_scroll
Do you have custom code interacting with facets?
HaikoGParticipant3 years, 9 months ago #15929We do have some custom code running, but turning that off did not change the behaviour. The only code interacting with the facets is
add_filter( WPSOLR_Events::WPSOLR_FILTER_UPDATE_FACETS_DATA, ‘hg_filter_facet_items’, 10, 1);
function hg_filter_facet_items($facets){
// loop through array in array in array
foreach ($facets as $fkey => $facet){
if (is_array($facet)){
foreach ($facet as $fikey => $facet_item){
if (isset($facet_item[‘id’]) && $facet_item[‘id’] == ‘product_cat_str’){
// get terms that are allowed to be filtered (hide customer specific categories)
$show_terms = get_terms( ‘product_cat’, array(‘meta_key’ => ‘include_in_queryfilters’, ‘meta_value’ => 1) );
foreach ($facet_item[‘items’] as $itemkey => $item){
if (!in_array($item[‘value’], array_column($show_terms, ‘name’))){
unset($facets[$fkey][$fikey][‘items’][$itemkey]);
}
}
}
}}
}return $facets;
}I’ll try turning off some other customizations
You must be logged in to reply to this topic.