The warning stays the same.
Remove Comments
-
heatherbell
- Senior Contributor
- Posts: 2540
- Joined: Mon Oct 07, 2019 4:39 am
- Phoenix Version:
- Has thanked: 35 times
- Been thanked: 243 times
-
heatherbell
- Senior Contributor
- Posts: 2540
- Joined: Mon Oct 07, 2019 4:39 am
- Phoenix Version:
- Has thanked: 35 times
- Been thanked: 243 times
-
heatherbell
- Senior Contributor
- Posts: 2540
- Joined: Mon Oct 07, 2019 4:39 am
- Phoenix Version:
- Has thanked: 35 times
- Been thanked: 243 times
-
raiwa
- Certified Developer
- Posts: 1641
- Joined: Sat Dec 21, 2019 8:08 am
- Phoenix Version: 1.1.0.6
- : Buy Me A Beverage
- Has thanked: 70 times
- Been thanked: 152 times
Re: Remove Comments
I did the second change suggested by @cartz and it works error free.ecartz wrote: ↑Fri Feb 09, 2024 3:29 am Delete the first block entirely. For the second block:replace with Or use the class, something likeCode: Select all
<div class="form-group row"> <label for="inputComments" class="col-form-label col-sm-4 text-sm-right"><?= ENTRY_COMMENTS ?></label> <div class="col-sm-8"><?= $comments_textarea ?></div> </div>You don't need the textarea, the variable, nor the id.Code: Select all
<?= new Input('comments', ['value' => ''], 'hidden') ?>
Make sure to do it in both pages, checkout_shipping.php and checkout_payment.php
You should also remove these code:
Code: Select all
$comments_textarea = new Textarea('comments', [
'cols' => '60',
'rows' => '5',
'id' => 'inputComments',
'placeholder' => ENTRY_COMMENTS_PLACEHOLDER,
]);
if (isset($_SESSION['comments'])) {
$comments_textarea->set_text($_SESSION['comments']);
}
Code: Select all
if (isset($_SESSION['comments'])) {
$comments_textarea->set_text($_SESSION['comments']);
}
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
https://docs.google.com/spreadsheets/d/ ... sp=sharing
Need Help?viewtopic.php?f=10&t=27
-
heatherbell
- Senior Contributor
- Posts: 2540
- Joined: Mon Oct 07, 2019 4:39 am
- Phoenix Version:
- Has thanked: 35 times
- Been thanked: 243 times
Re: Remove Comments
TY. As per OP, had not seen/changed Lines 149-154 checkout_shipping.php
So to clarify for future readers.
To remove or hide comments on checkout_shipping and checkout_payment:
checkout_shipping.php Lines 118-127
remove
Code: Select all
$comments_textarea = new Textarea('comments', [
'cols' => '60',
'rows' => '5',
'id' => 'inputComments',
'placeholder' => ENTRY_COMMENTS_PLACEHOLDER,
]);
if (isset($_SESSION['comments'])) {
$comments_textarea->set_text($_SESSION['comments']);
}change from
Code: Select all
<div class="form-group row">
<label for="inputComments" class="col-form-label col-sm-4 text-left text-sm-right"><?= ENTRY_COMMENTS ?></label>
<div class="col-sm-8">
<?= $comments_textarea ?>
</div>
</div>Code: Select all
<?= new Input('comments', ['value' => ''], 'hidden') ?>change from
Code: Select all
<div class="form-group row">
<label for="inputComments" class="col-form-label col-sm-4 text-sm-right"><?= ENTRY_COMMENTS ?></label>
<div class="col-sm-8"><?= $comments_textarea ?></div>
</div>Code: Select all
<?= new Input('comments', ['value' => ''], 'hidden') ?>-
raiwa
- Certified Developer
- Posts: 1641
- Joined: Sat Dec 21, 2019 8:08 am
- Phoenix Version: 1.1.0.6
- : Buy Me A Beverage
- Has thanked: 70 times
- Been thanked: 152 times
Re: Remove Comments
I know that this is an old discussion. But I still believe that, at least, a partial modularisation and content/layout modules would be better and more user friendly than hooks.
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
https://docs.google.com/spreadsheets/d/ ... sp=sharing
Need Help?viewtopic.php?f=10&t=27
- burt
- Core Team
- Posts: 4561
- Joined: Tue Oct 29, 2019 9:37 am
- Phoenix Version: v1.1.0.8
- : Buy Me A Beverage
- Has thanked: 252 times
- Been thanked: 422 times
Re: Remove Comments
This seems to imply that you removed the $comments_textarea (L18 - L26) rather than simply adding in "hidden" to the parameters.
Not that it matters as you have found a solution now.heatherbell wrote: ↑Fri Feb 09, 2024 5:53 amThis changed the warning to:
PHP Warning: Undefined variable $comments_textarea in //templates/override/includes/pages/checkout_payment.php on line 105
Stack trace:
1. {main}() //checkout_payment.php:0
2. require() //checkout_payment.php:25