This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Reply To: Compact Box Layout not loading correct sometimes

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

#46108
Ernest MarcinkoErnest Marcinko
Keymaster

Okay, let’s try something different.

On the index table settings, do NOT select the product variations, that may actually conflict with this. Try this code instead:

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' ) {
	$_product = wc_get_product( $r->id );  
	$variations = $_product->get_children();
	if ( !is_wp_error($variations) && is_array($variations) ) {
		foreach ( $variations as $variation ) {
			$content .= ' ' . $variation->get_description();
			$content .= ' ' .  $variation->get_sku();
		}
	}
  }

  return $content;
}

If all goes well this should make some sort of a change.