session->get('wc_notices', array()); $notice_types = apply_filters('woocommerce_notice_types', array('error', 'success', 'notice')); // Comment or delete this to hide Alerts ob_start(); foreach ($notice_types as $notice_type) { if (wc_notice_count($notice_type) > 0) { wc_get_template("notices/{$notice_type}.php", array( 'notices' => array_filter($all_notices[$notice_type]), )); } } $fragments['notices_html'] = ob_get_clean(); // Comment or delete this to hide Alerts wc_clear_notices(); return $fragments; } add_filter('woocommerce_add_to_cart_fragments', 'aspace_ajax_add_to_cart_add_fragments'); // Add fragments for notices End