Viewing 2 replies - 1 through 2 (of 2 total)
  • I ran into this need as well and managed to do this with a snippet in functions.php:

    // Remove onesignal on homepage and product pages
    function onesignal_initialize_sdk_filter($onesignal_settings)
    {
    	if (
    		is_page('homepage') ||
    		is_page('cart') ||
    		is_page('checkout') ||
    		is_page('my-account')
    	) {
    		return false;
    	} else {
    		return true;
    	}
    }
    
    add_filter('onesignal_initialize_sdk', 'onesignal_initialize_sdk_filter', 10, 1);

    You can adjust to suit ??

    Thanks for sharing, @jkohlbach!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘CAn we disable pushnotifications from some pages?’ is closed to new replies.