- 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:
parent
47419b9602
commit
16bd779fd4
9 changed files with 263 additions and 24 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue