$notice_data ) { wc_get_template( 'notices/'. $notice_type .'.php', array( 'notices' => array_filter( $notices[ $notice_type ] ) ) ); } $fragments['notices'] = ob_get_clean(); wc_clear_notices(); } } return $fragments; } add_filter( 'woocommerce_add_to_cart_fragments', 'botiga_single_ajax_add_to_cart_add_fragments' );