awesomemotive / easy-digital-downloads

Sell digital downloads through WordPress
https://easydigitaldownloads.com
GNU General Public License v2.0
866 stars 474 forks source link

Customer address view improvement #5672

Open arraypress opened 7 years ago

arraypress commented 7 years ago

The EDD customer view screen only shows the abbreviated ISO codes for both the state and country address fields, which is confusing and unintuitive when viewing customer records. For example, a Spanish customer shows like this:

B
ES
90001

Since most people won't know these codes off by heart, it would be more usable to have the full state and country name shown.

arraypress commented 7 years ago

This is a small fix, but the span <span class="info-item" data-key="line2"></span> shows (and occupies space) even when no address line is present. This more than likely applies to other empty address fields as well.

cklosowski commented 7 years ago

We can improve that output for sure. The reason those fields show and are blank is because of the way our 'Edit' work flow executes on fields that are output there. It does a swap of fields to change from the span to the input when someone clicks on the Edit Customer button.

By having them there, it makes it possible for us to swap them from edit to display mode and back without any issues. We can look at ways to improve that, but we need to maintain some sort of existence of the fields for the JS to work, or we need to change the JS.

arraypress commented 6 years ago

@cklosowski, I have submitted two associated PR fixes for this: #6131 and #6130.

I have also fixed a bug where manually edited state names weren't displayed and editable.

arraypress commented 6 years ago

Just discovered another bug with #6131, let me investigate.

arraypress commented 6 years ago

Fixed! Was missing a parameter on my own function! :)

arraypress commented 6 years ago

Discovered a non-related bug with the AJAX population of the states, out with my contributions above (tested on fresh install).

If you edit a customer, select a country, the states are populated correctly. However if you select another country with pre-populated states the list shows the existing countries states. I will post an issue for this.

sunnyratilal commented 6 years ago

@davidsherlock That sounds more like a bug with Chosen instead of the actual AJAX result? Does the console show the correct request being made?