Update readyForCheckout, shipping address is optional, must have gatewayId, too.
This commit is contained in:
parent
822cac8dec
commit
e0a9f34b53
1 changed files with 8 additions and 3 deletions
|
|
@ -526,13 +526,15 @@ sub readyForCheckout {
|
||||||
return 0 if WebGUI::Error->caught;
|
return 0 if WebGUI::Error->caught;
|
||||||
|
|
||||||
# Check if the shipping address is set and correct
|
# Check if the shipping address is set and correct
|
||||||
my $shipAddress = eval{$self->getShippingAddress};
|
if ($self->requiresShipping) {
|
||||||
return 0 if WebGUI::Error->caught;
|
my $shipAddress = eval{$self->getShippingAddress};
|
||||||
|
return 0 if WebGUI::Error->caught;
|
||||||
|
}
|
||||||
|
|
||||||
# Check if the cart has items
|
# Check if the cart has items
|
||||||
return 0 unless scalar @{ $self->getItems };
|
return 0 unless scalar @{ $self->getItems };
|
||||||
|
|
||||||
# fail if there are multiple recurring items or if
|
# fail if there are multiple recurring items
|
||||||
return 0 if ($self->hasMixedItems);
|
return 0 if ($self->hasMixedItems);
|
||||||
|
|
||||||
# Check minimum cart checkout requirement
|
# Check minimum cart checkout requirement
|
||||||
|
|
@ -549,6 +551,9 @@ sub readyForCheckout {
|
||||||
##Must have a configured shipping id.
|
##Must have a configured shipping id.
|
||||||
return 0 if ! $self->get('shipperId');
|
return 0 if ! $self->get('shipperId');
|
||||||
|
|
||||||
|
##Must have a configured payment method.
|
||||||
|
return 0 if ! $self->get('gatewayId');
|
||||||
|
|
||||||
##Check for any other logged errors
|
##Check for any other logged errors
|
||||||
return 0 if $error{ id $self };
|
return 0 if $error{ id $self };
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue