• Resolved ScytheZ

    (@scythez)


    Hey,

    i’ve started using your plugin since last night and i’ve hit a little bit of bug. I’ve set up 2 duplicate popups for 2 languages and since i use polylang i’ve set up the filter to hide each when there is a cookie for the pll_language either en or ro. The issue is that even if the cookie is present (dev tools / applications / cookies and the whole site is ok as translation) the plugin doesn’t pick the cookie and i get two popups overlaying each other. Is there anything i can check or try without cookies to hide / show based on language (we don’t have urls that would help here, no language code in url).

    Other than that pretty good plugin.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter ScytheZ

    (@scythez)

    And in the filter is set on pll_language is en on one and ro on the other. And as you can see both show up.

    Plugin Support Nithin – WPMU DEV Support

    (@wpmudevsupport11)

    Hi @scythez,

    I’m afraid, there isn’t any setting in Hustle to detect based on language. Is there a page URL that you could share where you are noticing the issue?

    Also possible to share the export of both the popups so that we could have a better idea regarding the existing configuration on the Hustle Side?

    You should find the option to export the popup in the “Gear icon” as mentioned in the following doc:
    https://wpmudev.com/docs/wpmu-dev-plugins/hustle/#module-dashboards

    You can share the export file via Google Drive, Dropbox or any cloud service in the next reply.

    Looking forward to your response.

    Kind Regards,

    Nithin

    Thread Starter ScytheZ

    (@scythez)

    Plugin Support Saurabh – WPMU DEV Support

    (@wpmudev-support7)

    Hi @scythez

    Thanks for the export file. I have performed a few tests on my lab site and was able to reproduce the same issue when trying to detect cookies created by Polylang. We will need to perform some additional tests with the help of our Second Level Support team and will provide an update based on the results.

    Please take into account our Second Level Support team handle more complex issues and their response may take some considerable time.

    Thanks for your patience and understanding on this matter.

    Kind regards

    Luis

    Plugin Support Saurabh – WPMU DEV Support

    (@wpmudev-support7)

    Hi @scythez

    Our Second Level Support team has recommended to use a code snippet that can hide the popups as required instead of setting Visibility rules . Let me share the code in the section below:

    add_action( 'plugins_loaded', function() {
    	if ( ! function_exists( 'pll_current_language' ) ) {
    		return;
    	}
    	add_filter( 'hustle_render_module_markup', function( $html, $module, $render_id, $sub_type, $post_id ) {
    		// Change the Pop-up IDs here:
    		$ids = array(
    			/* [Pop-up ID] => [Hidden to language] */
    			4 => 'en'
    		);
    
    		$module_id = (int) $module->module->module_id;
    		$lang      = pll_current_language();
    
    		if ( ! empty( $lang ) && isset( $ids[ $module_id ] ) && $ids[ $module_id ] === $lang )  {
    			return '';
    		}
    
    		return $html;
    	}, 10, 5 );
    });

    You’ll need to add the id’s as an array, for instance, if you want to hide a popup with id=4 in the “ro” language and hide the popup id= 5 in the “en” language, the array should be defined as indicated below:

    /* [Pop-up ID] => [Hidden to language] */
    4 => 'ro',
    5=> 'en'
    );

    Please remember that trigger settings in the Behavior tab should not be changed.

    This code can be added in a MU plugin file as mentioned?here:
    https://wpmudev.com/docs/using-wordpress/installing-wordpress-plugins/#installing-mu-plugins

    Hope this information helps.

    Kind regards

    Luis

    Plugin Support Patrick – WPMU DEV Support

    (@wpmudevsupport12)

    Hi @scythez

    I hope you are doing well and safe!

    We haven’t heard from you in a while, I’ll mark this thread as resolved.

    Feel free to let us know if you have any additional questions or problems.

    Best Regards
    Patrick Freitas

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Hustle and second language’ is closed to new replies.