Skip to content
Permalink
Browse files

Make address form fields less sticky. If you want data saved, you mus…

…t choose the Update address option.
  • Loading branch information...
perlDreamer committed May 10, 2010
1 parent 6965611 commit 18301e3bfdeabfa76692b9e5b1c2247fcb868d29
Showing with 6 additions and 5 deletions.
  1. +6 −5 lib/WebGUI/Shop/AddressBook.pm
@@ -82,32 +82,33 @@ sub appendAddressFormVars {
$properties ||= {};
$prefix ||= '';
$var ||= {};
my $hasAddress = keys %{ $properties };
for ( qw{ address1 address2 address3 label firstName lastName city state organization } ) {
$var->{ $prefix . $_ . 'Field' } = WebGUI::Form::text( $session, {
name => $prefix . $_,
maxlength => 35,
defaultValue => $properties->{ $_ } || $form->get($prefix . $_),
defaultValue => $hasAddress ? $properties->{ $_ } : $form->get($prefix . $_),
} );
}
$var->{ $prefix . 'countryField' } =
WebGUI::Form::country( $session,{
name => $prefix . 'country',
defaultValue => $properties->{ country } || $form->get($prefix . 'country' ),
defaultValue => $hasAddress ? $properties->{ country } : $form->get($prefix . 'country' ),
} );
$var->{ $prefix . 'codeField' } =
WebGUI::Form::zipcode( $session, {
name => $prefix . 'code',
defaultValue => $properties->{ code } || $form->get($prefix . 'code' ),
defaultValue => $hasAddress ? $properties->{ code } : $form->get($prefix . 'code' ),
} );
$var->{ $prefix . 'phoneNumberField' } =
WebGUI::Form::phone( $session, {
name => $prefix . 'phoneNumber',
defaultValue => $properties->{ phoneNumber } || $form->get($prefix . 'phoneNumber' ),
defaultValue => $hasAddress ? $properties->{ phoneNumber } : $form->get($prefix . 'phoneNumber' ),
} );
$var->{ $prefix . 'emailField' } =
WebGUI::Form::email( $session, {
name => $prefix . 'email',
defaultValue => $properties->{ email } || $form->get($prefix . 'email' ),
defaultValue => $hasAddress ? $properties->{ email } : $form->get($prefix . 'email' ),
} );
}

0 comments on commit 18301e3

Please sign in to comment.
You can’t perform that action at this time.