Blank screen after trying to modify layout in Admin

Open to all! Ask other shopowners for help.
Post Reply
User avatar
Portman
Contributor
Posts: 158
Joined: Mon Mar 08, 2021 1:04 am
Phoenix Version: v1.0.8.20
Has thanked: 29 times
Been thanked: 4 times

Blank screen after trying to modify layout in Admin

Post 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


Join The Code Co-op to get access to your library in the Code Co-op Forum
User avatar
burt
Core Team
Posts: 4561
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 413 times

Re: Blank screen after trying to modify layout in Admin

Post by burt »

L33 of that code is;

} ?>
<?php

Paste the code from the core file.
I am not here to build for you.
I am here to build with you. Let's help each other.
raiwa
Certified Developer
Posts: 1641
Joined: Sat Dec 21, 2019 8:08 am
Phoenix Version: 1.1.0.6
Has thanked: 70 times
Been thanked: 152 times

Re: Blank screen after trying to modify layout in Admin

Post by raiwa »

It’s probably the pi/layout module install/uninstall bug fixed in 1.0.8.21.
Public Phoenix Change Log Cheat Set on Google Sheets
https://docs.google.com/spreadsheets/d/ ... sp=sharing

Need Help?viewtopic.php?f=10&t=27
User avatar
Portman
Contributor
Posts: 158
Joined: Mon Mar 08, 2021 1:04 am
Phoenix Version: v1.0.8.20
Has thanked: 29 times
Been thanked: 4 times

Re: Blank screen after trying to modify layout in Admin

Post 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
*/
?>
User avatar
Portman
Contributor
Posts: 158
Joined: Mon Mar 08, 2021 1:04 am
Phoenix Version: v1.0.8.20
Has thanked: 29 times
Been thanked: 4 times

Re: Blank screen after trying to modify layout in Admin

Post 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
heatherbell
Senior Contributor
Posts: 2540
Joined: Mon Oct 07, 2019 4:39 am
Phoenix Version:
Has thanked: 35 times
Been thanked: 243 times

Re: Blank screen after trying to modify layout in Admin

Post 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
User avatar
burt
Core Team
Posts: 4561
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 413 times

Re: Blank screen after trying to modify layout in Admin

Post 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?
User avatar
Portman
Contributor
Posts: 158
Joined: Mon Mar 08, 2021 1:04 am
Phoenix Version: v1.0.8.20
Has thanked: 29 times
Been thanked: 4 times

Re: Blank screen after trying to modify layout in Admin

Post 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.....
User avatar
burt
Core Team
Posts: 4561
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 413 times

Re: Blank screen after trying to modify layout in Admin

Post 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.


Join The Code Co-op to get access to your library in the Code Co-op Forum
Post Reply