Skip to content
Permalink
Browse files

Check for mixed items in the cart AFTER processing delete requests. F…

…ixes bug #12239.
  • Loading branch information...
perlDreamer committed Aug 30, 2011
1 parent 7a89bf1 commit 36f818ed5e984d5f0e85be3f68defc76ca509f5b
Showing with 7 additions and 5 deletions.
  1. +1 −0 docs/changelog/7.x.x.txt
  2. +6 −5 lib/WebGUI/Shop/Cart.pm
@@ -4,6 +4,7 @@
- fixed #12195: Visitor group by scratch membership shared among all Visitors (Dale Trexel)
- fixed #12227: Corrected AssetReport such that OrderBy works correctly.
- fixed #12238: Old template attachement in search template slows down sites
- fixed #12239: Still get cart error message after removing extra recurring items from the cart

7.10.22
- rfe #12223: Add date type to content profiling (metadata)
@@ -758,17 +758,18 @@ sub updateFromForm {
$item->update({shippingAddressId => $itemAddressId});
}
}
if ($self->hasMixedItems) {
my $i18n = WebGUI::International->new($self->session, "Shop");
$error{id $self} = $i18n->get('mixed items warning');
}

my @cartItemIds = $form->process('remove_item', 'checkList');
foreach my $cartItemId (@cartItemIds) {
my $item = eval { $self->getItem($cartItemId); };
$item->remove if ! Exception::Class->caught();
}

##Remove the items BEFORE we check to see if there are duplicates.
if ($self->hasMixedItems) {
my $i18n = WebGUI::International->new($self->session, "Shop");
$error{id $self} = $i18n->get('mixed items warning');
}

##Visitor cannot have an address book, or set a payment gateway, so skip the rest of this.
return 1 if $session->user->isVisitor;

0 comments on commit 36f818e

Please sign in to comment.
You can’t perform that action at this time.