Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Compact Box Layout not loading correct sometimes › Reply To: Compact Box Layout not loading correct sometimes
November 20, 2023 at 9:57 am
#46102
Keymaster
Hi Leonidas,
I think so, but it may require a bit of custom code and special configuration.
Try adding this code via the Code Snippets plugin or to the functions.php file in your theme/child theme directory – make sure to have a full server back-up first for safety. For more details you can check the safe coding guidelines.
add_filter( 'asp_post_content_before_tokenize_clear', 'asp_tokenize_sku_variation', 10, 2 );
function asp_tokenize_sku_variation($content, $post) {
if ( $post->post_type == 'product' && ($variations = $_product->get_children()) ) {
foreach ( $variations as $variation ) {
$content .= ' ' . $variation->get_description();
$content .= ' ' . $variation->get_sku();
}
}
return $content;
}
Then you will have to enable and use the index table engine. It will then index the variation description and SKU for each product as part of a the product content.