Forum

Thread tagged as: Question, Problem, Error

Perch headers issue

Hi All

Im having header issues again

Warning: Cannot modify header information - headers already sent by (output started at /var/sites/s/swanagelifeboat.myboxproject.co.uk/public_html/perch/templates/layouts/header.php:6) in /var/sites/s/swanagelifeboat.myboxproject.co.uk/public_html/perch/core/lib/PerchUtil.class.php on line 194

i have looked for white space and made sure its saved without bom in dreamweaver and geany

but still have the same issue

it only happens on the payment page

<?php include('../../perch/runtime.php'); ?>
<?php perch_layout('header'); ?>
<div class="row">
<div class="large-12 columns">
<div id="cart_title">
<h3>Thank you will now be redirected to PayPal</h3>
</div>
</div>
</div>
<?php perch_layout('footer'); ?>
<div class="">
<?php
if (perch_member_logged_in()) {

  // your 'success' return URL
  $return_url = 'https://swanagelifeboat.myboxproject.co.uk/shop/return';
  $cancel_url = 'https://swanagelifeboat.myboxproject.co.uk/';

  perch_shop_checkout('paypal-express', [
    'return_url' => $return_url,
    'cancel_url' => $cancel_url,
  ]);
}
?>
</div>

any ideas been trying allsorts for two days now

Anthony Elleray

Anthony Elleray 2 points

  • 5 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

perch_shop_checkout() needs to be called before you output any HTML at all.