Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Some products dont show in search › Reply To: Some products dont show in search
November 9, 2015 at 1:46 pm
#6575
Hi!
Looks like the translation ID for italian is missing from Cesarini Sartori Rossobastardo product. If I switch to english, I can see the result.
You can try 3 different solutions:
1. Solution
- Deactivate and Activate WPML again. This should generate the missing tranlsations.
- …then Re-create the Index Engine (Delete Index -> New index: https://i.imgur.com/PoFPNGg.png )
2. If 1. solution not working, then:
Open wp-content/plugins/ajax-search-pro/includes/etc/indextable.class.php file and go to line 908 – 926, where you should see this:
private function langcode_post_id($post){
global $wpdb;
$post_type = "post_" . $post->post_type;
$query = $wpdb->prepare("
SELECT language_code
FROM " . $wpdb->prefix . "icl_translations
WHERE
element_type = '%s' AND
element_id = %d"
, $post_type, $post->ID);
$query_exec = $wpdb->get_row($query);
if ( null !== $query_exec )
return $query_exec->language_code;
return "";
}
Change it to:
private function langcode_post_id($post){
global $wpdb;
global $sitepress;
$post_type = "post_" . $post->post_type;
$query = $wpdb->prepare("
SELECT language_code
FROM " . $wpdb->prefix . "icl_translations
WHERE
element_type = '%s' AND
element_id = %d"
, $post_type, $post->ID);
$query_exec = $wpdb->get_row($query);
if ( null !== $query_exec )
return $query_exec->language_code;
if ( is_object($sitepress) && method_exists($sitepress, 'get_default_language') )
return $sitepress->get_default_language();
return "";
}
Then Re-create the Index Engine (Delete Index -> New index: https://i.imgur.com/PoFPNGg.png )
Let me know if any of this helps!
Best,Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)



