Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › WPML and Products are not displaying › Reply To: WPML and Products are not displaying
Okay – so it is the missing translations causing the issue here.
It is sort of hard coded to the query, but I could potentially suggest a modification to exclude these translations from the query, and maybe add a hook point to a future release to avoid that.
Can you provide temporary FTP access?
If not then please follow these steps:
– Open up the \wp-content\plugins\ajax-search-pro\includes\classes\Search\SearchPostTypes.php file on the server
– Find the line (around 277):
if ($site_lang_selected) {
– Change it to:
if ($args['_wpml_allow_missing_translations'] && $site_lang_selected) {
– Save the file
Do the same steps for:
– \wp-content\plugins\ajax-search-pro\includes\classes\Search\SearchIndex.php file on the server
– Find the line (around 168):
if ($site_lang_selected) {
– Change it to:
if ($args['_wpml_allow_missing_translations'] && $site_lang_selected) {
– Save the file
After the change, a custom code is required to exclicitly set the allowance. 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_query_args', 'asp_query_args_change', 10, 1 );
function asp_query_args_change( $args ) {
$args['_wpml_allow_missing_translations'] = false;
return $args;
}
This will prevent missing translations from each language as well as will retain in any future versions as if this works, then I will append it to the next upcoming version.