kgltkn
September 1, 2017 at 2:08 am
Hello
After payment via Paypal the redirect doesnt work.
I get the following mmessage:
Warning: Cannot modify header information – headers already sent by (output started at /homepages/7/d466324795/htdocs/web/wp-content/themes/boat/header.php:9) in /homepages/7/d466324795/htdocs/web/wp-includes/pluggable.php on line 1195
Any Fix for that?
Thanks
Tony
September 1, 2017 at 3:15 am
Add New Note to this Reply
Hi there,
Something within your themes header.php file on line 9 is outputting something to the page that it should not be.
However, is this a live site or development? The above error showing on the page means you also have error_reporting enabled on that site which you don’t want to have enabled on a production site. You should log the errors rather than displaying them to your users, for that you can use a snippet like this:
https://gist.github.com/Pebblo/8787f5530ea777c84aaf62f075e55b32
Add that to your wp-config.php file to log errors and in /wp-content/debug.log rather than displaying them.
kgltkn
September 3, 2017 at 5:17 am
Add New Note to this Reply
Hi and thank you for your answer.
This is a live site.
I filled the snippet into my wp-config.php.
My header.php:
<?php
/**
* The Header for our theme.
*
* @package Betheme
* @author Muffin group
* @link http://muffingroup.com
*/
?><!DOCTYPE html>
<?php
if( $_GET && key_exists('mfn-rtl', $_GET) ):
echo '<html class="no-js" lang="ar" dir="rtl">';
else:
?>
<html class="no-js<?php echo mfn_user_os(); ?>" <?php language_attributes(); ?><?php mfn_tag_schema(); ?>>
<?php endif; ?>
<!-- head -->
<head>
<!-- meta -->
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<?php
if( mfn_opts_get('responsive') ){
if( mfn_opts_get('responsive-zoom') ){
echo '<meta name="viewport" content="width=device-width, initial-scale=1" />';
} else {
echo '<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />';
}
}
?>
<?php do_action('wp_seo'); ?>
<link rel="shortcut icon" href="<?php mfn_opts_show( 'favicon-img', THEME_URI .'/images/favicon.ico' ); ?>" />
<?php if( mfn_opts_get('apple-touch-icon') ): ?>
<link rel="apple-touch-icon" href="<?php mfn_opts_show( 'apple-touch-icon' ); ?>" />
<?php endif; ?>
<!-- wp_head() -->
<?php wp_head(); ?>
</head>
<!-- body -->
<body <?php body_class(); ?>>
<?php do_action( 'mfn_hook_top' ); ?>
<?php get_template_part( 'includes/header', 'sliding-area' ); ?>
<?php if( mfn_header_style( true ) == 'header-creative' ) get_template_part( 'includes/header', 'creative' ); ?>
<!-- #Wrapper -->
<div id="Wrapper">
<?php
// Featured Image | Parallax ----------
$header_style = '';
if( mfn_opts_get( 'img-subheader-attachment' ) == 'parallax' ){
if( mfn_opts_get( 'parallax' ) == 'stellar' ){
$header_style = ' class="bg-parallax" data-stellar-background-ratio="0.5"';
} else {
$header_style = ' class="bg-parallax" data-enllax-ratio="0.3"';
}
}
?>
<?php if( mfn_header_style( true ) == 'header-below' ) echo mfn_slider(); ?>
<!-- #Header_bg -->
<div id="Header_wrapper" <?php echo $header_style; ?>>
<!-- #Header -->
<header id="Header">
<?php if( mfn_header_style( true ) != 'header-creative' ) get_template_part( 'includes/header', 'top-area' ); ?>
<?php if( mfn_header_style( true ) != 'header-below' ) echo mfn_slider(); ?>
</header>
<?php
if( ( mfn_opts_get('subheader') != 'all' ) &&
( ! get_post_meta( mfn_ID(), 'mfn-post-hide-title', true ) ) &&
( get_post_meta( mfn_ID(), 'mfn-post-template', true ) != 'intro' ) ){
$subheader_advanced = mfn_opts_get( 'subheader-advanced' );
$subheader_style = '';
if( mfn_opts_get( 'subheader-padding' ) ){
$subheader_style .= 'padding:'. mfn_opts_get( 'subheader-padding' ) .';';
}
if( is_search() ){
// Page title -------------------------
echo '<div id="Subheader" style="'. $subheader_style .'">';
echo '<div class="container">';
echo '<div class="column one">';
if( trim( $_GET['s'] ) ){
global $wp_query;
$total_results = $wp_query->found_posts;
} else {
$total_results = 0;
}
$translate['search-results'] = mfn_opts_get('translate') ? mfn_opts_get('translate-search-results','results found for:') : __('results found for:','betheme');
echo '<h1 class="title">'. $total_results .' '. $translate['search-results'] .' '. esc_html( $_GET['s'] ) .'</h1>';
echo '</div>';
echo '</div>';
echo '</div>';
} elseif( ! mfn_slider_isset() || ( is_array( $subheader_advanced ) && isset( $subheader_advanced['slider-show'] ) ) ){
// Page title -------------------------
// Subheader | Options
$subheader_options = mfn_opts_get( 'subheader' );
if( is_home() && ! get_option( 'page_for_posts' ) && ! mfn_opts_get( 'blog-page' ) ){
$subheader_show = false;
} elseif( is_array( $subheader_options ) && isset( $subheader_options[ 'hide-subheader' ] ) ){
$subheader_show = false;
} elseif( get_post_meta( mfn_ID(), 'mfn-post-hide-title', true ) ){
$subheader_show = false;
} else {
$subheader_show = true;
}
// title
if( is_array( $subheader_options ) && isset( $subheader_options[ 'hide-title' ] ) ){
$title_show = false;
} else {
$title_show = true;
}
// breadcrumbs
if( is_array( $subheader_options ) && isset( $subheader_options[ 'hide-breadcrumbs' ] ) ){
$breadcrumbs_show = false;
} else {
$breadcrumbs_show = true;
}
if( is_array( $subheader_advanced ) && isset( $subheader_advanced[ 'breadcrumbs-link' ] ) ){
$breadcrumbs_link = 'has-link';
} else {
$breadcrumbs_link = 'no-link';
}
// Subheader | Print
if( $subheader_show ){
echo '<div id="Subheader" style="'. $subheader_style .'">';
echo '<div class="container">';
echo '<div class="column one">';
// Title
if( $title_show ){
$title_tag = mfn_opts_get( 'subheader-title-tag', 'h1' );
echo '<'. $title_tag .' class="title">'. mfn_page_title() .'</'. $title_tag .'>';
}
// Breadcrumbs
if( $breadcrumbs_show ){
mfn_breadcrumbs( $breadcrumbs_link );
}
echo '</div>';
echo '</div>';
echo '</div>';
}
}
}
?>
</div>
<?php
// Single Post | Template: Intro
if( get_post_meta( mfn_ID(), 'mfn-post-template', true ) == 'intro' ){
get_template_part( 'includes/header', 'single-intro' );
}
?>
<?php do_action( 'mfn_hook_content_before' );
// Omit Closing PHP Tags
I dont see anything on line 9 that maybe causes the error.
Tony
September 4, 2017 at 3:31 am
Add New Note to this Reply
Ok, so what happens now when you make a payment with PayPal?
Which specific version number of Event Espresso 4 are you using?
Can you link me an event so I can view the code, please?
kgltkn
September 4, 2017 at 2:11 pm
Add New Note to this Reply
The Payment works and we receive the payment. But instead of redirecting to the sussess page this error appears.
EE Version 4.9.41.p
Here a link to an event: http://event.boat4.de/Veranstaltungen/test/
Tony
September 4, 2017 at 2:19 pm
Add New Note to this Reply
If that error still appears they your site is still set to display errors, you need to set it not to display errors and confirm if you get the same problem.
Try adding: @ini_set( 'display_errors', 0 );
to the snippet I gave you earlier.
Tony
September 4, 2017 at 2:21 pm
Add New Note to this Reply
Or try temporarily switching to a default theme such as twentyseventeen and confirm if you get the same problem.
You can switch themes only for site admins using Theme Test Drive .
kgltkn
September 5, 2017 at 2:32 am
Add New Note to this Reply
I Updated my Theme and EE to the newest version. Now everything works as it shoud.
Thank you very much.
Tony
September 5, 2017 at 2:51 am
Add New Note to this Reply
Great, I’m glad it’s working for you.