Fix a Shop bug dealing with shippers that are no longer available. Fixes bug #11001.

This commit is contained in:
Colin Kuskie 2009-09-28 15:56:32 -07:00
parent c8b17b3f68
commit aad5f55601
2 changed files with 4 additions and 1 deletions

View file

@ -865,8 +865,10 @@ sub www_view {
foreach my $option (keys %{$options}) {
$formOptions{$option} = $options->{$option}{label}." (".$self->formatCurrency($options->{$option}{price}).")";
}
my $defaultOption = $self->get('shipperId') ? $self->get('shipperId') : '';
$var{shippingOptions} = WebGUI::Form::selectBox($session, {name=>"shipperId", options=>\%formOptions, value=>$self->get("shipperId")});
if (!exists $options->{$self->get('shipperId')}) {
$self->update({shipperId => ''});
}
if (my $shipperId = $self->get('shipperId')) {
$var{shippingPrice} = $options->{$shipperId}->{price};
}