- Added Cashier/Point of Sale mode for the Shop.

- Added the notion of a default address to the Shop's address book.
This commit is contained in:
JT Smith 2008-11-15 01:26:16 +00:00
parent 47419b9602
commit 16bd779fd4
9 changed files with 263 additions and 24 deletions

View file

@ -105,7 +105,18 @@ Optionally supply this variable which will set the payment address to this addre
sub www_getCredentials {
my ($self, $addressId) = @_;
my $session = $self->session;
$addressId = $session->form->process('addressId') if ($addressId eq "");
# Process address from address book if passed
$addressId = $session->form->process( 'addressId' );
my $address;
if ( $addressId ) {
$address = eval{ $self->getAddress( $addressId ) };
}
else {
$address = $self->getCart->getShippingAddress;
}
my $billingAddressHtml = $address->getHtmlFormatted;
# Generate the json string that defines where the address book posts the selected address
my $callbackParams = {
url => $session->url->page,
@ -126,18 +137,11 @@ sub www_getCredentials {
. WebGUI::Form::submit( $session, { value => 'Choose billing address' } )
. WebGUI::Form::formFooter( $session);
# Get billing address
my $billingAddress = eval { $self->getAddress($addressId) };
my $billingAddressHtml;
if ($billingAddress) {
$billingAddressHtml = $billingAddress->getHtmlFormatted;
}
# Generate 'Proceed' button
my $proceedButton = WebGUI::Form::formHeader( $session )
. $self->getDoFormTags('pay')
. WebGUI::Form::hidden($session, {name=>"addressId", value=>$addressId})
. WebGUI::Form::hidden($session, {name=>"addressId", value=>$address->getId})
. WebGUI::Form::submit( $session, { value => 'Pay' } )
. WebGUI::Form::formFooter( $session);