• Resolved Sylvie D

    (@sylvie-d)


    I am using SUBSCRIBE2 10.3 and the WPML translation plugin on a trilingual website (English/French/German). I am aware that there could be some incompatibilities.

    What I would like to do is simple:
    1) exclude some categories of the English version from the email notifications,
    2) AND exclude all categories of the French and German versions, to avoid notifications being sent each time a new translation is up (= posted in a French/German category)

    The issue is:
    in Subscribe2/Settings/Registered Users/Exclude categories: notification categories can be excluded:
    – either from the English version
    – OR from the French version
    – OR from the German version,
    but not from English + French + German.

    Because, although SUBSCRIBE2 lists all the French/German categories (translated via WPML) correctly, when excluded categories are checked for the French version for instance, the excluded categories of the English version automatically get unchecked.

    Is this a bug? Is there a way around that or a quick fix?

    I am happy with both plugins, that are working well for me and would not like to change!
    Thank you for your time.

    https://www.ads-software.com/plugins/subscribe2/

Viewing 6 replies - 1 through 6 (of 6 total)
  • @sylvie D,

    You’d have to manually amend the database setting really to exclude all of the category IDs and then make sure nobody changes the settings on that page or you’ll lose the settings again.

    Can you find all of the category IDs? Can you manage a little bit of coding?

    Thread Starter Sylvie D

    (@sylvie-d)

    Thank you for your quick response.
    Coding is not my force but if you could tell me exactly what to do, I would try it on a test website.

    @sylvie D,

    You can either create a plugin or add this to the functions.php file of your theme. The plugin route ensures that you won’t lose this change if you update your theme in the future.

    If you want to use the plugin route, install the Pluginception plugin on your blog, create a plugin, edit it and paste in the code below.

    If you are going to use the functions.php method edit your theme, find that file and paste the below in at the end.

    Where it currently says ‘1,2,3,4’ you will need to insert the IDs of all of the categories you want excluding.

    function s2_update_exclude() {
    	global $mysubscribe2;
    	$mysubscribe2->subscribe2_options['exclude'] = '1,2,3,4';
    	update_option( 'subscribe2_options', $this->subscribe2_options );
    } // end s2_update_exclude
    add_action( 'shutdown', 's2_update_exclude');
    Thread Starter Sylvie D

    (@sylvie-d)

    Thank you.

    I added the piece of code at the end of functions.php in my theme and got this error:
    Fatal error: Using $this when not in object context

    on this line:
    update_option( ‘subscribe2_options’, $this->subscribe2_options );

    @sylvie D,

    Whoops, untested code, change the $this-> to $mysubscribe2->

    Thread Starter Sylvie D

    (@sylvie-d)

    Great! It works.
    I hope this can benefit other users.
    Thanks a lot for being so helpful.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Problem excluding categories on multilingual website’ is closed to new replies.