Provide warnings in the Cart and Ship Driver screens when there are no

shipping plugins configured.  This prevented checkout no feedback.
fixes #10849.
This commit is contained in:
Colin Kuskie 2009-08-28 15:35:40 +00:00
parent 6c9ae74654
commit d902174739
4 changed files with 33 additions and 4 deletions

View file

@ -1,4 +1,5 @@
7.7.19
- fixed #10849: Shop: Bad behavior with no shipping drivers
- fixed #10843: Ad Sales: how many do I have to buy?
- fixed #10835: Ad Sales: Ad Space field not user-friendly
- fixed #10841: Ad Sales: hover help spelling error

View file

@ -520,6 +520,9 @@ sub readyForCheckout {
return 0 if $total < $requiredAmount;
}
##Check for any other logged errors
return 0 if $error{ id $self };
# All checks passed so return true
return 1;
}
@ -799,7 +802,6 @@ sub www_view {
my %var = (
%{$self->get},
items => \@items,
error => $error{id $self},
formHeader => WebGUI::Form::formHeader($session)
. WebGUI::Form::hidden($session, {name=>"shop", value=>"cart"})
. WebGUI::Form::hidden($session, {name=>"method", value=>"update"})
@ -847,9 +849,16 @@ sub www_view {
$defaultOption = $option;
$formOptions{$option} = $options->{$option}{label}." (".$self->formatCurrency($options->{$option}{price}).")";
}
$var{shippingOptions} = WebGUI::Form::selectBox($session, {name=>"shipperId", options=>\%formOptions, defaultValue=>$defaultOption, value=>$self->get("shipperId")});
$var{shippingPrice} = ($self->get("shipperId") ne "") ? $options->{$self->get("shipperId")}{price} : $options->{$defaultOption}{price};
$var{shippingPrice} = $self->formatCurrency($var{shippingPrice});
if ($defaultOption) {
$var{shippingOptions} = WebGUI::Form::selectBox($session, {name=>"shipperId", options=>\%formOptions, defaultValue=>$defaultOption, value=>$self->get("shipperId")});
$var{shippingPrice} = ($self->get("shipperId") ne "") ? $options->{$self->get("shipperId")}{price} : $options->{$defaultOption}{price};
$var{shippingPrice} = $self->formatCurrency($var{shippingPrice});
}
else {
$var{shippingOptions} = '';
$var{shippingPrice} = 0;
$error{id $self} = $i18n->get("No shipping plugins configured");
}
}
# Tax variables
@ -871,6 +880,7 @@ sub www_view {
$var{ inShopCreditDeduction } = $credit->calculateDeduction($var{totalPrice});
$var{ totalPrice } = $self->formatCurrency($var{totalPrice} + $var{inShopCreditDeduction});
$var{ readyForCheckout } = $self->readyForCheckout;
$var{ error } = $error{id $self};
# render the cart
my $template = WebGUI::Asset::Template->new($session, $session->setting->get("shopCartTemplateId"));

View file

@ -265,6 +265,7 @@ sub www_manage {
.WebGUI::Form::selectBox($session, {name=>"className", options=>$self->getDrivers})
.WebGUI::Form::submit($session, {value=>$i18n->get("add shipper")})
.WebGUI::Form::formFooter($session);
my $hasShipper = 0;
foreach my $shipper (@{$self->getShippers}) {
$output .= '<div style="clear: both;">'
.WebGUI::Form::formHeader($session, {extras=>'style="float: left;"'})
@ -283,8 +284,13 @@ sub www_manage {
.' '
.$shipper->get("label")
.'</div>';
$hasShipper = 1;
}
my $console = $admin->getAdminConsole;
if (! $hasShipper) {
my $noShipper = $i18n->get('No shippers');
$output = qq|<div class="error">$noShipper</div>\n| . $output;
}
return $console->render($output, $i18n->get("shipping methods"));
}

View file

@ -1647,6 +1647,18 @@ our $I18N = {
context => q|Label in the EU tax manager|,
},
'No shipping plugins configured' => {
message => q|No shipping plugins configured. Please notify the site adminstrator.|,
lastUpdated => 0,
context => q|Error message in the cart|,
},
'No shippers' => {
message => q|No shipping drivers are configured. Users will not be able to checkout until at least one is configured.|,
lastUpdated => 0,
context => q|Error message in the manage ship driver screen.|,
},
};
1;