Skip to content

Commit

Permalink
Fix error in system config tax
Browse files Browse the repository at this point in the history
  • Loading branch information
luigifab committed Jun 6, 2022
1 parent a70dbf5 commit 14d93eb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions js/mage/adminhtml/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,6 @@ FormElementDependenceController.prototype = {
// optional_zip_countries.phtml
function onAddressCountryChanged(countryElement) {
var zipElementId = countryElement.id.replace(/country_id/, 'postcode');

// Ajax-request and normal content load compatibility
if ($(zipElementId) != undefined) {
setPostcodeOptional($(zipElementId), countryElement.value);
Expand All @@ -602,7 +601,10 @@ function onAddressCountryChanged(countryElement) {
}

function setPostcodeOptional(zipElement, country) {
if (optionalZipCountries.indexOf(country) != -1) {
if (typeof optionalZipCountries == 'undefined') {
// nothing to do (for example in system config)
}
else if (optionalZipCountries.indexOf(country) != -1) {
Validation.reset(zipElement);
while (zipElement.hasClassName('required-entry')) {
zipElement.removeClassName('required-entry');
Expand Down

0 comments on commit 14d93eb

Please sign in to comment.