Skip to content

Commit 7754300

Browse files
committed
Merge branch 'main' into next
2 parents 56fa540 + f578a5c commit 7754300

File tree

3 files changed

+16
-23
lines changed

3 files changed

+16
-23
lines changed

app/Mage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ public static function getConfig()
474474
}
475475

476476
/**
477-
* Add observer to even object
477+
* Add observer to events object
478478
*
479479
* @param string $eventName
480480
* @param callback $callback

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);

composer.lock

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)