Skip to content

Commit

Permalink
[bug-OpenMage#193] Fix switching between customer addresses in the ad…
Browse files Browse the repository at this point in the history
…min panel

* make sure address data is reset for each loop iteration
* stop setting empty region field to '0' when switching between saved addresses
  • Loading branch information
bob2021 authored and edannenberg committed Aug 22, 2019
1 parent 8a16d50 commit bc86022
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
<?php foreach ($addressCollection as $_address): ?>
<div id="form_address_item_<?php echo $_address->getId() ?>" style="display:none">
<?php
$this->getForm()->addValues($_address->getData())
$this->getForm()->setValues($_address->getData())
->setHtmlIdPrefix("_item{$_address->getId()}")
->setFieldNameSuffix('address['.$_address->getId().']');
$this->addValuesToNamePrefixElement($_address->getPrefix())
Expand Down
2 changes: 1 addition & 1 deletion js/mage/adminhtml/sales.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ AdminOrder.prototype = {
}

if (fields[i].changeUpdater) fields[i].changeUpdater();
if (name == 'region' && data['region_id'] && !data['region']){
if (name == 'region' && data['region_id'] > 0 && !data['region']){
fields[i].value = data['region_id'];
}
}
Expand Down

0 comments on commit bc86022

Please sign in to comment.