Skip to content

Commit 595b123

Browse files
authored
Fixed a bug that prevented saving the shipping methods page from backend (#3397)
1 parent c162b9e commit 595b123

File tree

1 file changed

+10
-17
lines changed
  • app/design/adminhtml/default/default/template/system/shipping

1 file changed

+10
-17
lines changed

app/design/adminhtml/default/default/template/system/shipping/ups.phtml

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ if (!Mage::helper('usa')->validateUpsType($storedUpsType)) {
108108

109109
this.setFormValues();
110110
Event.observe($(this.carriersUpsTypeId), 'change', this.setFormValues.bind(this));
111+
Event.observe($('carriers_ups_active'), 'change', this.setFormValues.bind(this));
111112
},
112113
updateAllowedMethods: function(originShipmentTitle)
113114
{
@@ -158,23 +159,15 @@ if (!Mage::helper('usa')->validateUpsType($storedUpsType)) {
158159
setFormValues: function()
159160
{
160161
var a;
161-
if ($F(this.carriersUpsTypeId) == 'UPS') {
162-
for (a = 0; a < this.checkingUpsXmlId.length; a++) {
163-
$(this.checkingUpsXmlId[a]).removeClassName('required-entry');
164-
}
165-
for (a = 0; a < this.checkingUpsId.length; a++) {
166-
$(this.checkingUpsXmlId[a]).addClassName('required-entry');
167-
}
168-
Event.stopObserving($('carriers_ups_origin_shipment'), 'change', this.changeOriginShipment.bind(this));
169-
showRowArrayElements(this.onlyUpsElements);
170-
hideRowArrayElements(this.onlyUpsXmlElements);
171-
this.changeOriginShipment(null, 'default');
172-
} else {
173-
for (a = 0; a < this.checkingUpsXmlId.length; a++) {
174-
$(this.checkingUpsXmlId[a]).addClassName('required-entry');
175-
}
176-
for (a = 0; a < this.checkingUpsId.length; a++) {
177-
$(this.checkingUpsXmlId[a]).removeClassName('required-entry');
162+
if ($F(this.carriersUpsTypeId) == 'UPS_XML') {
163+
if (document.getElementById('carriers_ups_active').value == 1) {
164+
for (a = 0; a < this.checkingUpsXmlId.length; a++) {
165+
$(this.checkingUpsXmlId[a]).addClassName('required-entry');
166+
}
167+
} else {
168+
for (a = 0; a < this.checkingUpsXmlId.length; a++) {
169+
$(this.checkingUpsXmlId[a]).removeClassName('required-entry');
170+
}
178171
}
179172
Event.observe($('carriers_ups_origin_shipment'), 'change', this.changeOriginShipment.bind(this));
180173
showRowArrayElements(this.onlyUpsXmlElements);

0 commit comments

Comments
 (0)