Changing the list based on custom logic is not working
-
On our site we WPML plugin and we have total 4 language. We are trying to change the list based on language by your code provided here https://support.saintsystems.com/hc/en-us/articles/214034483-Changing-the-list-based-on-custom-logic. But its not working every time the subscriber is going to EN list if we placing order from es page or pt-pt page. The following code are we using. Please check why its not working and provide solution for us.
add_filter( ‘ss_wc_mailchimp_subscribe_options’ , ‘wphero_wc_mailchimp_change_list_based_on_language’, 10 , 1 );
function wphero_wc_mailchimp_change_list_based_on_language( $subscribe_options ) {if ($_COOKIE[‘_icl_current_language’] == ‘en’) {
$subscribe_options[‘list_id’] = ‘XXXXX’;
}elseif ($_COOKIE[‘_icl_current_language’] == ‘pt-pt’) {
$subscribe_options[‘list_id’] = ‘XXXX’;
}elseif ($_COOKIE[‘_icl_current_language’] == ‘fr’) {
$subscribe_options [‘list_id’] = ‘XXXX’;
}elseif ($_COOKIE[‘_icl_current_language’] == ‘es’) {
$subscribe_options[‘list_id’] = ‘XXXX’;
}return $subscribe_options;
}
- The topic ‘Changing the list based on custom logic is not working’ is closed to new replies.