Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add/Remove mark when region/zip is required #2149

Merged
merged 2 commits into from
Sep 27, 2022

Conversation

luigifab
Copy link
Contributor

@luigifab luigifab commented May 25, 2022

Description

This PR fix display and validation when region/zip are required, for Customers addresses in backend.

Manual testing scenarios

In System / Configuration / General, set Allow Countries to USA, France, Ireland ; and remove France for State is required for.
Go to Customers, open any customer or add a new customer, then go to Addresses tab and add a new address.
Go to Sales, open any order, and try to edit Shipping or Billing address.

If you set country to usa, if you try to save the customer:

image

That's the truth.
Now if you set country to Ireland, if you try to save the customer:

image

That's wrong.
Now if you set country to France, if you try to save the customer:

image

That's the truth.
Apply the PR and try again.

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All automated tests passed successfully (all builds are green)
  • Add yourself to contributors list

@github-actions github-actions bot added Component: Adminhtml Relates to Mage_Adminhtml Component: Customer Relates to Mage_Customer Component: Directory Relates to Mage_Directory Component: Sales Relates to Mage_Sales JavaScript Relates to js/* Template : admin Relates to admin template labels May 25, 2022
fballiano
fballiano previously approved these changes May 31, 2022
Copy link
Contributor

@kiatng kiatng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested & worked.

@fballiano fballiano merged commit 00748ce into OpenMage:1.9.4.x Sep 27, 2022
@github-actions
Copy link
Contributor

Unit Test Results

1 files  ±0  1 suites  ±0   0s ⏱️ ±0s
0 tests ±0  0 ✔️ ±0  0 💤 ±0  0 ❌ ±0 
7 runs  ±0  5 ✔️ ±0  2 💤 ±0  0 ❌ ±0 

Results for commit 00748ce. ± Comparison against base commit 45db076.

@luigifab luigifab deleted the address-zip branch September 28, 2022 07:59
@luigifab
Copy link
Contributor Author

There is a little bug, on admin login page.
We need something like:

diff --git a/js/mage/adminhtml/form.js b/js/mage/adminhtml/form.js
@@ -609,4 +609,6 @@ function setPostcodeOptional(zipElement, country) {
     }
 }
 
-varienGlobalEvents.attachEventHandler("address_country_changed", onAddressCountryChanged);
+if (typeof varienGlobalEvents != 'undefined') {
+    varienGlobalEvents.attachEventHandler("address_country_changed", onAddressCountryChanged);
+}

@fballiano
Copy link
Contributor

@luigifab created a PR for that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Adminhtml Relates to Mage_Adminhtml Component: Customer Relates to Mage_Customer Component: Directory Relates to Mage_Directory Component: Sales Relates to Mage_Sales JavaScript Relates to js/* Template : admin Relates to admin template
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants