Skip to content

Commit

Permalink
dont use ignore variable, use getIsUserDefined instead
Browse files Browse the repository at this point in the history
  • Loading branch information
justinbeaty committed Aug 2, 2022
1 parent 6e379ce commit 1956c43
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 15 deletions.
9 changes: 4 additions & 5 deletions app/code/core/Mage/Checkout/Block/Onepage/Billing.php
Original file line number Diff line number Diff line change
Expand Up @@ -231,11 +231,10 @@ public function extraFields()
$form->setFormCode('checkout_register');

$attributes = $form->getAttributes();

$ignore = ['prefix', 'firstname', 'middlename', 'lastname', 'suffix', 'email', 'dob', 'taxvat', 'created_at', 'gender'];

foreach ($ignore as $code) {
unset($attributes[$code]);
foreach ($attributes as $code => $attribute) {
if (!$attribute->getIsUserDefined()) {
unset($attributes[$code]);
}
}

return $attributes;
Expand Down
9 changes: 4 additions & 5 deletions app/code/core/Mage/Customer/Block/Form/Edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,10 @@ public function extraFields()
->initDefaultValues();

$attributes = $form->getAttributes();

$ignore = ['prefix', 'firstname', 'middlename', 'lastname', 'suffix', 'email', 'dob', 'taxvat', 'created_at', 'gender'];

foreach ($ignore as $code) {
unset($attributes[$code]);
foreach ($attributes as $code => $attribute) {
if (!$attribute->getIsUserDefined()) {
unset($attributes[$code]);
}
}

return $attributes;
Expand Down
9 changes: 4 additions & 5 deletions app/code/core/Mage/Customer/Block/Form/Register.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,11 +193,10 @@ public function extraFields()
$form->setFormCode('customer_account_create');

$attributes = $form->getAttributes();

$ignore = ['prefix', 'firstname', 'middlename', 'lastname', 'suffix', 'email', 'dob', 'taxvat', 'created_at', 'gender'];

foreach ($ignore as $code) {
unset($attributes[$code]);
foreach ($attributes as $code => $attribute) {
if (!$attribute->getIsUserDefined()) {
unset($attributes[$code]);
}
}

return $attributes;
Expand Down

0 comments on commit 1956c43

Please sign in to comment.