Appointments+ qtranslate problem

Hi there, I have a problem with the service descriptions which are being shown as excerpts, in case of a multiple language site using qtranslate are shown only in the default language of the site.Thanks for the support, Stefan. Here is the link to my site: http://exitgames.ro/rezervari/?wcalendar=1403777932&lang=hu (to a non default language)

  • Saurabh

    Hi @Stefan,

    I had to look real deep and have managed to fix this. The code provided in the other thread doesn't work due to two bugs. One in our plugin and the other in qTranslate.

    Fixing the Appointments+ bug, involved replacing line numbers (approx.) 1245, in appointments/includes/class_app_shortcodes.php:
    $href = apply_filters( 'app_service_href', add_query_arg( array( "wcalendar"=>$wcalendar, "app_service_id" => "'+selected_service" ), $href ) );

    with, the following code:

    $href = apply_filters( 'app_service_href', add_query_arg( array( "wcalendar"=>$wcalendar ), $href ) );
    
    $href = add_query_arg( array( "app_service_id" => "'+selected_service" ),$href );

    We'll fix this in the next version of the plugin.

    Second the code that was provided in this thread failed because qTranslate would replace all &'s with &'s breaking the javascript.

    That's why the appointments weren't happening.

    The new code would be:

    function my_connect_qtrans_apps () {
    	if (function_exists('qtrans_useCurrentLanguageIfNotFoundShowAvailable')) {
    		add_filter('app_pre_content', 'qtrans_useCurrentLanguageIfNotFoundShowAvailable', 0);
    		add_filter('app_the_content', 'qtrans_useCurrentLanguageIfNotFoundShowAvailable', 0);
    	}
    	if (function_exists('qtrans_convertURL')) {
    		add_filter('app_service_href', 'my_qtrans_convertURL_filter',0);
    		add_filter('app_worker_href', 'my_qtrans_convertURL_filter',0);
    	}
    }
    
    function my_qtrans_convertURL_filter($href){
    	$url = qtrans_convertURL($href);
    	$url = str_replace('&','&',$url);
    	$url = str_replace('&','&',$url);
    	return $url;
    }
    add_action('plugins_loaded', 'my_connect_qtrans_apps');

    Also, for some reason, this code wasn't loading from your theme's functions.php. So, I had to create a new plugin for this. I'm attaching the plugin here, for anyone else to use.

    Do let me know if it works for you, too.

    Best

    Saurabh

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.