Skip to content

Commit

Permalink
Testing rendering all fields from group part 2
Browse files Browse the repository at this point in the history
  • Loading branch information
justinbeaty committed Oct 15, 2024
1 parent 71aa642 commit ed1ebaa
Showing 1 changed file with 21 additions and 40 deletions.
61 changes: 21 additions & 40 deletions app/design/frontend/rwd/default/template/customer/form/edit.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -15,44 +15,30 @@
</div>
<?= $this->getMessagesBlock()->toHtml() ?>
<form action="<?= $this->getUrl('customer/account/editPost') ?>" method="post" autocomplete="off" id="form-validate" class="scaffold-form" enctype="multipart/form-data">
<?= $this->getBlockHtml('formkey') ?>

<?php $_groups = $this->getGroupedFields() ?>
<?php foreach (array_keys($_groups) as $_i => $_group): ?>
<div class="fieldset">
<?= $this->getBlockHtml('formkey') ?>
<h2 class="legend"><?= $this->__('Account Information') ?></h2>
<h2 class="legend"><?= $this->__($_group) ?></h2>
<?php if ($_i === 0): ?>
<p class="required"><?= $this->__('* Required Fields') ?></p>
<?php endif ?>
<ul class="form-list">
<li class="fields">
<?= $this->getLayout()->createBlock('customer/widget_name')->setObject($this->getCustomer())->toHtml() ?>
</li>
<li>
<label for="email" class="required"><em>*</em><?= $this->__('Email Address') ?></label>
<div class="input-box">
<input type="email" autocapitalize="off" autocorrect="off" spellcheck="false" name="email" id="email" value="<?= $this->escapeHtml($this->getCustomer()->getEmail()) ?>" title="<?= Mage::helper('core')->quoteEscape($this->__('Email Address')) ?>" class="input-text required-entry validate-email" />
</div>
</li>
<?php $_dob = $this->getLayout()->createBlock('customer/widget_dob') ?>
<?php if ($_dob->isEnabled()): ?>
<li><?= $_dob->setDate($this->getCustomer()->getDob())->toHtml() ?></li>
<?php endif ?>
<?php $_taxvat = $this->getLayout()->createBlock('customer/widget_taxvat') ?>
<?php if ($_taxvat->isEnabled()): ?>
<li><?= $_taxvat->setTaxvat($this->getCustomer()->getTaxvat())->toHtml() ?></li>
<?php endif ?>
<?php $_gender = $this->getLayout()->createBlock('customer/widget_gender') ?>
<?php if ($_gender->isEnabled()): ?>
<li><?= $_gender->setGender($this->getCustomer()->getGender())->toHtml() ?></li>
<?php foreach ($_groups[$_group] as $_code => $_attribute): ?>
<?php $_block = 'eav/widget_'.$_attribute->getFrontendInput() ?>
<?php $_element = $this->getLayout()->createBlock($_block)->setData('attribute', $_attribute) ?>
<?php if ($_element->isEnabled()): ?>
<li><?= $_element->setObject($this->getCustomer())->toHtml() ?></li>
<?php endif ?>
<?php endforeach ?>
</ul>
</div>
<?php endforeach ?>

<?php foreach ($this->getGroupedFields() as $_group => $_attributes): ?>
<h2 class="legend"><?= $this->__($_group) ?></h2>
<?php foreach ($_attributes as $_code => $_attribute): ?>
<?php $_block = 'eav/widget_'.$_attribute->getFrontendInput() ?>
<?php $_element = $this->getLayout()->createBlock($_block)->setData('attribute', $_attribute) ?>
<?php if ($_element->isEnabled()): ?>
<li><?= $_element->setObject($this->getCustomer())->toHtml() ?></li>
<?php endif ?>
<?php endforeach ?>
<?php endforeach ?>

<div class="fieldset">
<h2 class="legend"><?= $this->__('Password Information') ?></h2>
<ul class="form-list">
<li>
<label for="current_password" class="required"><em>*</em><?= Mage::helper('core')->quoteEscape($this->__('Current Password')) ?></label>
<div class="input-box">
Expand All @@ -64,12 +50,7 @@
<li class="control">
<input type="checkbox" name="change_password" id="change_password" value="1" onclick="setPasswordForm(this.checked)" title="<?= Mage::helper('core')->quoteEscape($this->__('Change Password')) ?>"<?php if($this->getCustomer()->getChangePassword()==1): ?> checked="checked"<?php endif ?> class="checkbox" /><label for="change_password"><?= $this->__('Change Password') ?></label>
</li>
</ul>
</div>
<div class="fieldset" style="display:none;">
<h2 class="legend"><?= $this->__('Change Password') ?></h2>
<ul class="form-list">
<li class="fields">
<li style="display:none;">
<div class="field">
<label for="password" class="required"><em>*</em><?= $this->__('New Password') ?></label>
<div class="input-box">
Expand Down Expand Up @@ -103,7 +84,7 @@
//<![CDATA[
var dataForm = new VarienForm('form-validate', true);
function setPasswordForm(arg){
$('password').up('.fieldset')[arg ? 'show': 'hide']();
$('password').up('li')[arg ? 'show': 'hide']();
}

<?php if($this->getCustomer()->getChangePassword()): ?>
Expand Down

0 comments on commit ed1ebaa

Please sign in to comment.