summaryrefslogtreecommitdiff
path: root/httemplate/misc/xmlhttp-address_standardize.html
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2012-11-20 16:11:50 -0800
committerMark Wells <mark@freeside.biz>2012-11-20 16:11:50 -0800
commit5ad226c0ff7759184ea26d66292ccebd2ec00af7 (patch)
tree519e281dff475619d92e8a6feb175210fdf72207 /httemplate/misc/xmlhttp-address_standardize.html
parent044e4ea5533f1c14697b7ad408dc0cf0e0327abb (diff)
fix a confusing standardization behavior, #13763
Diffstat (limited to 'httemplate/misc/xmlhttp-address_standardize.html')
-rw-r--r--httemplate/misc/xmlhttp-address_standardize.html8
1 files changed, 7 insertions, 1 deletions
diff --git a/httemplate/misc/xmlhttp-address_standardize.html b/httemplate/misc/xmlhttp-address_standardize.html
index 1620642cb..988057163 100644
--- a/httemplate/misc/xmlhttp-address_standardize.html
+++ b/httemplate/misc/xmlhttp-address_standardize.html
@@ -24,6 +24,7 @@ if ($old{onlyship}) {
} else {
@prefixes = ('bill_', 'ship_');
}
+my $all_same = 1;
foreach my $pre ( @prefixes ) {
my $location = {
@@ -38,8 +39,13 @@ foreach my $pre ( @prefixes ) {
foreach ( keys(%$cache) ) {
$new{$pre.$_} = $cache->get($_);
}
+
+ foreach ( qw(address1 address2 city state zip country) ) {
+ $all_same = 0 if ( $new{$pre.$_} ne $old{$pre.$_} );
+ last if !$all_same;
+ }
}
-my $return = { old => \%old, new => \%new };
+my $return = { old => \%old, new => \%new, all_same => $all_same };
warn "result:\n".encode_json($return) if $DEBUG;
</%init>