Skip to content

Commit

Permalink
#297: Variable name change in v200 (review write page)
Browse files Browse the repository at this point in the history
Note: Includes some minor reformatting/refactoring.
  • Loading branch information
lat9 committed Jan 11, 2024
1 parent 3a8a111 commit 42d55b6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
2 changes: 2 additions & 0 deletions docs/bootstrap/readme.html
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,10 @@ <h2>Version History</h2>
<li>v3.6.2, 2024-01-11 (lat9, drbyte, torvista)<ul>
<li>BUGFIX: Correct submit-button HTML <var>id</var> attribute on <var>checkout_one_confirmation</var> page.</li>
<li>BUGFIX: Remove unwanted list-item tags from suggested value for the breadcrumb-separator from the <var>zca_bootstrap_*.log</var>.</li>
<li>INTROP: Variable containing customer information's name changed in zc200 for <var>product_reviews_write</var> page.</li>
<li>The following files were changed:<ol>
<li>/includes/templates/bootstrap/templates/tpl_checkout_one_confirmation_default.php</li>
<li>/includes/templates/bootstrap/templates/tpl_product_reviews_write_default.php</li>
<li>/YOUR_ADMIN/includes/init_includes/init_zca_bootstrap_template_admin.php</li>
</ol></li>
</ul></li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
/**
* Page Template
*
* BOOTSTRAP v3.5.0
* BOOTSTRAP v3.6.2
*
* @copyright Copyright 2003-2020 Zen Cart Development Team
* @copyright Copyright 2003-2024 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: DrByte 2019 Jul 15 Modified in v1.5.7 $
Expand Down Expand Up @@ -72,11 +72,22 @@
<!--bof products review write card-->
<div id="productsReviewWrite-card" class="card">
<div id="productsReviewWrite-card-header" class="card-header">
<?php echo SUB_TITLE_FROM, zen_output_string_protected($customer->fields['customers_firstname'] . ' ' . $customer->fields['customers_lastname']); ?>
<?php
// -----
// In zc200+, the name of the variable that contains the name of the reviewer has
// changed from $customer to $reviewer. Since this template still supports
// zc157 and later, use $reviewer if present; otherwise, fall back to $customer.
//
$reviewer = $reviewer ?? $customer;
?>
<?php echo SUB_TITLE_FROM . ' ' . zen_output_string_protected($reviewer->fields['customers_firstname'] . ' ' . $reviewer->fields['customers_lastname']); ?>
</div>
<div id="productsReviewWrite-card-body" class="card-body">
<?php if ($messageStack->size('review_text') > 0) echo $messageStack->output('review_text'); ?>

<?php
if ($messageStack->size('review_text') > 0) {
echo $messageStack->output('review_text');
}
?>
<div class="text-center p-3"><?php echo SUB_TITLE_RATING; ?></div>

<div class="custom-control custom-radio custom-control-inline">
Expand Down Expand Up @@ -106,7 +117,7 @@
<?php echo zen_draw_input_field($antiSpamFieldName, '', ' size="60" id="RAS" style="visibility:hidden; display:none;" autocomplete="off"'); ?>

<div id="productsReviewWrite-reviewsWriteNotice">
<?php echo TEXT_NO_HTML . (REVIEWS_APPROVAL == '1' ? '<br>' . TEXT_APPROVAL_REQUIRED: ''); ?>
<?php echo TEXT_NO_HTML . (REVIEWS_APPROVAL === '1' ? '<br>' . TEXT_APPROVAL_REQUIRED: ''); ?>
</div>

<div id="productsReviewWrite-btn-toolbar" class="btn-toolbar justify-content-end my-3" role="toolbar">
Expand Down

0 comments on commit 42d55b6

Please sign in to comment.