Page 1 of 1

Blank screen after trying to modify layout in Admin

Posted: Sat Jan 27, 2024 3:16 am
by Portman
Hi,

I have been playing around with PI files to get the products page to do want I want - and had got it all (or mostly) doing what I want so went into admin to play around with the layout (Admin->Modules-Layout). when I try to change any of the modules setting and then save it I get a blank screen ... I looked in the error log for admin and the only error I can find that may be relevant is this one;

Code: Select all

PHP Warning:  Cannot modify header information - headers already sent by (output started at .../includes/modules/pi/product_info/tpl_pi_buy_button.php:33) in .../includes/system/versioned/1.0.8.5/href.php on line 195
this is the same error that comes up regardless of which module I modify
/includes/modules/pi/product_info/tpl_pi_buy_button.php is unmodified, though I do have a bunch of modified files including this one in the templates/override/... folders.

I do not know if there is something wrong with one of these files - I'll put the tpl_pi_buy_button.php file from the override folder below incase that is the issue...

Code: Select all

<?php

	if ( isset($_SESSION['customer_id']) && defined('MODULE_STORE_WHOLESALE_STATUS') && MODULE_STORE_WHOLESALE_STATUS == 'True'  && isset($_SESSION['wholesale_group']) && $_SESSION['wholesale_group'] > '0' ) { 
		
		$products_ws_price = $GLOBALS['product']->get('ws_price_' . $_SESSION['wholesale_group'] );

	if ( $products_ws_price > 0 ) { 
  ?>


<div class="col-sm-<?= (int)PI_BUY_CONTENT_WIDTH ?> pi-buy-button mt-2">

  <?=  
    new Button(PI_BUY_BUTTON_TEXT, 'fas fa-shopping-cart', 'btn-success btn-block btn-lg btn-product-info btn-buy', [
      'data-has-attributes' => (int)$GLOBALS['product']->get('has_attributes'),
      'data-in-stock' => (int)$GLOBALS['product']->get('in_stock'),
      'data-product-id' => (int)$GLOBALS['product']->get('id'),
    ]),
    new Input('products_id', ['value' => (int)$GLOBALS['product']->get('id')], 'hidden');
		
  ?>
</div>
<?php	}
	if ( $products_ws_price == 0 ) { 
?> 
	   <div class="col-sm-<?= (int)PI_BUY_CONTENT_WIDTH ?> alert alert-warning text-center">
		<?php echo PI_BUY_NA_TEXT;?> 
		</div>	
<?php 
	}

	} ?>
<?php
/*
  $Id$

  CE Phoenix, E-Commerce made Easy
  https://phoenixcart.org

  Copyright (c) 2021 Phoenix Cart

  Released under the GNU General Public License
*/
?>
Thanks for any help

Re: Blank screen after trying to modify layout in Admin

Posted: Sat Jan 27, 2024 10:20 am
by burt
L33 of that code is;

} ?>
<?php

Paste the code from the core file.

Re: Blank screen after trying to modify layout in Admin

Posted: Sat Jan 27, 2024 12:32 pm
by raiwa
It’s probably the pi/layout module install/uninstall bug fixed in 1.0.8.21.

Re: Blank screen after trying to modify layout in Admin

Posted: Mon Feb 05, 2024 6:22 am
by Portman
burt wrote: Sat Jan 27, 2024 10:20 am Paste the code from the core file.
the core file is...

Code: Select all

<div class="col-sm-<?= (int)PI_BUY_CONTENT_WIDTH ?> pi-buy-button mt-2">
  <?=
    new Button(PI_BUY_BUTTON_TEXT, 'fas fa-shopping-cart', 'btn-success btn-block btn-lg btn-product-info btn-buy', [
      'data-has-attributes' => (int)$GLOBALS['product']->get('has_attributes'),
      'data-in-stock' => (int)$GLOBALS['product']->get('in_stock'),
      'data-product-id' => (int)$GLOBALS['product']->get('id'),
    ]),
    new Input('products_id', ['value' => (int)$GLOBALS['product']->get('id')], 'hidden');
  ?>
</div>

<?php
/*
  $Id$

  CE Phoenix, E-Commerce made Easy
  https://phoenixcart.org

  Copyright (c) 2021 Phoenix Cart

  Released under the GNU General Public License
*/
?>

Re: Blank screen after trying to modify layout in Admin

Posted: Mon Feb 05, 2024 6:24 am
by Portman
raiwa wrote: Sat Jan 27, 2024 12:32 pm It’s probably the pi/layout module install/uninstall bug fixed in 1.0.8.21.
is that update available yet? I have not found it and my site says it is up to date at 1.0.8.20

Re: Blank screen after trying to modify layout in Admin

Posted: Mon Feb 05, 2024 12:47 pm
by heatherbell
Portman wrote: Mon Feb 05, 2024 6:24 am
raiwa wrote: Sat Jan 27, 2024 12:32 pm It’s probably the pi/layout module install/uninstall bug fixed in 1.0.8.21.
is that update available yet? I have not found it and my site says it is up to date at 1.0.8.20
1.0.8.21 has not yet been publicly released but has been released early to VIP PRO members. That is one of the many benefits of VIP PRO membership

Re: Blank screen after trying to modify layout in Admin

Posted: Mon Feb 05, 2024 1:24 pm
by burt
burt wrote: Sat Jan 27, 2024 10:20 am L33 of that code is;

} ?>
<?php
Try changing by simply removing the ?> and <?php

I think this is an addon, right? Some wholesale mod?
Or is it something you have made yourself?

Re: Blank screen after trying to modify layout in Admin

Posted: Tue Feb 06, 2024 8:07 am
by Portman
Thanks for your help @burt ... it is an original mod I wrote to work with a wholesale mod...

I actually found the error and it had nothing to do with the code, I accidently uploaded this template file into includes/modules/pi/product_info (not the template folder) and this is what was causing the error - so matter what I changed with the file in the override folder the error kept coming up :oops:

Anyway, slightly embarrassingly I will slink away now.....

Re: Blank screen after trying to modify layout in Admin

Posted: Tue Feb 06, 2024 10:10 am
by burt
We've all done something like that. Even the "experts".
Take the time I was working (on a test shop) in admin, and nothing was changing front end.
Took me a while to work out I'm in the admin of 1 test shop and the shopside of a different test shop.