Changed www_checkoutConfirm to check to see if there are multiple shipping methods enabled before displaying the link to change them. Added a template variable which is available if there are multiple shipping pluggins.

This commit is contained in:
Frank Dillon 2006-04-25 00:50:28 +00:00
parent c3f0401d6e
commit cd02e1fe32

View file

@ -305,8 +305,14 @@ sub www_checkoutConfirm {
$var{'changePayment.url'} = $session->url->page('op=selectPaymentGateway');
$var{'changePayment.label'} = $i18n->get('change payment gateway');
$var{'changeShipping.url'} = $session->url->page('op=selectShippingMethod');
$var{'changeShipping.label'} = $i18n->get('change shipping method');
my $plugins = WebGUI::Commerce::Shipping->getEnabledPlugins($session);
if (scalar(@$plugins) > 1) {
$var{'changeShipping.url'} = $session->url->page('op=selectShippingMethod');
$var{'changeShipping.label'} = $i18n->get('change shipping method');
$var{'hasMultipleShipping'} = "true";
}
$var{'viewShoppingCart.url'} = $session->url->page('op=viewCart');
$var{'viewShoppingCart.label'} = $i18n->get('view shopping cart');
@ -1090,13 +1096,14 @@ sub www_viewCart {
foreach (@$normal) {
$_->{deleteIcon} = $session->icon->delete('op=deleteCartItem;itemId='.$_->{item}->id.';itemType='.$_->{item}->type);
$_->{'quantity.form'} = WebGUI::Form::integer($session,{
$_->{'quantity.form'} = WebGUI::Form::integer($session, {
name => 'quantity~'.$_->{item}->type.'~'.$_->{item}->id,
value => $_->{quantity},
size => 3,
});
$total += $_->{totalPrice};
}
foreach (@$recurring) {
$_->{deleteIcon} = $session->icon->delete('op=deleteCartItem;itemId='.$_->{item}->id.';itemType='.$_->{item}->type);
$_->{'quantity.form'} = WebGUI::Form::integer($session,{